W3C home > Mailing lists > Public > public-html-bugzilla@w3.org > July 2012

[Bug 16790] The term microtask should be defined

From: <bugzilla@jessica.w3.org>
Date: Fri, 13 Jul 2012 21:56:03 +0000
Message-Id: <E1SpnqF-0007GA-8e@jessica.w3.org>
To: public-html-bugzilla@w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=16790

--- Comment #13 from Glenn Maynard <glenn@zewt.org> 2012-07-13 21:56:02 UTC ---
(redirecting from https://bugzilla.mozilla.org/show_bug.cgi?id=773132)

> Script (event listener etc) can't know what all scripts will run before the next stable state.
> Microtask doesn't really have that problem.

I was thinking that with stable states,

<script>url = URL.createObjectURL(blob, {autoRevoke: true});</script>
<script>/* use url */</script>

would free the URL before the second script runs.  Actually, the stable state
happens when </script> is parsed, before the script is run.  (That might give
the same effect, since that's still before the second script runs, but it might
not work in all cases.)

Stable states are definitely wrong for:

url = createObjectURL(blob, {autoRevoke: true});
document.write("<script>console.log('y');</scr" + "ipt>");

where url should *not* be revoked by "</script>" being parsed.

Microtask checkpoints seem nondeterministic for this, though.  If the whole
block is parsed in a single invocation of the parser, then there's no
checkpoint until the parser returns, so the URL isn't revoked for the second
script.  If there's a delay due to incremental parsing and we return to the
event loop, the event loop gives us a checkpoint, so the URL *is* revoked
between scripts.

Maybe this just needs its own concept: something that's always invoked when
exiting the outermost script, including from parser-invoked scripts.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Friday, 13 July 2012 21:56:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 13 July 2012 21:56:04 GMT