browser

Browser Rendering Difference Between strict/transitional DOCTYPEs

本秂侑毒 提交于 2019-12-21 17:19:44
问题 I came across an 'issue' some time ago that I never did get to the bottom of. Hopefully somebody can shine a light on it. What causes certain browsers (Chrome, Opera and Safari) to render a page differently when I change the DOCTYPE from strict to transitional. I know the general cause of this is quirks mode being triggered, but both the XHTML and CSS for both files validate according to the w3c validator. I can only assume that these browsers use different internal style sheets for the two

HTTP Request Corruption

亡梦爱人 提交于 2019-12-21 17:09:42
问题 On a site that receives a very high amount of traffic some small percent of requests come like this: http://cheezburger.com/ScriptResource.axd?d=zaVpgH63ePt90pn</a> <br /> <br /> <p> <a id= On the page referrer page there is a line like so: <script src="/ScriptResource.axd?d=zaVpgH63ePt90p8fuEYkPAKFZuziMYsiIUbmxDb-gQ23Cx78LNJNFXTqKciA4ND_frR-_r9UKsdtLPk6M08xyk6cXFSLUrbBGDlvPIf-F9w1&t=ffffffffd5e08dd5" type="text/javascript"></script> and another couple lines much further on: <a id="login

Why blocking event loop does not block css animation?

大城市里の小女人 提交于 2019-12-21 16:56:57
问题 I do not know the webpage rendering lifecycle - so in the example below I have two hearts - one is animated by js and another one in CSS. When I block an event loop with an alert message, CSS heart remains animated. let scale = true; setInterval(() => { $('.animate-js').css('transform', `scale(${scale ? 1.4 : 1})`); scale = !scale; }, 1000) body { text-align: center; } .heart { white-space: nowrap; display: inline-block; font-size: 150px; color: #e00; transform-origin: center; } .animate-css

Preventing browser caching on web application upgrades

孤街醉人 提交于 2019-12-21 13:58:13
问题 I have a quite troublesome issue which I didn't find a good solution for yet. I allow caching of all my application static files (JS, CSS and images) by browser for performance. Problem is, when I'm doing upgrades, the users still use the old version from their cache, which often breaks the application, and requires clearing the cache every time to solve the problem. Is there any good multi-browser approach which still allows caching the files, but can force to reload them when needed? Thanks

Removing HtmlElement objects programmatically using C#

こ雲淡風輕ζ 提交于 2019-12-21 12:44:07
问题 In a WebBrowser control, how do I remove HtmlElement objects? There are no methods in the HtmlElement class to accomplish this. As a workaround, I can create a "dummy" HtmlElement (without inserting it into the HtmlDocument ), into which I then insert (via AppendChild ) the HtmlElement objects to be removed. This feels like a hack. Is there a better way to do this? P.S. I want to retain the HtmlElement in memory to be used later, not simply destroy it (which is what setting its parent's

Python: How to fill out form all at once with splinter/Browser?

≡放荡痞女 提交于 2019-12-21 12:37:26
问题 Currently, I’m filling out the form on a site with the following: browser.fill(‘form[firstname]’, ‘Mabel’) browser.fill(‘form[email]’, ‘hi@hi.com’) browser.select(‘form[color]’, ‘yellow’) But the form gets filled out the form sequentially, one after the other. Is there a way to fill out the form all at once? Thank you and will be sure to vote up and accept the answer! 回答1: Browser has a method called: fill_form(field_values) It takes a dict parameter, with the field names, and the values, and

IE Question: How many CSS includes can it handle?

旧城冷巷雨未停 提交于 2019-12-21 12:21:34
问题 I came across a strange behavior while theming Drupal. I turned a few modules that added 5 to 10 link tags to the page. While these new stylesheets were added to the cascade in Firefox, in IE8, by adding these the browser discarded the earlier added CSS files from the hierarchy. In fact, the first files were the first to go, which completely screwed up the styling of the page and had me scratching my head for a while. Eventually I discovered the newly added modules had caused IE to pass some

Does the browser's render reflow if element's position is absolute?

好久不见. 提交于 2019-12-21 12:21:31
问题 If I have an element with an absolute position and I change it's left and top position will reflow to it's parent children? and what about it's own children if they are not affected as they are also absolute positioned by left and top axis? If I change an element's width/height but have no importance in the parent and in it's children? 回答1: An object with absolute position does not affect the layout of the page. The page is laid out without regard for an absolute positioned object. Moving the

“onscroll” fired after or before repaint?

瘦欲@ 提交于 2019-12-21 12:09:44
问题 I have a scrollbar on a div element. On many browsers (I tested this on recent versions of Chrome and Firefox on MacOS and Linux), it seems like the browsers make sure that code bound to onscroll is called before the repaint trigger by the scrolling. In other words, the following fiddle does not flicker nor blink when scrolling http://jsfiddle.net/m2E65/1/ : var onscroll = function() { var y = $("#container").scrollTop() + 30; var z = 0 for (var c=0; c<y*10000; c++) { z+=c; } $("#label").text

Getting the number of files in a folder in java [duplicate]

淺唱寂寞╮ 提交于 2019-12-21 10:19:20
问题 This question already has answers here : Counting the number of files in a directory using Java (9 answers) Closed 4 years ago . I'm making a basic file browser and want to know how to get the number of files in any given directory (necessary for the for loops that add the files to the tree and table) 回答1: From javadocs: http://download.oracle.com/javase/6/docs/api/java/io/File.html You can use: new File("/path/to/folder").listFiles().length 回答2: new File(<directory path>).listFiles().length