[html5] r8107 - [e] (0) Tidy the AAA. Affected topics: HTML Syntax and Parsing

whatwg at whatwg.org whatwg at whatwg.org
Wed Jul 31 12:54:24 PDT 2013


Author: ianh
Date: 2013-07-31 12:54:23 -0700 (Wed, 31 Jul 2013)
New Revision: 8107

Modified:
   complete.html
   index
   source
Log:
[e] (0) Tidy the AAA.
Affected topics: HTML Syntax and Parsing

Modified: complete.html
===================================================================
--- complete.html	2013-07-31 19:27:34 UTC (rev 8106)
+++ complete.html	2013-07-31 19:54:23 UTC (rev 8107)
@@ -91466,7 +91466,7 @@
    <li><p>Pop elements from the <a href=#stack-of-open-elements>stack of open elements</a> until a <code><a href=#the-p-element>p</a></code> element
    has been popped from the stack.</li>
 
-  </ol><p id=adoptionAgency>The <dfn id=adoption-agency-algorithm>adoption agency algorithm</dfn>, which takes as its only argument
+  </ol><!-- AAA --><p id=adoptionAgency>The <dfn id=adoption-agency-algorithm>adoption agency algorithm</dfn>, which takes as its only argument
   a tag name <var title="">subject</var> for which the algorithm is being run, consists of the
   following steps:</p>
 
@@ -91479,49 +91479,57 @@
 
    <li>
 
-    <p>Let the <var title="">formatting element</var> be the last element in the <a href=#list-of-active-formatting-elements>list of
-    active formatting elements</a> that:</p>
+    <p>Let <var title="">formatting element</var> be the last element in the <a href=#list-of-active-formatting-elements>list of active
+    formatting elements</a> that:</p>
 
     <ul><li>is between the end of the list and the last scope marker in the list, if any, or the start
      of the list otherwise, and</li>
 
      <li>has the tag name <var title="">subject</var>.</li>
 
-    </ul><p>If there is no such node, then abort these steps and instead act as described in the "any
+    </ul><p>If there is no such element, then abort these steps and instead act as described in the "any
     other end tag" entry below.</p>
 
-    <p>Otherwise, if there is such a node, but that node is not in the <a href=#stack-of-open-elements>stack of open
-    elements</a>, then this is a <a href=#parse-error>parse error</a>; remove the element from the list, and
-    abort these steps.</p>
+   </li>
 
-    <p>Otherwise, if there is such a node, and that node is also in the <a href=#stack-of-open-elements>stack of open
-    elements</a>, but the element is not <a href=#has-an-element-in-scope title="has an element in scope">in scope</a>,
-    then this is a <a href=#parse-error>parse error</a>; abort these steps.</p>
+   <li><p>If <var title="">formatting element</var> is not in the <a href=#stack-of-open-elements>stack of open
+   elements</a>, then this is a <a href=#parse-error>parse error</a>; remove the element from the list, and
+   abort these steps.</li>
 
-    <p>Otherwise, there is a <var title="">formatting element</var> and that element is in <a href=#stack-of-open-elements title="stack of open elements">the stack</a> and is <a href=#has-an-element-in-scope title="has an element in scope">in
-    scope</a>. If the element is not the <a href=#current-node>current node</a>, this is a <a href=#parse-error>parse
-    error</a>. In any case, proceed with the algorithm as written in the following steps.</p>
+   <li><p>If <var title="">formatting element</var> is in the <a href=#stack-of-open-elements>stack of open elements</a>,
+   but the element is not <a href=#has-an-element-in-scope title="has an element in scope">in scope</a>, then this is a
+   <a href=#parse-error>parse error</a>; abort these steps.</li>
 
-   </li>
+   <!-- at this point, <var title="">formatting element</var> is in <span title="stack of open
+        elements">the stack</span> and <span title="list of active formatting elements">the
+        list</span>, and is <span title="has an element in scope">in scope</span>. -->
 
-   <li><p>Let the <var title="">furthest block</var> be the topmost node in the <a href=#stack-of-open-elements>stack of open
-   elements</a> that is lower in the stack than the <var title="">formatting element</var>, and
-   is an element in the <a href=#special>special</a> category. There might not be one.</li>
+   <li><p>If <var title="">formatting element</var> is not the <a href=#current-node>current node</a>, this is a
+   <a href=#parse-error>parse error</a>. (But do not abort these steps.)</li>
 
