On 1/28/15 11:49 AM, Josh Matthews wrote:
Those are good points. Since those events go through the regular script event loop
Should they, though?
we would presumably have to process every pending script event in line before them, which could be bad? Stuff like >setTimeout(function() { window.location = "http://google.com"; }, 0) >alert("hi there") would certainly cause observable behaviour differences vs. having task queues that can be blocked and unblocked independently.
So here's the thing. The current spec for alert() doesn't actually allow navigating the page or closing the tab while the alert is up (or more precisely doesn't really define the behavior if you do, last I checked). So you have to make it up as you go along, unless the spec has gotten changed...
What Gecko would do in your example above is suppress timers on the window while the alert is up and keep them suppressed. If you navigate before the alert comes down, the timer never fires.
-Boris _______________________________________________ dev-servo mailing list dev-servo@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-servo