[html5] r3769 - [cgt] (2) Make </li> be scoped by <ol>/<ul> also.

whatwg at whatwg.org whatwg at whatwg.org
Mon Sep 7 04:26:32 PDT 2009


Author: ianh
Date: 2009-09-07 04:26:31 -0700 (Mon, 07 Sep 2009)
New Revision: 3769

Modified:
   index
   source
Log:
[cgt] (2) Make </li> be scoped by <ol>/<ul> also.

Modified: index
===================================================================
--- index	2009-09-07 11:05:33 UTC (rev 3768)
+++ index	2009-09-07 11:26:31 UTC (rev 3769)
@@ -61158,8 +61158,9 @@
    <dd><p>All other elements found while parsing an HTML
    document.</dd>
 
-  </dl><p>The <a href=#stack-of-open-elements>stack of open elements</a> is said to <dfn id=has-an-element-in-scope title="has an element in scope">have an element in scope</dfn> when
-  the following algorithm terminates in a match state:</p>
+  </dl><p>The <a href=#stack-of-open-elements>stack of open elements</a> is said to <dfn id=has-an-element-in-the-specific-scope title="has an element in the specific scope">have an element in a
+  specific scope</dfn> consisting of a list of element types <var title="">list</var> when the following algorithm terminates in a
+  match state:</p>
 
   <ol><li><p>Initialize <var title="">node</var> to be the <a href=#current-node>current
    node</a> (the bottommost node of the stack).</li>
@@ -61167,19 +61168,9 @@
    <li><p>If <var title="">node</var> is the target node, terminate in
    a match state.</li>
 
-   <li><p>Otherwise, if <var title="">node</var> is one of the
-   following elements, terminate in a failure state:</p>
-    <ul class=brief><li><code><a href=#the-applet-element>applet</a></code> in the HTML namespace</li>
-     <li><code><a href=#the-caption-element>caption</a></code> in the HTML namespace</li>
-     <li><code><a href=#the-html-element-0>html</a></code> in the HTML namespace</li> <!-- (This can only happen if the <var title="">node</var> is the topmost node of the <span>stack of open elements</span>, and prevents the next step from being invoked if there are no more elements in the stack.) -->
-     <li><code><a href=#the-table-element>table</a></code> in the HTML namespace</li>
-     <li><code><a href=#the-td-element>td</a></code> in the HTML namespace</li>
-     <li><code><a href=#the-th-element>th</a></code> in the HTML namespace</li>
-     <li><code><a href=#the-button-element>button</a></code> in the HTML namespace</li>
-     <li><code><a href=#the-marquee-element>marquee</a></code> in the HTML namespace</li>
-     <li><code><a href=#the-object-element>object</a></code> in the HTML namespace</li>
-     <li><code title="">foreignObject</code> in the SVG namespace</li>
-    </ul></li>
+   <li><p>Otherwise, if <var title="">node</var> is one of the element
+   types in <var title="">list</var>, terminate in a failure
+   state.</li>
 
    <li><p>Otherwise, set <var title="">node</var> to the previous
    entry in the <a href=#stack-of-open-elements>stack of open elements</a> and return to step
@@ -61187,29 +61178,35 @@
    the previous step if the top of the stack — an
    <code><a href=#the-html-element-0>html</a></code> element — is reached.)</li>
 
-  </ol><p>The <a href=#stack-of-open-elements>stack of open elements</a> is said to <dfn id=has-an-element-in-table-scope title="has an element in table scope">have an element in <em>table
-  scope</em></dfn> when the following algorithm terminates in a match
-  state:</p>
+  </ol><p>The <a href=#stack-of-open-elements>stack of open elements</a> is said to <dfn id=has-an-element-in-scope title="has an element in scope">have an element in scope</dfn> when
+  it <a href=#has-an-element-in-the-specific-scope>has an element in the specific scope</a> consisting
+  of the following element types:</p>
 
