Skip to content

Commit

Permalink
[] (0) Remove support for <script defer> with no src='', and remove t…
Browse files Browse the repository at this point in the history
…he associated magic with innerHTML that this involved.

git-svn-id: http://svn.whatwg.org/webapps@3550 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Aug 7, 2009
1 parent f22ea75 commit a7abce9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 113 deletions.
60 changes: 7 additions & 53 deletions index
Expand Up @@ -71,7 +71,7 @@
<div class=head>
<p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
<h1>HTML 5</h1>
<h2 class="no-num no-toc" id=draft-standard-&mdash;-date:-01-jan-1901>Draft Standard &mdash; 6 August 2009</h2>
<h2 class="no-num no-toc" id=draft-standard-&mdash;-date:-01-jan-1901>Draft Standard &mdash; 7 August 2009</h2>
<p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
<p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
<!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
Expand Down Expand Up @@ -9464,48 +9464,6 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0

<ol><li>

<p>If the node is an <code>Element</code> node, and the node's
document is an <a href=#html-documents title="HTML documents">HTML document</a>,
and the node is <a href=#in-a-document>in a <code>Document</code></a>, and the
node's document has an <a href=#active-parser>active parser</a>, and the
<a href=#insertion-point>insertion point</a> associated with that parser's
<a href=#the-input-stream>input stream</a> is not undefined (that is, it
<em>does</em> point to somewhere in the input stream), and the
<a href=#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing>list of scripts that will execute when the document has
finished parsing</a> is not empty, then run the following
substeps:</p>

<ol><li><p>Let <var title="">the script</var> be the first element in
the <a href=#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing>list of scripts that will execute when the document has
finished parsing</a>.</li>

<li><p><i>Loop</i>: If <var title="">the script</var> is a
<code><a href=#script>script</a></code> element without a <code title=attr-script-src><a href=#attr-script-src>src</a></code> attribute, then <a href=#executing-a-script-block title="executing a script block">execute</a> <var title="">the
script</var>.</li>

<li><p>If <var title="">the script</var> is not the last script
in the <a href=#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing>list of scripts that will execute when the document
has finished parsing</a>, then let <var title="">the
script</var> be the next script in that list, and return to the
step marked <i>loop</i>.</p>

<li><p>Remove any scripts that were executed as part of this
algorithm from the <a href=#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing>list of scripts that will execute when
the document has finished parsing</a>.</li>

</ol><!--
TESTS: http://www.hixie.ch/tests/adhoc/html/parsing/script-defer-write/
Note: IE8 actually drops on the floor any scripts which had
src="" but aren't yet completely loaded, and executes the rest. I
don't want to spec a race condition, though, and other browser
vendors don't want to block on network I/O in
innerHTML. Unfortunately, this means that external scripts with
defer="" will blow away the document if they do document.write(),
which is incompatible with IE.
--></li>

<li>

<p>If the node's document is an <a href=#html-documents title="HTML documents">HTML
document</a>: Invoke the <a href=#html-fragment-parsing-algorithm>HTML fragment parsing
algorithm</a>.</p>
Expand Down Expand Up @@ -11421,6 +11379,10 @@ people expect to have work and what is necessary.
support <code title=attr-script-defer><a href=#attr-script-defer>defer</a></code> (and not <code title=attr-script-async><a href=#attr-script-async>async</a></code>) to fall back to the <code title=attr-script-defer><a href=#attr-script-defer>defer</a></code> behavior instead of the
synchronous blocking behavior that is the default.</p>

<p>If the <code title=attr-script-defer><a href=#attr-script-defer>defer</a></code> attribute may
be specified, the <code title=attr-script-src><a href=#attr-script-src>src</a></code> attribute
must also be specified.</p>

