Skip to content

Commit

Permalink
[giow] (2) Make sure that all synchronous sections run before <script…
Browse files Browse the repository at this point in the history
…> elements, so that a <script> following a <video> has a state that doesn't depend on whether the browser splits up its parser tasks.

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

git-svn-id: http://svn.whatwg.org/webapps@5905 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 18, 2011
1 parent ffdb340 commit de058fa
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 47 deletions.
38 changes: 22 additions & 16 deletions complete.html
Expand Up @@ -239,7 +239,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1>Web Applications 1.0</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 17 February 2011</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 18 February 2011</h2>
</hgroup><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 @@ -64633,16 +64633,7 @@ <h5 id=processing-model-2><span class=secno>7.1.4.2 </span>Processing model</h5>

<li><p>Remove that task from its <a href=#task-queue>task queue</a>.</li>

<li><p>If any asynchronously-running algorithms are <dfn id=await-a-stable-state title="await a stable state">awaiting a stable state</dfn>, then
run their <dfn id=synchronous-section>synchronous section</dfn> and then resume running
their asynchronous algorithm.</p>

<p class=note>A <a href=#synchronous-section>synchronous section</a> never mutates
the DOM, runs any script, or has any other side-effects.</p>

<p class=note>Steps in <a href=#synchronous-section title="synchronous
section">synchronous sections</a> are marked with
&#8987;.</li>
<li><p><a href=#provide-a-stable-state>Provide a stable state</a>.</li>

<li><p>If necessary, update the rendering or user interface of any
<code><a href=#document>Document</a></code> or <a href=#browsing-context>browsing context</a> to reflect
Expand All @@ -64651,7 +64642,19 @@ <h5 id=processing-model-2><span class=secno>7.1.4.2 </span>Processing model</h5>
<li><p>Return to the first step of the <a href=#event-loop>event
loop</a>.</li>

</ol><hr><p>When an algorithm says to <dfn id=spin-the-event-loop>spin the event loop</dfn> until
</ol><hr><p>When the user agent is to <dfn id=provide-a-stable-state>provide a stable state</dfn>, if
any asynchronously-running algorithms are <dfn id=await-a-stable-state title="await a stable
state">awaiting a stable state</dfn>, then the user agent must run
their <dfn id=synchronous-section>synchronous section</dfn> and then resume running their
asynchronous algorithm (if appopriate).</p>

<p class=note>A <a href=#synchronous-section>synchronous section</a> never mutates
the DOM, runs any script, or has any other side-effects.</p>

<p class=note>Steps in <a href=#synchronous-section title="synchronous
section">synchronous sections</a> are marked with &#8987;.</p>

<hr><p>When an algorithm says to <dfn id=spin-the-event-loop>spin the event loop</dfn> until
a condition <var title="">goal</var> is met, the user agent must run
the following steps:</p>

Expand Down Expand Up @@ -82839,6 +82842,8 @@ <h5 id=the-before-head-insertion-mode><span class=secno>12.2.5.6 </span>The "<df
<dt id=scriptEndTag>An end tag whose tag name is "script"</dt>
<dd>

<p><a href=#provide-a-stable-state>Provide a stable state</a>.</p>

