W3C home > Mailing lists > Public > public-html@w3.org > November 2010

Re: Executing script-inserted external scripts in insertion order

From: Henri Sivonen <hsivonen@iki.fi>
Date: Tue, 2 Nov 2010 14:48:21 +0100
Cc: Getify <getify@gmail.com>, public html <public-html@w3.org>
Message-Id: <B547617E-CA65-4CB9-B0D0-4D8CDD7BEDBD@iki.fi>
To: Tony Gentilcore <tonyg@google.com>
On Oct 30, 2010, at 02:38, Tony Gentilcore wrote:

> Nice writeup! The .async=false proposal you outline in the wiki looks great to me. I'm happy to put together a WebKit patch if we settle on it and there's a bug for Hixie to update the spec.

FWIW, the Gecko patch that up for review has the following behavior for .async in spec-ese:

When a script element node is created, if it is being flagged as parser-inserted, set its force-async flag to false. Otherwise, set its force-async flag to true. (Note that createContextualFragment, innerHTML and XSLTProcessor::transformToFragment-created scripts are not flagged as parser-inserted.) This flag setting happens before any attributes are set on the node.

When a previously-created script element node loses its parser-insertedness, if the element doesn't have the async content attribute, set the force-async flag to true and false otherwise.

When a script element node obtains the async content attribute (via setAttribute, setAttributeNode, setAttributeNS, by the fragment parsing algorithm or the XSLTProcessor adding the attribute, etc.), set the force-async flag to false. (Note that calling removeAttribute("async") doesn't modify the force-async flag.)

The async IDL attribute must behave as follows:
 * Upon setting, set the force-async flag to false and then reflect the async content attribute.
 * Upon getting, if the force-async flag is true, return true. Otherwise, reflect the async content attribute.

(And the "run" algorithm for scripts is extended with an additional case for scripts that are external, aren't flagged as parser-inserted and that have the async DOM property reporting false.)

Henri Sivonen
Received on Tuesday, 2 November 2010 13:49:03 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:45:26 UTC