+   <li><p>Let <var title="">furthest block</var> be the topmost node in the <a href=#stack-of-open-elements>stack of open
+   elements</a> that is lower in the stack than <var title="">formatting element</var>, and is an
+   element in the <a href=#special>special</a> category. There might not be one.</li>
+
+   <!-- <html> ... <formatting element> ... <furthest block> ... <current node> -->
+
    <li><p>If there is no <var title="">furthest block</var>, then the UA must first pop all the
    nodes from the bottom of the <a href=#stack-of-open-elements>stack of open elements</a>, from the <a href=#current-node>current
-   node</a> up to and including the <var title="">formatting element</var>, then remove the <var title="">formatting element</var> from the <a href=#list-of-active-formatting-elements>list of active formatting elements</a>, and
-   finally abort these steps.</li>
+   node</a> up to and including <var title="">formatting element</var>, then remove <var title="">formatting element</var> from the <a href=#list-of-active-formatting-elements>list of active formatting elements</a>, and
+   finally abort these steps.</li> <!-- the "reconstruct the active formatting elements"
+   algorithm will rebuild them later -->
 
-   <li><p>Let the <var title="">common ancestor</var> be the element immediately above the <var title="">formatting element</var> in the <a href=#stack-of-open-elements>stack of open elements</a>.</li>
+   <li><p>Let <var title="">common ancestor</var> be the element immediately above <var title="">formatting element</var> in the <a href=#stack-of-open-elements>stack of open elements</a>.</li>
 
-   <li><p>Let a bookmark note the position of the <var title="">formatting element</var> in the
+   <!-- <html> ... <common ancestor> <formatting element> ... <furthest block> ... <current node> -->
+
+   <li><p>Let a bookmark note the position of <var title="">formatting element</var> in the
    <a href=#list-of-active-formatting-elements>list of active formatting elements</a> relative to the elements on either side of it in
    the list.</li>
 
    <li>
 
-    <p>Let <var title="">node</var> and <var title="">last node</var> be the <var title="">furthest
+    <p>Let <var title="">node</var> and <var title="">last node</var> be <var title="">furthest
     block</var>. Follow these steps:</p>
 
     <ol><li><p>Let <var title="">inner loop counter</var> be zero.</li>
@@ -91531,36 +91539,34 @@
 
      <li><p>Increment <var title="">inner loop counter</var> by one.</li>
 
-     <li>Let <var title="">node</var> be the element immediately above <var title="">node</var> in
-     the <a href=#stack-of-open-elements>stack of open elements</a>, or if <var title="">node</var> is no longer in the
-     <a href=#stack-of-open-elements>stack of open elements</a> (e.g. because it got removed by the next step), the element
-     that was immediately above <var title="">node</var> in the <a href=#stack-of-open-elements>stack of open elements</a>
-     before <var title="">node</var> was removed.</li>
+     <li><p>Let <var title="">node</var> be the element immediately above <var title="">node</var>
+     in the <a href=#stack-of-open-elements>stack of open elements</a>, or if <var title="">node</var> is no longer in the
+     <a href=#stack-of-open-elements>stack of open elements</a> (e.g. because it got removed by this algorithm<!-- in
+     particular, the step labeled "removal" below -->), the element that was immediately above <var title="">node</var> in the <a href=#stack-of-open-elements>stack of open elements</a> before <var title="">node</var>
+     was removed.</li>
 
-     <li>If <var title="">node</var> is not in the <a href=#list-of-active-formatting-elements>list of active formatting elements</a>,
-     then remove <var title="">node</var> from the <a href=#stack-of-open-elements>stack of open elements</a> and then go
-     back to the step labeled <i>inner loop</i>.</li>
+     <li><p><!-- "removal" step: -->If <var title="">node</var> is not in the <a href=#list-of-active-formatting-elements>list of active
+     formatting elements</a>, then remove <var title="">node</var> from the <a href=#stack-of-open-elements>stack of open
+     elements</a> and then go back to the step labeled <i>inner loop</i>.</li>
 
-     <li>Otherwise, if <var title="">node</var> is the <var title="">formatting element</var>, then
+     <li><p>Otherwise, if <var title="">node</var> is <var title="">formatting element</var>, then
      go to the next step in the overall algorithm.</li>
 
