Skip to content
Permalink
Browse files

[giow] (2) Make sure that all synchronous sections run before <script…

…> 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 de058fac698f2c2dc74145e6042e8630a223d5f6
Showing with 66 additions and 47 deletions.
  1. +22 −16 complete.html
  2. +22 −16 index
  3. +22 −15 source

<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>-->

<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
<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>

<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>

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>
38 index

<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>-->

<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
<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>

<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>

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>
37 source

<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

<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>
<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>

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>

0 comments on commit de058fa

Please sign in to comment.
You can’t perform that action at this time.