<p>Changing the <code title=attr-script-src><a href=#attr-script-src>src</a></code>, <code title=attr-script-type><a href=#attr-script-type>type</a></code>, <code title=attr-script-charset><a href=#attr-script-charset>charset</a></code>, <code title=attr-script-async><a href=#attr-script-async>async</a></code>, and <code title=attr-script-defer><a href=#attr-script-defer>defer</a></code> attributes dynamically has no
direct effect; these attribute are only used at specific times
described below (namely, when the element is <a href=#insert-an-element-into-a-document title="insert an
Expand Down Expand Up @@ -11579,21 +11541,13 @@ people expect to have work and what is necessary.

<dl class=switch><dt>If the document is still being parsed, and the element has a
<code title=attr-script-defer><a href=#attr-script-defer>defer</a></code> attribute, and the
element does not have an <code title=attr-script-async><a href=#attr-script-async>async</a></code> attribute</dt>
element has a <code title=attr-script-src><a href=#attr-script-src>src</a></code> attribute,
and the element does not have an <code title=attr-script-async><a href=#attr-script-async>async</a></code> attribute</dt>

<dd>The element must be added to the end of the <a href=#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing>list of
scripts that will execute when the document has finished
parsing</a>.

<!-- What IE does here is slightly different. If we need to tweak
this for better compatibility:
http://www.websiteoptimization.com/speed/tweak/defer/test/
internal deferred scripts execute before any external scripts execute, or before the LOAD if there are none
external deferred scripts execute before the LOAD
See also the innerHTML attribute, which does weird things for
this list of scripts.
-->

</dd>


Expand Down
66 changes: 6 additions & 60 deletions source
Expand Up @@ -9766,56 +9766,6 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0

<ol>

<li>

<p>If the node is an <code>Element</code> node, and the node's
document is an <span title="HTML documents">HTML document</span>,
and the node is <span>in a <code>Document</code></span>, and the
node's document has an <span>active parser</span>, and the
<span>insertion point</span> associated with that parser's
<span>input stream</span> is not undefined (that is, it
<em>does</em> point to somewhere in the input stream), and the
<span>list of scripts that will execute when the document has
finished parsing</span> is not empty, then run the following
substeps:</p>

<ol>

<li><p>Let <var title="">the script</var> be the first element in
the <span>list of scripts that will execute when the document has
finished parsing</span>.</p></li>

<li><p><i>Loop</i>: If <var title="">the script</var> is a
<code>script</code> element without a <code
title="attr-script-src">src</code> attribute, then <span
title="executing a script block">execute</span> <var title="">the
script</var>.</p></li>

<li><p>If <var title="">the script</var> is not the last script
in the <span>list of scripts that will execute when the document
has finished parsing</span>, then let <var title="">the
script</var> be the next script in that list, and return to the
step marked <i>loop</i>.</p>

<li><p>Remove any scripts that were executed as part of this
algorithm from the <span>list of scripts that will execute when
the document has finished parsing</span>.</p></li>

</ol>

<!--
TESTS: http://www.hixie.ch/tests/adhoc/html/parsing/script-defer-write/
Note: IE8 actually drops on the floor any scripts which had
src="" but aren't yet completely loaded, and executes the rest. I
don't want to spec a race condition, though, and other browser
vendors don't want to block on network I/O in
innerHTML. Unfortunately, this means that external scripts with
defer="" will blow away the document if they do document.write(),
which is incompatible with IE.
-->

</li>

<li>

<p>If the node's document is an <span title="HTML documents">HTML
Expand Down Expand Up @@ -12023,6 +11973,10 @@ people expect to have work and what is necessary.
title="attr-script-defer">defer</code> behavior instead of the
synchronous blocking behavior that is the default.</p>

<p>If the <code title="attr-script-defer">defer</code> attribute may
be specified, the <code title="attr-script-src">src</code> attribute
must also be specified.</p>

<p>Changing the <code title="attr-script-src">src</code>, <code
title="attr-script-type">type</code>, <code
title="attr-script-charset">charset</code>, <code
Expand Down Expand Up @@ -12218,22 +12172,14 @@ people expect to have work and what is necessary.

<dt>If the document is still being parsed, and the element has a
<code title="attr-script-defer">defer</code> attribute, and the
element does not have an <code
element has a <code title="attr-script-src">src</code> attribute,
and the element does not have an <code
title="attr-script-async">async</code> attribute</dt>

<dd>The element must be added to the end of the <span>list of
scripts that will execute when the document has finished
parsing</span>.

<!-- What IE does here is slightly different. If we need to tweak
this for better compatibility:
http://www.websiteoptimization.com/speed/tweak/defer/test/
internal deferred scripts execute before any external scripts execute, or before the LOAD if there are none
external deferred scripts execute before the LOAD
See also the innerHTML attribute, which does weird things for
this list of scripts.
-->

</dd>


Expand Down

0 comments on commit a7abce9

Please sign in to comment.