-     <li><a href=#create-an-element-for-the-token>Create an element for the token</a> for which the element <var title="">node</var>
-     was created, with <var title="">common ancestor</var> as the intended parent; replace the entry
-     for <var title="">node</var> in the <a href=#list-of-active-formatting-elements>list of active formatting elements</a> with an
-     entry for the new element, replace the entry for <var title="">node</var> in the <a href=#stack-of-open-elements>stack of
-     open elements</a> with an entry for the new element, and let <var title="">node</var> be the
-     new element.</li>
+     <li><p><a href=#create-an-element-for-the-token>Create an element for the token</a> for which the element <var title="">node</var> was created, with <var title="">common ancestor</var> as the intended
+     parent; replace the entry for <var title="">node</var> in the <a href=#list-of-active-formatting-elements>list of active formatting
+     elements</a> with an entry for the new element, replace the entry for <var title="">node</var> in the <a href=#stack-of-open-elements>stack of open elements</a> with an entry for the new
+     element, and let <var title="">node</var> be the new element.</li>
 
-     <li>If <var title="">last node</var> is the <var title="">furthest block</var>, then move the
+     <li><p>If <var title="">last node</var> is <var title="">furthest block</var>, then move the
      aforementioned bookmark to be immediately after the new <var title="">node</var> in the
      <a href=#list-of-active-formatting-elements>list of active formatting elements</a>.</li>
 
-     <li>Insert <var title="">last node</var> into <var title="">node</var>, first removing it from
-     its previous parent node if any.</li>
+     <li><p>Insert <var title="">last node</var> into <var title="">node</var>, first removing it
+     from its previous parent node if any.</li>
 
-     <li>Let <var title="">last node</var> be <var title="">node</var>.</li>
+     <li><p>Let <var title="">last node</var> be <var title="">node</var>.</li>
 
-     <li>Return to the step labeled <i>inner loop</i>.</li>
+     <li><p>Return to the step labeled <i>inner loop</i>.</li>
 
     </ol></li>
 
@@ -91568,22 +91574,22 @@
    <a href=#appropriate-place-for-inserting-a-node>appropriate place for inserting a node</a>, but using <var title="">common
    ancestor</var> as the <i>override target</i>.</li>
 
-   <li><p><a href=#create-an-element-for-the-token>Create an element for the token</a> for which the <var title="">formatting
+   <li><p><a href=#create-an-element-for-the-token>Create an element for the token</a> for which <var title="">formatting
    element</var> was created, with <var title="">furthest block</var> as the intended
    parent.</li>
 
-   <li><p>Take all of the child nodes of the <var title="">furthest block</var> and append them to
-   the element created in the last step.</li>
+   <li><p>Take all of the child nodes of <var title="">furthest block</var> and append them to the
+   element created in the last step.</li>
 
-   <li><p>Append that new element to the <var title="">furthest block</var>.</li>
+   <li><p>Append that new element to <var title="">furthest block</var>.</li>
 
-   <li><p>Remove the <var title="">formatting element</var> from the <a href=#list-of-active-formatting-elements>list of active formatting
+   <li><p>Remove <var title="">formatting element</var> from the <a href=#list-of-active-formatting-elements>list of active formatting
    elements</a>, and insert the new element into the <a href=#list-of-active-formatting-elements>list of active formatting
    elements</a> at the position of the aforementioned bookmark.</li>
 
-   <li><p>Remove the <var title="">formatting element</var> from the <a href=#stack-of-open-elements>stack of open
+   <li><p>Remove <var title="">formatting element</var> from the <a href=#stack-of-open-elements>stack of open
    elements</a>, and insert the new element into the <a href=#stack-of-open-elements>stack of open elements</a>
-   immediately below the position of the <var title="">furthest block</var> in that stack.</li>
+   immediately below the position of <var title="">furthest block</var> in that stack.</li>
 
    <li><p>Jump back to the step labeled <i>outer loop</i>.</li>
 

Modified: index
===================================================================
--- index	2013-07-31 19:27:34 UTC (rev 8106)
+++ index	2013-07-31 19:54:23 UTC (rev 8107)
@@ -91466,7 +91466,7 @@
    <li><p>Pop elements from the <a href=#stack-of-open-elements>stack of open elements</a> until a <code><a href=#the-p-element>p</a></code> element
    has been popped from the stack.</li>
 
