Open Bug 1225211 Opened 5 years ago Updated 2 years ago

Timeout fire before the “click” event loop is complete

Categories

(Core :: DOM: Core & HTML, defect)

42 Branch
defect
Not set
normal

Tracking

()

UNCONFIRMED

People

(Reporter: hdd2008, Unassigned)

References

(Depends on 1 open bug)

Details

(Whiteboard: DUPEME)

User Agent: Opera/9.80 (Windows NT 6.1; WOW64) Presto/2.12.388 Version/12.17

Steps to reproduce:

http://stackoverflow.com/questions/33741170/why-does-the-timeout-fire-before-the-click-event-loop-is-complete-on-firefox

http://jsfiddle.net/pLezf4ar/


Actual results:

alert shows 10


Expected results:

alert shows 0
From the stackoverflow thread:
"Because unlike many browsers, Firefox may allow the JavaScript thread to run other code while the alert, prompt, and confirm modals are showing, suspending the current code. [...]

I would expect [...] that Mozilla will change this to be in line with other browsers, as one could argue it violates JavaScript's run-to-completion semantics for tasks, and those semantics just got beefed up and clarified by the latest specification."
Component: Untriaged → JavaScript Engine
This has nothing to do with the JS engine, which doesn't even have an event loop in Firefox so far.  alert() and confirm() are pure DOM code.
Component: JavaScript Engine → DOM
Depends on: 1173716
Whiteboard: DUPEME
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.