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

[Bug 11295] New: Make script-inserted external scripts that have .async=false execute in the insertion order, default to true

From: <bugzilla@jessica.w3.org>
Date: Thu, 11 Nov 2010 09:14:19 +0000
To: public-html-bugzilla@w3.org
Message-ID: <bug-11295-2486@http.www.w3.org/Bugs/Public/>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=11295

           Summary: Make script-inserted external scripts that have
                    .async=false execute in the insertion order, default
                    to true
           Product: HTML WG
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: P2
         Component: HTML5 spec (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: hsivonen@iki.fi
         QAContact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html-wg-issue-tracking@w3.org,
                    public-html@w3.org


Please apply the following delta to the spec. This is a formalization of a
suggestion from Getify on public-html and has been implemented on Firefox
trunk.

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 (even
parser-set ones) are set on the node (so a fragment parser-set async attribute
may modify the flag shortly after).

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 parser 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, because that would violate a reasonable and pretty deeply-baked
assumption that removing a non-existing attribute does *nothing*.)

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.

In step 13. of
http://www.whatwg.org/specs/web-apps/current-work/#running-a-script before the
case "If the element has a src attribute" add a case:
If the script has a src attribute and the async IDL property getter returns
false,
The element must be added to the queue of ordered script-inserted external
scripts of the Document of the script element at the time the running a script
algorithm started.

The task that the networking task source places on the task queue once the
fetching algorithm has completed must run these steps:
1) If the queue of ordered script-inserted external scripts is empty or the
first script in the queue of ordered script-inserted external scripts has not
been fetched yet, abort these steps.
2) Execute the first script in the queue of ordered script-inserted external
scripts.
3) Remove the first script from queue of ordered script-inserted external
scripts.
4) Goto step #1.

Modify step 5 of  http://www.whatwg.org/specs/web-apps/current-work/#the-end to
say:
Spin the event loop until the set of scripts that will execute as soon as
possible is empty and the queue of ordered script-inserted external scripts is
empty.

-- 
Configure bugmail: http://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 Thursday, 11 November 2010 09:14:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 11 November 2010 09:14:22 GMT