On Thu, 5 Jun 2014, Joshua Bell wrote:
> 
> For case 2, it looks like implementations differ on whether microtasks 
> are run as part of the event dispatch. This seems to be outside the 
> domain of the IDB spec itself, somewhere between DOM and ES. Anyone want 
> to offer an interpretation?

Event dispatch (specifically, the handling of "onsuccess", as opposed to 
addEventListener('success') which is similar but defined in other specs) 
is something that HTML tries to define. Assuming IndexDB defers to HTML's 
definition of "event handler IDL attribute", then you go through the 
"event handler processing algorithm", which calls "jump to a code 
entry-point" which calls "clean up after running a callback" which calls 
"perform a microtask checkpoint" which, once ES and HTML have been made to 
play nice, invokes the promise callbacks, all before the task that fired 
the event handler has returned to the event loop. And once it does return 
to the event loop, the next major thing _it_ does is "perform a microtask 
checkpoint" anyway.

HTH.
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Reply via email to