[html5] r8630 - [giow] (0) Refactor 'stable states' to be defined in terms of microtasks Fixing [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue May 13 12:18:51 PDT 2014


Author: ianh
Date: 2014-05-13 12:18:47 -0700 (Tue, 13 May 2014)
New Revision: 8630

Modified:
   complete.html
   index
   source
Log:
[giow] (0) Refactor 'stable states' to be defined in terms of microtasks
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=24724
Affected topics: DOM APIs, HTML Syntax and Parsing

Modified: complete.html
===================================================================
--- complete.html	2014-05-13 18:39:37 UTC (rev 8629)
+++ complete.html	2014-05-13 19:18:47 UTC (rev 8630)
@@ -72525,8 +72525,6 @@
 
    <li><p><a href=#perform-a-microtask-checkpoint>Perform a microtask checkpoint</a>.</li>
 
-   <li><p><a href=#provide-a-stable-state>Provide a stable state</a>.</li>
-
    <li><p><i>Update the rendering</i>: If this <a href=#event-loop>event loop</a> is a <a href=#browsing-context>browsing
    context</a> <a href=#event-loop>event loop</a> (as opposed to a <a href=#workers>worker</a> <a href=#event-loop>event
    loop</a>), then, if necessary, update the rendering or user interface of any
@@ -72587,7 +72585,7 @@
 
     <p><i>Run</i>: Run the selected <a href=#concept-task title=concept-task>task</a>.</p>
 
-    <p class=note>This will typically invoke scripted callbacks, which eventually calls the
+    <p class=note>This might involve invoking scripted callbacks, which eventually calls the
     <a href=#clean-up-after-running-a-callback>clean up after running a callback</a> steps, which call this <a href=#perform-a-microtask-checkpoint>perform a microtask
     checkpoint</a> algorithm again, which is why we use the <a href=#performing-a-microtask-checkpoint>performing a microtask
     checkpoint</a> flag to avoid reentrancy.</p>
@@ -72624,15 +72622,11 @@
 
    <li><p>Set the <a href=#event-loop>event loop</a>'s <a href=#currently-running-task>currently running task</a> back to <var title="">parent</var>.</li>
 
-  </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 appropriate).</p>
+  </ol><hr><p>When an asynchronously-running algorithm is to <dfn id=await-a-stable-state>await a stable state</dfn>, the user agent
+  must <a href=#queue-a-microtask>queue a microtask</a> that first runs the algorithm's <dfn id=synchronous-section>synchronous
+  section</dfn>, and then resumes running the asynchronous algorithm (if appropriate), as described
+  in the algorithm's steps.</p>
 
-  <p class=note>A <a href=#synchronous-section>synchronous section</a> never mutates the DOM, runs any script, or has
-  any side-effects detectable from another <a href=#synchronous-section>synchronous section</a>, and thus <a href=#synchronous-section title="synchronous section">synchronous sections</a> can be run in any order, and cannot
-  <a href=#spin-the-event-loop>spin the event loop</a>.</p>
-
   <p class=note>Steps in <a href=#synchronous-section title="synchronous section">synchronous sections</a> are marked
   with &#x231b;.</p>
 
@@ -93029,8 +93023,6 @@
 
     <p>If the <a href=#stack-of-script-settings-objects>stack of script settings objects</a> is empty, <a href=#perform-a-microtask-checkpoint>perform a microtask checkpoint</a>.</p>
 
-    <p>If the <a href=#stack-of-script-settings-objects>stack of script settings objects</a> is empty, <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=#the-script-element>script</a></code> element).</p>
 
@@ -95637,12 +95629,13 @@
   motivated by a desire for user agents to all handle entities in an interoperable fashion without
   requiring any network access for handling external subsets. <a href=#refsXML>[XML]</a></p>
 
+<!--CLEANUP-->
   <p id=scriptTagXML>When an <a href=#xml-parser>XML parser</a> creates a <code><a href=#the-script-element>script</a></code> element, it
   must be marked as being <a href=#parser-inserted>"parser-inserted"</a> and its <a href=#force-async>"force-async"</a> 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=#perform-a-microtask-checkpoint>perform a microtask checkpoint</a>,
-  <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
+  and then <a href=#prepare-a-script title="prepare a script">prepare</a> the
   <code><a href=#the-script-element>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>
 

Modified: index
===================================================================
--- index	2014-05-13 18:39:37 UTC (rev 8629)
+++ index	2014-05-13 19:18:47 UTC (rev 8630)
@@ -72525,8 +72525,6 @@
 
    <li><p><a href=#perform-a-microtask-checkpoint>Perform a microtask checkpoint</a>.</li>
 
-   <li><p><a href=#provide-a-stable-state>Provide a stable state</a>.</li>
-
    <li><p><i>Update the rendering</i>: If this <a href=#event-loop>event loop</a> is a <a href=#browsing-context>browsing
    context</a> <a href=#event-loop>event loop</a> (as opposed to a <a href=#workers>worker</a> <a href=#event-loop>event
    loop</a>), then, if necessary, update the rendering or user interface of any
@@ -72587,7 +72585,7 @@
 
     <p><i>Run</i>: Run the selected <a href=#concept-task title=concept-task>task</a>.</p>
 
-    <p class=note>This will typically invoke scripted callbacks, which eventually calls the
+    <p class=note>This might involve invoking scripted callbacks, which eventually calls the
     <a href=#clean-up-after-running-a-callback>clean up after running a callback</a> steps, which call this <a href=#perform-a-microtask-checkpoint>perform a microtask
     checkpoint</a> algorithm again, which is why we use the <a href=#performing-a-microtask-checkpoint>performing a microtask
     checkpoint</a> flag to avoid reentrancy.</p>