-  </ol><p id=adoptionAgency>The <dfn id=adoption-agency-algorithm>adoption agency algorithm</dfn>, which takes as its only argument
+  </ol><!-- AAA --><p id=adoptionAgency>The <dfn id=adoption-agency-algorithm>adoption agency algorithm</dfn>, which takes as its only argument
   a tag name <var title="">subject</var> for which the algorithm is being run, consists of the
   following steps:</p>
 
@@ -91479,49 +91479,57 @@
 
    <li>
 
-    <p>Let the <var title="">formatting element</var> be the last element in the <a href=#list-of-active-formatting-elements>list of
-    active formatting elements</a> that:</p>
+    <p>Let <var title="">formatting element</var> be the last element in the <a href=#list-of-active-formatting-elements>list of active
+    formatting elements</a> that:</p>
 
     <ul><li>is between the end of the list and the last scope marker in the list, if any, or the start
      of the list otherwise, and</li>
 
      <li>has the tag name <var title="">subject</var>.</li>
 
-    </ul><p>If there is no such node, then abort these steps and instead act as described in the "any
+    </ul><p>If there is no such element, then abort these steps and instead act as described in the "any
     other end tag" entry below.</p>
 
-    <p>Otherwise, if there is such a node, but that node is not in the <a href=#stack-of-open-elements>stack of open
-    elements</a>, then this is a <a href=#parse-error>parse error</a>; remove the element from the list, and
-    abort these steps.</p>
+   </li>
 
-    <p>Otherwise, if there is such a node, and that node is also in the <a href=#stack-of-open-elements>stack of open
-    elements</a>, but the element is not <a href=#has-an-element-in-scope title="has an element in scope">in scope</a>,
-    then this is a <a href=#parse-error>parse error</a>; abort these steps.</p>
+   <li><p>If <var title="">formatting element</var> is not in the <a href=#stack-of-open-elements>stack of open
+   elements</a>, then this is a <a href=#parse-error>parse error</a>; remove the element from the list, and
+   abort these steps.</li>
 
-    <p>Otherwise, there is a <var title="">formatting element</var> and that element is in <a href=#stack-of-open-elements title="stack of open elements">the stack</a> and is <a href=#has-an-element-in-scope title="has an element in scope">in
-    scope</a>. If the element is not the <a href=#current-node>current node</a>, this is a <a href=#parse-error>parse
-    error</a>. In any case, proceed with the algorithm as written in the following steps.</p>
+   <li><p>If <var title="">formatting element</var> is in the <a href=#stack-of-open-elements>stack of open elements</a>,
+   but the element is not <a href=#has-an-element-in-scope title="has an element in scope">in scope</a>, then this is a
+   <a href=#parse-error>parse error</a>; abort these steps.</li>
 
-   </li>
+   <!-- at this point, <var title="">formatting element</var> is in <span title="stack of open
+        elements">the stack</span> and <span title="list of active formatting elements">the
+        list</span>, and is <span title="has an element in scope">in scope</span>. -->
 
-   <li><p>Let the <var title="">furthest block</var> be the topmost node in the <a href=#stack-of-open-elements>stack of open
-   elements</a> that is lower in the stack than the <var title="">formatting element</var>, and
-   is an element in the <a href=#special>special</a> category. There might not be one.</li>
+   <li><p>If <var title="">formatting element</var> is not the <a href=#current-node>current node</a>, this is a
+   <a href=#parse-error>parse error</a>. (But do not abort these steps.)</li>
 
+   <li><p>Let <var title="">furthest block</var> be the topmost node in the <a href=#stack-of-open-elements>stack of open
+   elements</a> that is lower in the stack than <var title="">formatting element</var>, and is an
+   element in the <a href=#special>special</a> category. There might not be one.</li>
+
+   <!-- <html> ... <formatting element> ... <furthest block> ... <current node> -->
+
    <li><p>If there is no <var title="">furthest block</var>, then the UA must first pop all the
    nodes from the bottom of the <a href=#stack-of-open-elements>stack of open elements</a>, from the <a href=#current-node>current
-   node</a> up to and including the <var title="">formatting element</var>, then remove the <var title="">formatting element</var> from the <a href=#list-of-active-formatting-elements>list of active formatting elements</a>, and
-   finally abort these steps.</li>
+   node</a> up to and including <var title="">formatting element</var>, then remove <var title="">formatting element</var> from the <a href=#list-of-active-formatting-elements>list of active formatting elements</a>, and
+   finally abort these steps.</li> <!-- the "reconstruct the active formatting elements"
+   algorithm will rebuild them later -->
 
