Closed Bug 1180927 Opened 7 years ago Closed 6 years ago
Observer callbacks should be called before executing defer scritps
This doesn't seem to be spec'ed currently (I filled a W3C bug ) but if would be nice to follow the implementation of Chrome and Safari here and execute Mutation Observer callbacks before we execute deferred scripts. That would allow us to prototype API's with shims that rely on Mutation Observer.  https://www.w3.org/Bugs/Public/show_bug.cgi?id=28920
Olli, can you help me move this forward? I don't know who to ping in the w3c bug :)
I've pinged Anne at least, who might work on the spec a bit if Hixie isn't available.
This is a minimized testcase of the behavior. The first script is synchronous and it uses MutationObserver to shim a WebAPI. The second script is deferred and wants to operate on DOM and wants to assume that any elements that were injected into DOM were already modified by the shim's MutationObserver. This behavior works well in Safari and Chrome and is non deterministic in Gecko.
I'll change our defer script handling to be more async. I hope it doesn't slow down stuff too much on b2g.
Assignee: nobody → bugs
The original testcase doesn't test defer handling, but inline script handling.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 789315
You need to log in before you can comment on or make changes to this bug.