-  <ol><li><p>Initialize <var title="">node</var> to be the <a href=#current-node>current
-   node</a> (the bottommost node of the stack).</li>
+  <ul class=brief><li><code><a href=#the-applet-element>applet</a></code> in the HTML namespace</li>
+   <li><code><a href=#the-caption-element>caption</a></code> in the HTML namespace</li>
+   <li><code><a href=#the-html-element-0>html</a></code> in the HTML namespace</li> <!-- (This can only happen if the <var title="">node</var> is the topmost node of the <span>stack of open elements</span>, and prevents the next step from being invoked if there are no more elements in the stack.) -->
+   <li><code><a href=#the-table-element>table</a></code> in the HTML namespace</li>
+   <li><code><a href=#the-td-element>td</a></code> in the HTML namespace</li>
+   <li><code><a href=#the-th-element>th</a></code> in the HTML namespace</li>
+   <li><code><a href=#the-button-element>button</a></code> in the HTML namespace</li>
+   <li><code><a href=#the-marquee-element>marquee</a></code> in the HTML namespace</li>
+   <li><code><a href=#the-object-element>object</a></code> in the HTML namespace</li>
+   <li><code title="">foreignObject</code> in the SVG namespace</li>
+  </ul><p>The <a href=#stack-of-open-elements>stack of open elements</a> is said to <dfn id=has-an-element-in-list-item-scope title="has an element in list item scope">have an element in list
+  item scope</dfn> when it <a href=#has-an-element-in-the-specific-scope>has an element in the specific
+  scope</a> consisting of the following element types:</p>
 
-   <li><p>If <var title="">node</var> is the target node, terminate in
-   a match state.</li>
+  <ul class=brief><li>All the element types listed above for the <i><a href=#has-an-element-in-scope>has an element
+   in scope</a></i> algorithm.</li>
+   <li><code><a href=#the-ol-element>ol</a></code> in the HTML namespace</li>
+   <li><code><a href=#the-ul-element>ul</a></code> in the HTML namespace</li>
+  </ul><p>The <a href=#stack-of-open-elements>stack of open elements</a> is said to <dfn id=has-an-element-in-table-scope title="has an element in table scope">have an element in <em>table
+  scope</em></dfn> when it <a href=#has-an-element-in-the-specific-scope>has an element in the specific
+  scope</a> consisting of the following element types:</p>
 