-   <li><p>Let the <var title="">common ancestor</var> be the element immediately above the <var title="">formatting element</var> in the <a href=#stack-of-open-elements>stack of open elements</a>.</li>
+   <li><p>Let <var title="">common ancestor</var> be the element immediately above <var title="">formatting element</var> in the <a href=#stack-of-open-elements>stack of open elements</a>.</li>
 
-   <li><p>Let a bookmark note the position of the <var title="">formatting element</var> in the
+   <!-- <html> ... <common ancestor> <formatting element> ... <furthest block> ... <current node> -->
+
+   <li><p>Let a bookmark note the position of <var title="">formatting element</var> in the
    <a href=#list-of-active-formatting-elements>list of active formatting elements</a> relative to the elements on either side of it in
    the list.</li>
 
    <li>
 
-    <p>Let <var title="">node</var> and <var title="">last node</var> be the <var title="">furthest
+    <p>Let <var title="">node</var> and <var title="">last node</var> be <var title="">furthest
     block</var>. Follow these steps:</p>
 
     <ol><li><p>Let <var title="">inner loop counter</var> be zero.</li>
@@ -91531,36 +91539,34 @@
 
      <li><p>Increment <var title="">inner loop counter</var> by one.</li>
 
-     <li>Let <var title="">node</var> be the element immediately above <var title="">node</var> in
-     the <a href=#stack-of-open-elements>stack of open elements</a>, or if <var title="">node</var> is no longer in the
-     <a href=#stack-of-open-elements>stack of open elements</a> (e.g. because it got removed by the next step), the element
-     that was immediately above <var title="">node</var> in the <a href=#stack-of-open-elements>stack of open elements</a>
-     before <var title="">node</var> was removed.</li>
+     <li><p>Let <var title="">node</var> be the element immediately above <var title="">node</var>
+     in the <a href=#stack-of-open-elements>stack of open elements</a>, or if <var title="">node</var> is no longer in the
+     <a href=#stack-of-open-elements>stack of open elements</a> (e.g. because it got removed by this algorithm<!-- in
+     particular, the step labeled "removal" below -->), the element that was immediately above <var title="">node</var> in the <a href=#stack-of-open-elements>stack of open elements</a> before <var title="">node</var>
+     was removed.</li>
 
-     <li>If <var title="">node</var> is not in the <a href=#list-of-active-formatting-elements>list of active formatting elements</a>,
-     then remove <var title="">node</var> from the <a href=#stack-of-open-elements>stack of open elements</a> and then go
-     back to the step labeled <i>inner loop</i>.</li>
+     <li><p><!-- "removal" step: -->If <var title="">node</var> is not in the <a href=#list-of-active-formatting-elements>list of active
+     formatting elements</a>, then remove <var title="">node</var> from the <a href=#stack-of-open-elements>stack of open
+     elements</a> and then go back to the step labeled <i>inner loop</i>.</li>
 
-     <li>Otherwise, if <var title="">node</var> is the <var title="">formatting element</var>, then
+     <li><p>Otherwise, if <var title="">node</var> is <var title="">formatting element</var>, then
      go to the next step in the overall algorithm.</li>
 
-     <li><a href=#create-an-element-for-the-token>Create an element for the token</a> for which the element <var title="">node</var>
-     was created, with <var title="">common ancestor</var> as the intended parent; replace the entry
-     for <var title="">node</var> in the <a href=#list-of-active-formatting-elements>list of active formatting elements</a> with an
-     entry for the new element, replace the entry for <var title="">node</var> in the <a href=#stack-of-open-elements>stack of
-     open elements</a> with an entry for the new element, and let <var title="">node</var> be the
-     new element.</li>
+     <li><p><a href=#create-an-element-for-the-token>Create an element for the token</a> for which the element <var title="">node</var> was created, with <var title="">common ancestor</var> as the intended
+     parent; replace the entry for <var title="">node</var> in the <a href=#list-of-active-formatting-elements>list of active formatting
+     elements</a> with an entry for the new element, replace the entry for <var title="">node</var> in the <a href=#stack-of-open-elements>stack of open elements</a> with an entry for the new
+     element, and let <var title="">node</var> be the new element.</li>
 