@@ -72624,15 +72622,11 @@
 
    <li><p>Set the <a href=#event-loop>event loop</a>'s <a href=#currently-running-task>currently running task</a> back to <var title="">parent</var>.</li>
 
-  </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 appropriate).</p>
+  </ol><hr><p>When an asynchronously-running algorithm is to <dfn id=await-a-stable-state>await a stable state</dfn>, the user agent
+  must <a href=#queue-a-microtask>queue a microtask</a> that first runs the algorithm's <dfn id=synchronous-section>synchronous
+  section</dfn>, and then resumes running the asynchronous algorithm (if appropriate), as described
+  in the algorithm's steps.</p>
 
-  <p class=note>A <a href=#synchronous-section>synchronous section</a> never mutates the DOM, runs any script, or has
-  any side-effects detectable from another <a href=#synchronous-section>synchronous section</a>, and thus <a href=#synchronous-section title="synchronous section">synchronous sections</a> can be run in any order, and cannot
-  <a href=#spin-the-event-loop>spin the event loop</a>.</p>
-
   <p class=note>Steps in <a href=#synchronous-section title="synchronous section">synchronous sections</a> are marked
   with &#x231b;.</p>
 
@@ -93029,8 +93023,6 @@
 
     <p>If the <a href=#stack-of-script-settings-objects>stack of script settings objects</a> is empty, <a href=#perform-a-microtask-checkpoint>perform a microtask checkpoint</a>.</p>
 
-    <p>If the <a href=#stack-of-script-settings-objects>stack of script settings objects</a> is empty, <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=#the-script-element>script</a></code> element).</p>
 
@@ -95637,12 +95629,13 @@
   motivated by a desire for user agents to all handle entities in an interoperable fashion without
   requiring any network access for handling external subsets. <a href=#refsXML>[XML]</a></p>
 
+<!--CLEANUP-->
   <p id=scriptTagXML>When an <a href=#xml-parser>XML parser</a> creates a <code><a href=#the-script-element>script</a></code> element, it
   must be marked as being <a href=#parser-inserted>"parser-inserted"</a> and its <a href=#force-async>"force-async"</a> 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=#perform-a-microtask-checkpoint>perform a microtask checkpoint</a>,
-  <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
+  and then <a href=#prepare-a-script title="prepare a script">prepare</a> the
   <code><a href=#the-script-element>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>
 

Modified: source
===================================================================
--- source	2014-05-13 18:39:37 UTC (rev 8629)
+++ source	2014-05-13 19:18:47 UTC (rev 8630)
@@ -79880,8 +79880,6 @@
 
    <li><p><span>Perform a microtask checkpoint</span>.</p></li>
 
-   <li><p><span>Provide a stable state</span>.</p></li>
-
    <li><p><i>Update the rendering</i>: If this <span>event loop</span> is a <span>browsing
    context</span> <span>event loop</span> (as opposed to a <a href="#workers">worker</a> <span>event
    loop</span>), then, if necessary, update the rendering or user interface of any
@@ -79952,7 +79950,7 @@
 
     <p><i>Run</i>: Run the selected <span data-x="concept-task">task</span>.</p>
 
-    <p class="note">This will typically invoke scripted callbacks, which eventually calls the
+    <p class="note">This might involve invoking scripted callbacks, which eventually calls the
     <span>clean up after running a callback</span> steps, which call this <span>perform a microtask
     checkpoint</span> algorithm again, which is why we use the <span>performing a microtask
     checkpoint</span> flag to avoid reentrancy.</p>
@@ -79999,16 +79997,11 @@
 
   <hr>
 
-  <p>When the user agent is to <dfn>provide a stable state</dfn>, if any asynchronously-running
-  algorithms are <dfn data-x="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 appropriate).</p>
+  <p>When an asynchronously-running algorithm is to <dfn>await a stable state</dfn>, the user agent
+  must <span>queue a microtask</span> that first runs the algorithm's <dfn>synchronous
+  section</dfn>, and then resumes running the asynchronous algorithm (if appropriate), as described
+  in the algorithm's steps.</p>
 
-  <p class="note">A <span>synchronous section</span> never mutates the DOM, runs any script, or has
-  any side-effects detectable from another <span>synchronous section</span>, and thus <span
-  data-x="synchronous section">synchronous sections</span> can be run in any order, and cannot
-  <span>spin the event loop</span>.</p>
-
   <p class="note">Steps in <span data-x="synchronous section">synchronous sections</span> are marked
   with &#x231B;.</p>
 
@@ -102656,8 +102649,6 @@
 
     <p>If the <span>stack of script settings objects</span> is empty, <span>perform a microtask checkpoint</span>.</p>
 
-    <p>If the <span>stack of script settings objects</span> is empty, <span>provide a stable state</span>.</p>
-
     <p>Let <var data-x="">script</var> be the <span>current node</span> (which will be a
     <code>script</code> element).</p>
 
@@ -105546,12 +105537,13 @@
   motivated by a desire for user agents to all handle entities in an interoperable fashion without
   requiring any network access for handling external subsets. <a href="#refsXML">[XML]</a></p>
 
+<!--CLEANUP-->
   <p id="scriptTagXML">When an <span>XML parser</span> creates a <code>script</code> element, it
   must be marked as being <span>"parser-inserted"</span> and its <span>"force-async"</span> 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>perform a microtask checkpoint</span>,
-  <span>provide a stable state</span>, and then <span data-x="prepare a script">prepare</span> the
+  and then <span data-x="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>
 



More information about the Commit-Watchers mailing list