-   <li><p>Otherwise, if <var title="">node</var> is one of the
-   following elements, terminate in a failure state:</p>
-    <ul class=brief><li><code><a href=#the-html-element-0>html</a></code> in the HTML namespace</li> <!-- (This can only happen if the <var title="">node</var> is the topmost node of the <span>stack of open elements</span>, and prevents the next step from being invoked if there are no more elements in the stack.) -->
-     <li><code><a href=#the-table-element>table</a></code> in the HTML namespace</li>
-    </ul></li>
-
-   <li><p>Otherwise, set <var title="">node</var> to the previous
-   entry in the <a href=#stack-of-open-elements>stack of open elements</a> and return to step
-   2. (This will never fail, since the loop will always terminate in
-   the previous step if the top of the stack — an
-   <code><a href=#the-html-element-0>html</a></code> element — is reached.)</li>
-
-  </ol><p>Nothing happens if at any time any of the elements in the
+  <ul class=brief><li><code><a href=#the-html-element-0>html</a></code> in the HTML namespace</li> <!-- (This can only happen if the <var title="">node</var> is the topmost node of the <span>stack of open elements</span>, and prevents the next step from being invoked if there are no more elements in the stack.) -->
+   <li><code><a href=#the-table-element>table</a></code> in the HTML namespace</li>
+  </ul><p>Nothing happens if at any time any of the elements in the
   <a href=#stack-of-open-elements>stack of open elements</a> are moved to a new location in,
   or removed from, the <code>Document</code> tree. In particular, the
   stack is not changed in this situation. This can cause, amongst
@@ -64134,8 +64131,31 @@
 
     </ol></dd>
 
+   <!-- as normal, but needs care as the elements have optional tags, and are further scoped by <ol>/<ul> -->
+   <dt>An end tag whose tag name is "li"</dt>
+   <dd>
+
+    <p>If the <a href=#stack-of-open-elements>stack of open elements</a> does not <a href=#has-an-element-in-list-item-scope title="has an element in list item scope">have an element in list
+    item scope</a> with the same tag name as that of the token,
+    then this is a <a href=#parse-error>parse error</a>; ignore the token.</p>
+
+    <p>Otherwise, run these steps:</p>
+
+    <ol><li><p><a href=#generate-implied-end-tags>Generate implied end tags</a>, except
+     for elements with the same tag name as the token.</li>
+
+     <li><p>If the <a href=#current-node>current node</a> is not an element with
+     the same tag name as that of the token, then this is a
+     <a href=#parse-error>parse error</a>.</li>
+
+     <li><p>Pop elements from the <a href=#stack-of-open-elements>stack of open elements</a>
+     until an element with the same tag name as the token has been
+     popped from the stack.</li>
+
+    </ol></dd>
+
    <!-- as normal, but needs care as the elements have optional tags -->
-   <dt>An end tag whose tag name is one of: "dd", "dt", "li"</dt>
+   <dt>An end tag whose tag name is one of: "dd", "dt"</dt>
    <dd>
 
     <p>If the <a href=#stack-of-open-elements>stack of open elements</a> does not <a href=#has-an-element-in-scope title="has an element in scope">have an element in scope</a>

Modified: source
===================================================================
--- source	2009-09-07 11:05:33 UTC (rev 3768)
+++ source	2009-09-07 11:26:31 UTC (rev 3769)
@@ -75745,8 +75745,10 @@
   </dl>
 
   <p>The <span>stack of open elements</span> is said to <dfn
-  title="has an element in scope">have an element in scope</dfn> when
-  the following algorithm terminates in a match state:</p>
+  title="has an element in the specific scope">have an element in a
+  specific scope</dfn> consisting of a list of element types <var
+  title="">list</var> when the following algorithm terminates in a
+  match state:</p>
 
   <ol>
 
@@ -75756,21 +75758,9 @@
    <li><p>If <var title="">node</var> is the target node, terminate in
    a match state.</p></li>
 
-   <li><p>Otherwise, if <var title="">node</var> is one of the
-   following elements, terminate in a failure state:</p>
-    <ul class="brief">
-     <li><code>applet</code> in the HTML namespace</li>
-     <li><code>caption</code> in the HTML namespace</li>
-     <li><code>html</code> in the HTML namespace</li> <!-- (This can only happen if the <var title="">node</var> is the topmost node of the <span>stack of open elements</span>, and prevents the next step from being invoked if there are no more elements in the stack.) -->
-     <li><code>table</code> in the HTML namespace</li>
-     <li><code>td</code> in the HTML namespace</li>
-     <li><code>th</code> in the HTML namespace</li>
-     <li><code>button</code> in the HTML namespace</li>
-     <li><code>marquee</code> in the HTML namespace</li>
-     <li><code>object</code> in the HTML namespace</li>
-     <li><code title="">foreignObject</code> in the SVG namespace</li>
-    </ul>
-   </li>
+   <li><p>Otherwise, if <var title="">node</var> is one of the element
+   types in <var title="">list</var>, terminate in a failure
+   state.</p></li>
 
    <li><p>Otherwise, set <var title="">node</var> to the previous
    entry in the <span>stack of open elements</span> and return to step
@@ -75781,34 +75771,45 @@
   </ol>
 
   <p>The <span>stack of open elements</span> is said to <dfn
-  title="has an element in table scope">have an element in <em>table
-  scope</em></dfn> when the following algorithm terminates in a match
-  state:</p>
+  title="has an element in scope">have an element in scope</dfn> when
+  it <span>has an element in the specific scope</span> consisting
+  of the following element types:</p>
 
-  <ol>
+  <ul class="brief">
+   <li><code>applet</code> in the HTML namespace</li>
+   <li><code>caption</code> in the HTML namespace</li>
+   <li><code>html</code> in the HTML namespace</li> <!-- (This can only happen if the <var title="">node</var> is the topmost node of the <span>stack of open elements</span>, and prevents the next step from being invoked if there are no more elements in the stack.) -->
+   <li><code>table</code> in the HTML namespace</li>
+   <li><code>td</code> in the HTML namespace</li>
+   <li><code>th</code> in the HTML namespace</li>
+   <li><code>button</code> in the HTML namespace</li>
+   <li><code>marquee</code> in the HTML namespace</li>
+   <li><code>object</code> in the HTML namespace</li>
+   <li><code title="">foreignObject</code> in the SVG namespace</li>
+  </ul>
 
-   <li><p>Initialize <var title="">node</var> to be the <span>current
-   node</span> (the bottommost node of the stack).</p></li>
+  <p>The <span>stack of open elements</span> is said to <dfn
+  title="has an element in list item scope">have an element in list
+  item scope</dfn> when it <span>has an element in the specific
+  scope</span> consisting of the following element types:</p>
 
-   <li><p>If <var title="">node</var> is the target node, terminate in
-   a match state.</p></li>
+  <ul class="brief">
+   <li>All the element types listed above for the <i>has an element
+   in scope</i> algorithm.</li>
+   <li><code>ol</code> in the HTML namespace</li>
+   <li><code>ul</code> in the HTML namespace</li>
+  </ul>
 
-   <li><p>Otherwise, if <var title="">node</var> is one of the
-   following elements, terminate in a failure state:</p>
-    <ul class="brief">
-     <li><code>html</code> in the HTML namespace</li> <!-- (This can only happen if the <var title="">node</var> is the topmost node of the <span>stack of open elements</span>, and prevents the next step from being invoked if there are no more elements in the stack.) -->
-     <li><code>table</code> in the HTML namespace</li>
-    </ul>
-   </li>
+  <p>The <span>stack of open elements</span> is said to <dfn
+  title="has an element in table scope">have an element in <em>table
+  scope</em></dfn> when it <span>has an element in the specific
+  scope</span> consisting of the following element types:</p>
 
-   <li><p>Otherwise, set <var title="">node</var> to the previous
-   entry in the <span>stack of open elements</span> and return to step
-   2. (This will never fail, since the loop will always terminate in
-   the previous step if the top of the stack — an
-   <code>html</code> element — is reached.)</p></li>
+  <ul class="brief">
+   <li><code>html</code> in the HTML namespace</li> <!-- (This can only happen if the <var title="">node</var> is the topmost node of the <span>stack of open elements</span>, and prevents the next step from being invoked if there are no more elements in the stack.) -->
+   <li><code>table</code> in the HTML namespace</li>
+  </ul>
 
-  </ol>
-
   <p>Nothing happens if at any time any of the elements in the
   <span>stack of open elements</span> are moved to a new location in,
   or removed from, the <code>Document</code> tree. In particular, the
@@ -79100,8 +79101,36 @@
 
    </dd>
 
+   <!-- as normal, but needs care as the elements have optional tags, and are further scoped by <ol>/<ul> -->
+   <dt>An end tag whose tag name is "li"</dt>
+   <dd>
+
+    <p>If the <span>stack of open elements</span> does not <span
+    title="has an element in list item scope">have an element in list
+    item scope</span> with the same tag name as that of the token,
+    then this is a <span>parse error</span>; ignore the token.</p>
+
+    <p>Otherwise, run these steps:</p>
+
+    <ol>
+
+     <li><p><span>Generate implied end tags</span>, except
+     for elements with the same tag name as the token.</p></li>
+
+     <li><p>If the <span>current node</span> is not an element with
+     the same tag name as that of the token, then this is a
+     <span>parse error</span>.</p></li>
+
+     <li><p>Pop elements from the <span>stack of open elements</span>
+     until an element with the same tag name as the token has been
+     popped from the stack.</p></li>
+
+    </ol>
+
+   </dd>
+
    <!-- as normal, but needs care as the elements have optional tags -->
-   <dt>An end tag whose tag name is one of: "dd", "dt", "li"</dt>
+   <dt>An end tag whose tag name is one of: "dd", "dt"</dt>
    <dd>
 
     <p>If the <span>stack of open elements</span> does not <span




More information about the Commit-Watchers mailing list