-     <li>If <var title="">last node</var> is the <var title="">furthest block</var>, then move the
+     <li><p>If <var title="">last node</var> is <var title="">furthest block</var>, then move the
      aforementioned bookmark to be immediately after the new <var title="">node</var> in the
      <a href=#list-of-active-formatting-elements>list of active formatting elements</a>.</li>
 
-     <li>Insert <var title="">last node</var> into <var title="">node</var>, first removing it from
-     its previous parent node if any.</li>
+     <li><p>Insert <var title="">last node</var> into <var title="">node</var>, first removing it
+     from its previous parent node if any.</li>
 
-     <li>Let <var title="">last node</var> be <var title="">node</var>.</li>
+     <li><p>Let <var title="">last node</var> be <var title="">node</var>.</li>
 
-     <li>Return to the step labeled <i>inner loop</i>.</li>
+     <li><p>Return to the step labeled <i>inner loop</i>.</li>
 
     </ol></li>
 
@@ -91568,22 +91574,22 @@
    <a href=#appropriate-place-for-inserting-a-node>appropriate place for inserting a node</a>, but using <var title="">common
    ancestor</var> as the <i>override target</i>.</li>
 
-   <li><p><a href=#create-an-element-for-the-token>Create an element for the token</a> for which the <var title="">formatting
+   <li><p><a href=#create-an-element-for-the-token>Create an element for the token</a> for which <var title="">formatting
    element</var> was created, with <var title="">furthest block</var> as the intended
    parent.</li>
 
-   <li><p>Take all of the child nodes of the <var title="">furthest block</var> and append them to
-   the element created in the last step.</li>
+   <li><p>Take all of the child nodes of <var title="">furthest block</var> and append them to the
+   element created in the last step.</li>
 
-   <li><p>Append that new element to the <var title="">furthest block</var>.</li>
+   <li><p>Append that new element to <var title="">furthest block</var>.</li>
 
-   <li><p>Remove the <var title="">formatting element</var> from the <a href=#list-of-active-formatting-elements>list of active formatting
+   <li><p>Remove <var title="">formatting element</var> from the <a href=#list-of-active-formatting-elements>list of active formatting
    elements</a>, and insert the new element into the <a href=#list-of-active-formatting-elements>list of active formatting
    elements</a> at the position of the aforementioned bookmark.</li>
 
-   <li><p>Remove the <var title="">formatting element</var> from the <a href=#stack-of-open-elements>stack of open
+   <li><p>Remove <var title="">formatting element</var> from the <a href=#stack-of-open-elements>stack of open
    elements</a>, and insert the new element into the <a href=#stack-of-open-elements>stack of open elements</a>
-   immediately below the position of the <var title="">furthest block</var> in that stack.</li>
+   immediately below the position of <var title="">furthest block</var> in that stack.</li>
 
    <li><p>Jump back to the step labeled <i>outer loop</i>.</li>
 

Modified: source
===================================================================
--- source	2013-07-31 19:27:34 UTC (rev 8106)
+++ source	2013-07-31 19:54:23 UTC (rev 8107)
@@ -102165,6 +102165,7 @@
 
   </ol>
 
+  <!-- AAA -->
   <p id="adoptionAgency">The <dfn>adoption agency algorithm</dfn>, which takes as its only argument
   a tag name <var title="">subject</var> for which the algorithm is being run, consists of the
   following steps:</p>
@@ -102180,8 +102181,8 @@
 
    <li>
 
-    <p>Let the <var title="">formatting element</var> be the last element in the <span>list of
-    active formatting elements</span> that:</p>
+    <p>Let <var title="">formatting element</var> be the last element in the <span>list of active
+    formatting elements</span> that:</p>
 
     <ul>
 
@@ -102192,44 +102193,51 @@
 
     </ul>
 
-    <p>If there is no such node, then abort these steps and instead act as described in the "any
+    <p>If there is no such element, then abort these steps and instead act as described in the "any
     other end tag" entry below.</p>
 
-    <p>Otherwise, if there is such a node, but that node is not in the <span>stack of open
-    elements</span>, then this is a <span>parse error</span>; remove the element from the list, and
-    abort these steps.</p>
+   </li>
 
