This is probably the most bizarre thing that I came across during the years of coding a website, so I thought that I would launch it with some people who are smarter than me to try to explain why this is happening. If there is no explanation, I'm probably going to present it as an error report. It took me forever to actually solve the cause of the problem.
The following behavior, which I can only produce in Firefox (version 15, currently and possibly some others). No problem in Internet Explorer, Chrome or Safari. It's so hard for me to explain that I just created a demo here: http://sandbox.uatu.net/dom-changes.php
The general idea is that with a very specific set of conditions, DOM changes are delayed by Firefox when the scroll window scrolls, regardless of whether the user scrolls or is automated using a script. Here's the setting:
<div id="superContainer"> <div id="subContainer"> <div id="mainPage"> scrollable box in here </div> </div> </div>
Important attributes:
superContainer measures height and width
subContainer has a height size
subContainer has an opacity parameter of less than 1
subContainer has background color
mainPage has a position absolute attribute
In any case, what you see if you visit this demo page is that an attempt to scroll the window hangs in all page animations. In fact, you can observe some of these elements in Firebug and see that the properties change in real time, but Firefox simply refuses to redraw anything on the page.
If you switch any of these attributes to the off position, everything will be fine. This is precisely this combination of settings that seems to be creating the problem.
Does anyone have any thoughts on why? I canβt tell you how this embarrassed me - I basically looked for the whole weekend, completely reviewing my code on the site where I found it.
source share