Skip to content

Commit

Permalink
[e] (0) Make the 'already started' flag actually work. Also, reorder …
Browse files Browse the repository at this point in the history
…things in the 'run' algorithm so that we check things in order of cost to check, instead of doing the work up front and then the checks afterwards.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=10240

git-svn-id: http://svn.whatwg.org/webapps@5449 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 8, 2010
1 parent 03cc87a commit 2256b18
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 71 deletions.
55 changes: 31 additions & 24 deletions complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -14171,8 +14171,7 @@ <h4 id=script><span class=secno>4.3.1 </span>The <dfn><code>script</code></dfn>
encoding</var></dfn>. They are determined when the script is run,
based on the attributes on the element at that time.</p>

<p>When a <code><a href=#script>script</a></code> element that is neither marked as
having <a href=#already-started>"already started"</a> nor marked as being
<p>When a <code><a href=#script>script</a></code> element that is not marked as being
<a href=#parser-inserted>"parser-inserted"</a> experiences one of the events listed
in the following list, the user agent must synchronously <a href=#running-a-script title="running a script">run</a> the <code><a href=#script>script</a></code>
element:</p>
Expand All @@ -14191,7 +14190,27 @@ <h4 id=script><span class=secno>4.3.1 </span>The <dfn><code>script</code></dfn>
<code><a href=#script>script</a></code> element is to be run, the user agent must act as
follows:</p>

<ol><li id=script-processing-prepare>
<ol><li id=script-processing-noscript>

<p>If <a href=#concept-n-noscript title=concept-n-noscript>scripting is
disabled</a> for the <code><a href=#script>script</a></code> element, or if the
<code><a href=#script>script</a></code> element is marked as having <a href=#already-started>"already
started"</a>, then the user agent must abort these steps at
this point. The script is not executed.</p>

</li>

<li id=script-processing-empty>

<p>If the element has no <code title=attr-script-src><a href=#attr-script-src>src</a></code>
attribute, and its child nodes consist only of comment nodes and
empty <a href=#text-node title="text node">text nodes</a>, then the user
agent must abort these steps at this point. The script is not
executed.</p>

</li>

<li id=script-processing-prepare>

<p>If either:</p>

Expand Down Expand Up @@ -14223,6 +14242,15 @@ <h4 id=script><span class=secno>4.3.1 </span>The <dfn><code>script</code></dfn>

</li>

<li>

<p>If the user agent does not <a href=#support-the-scripting-language>support the scripting
language</a> given by <var><a href="#the-script-block's-type">the script block's type</a></var> for
this <code><a href=#script>script</a></code> element, then the user agent must abort
these steps at this point. The script is not executed.</p>

</li>

<li id=script-processing-encoding>

<p>If the <code><a href=#script>script</a></code> element has a <code title=attr-script-charset><a href=#attr-script-charset>charset</a></code> attribute, then let
Expand Down Expand Up @@ -14257,27 +14285,6 @@ <h4 id=script><span class=secno>4.3.1 </span>The <dfn><code>script</code></dfn>

</ol></li>

<li id=script-processing-noscript>

<p>If <a href=#concept-n-noscript title=concept-n-noscript>scripting is
disabled</a> for the <code><a href=#script>script</a></code> element, or if the
user agent does not <a href=#support-the-scripting-language>support the scripting language</a>
given by <var><a href="#the-script-block's-type">the script block's type</a></var> for this
<code><a href=#script>script</a></code> element, then the user agent must abort these
steps at this point. The script is not executed.</p>

</li>

<li id=script-processing-empty>

<p>If the element has no <code title=attr-script-src><a href=#attr-script-src>src</a></code>
attribute, and its child nodes consist only of comment nodes and
empty <a href=#text-node title="text node">text nodes</a>, then the user
agent must abort these steps at this point. The script is not
executed.</p>

</li>

<li id=script-processing-start>

<p>The user agent must set the element's <a href=#already-started>"already
Expand Down
55 changes: 31 additions & 24 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -14148,8 +14148,7 @@ c-end = "--&gt;"</pre>
encoding</var></dfn>. They are determined when the script is run,
based on the attributes on the element at that time.</p>

<p>When a <code><a href=#script>script</a></code> element that is neither marked as
having <a href=#already-started>"already started"</a> nor marked as being
<p>When a <code><a href=#script>script</a></code> element that is not marked as being
<a href=#parser-inserted>"parser-inserted"</a> experiences one of the events listed
in the following list, the user agent must synchronously <a href=#running-a-script title="running a script">run</a> the <code><a href=#script>script</a></code>
element:</p>
Expand All @@ -14168,7 +14167,27 @@ c-end = "--&gt;"</pre>
<code><a href=#script>script</a></code> element is to be run, the user agent must act as
follows:</p>

<ol><li id=script-processing-prepare>
<ol><li id=script-processing-noscript>