-    <p>Otherwise, if there is such a node, and that node is also in the <span>stack of open
-    elements</span>, but the element is not <span title="has an element in scope">in scope</span>,
-    then this is a <span>parse error</span>; abort these steps.</p>
+   <li><p>If <var title="">formatting element</var> is not in the <span>stack of open
+   elements</span>, then this is a <span>parse error</span>; remove the element from the list, and
+   abort these steps.</p></li>
 
-    <p>Otherwise, there is a <var title="">formatting element</var> and that element is in <span
-    title="stack of open elements">the stack</span> and is <span title="has an element in scope">in
-    scope</span>. If the element is not the <span>current node</span>, this is a <span>parse
-    error</span>. In any case, proceed with the algorithm as written in the following steps.</p>
+   <li><p>If <var title="">formatting element</var> is in the <span>stack of open elements</span>,
+   but the element is not <span title="has an element in scope">in scope</span>, then this is a
+   <span>parse error</span>; abort these steps.</p></li>
 
-   </li>
+   <!-- at this point, <var title="">formatting element</var> is in <span title="stack of open
+        elements">the stack</span> and <span title="list of active formatting elements">the
+        list</span>, and is <span title="has an element in scope">in scope</span>. -->
 
-   <li><p>Let the <var title="">furthest block</var> be the topmost node in the <span>stack of open
-   elements</span> that is lower in the stack than the <var title="">formatting element</var>, and
-   is an element in the <span>special</span> category. There might not be one.</p></li>
+   <li><p>If <var title="">formatting element</var> is not the <span>current node</span>, this is a
+   <span>parse error</span>. (But do not abort these steps.)</p></li>
 
+   <li><p>Let <var title="">furthest block</var> be the topmost node in the <span>stack of open
+   elements</span> that is lower in the stack than <var title="">formatting element</var>, and is an
+   element in the <span>special</span> category. There might not be one.</p></li>
+
+   <!-- <html> ... <formatting element> ... <furthest block> ... <current node> -->
+
    <li><p>If there is no <var title="">furthest block</var>, then the UA must first pop all the
    nodes from the bottom of the <span>stack of open elements</span>, from the <span>current
-   node</span> up to and including the <var title="">formatting element</var>, then remove the <var
+   node</span> up to and including <var title="">formatting element</var>, then remove <var
    title="">formatting element</var> from the <span>list of active formatting elements</span>, and
-   finally abort these steps.</p></li>
+   finally abort these steps.</p></li> <!-- the "reconstruct the active formatting elements"
+   algorithm will rebuild them later -->
 
-   <li><p>Let the <var title="">common ancestor</var> be the element immediately above the <var
+   <li><p>Let <var title="">common ancestor</var> be the element immediately above <var
    title="">formatting element</var> in the <span>stack of open elements</span>.</p></li>
 
-   <li><p>Let a bookmark note the position of the <var title="">formatting element</var> in the
+   <!-- <html> ... <common ancestor> <formatting element> ... <furthest block> ... <current node> -->
+
+   <li><p>Let a bookmark note the position of <var title="">formatting element</var> in the
    <span>list of active formatting elements</span> relative to the elements on either side of it in
    the list.</p></li>
 
    <li>
 
-    <p>Let <var title="">node</var> and <var title="">last node</var> be the <var title="">furthest
+    <p>Let <var title="">node</var> and <var title="">last node</var> be <var title="">furthest
     block</var>. Follow these steps:</p>
 
     <ol>
@@ -102241,36 +102249,37 @@
 
      <li><p>Increment <var title="">inner loop counter</var> by one.</p></li>
 
-     <li>Let <var title="">node</var> be the element immediately above <var title="">node</var> in
-     the <span>stack of open elements</span>, or if <var title="">node</var> is no longer in the
-     <span>stack of open elements</span> (e.g. because it got removed by the next step), the element
-     that was immediately above <var title="">node</var> in the <span>stack of open elements</span>
-     before <var title="">node</var> was removed.</li>
+     <li><p>Let <var title="">node</var> be the element immediately above <var title="">node</var>
+     in the <span>stack of open elements</span>, or if <var title="">node</var> is no longer in the
+     <span>stack of open elements</span> (e.g. because it got removed by this algorithm<!-- in
+     particular, the step labeled "removal" below -->), the element that was immediately above <var
+     title="">node</var> in the <span>stack of open elements</span> before <var title="">node</var>
+     was removed.</p></li>
 
