al_9x wrote:
Fixed on all counts, thanks, what was it?
Well, actually I just changed something which worked the same way for more than a couple of years now, i.e. the UI synchronization deferring/coalescing machinery.
The way it used to work was that every time a sync was needed (e.g. because a new embedding had been blocked during page load) this was signaled (through a direct method call until 2.0rc8, through a global observers notification now) and a timer was created to defer it by 400 millisecs. If a previous "sync request" timer was found, it was cancelled. When the timer fired, the currently focused window was compare with the one which caused the synchronization to be needed, and if the two matched the actual synchronization (which is a relatively costly operation because it involves DOM manipulation, and can take up to 20-30 millisecs on old CPUs or mobile platforms) happened.
This caused multiple sync requests to "move forward" the actual operation, which was performed only when the situation had been "quiet" for 400 millisecs at least or if the DOM was ready, or the load was completed, or the tab had been just selected (these latter 3 events cause an immediate sync).
What I did in 2.0.1rc2 has been changing the policy above as follows: if a previously created timer is found, it is left alone and no new timer is created. When the timer fires, it synchronizes the with the currently focused window, no matter what. Any "immediate" synchronization (DOM ready, load complete or tab switch) cause the timer to be cancelled.
This ensures any micro-event (blocked content) requiring synchronization not to wait more than 400 millisecs (they are all coalesced to the nearest sync in 400 millisecs trains).
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8