<p>If <a href=#concept-n-noscript title=concept-n-noscript>scripting is
disabled</a> for the <code><a href=#script>script</a></code> element, or if the
<code><a href=#script>script</a></code> element is marked as having <a href=#already-started>"already
started"</a>, then the user agent must abort these steps at
this point. The script is not executed.</p>

</li>

<li id=script-processing-empty>

<p>If the element has no <code title=attr-script-src><a href=#attr-script-src>src</a></code>
attribute, and its child nodes consist only of comment nodes and
empty <a href=#text-node title="text node">text nodes</a>, then the user
agent must abort these steps at this point. The script is not
executed.</p>

</li>

<li id=script-processing-prepare>

<p>If either:</p>

Expand Down Expand Up @@ -14200,6 +14219,15 @@ c-end = "--&gt;"</pre>

</li>

<li>

<p>If the user agent does not <a href=#support-the-scripting-language>support the scripting
language</a> given by <var><a href="#the-script-block's-type">the script block's type</a></var> for
this <code><a href=#script>script</a></code> element, then the user agent must abort
these steps at this point. The script is not executed.</p>

</li>

<li id=script-processing-encoding>

<p>If the <code><a href=#script>script</a></code> element has a <code title=attr-script-charset><a href=#attr-script-charset>charset</a></code> attribute, then let
Expand Down Expand Up @@ -14234,27 +14262,6 @@ c-end = "--&gt;"</pre>

</ol></li>

<li id=script-processing-noscript>

<p>If <a href=#concept-n-noscript title=concept-n-noscript>scripting is
disabled</a> for the <code><a href=#script>script</a></code> element, or if the
user agent does not <a href=#support-the-scripting-language>support the scripting language</a>
given by <var><a href="#the-script-block's-type">the script block's type</a></var> for this
<code><a href=#script>script</a></code> element, then the user agent must abort these
steps at this point. The script is not executed.</p>

</li>

<li id=script-processing-empty>

<p>If the element has no <code title=attr-script-src><a href=#attr-script-src>src</a></code>
attribute, and its child nodes consist only of comment nodes and
empty <a href=#text-node title="text node">text nodes</a>, then the user
agent must abort these steps at this point. The script is not
executed.</p>

</li>

<li id=script-processing-start>

<p>The user agent must set the element's <a href=#already-started>"already
Expand Down
53 changes: 30 additions & 23 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -14980,8 +14980,7 @@ c-end = "-->"</pre>
encoding</var></dfn>. They are determined when the script is run,
based on the attributes on the element at that time.</p>

<p>When a <code>script</code> element that is neither marked as
having <span>"already started"</span> nor marked as being
<p>When a <code>script</code> element that is not marked as being
<span>"parser-inserted"</span> experiences one of the events listed
in the following list, the user agent must synchronously <span
title="running a script">run</span> the <code>script</code>
Expand All @@ -15008,6 +15007,26 @@ c-end = "-->"</pre>

<ol>

<li id="script-processing-noscript">

<p>If <span title="concept-n-noscript">scripting is
disabled</span> for the <code>script</code> element, or if the
<code>script</code> element is marked as having <span>"already
started"</span>, then the user agent must abort these steps at
this point. The script is not executed.</p>

</li>

<li id="script-processing-empty">

<p>If the element has no <code title="attr-script-src">src</code>
attribute, and its child nodes consist only of comment nodes and
empty <span title="text node">text nodes</span>, then the user
agent must abort these steps at this point. The script is not
executed.</p>

</li>

<li id="script-processing-prepare">

<p>If either:</p>
Expand Down Expand Up @@ -15056,6 +15075,15 @@ c-end = "-->"</pre>

</li>

<li>

<p>If the user agent does not <span>support the scripting
language</span> given by <var>the script block's type</var> for
this <code>script</code> element, then the user agent must abort
these steps at this point. The script is not executed.</p>

</li>

<li id="script-processing-encoding">

<p>If the <code>script</code> element has a <code
Expand Down Expand Up @@ -15104,27 +15132,6 @@ c-end = "-->"</pre>

</li>

<li id="script-processing-noscript">

<p>If <span title="concept-n-noscript">scripting is
disabled</span> for the <code>script</code> element, or if the
user agent does not <span>support the scripting language</span>
given by <var>the script block's type</var> for this
<code>script</code> element, then the user agent must abort these
steps at this point. The script is not executed.</p>

</li>

<li id="script-processing-empty">

<p>If the element has no <code title="attr-script-src">src</code>
attribute, and its child nodes consist only of comment nodes and
empty <span title="text node">text nodes</span>, then the user
agent must abort these steps at this point. The script is not
executed.</p>

</li>

<li id="script-processing-start">

<p>The user agent must set the element's <span>"already
Expand Down

0 comments on commit 2256b18

Please sign in to comment.