-     <li>If <var title="">node</var> is not in the <span>list of active formatting elements</span>,
-     then remove <var title="">node</var> from the <span>stack of open elements</span> and then go
-     back to the step labeled <i>inner loop</i>.</li>
+     <li><p><!-- "removal" step: -->If <var title="">node</var> is not in the <span>list of active
+     formatting elements</span>, then remove <var title="">node</var> from the <span>stack of open
+     elements</span> and then go back to the step labeled <i>inner loop</i>.</p></li>
 
-     <li>Otherwise, if <var title="">node</var> is the <var title="">formatting element</var>, then
-     go to the next step in the overall algorithm.</li>
+     <li><p>Otherwise, if <var title="">node</var> is <var title="">formatting element</var>, then
+     go to the next step in the overall algorithm.</p></li>
 
-     <li><span>Create an element for the token</span> for which the element <var title="">node</var>
-     was created, with <var title="">common ancestor</var> as the intended parent; replace the entry
-     for <var title="">node</var> in the <span>list of active formatting elements</span> with an
-     entry for the new element, replace the entry for <var title="">node</var> in the <span>stack of
-     open elements</span> with an entry for the new element, and let <var title="">node</var> be the
-     new element.</li>
+     <li><p><span>Create an element for the token</span> for which the element <var
+     title="">node</var> was created, with <var title="">common ancestor</var> as the intended
+     parent; replace the entry for <var title="">node</var> in the <span>list of active formatting
+     elements</span> with an entry for the new element, replace the entry for <var
+     title="">node</var> in the <span>stack of open elements</span> with an entry for the new
+     element, and let <var title="">node</var> be the new element.</p></li>
 
-     <li>If <var title="">last node</var> is the <var title="">furthest block</var>, then move the
+     <li><p>If <var title="">last node</var> is <var title="">furthest block</var>, then move the
      aforementioned bookmark to be immediately after the new <var title="">node</var> in the
-     <span>list of active formatting elements</span>.</li>
+     <span>list of active formatting elements</span>.</p></li>
 
-     <li>Insert <var title="">last node</var> into <var title="">node</var>, first removing it from
-     its previous parent node if any.</li>
+     <li><p>Insert <var title="">last node</var> into <var title="">node</var>, first removing it
+     from its previous parent node if any.</p></li>
 
-     <li>Let <var title="">last node</var> be <var title="">node</var>.</li>
+     <li><p>Let <var title="">last node</var> be <var title="">node</var>.</p></li>
 
-     <li>Return to the step labeled <i>inner loop</i>.</li>
+     <li><p>Return to the step labeled <i>inner loop</i>.</p></li>
 
     </ol>
 
@@ -102280,22 +102289,22 @@
    <span>appropriate place for inserting a node</span>, but using <var title="">common
    ancestor</var> as the <i>override target</i>.</p></li>
 
-   <li><p><span>Create an element for the token</span> for which the <var title="">formatting
+   <li><p><span>Create an element for the token</span> for which <var title="">formatting
    element</var> was created, with <var title="">furthest block</var> as the intended
    parent.</p></li>
 
-   <li><p>Take all of the child nodes of the <var title="">furthest block</var> and append them to
-   the element created in the last step.</p></li>
+   <li><p>Take all of the child nodes of <var title="">furthest block</var> and append them to the
+   element created in the last step.</p></li>
 
-   <li><p>Append that new element to the <var title="">furthest block</var>.</p></li>
+   <li><p>Append that new element to <var title="">furthest block</var>.</p></li>
 
-   <li><p>Remove the <var title="">formatting element</var> from the <span>list of active formatting
+   <li><p>Remove <var title="">formatting element</var> from the <span>list of active formatting
    elements</span>, and insert the new element into the <span>list of active formatting
    elements</span> at the position of the aforementioned bookmark.</p></li>
 
-   <li><p>Remove the <var title="">formatting element</var> from the <span>stack of open
+   <li><p>Remove <var title="">formatting element</var> from the <span>stack of open
    elements</span>, and insert the new element into the <span>stack of open elements</span>
-   immediately below the position of the <var title="">furthest block</var> in that stack.</p></li>
+   immediately below the position of <var title="">furthest block</var> in that stack.</p></li>
 
    <li><p>Jump back to the step labeled <i>outer loop</i>.</p></li>
 




More information about the Commit-Watchers mailing list