<p>Let <var title="">script</var> be the <a href=#current-node>current node</a>
(which will be a <code><a href=#script>script</a></code> element).</p>

Expand Down Expand Up @@ -85418,10 +85423,11 @@ <h3 id=parsing-xhtml-documents><span class=secno>13.2 </span>Parsing XHTML docum
flag must be unset. If the parser was originally created for the
<a href=#xml-fragment-parsing-algorithm>XML fragment parsing algorithm</a>, then the element must
be marked as <a href=#already-started>"already started"</a> also. When the element's
end tag is parsed, the user agent must <a href=#prepare-a-script title="prepare a
script">prepare</a> the <code><a href=#script>script</a></code> element. If this
causes there to be a <a href=#pending-parsing-blocking-script>pending parsing-blocking script</a>,
then the user agent must run the following steps:</p>
end tag is parsed, the user agent must <a href=#provide-a-stable-state>provide a stable
state</a>, and then <a href=#prepare-a-script title="prepare a script">prepare</a>
the <code><a href=#script>script</a></code> element. If this causes there to be a
<a href=#pending-parsing-blocking-script>pending parsing-blocking script</a>, then the user agent
must run the following steps:</p>

<ol><li><p>Block this instance of the <a href=#xml-parser>XML parser</a>, such
that the <a href=#event-loop>event loop</a> will not run <a href=#concept-task title=concept-task>tasks</a> that invoke it.</li>
Expand Down
38 changes: 22 additions & 16 deletions index
Expand Up @@ -243,7 +243,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 17 February 2011</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 18 February 2011</h2>
</hgroup><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 @@ -64636,16 +64636,7 @@ interface <dfn id=navigatoronline>NavigatorOnLine</dfn> {

<li><p>Remove that task from its <a href=#task-queue>task queue</a>.</li>

<li><p>If any asynchronously-running algorithms are <dfn id=await-a-stable-state title="await a stable state">awaiting a stable state</dfn>, then
run their <dfn id=synchronous-section>synchronous section</dfn> and then resume running
their asynchronous algorithm.</p>

<p class=note>A <a href=#synchronous-section>synchronous section</a> never mutates
the DOM, runs any script, or has any other side-effects.</p>

<p class=note>Steps in <a href=#synchronous-section title="synchronous
section">synchronous sections</a> are marked with
&#8987;.</li>
<li><p><a href=#provide-a-stable-state>Provide a stable state</a>.</li>

<li><p>If necessary, update the rendering or user interface of any
<code><a href=#document>Document</a></code> or <a href=#browsing-context>browsing context</a> to reflect
Expand All @@ -64654,7 +64645,19 @@ interface <dfn id=navigatoronline>NavigatorOnLine</dfn> {
<li><p>Return to the first step of the <a href=#event-loop>event
loop</a>.</li>

</ol><hr><p>When an algorithm says to <dfn id=spin-the-event-loop>spin the event loop</dfn> until
</ol><hr><p>When the user agent is to <dfn id=provide-a-stable-state>provide a stable state</dfn>, if
any asynchronously-running algorithms are <dfn id=await-a-stable-state title="await a stable
state">awaiting a stable state</dfn>, then the user agent must run
their <dfn id=synchronous-section>synchronous section</dfn> and then resume running their
asynchronous algorithm (if appopriate).</p>

<p class=note>A <a href=#synchronous-section>synchronous section</a> never mutates
the DOM, runs any script, or has any other side-effects.</p>

<p class=note>Steps in <a href=#synchronous-section title="synchronous
section">synchronous sections</a> are marked with &#8987;.</p>

<hr><p>When an algorithm says to <dfn id=spin-the-event-loop>spin the event loop</dfn> until
a condition <var title="">goal</var> is met, the user agent must run
the following steps:</p>

Expand Down Expand Up @@ -78810,6 +78813,8 @@ document.body.appendChild(text);
<dt id=scriptEndTag>An end tag whose tag name is "script"</dt>
<dd>

<p><a href=#provide-a-stable-state>Provide a stable state</a>.</p>

<p>Let <var title="">script</var> be the <a href=#current-node>current node</a>
(which will be a <code><a href=#script>script</a></code> element).</p>

Expand Down Expand Up @@ -81389,10 +81394,11 @@ document.body.appendChild(text);
flag must be unset. If the parser was originally created for the
<a href=#xml-fragment-parsing-algorithm>XML fragment parsing algorithm</a>, then the element must
be marked as <a href=#already-started>"already started"</a> also. When the element's
end tag is parsed, the user agent must <a href=#prepare-a-script title="prepare a
script">prepare</a> the <code><a href=#script>script</a></code> element. If this
causes there to be a <a href=#pending-parsing-blocking-script>pending parsing-blocking script</a>,
then the user agent must run the following steps:</p>
end tag is parsed, the user agent must <a href=#provide-a-stable-state>provide a stable
state</a>, and then <a href=#prepare-a-script title="prepare a script">prepare</a>
the <code><a href=#script>script</a></code> element. If this causes there to be a
<a href=#pending-parsing-blocking-script>pending parsing-blocking script</a>, then the user agent
must run the following steps:</p>

<ol><li><p>Block this instance of the <a href=#xml-parser>XML parser</a>, such
that the <a href=#event-loop>event loop</a> will not run <a href=#concept-task title=concept-task>tasks</a> that invoke it.</li>
Expand Down
37 changes: 22 additions & 15 deletions source
Expand Up @@ -73539,17 +73539,7 @@ interface <dfn>NavigatorOnLine</dfn> {

<li><p>Remove that task from its <span>task queue</span>.</p></li>

<li><p>If any asynchronously-running algorithms are <dfn
title="await a stable state">awaiting a stable state</dfn>, then
run their <dfn>synchronous section</dfn> and then resume running
their asynchronous algorithm.</p>

<p class="note">A <span>synchronous section</span> never mutates
the DOM, runs any script, or has any other side-effects.</p>

<p class="note">Steps in <span title="synchronous
section">synchronous sections</span> are marked with
&#x231B;.</p></li>
<li><p><span>Provide a stable state</span>.</p></li>

<li><p>If necessary, update the rendering or user interface of any
<code>Document</code> or <span>browsing context</span> to reflect
Expand All @@ -73562,6 +73552,20 @@ interface <dfn>NavigatorOnLine</dfn> {

<hr>

<p>When the user agent is to <dfn>provide a stable state</dfn>, if
any asynchronously-running algorithms are <dfn title="await a stable
state">awaiting a stable state</dfn>, then the user agent must run
their <dfn>synchronous section</dfn> and then resume running their
asynchronous algorithm (if appopriate).</p>

<p class="note">A <span>synchronous section</span> never mutates
the DOM, runs any script, or has any other side-effects.</p>

<p class="note">Steps in <span title="synchronous
section">synchronous sections</span> are marked with &#x231B;.</p>

<hr>

<p>When an algorithm says to <dfn>spin the event loop</dfn> until
a condition <var title="">goal</var> is met, the user agent must run
the following steps:</p>
Expand Down Expand Up @@ -93794,6 +93798,8 @@ document.body.appendChild(text);
<dt id="scriptEndTag">An end tag whose tag name is "script"</dt>
<dd>

<p><span>Provide a stable state</span>.</p>

<p>Let <var title="">script</var> be the <span>current node</span>
(which will be a <code>script</code> element).</p>

Expand Down Expand Up @@ -96694,10 +96700,11 @@ document.body.appendChild(text);
flag must be unset. If the parser was originally created for the
<span>XML fragment parsing algorithm</span>, then the element must
be marked as <span>"already started"</span> also. When the element's
end tag is parsed, the user agent must <span title="prepare a
script">prepare</span> the <code>script</code> element. If this
causes there to be a <span>pending parsing-blocking script</span>,
then the user agent must run the following steps:</p>
end tag is parsed, the user agent must <span>provide a stable
state</span>, and then <span title="prepare a script">prepare</span>
the <code>script</code> element. If this causes there to be a
<span>pending parsing-blocking script</span>, then the user agent
must run the following steps:</p>

<ol>

Expand Down

0 comments on commit de058fa

Please sign in to comment.