[html5] r1320 - /

whatwg at whatwg.org whatwg at whatwg.org
Sun Mar 2 22:31:34 PST 2008


Author: ianh
Date: 2008-03-02 22:31:23 -0800 (Sun, 02 Mar 2008)
New Revision: 1320

Modified:
   index
   source
Log:
[act] (2) Change the algorithm for </form> to work the same as for </div>. Also some scary editoral work that theoretically didn't change anything: simplify the 'generate implied end tags' algorith. Reword some of the algorithms so that they don't sound like you have to look through the stack twice.

Modified: index
===================================================================
--- index	2008-03-03 04:43:26 UTC (rev 1319)
+++ index	2008-03-03 06:31:23 UTC (rev 1320)
@@ -40838,20 +40838,14 @@
    implied end tags</h5>
 
   <p>When the steps below require the UA to <dfn id=generate>generate implied
-   end tags</dfn>, then, if the <a href="#current4">current node</a> is a
+   end tags</dfn>, then, while the <a href="#current4">current node</a> is a
    <code><a href="#dd">dd</a></code> element, a <code><a
    href="#dt">dt</a></code> element, an <code><a href="#li">li</a></code>
-   element, a <code><a href="#p">p</a></code> element, a <code><a
-   href="#tbody">tbody</a></code> element, a <code><a
-   href="#td">td</a></code> element, a <code><a
-   href="#tfoot0">tfoot</a></code> element, a <code><a
-   href="#th">th</a></code> element, a <code><a
-   href="#thead0">thead</a></code> element, a <code><a
-   href="#tr">tr</a></code> element, the UA must act as if an end tag with
-   the respective tag name had been seen and then <a
-   href="#generate">generate implied end tags</a> again.
+   element, or a <code><a href="#p">p</a></code> element, the UA must pop the
+   <a href="#current4">current node</a> off the <a href="#stack">stack of
+   open elements</a>.
 
-  <p>The step that requires the UA to generate implied end tags but lists an
+  <p>If a step requires the UA to generate implied end tags but lists an
    element to exclude from the process, then the UA must perform the above
    steps as if that element was not in the above list.
 
@@ -42204,52 +42198,59 @@
     "ul"
 
    <dd>
-    <p>If the <a href="#stack">stack of open elements</a> <a
-     href="#have-an">has an element in scope</a> with the same tag name as
-     that of the token, then <a href="#generate">generate implied end
-     tags</a>.</p>
-
-    <p>Now, if the <a href="#current4">current node</a> is not an element
-     with the same tag name as that of the token, then this is a <a
+    <p>If the <a href="#stack">stack of open elements</a> does not <a
+     href="#have-an" title="has an element in scope">have an element in
+     scope</a> with the same tag name as that of the token, then this is a <a
      href="#parse0">parse error</a>.</p>
 
-    <p>If the <a href="#stack">stack of open elements</a> <a
-     href="#have-an">has an element in scope</a> with the same tag name as
-     that of the token, then pop elements from this stack until an element
-     with that tag name has been popped from the stack.</p>
-    <!-- XXX quirk (except for in certain cases?):
-    <p>Otherwise, act as if a start tag with the tag name given in
-    the token had been seen, then reprocess the current token.</p>
-    -->
-    
+    <p>Otherwise, run these steps:</p>
 
+    <ol>
+     <li>
+      <p><a href="#generate">Generate implied end tags</a>.
+
+     <li>
+      <p>If the <a href="#current4">current node</a> is not an element with
+       the same tag name as that of the token, then this is a <a
+       href="#parse0">parse error</a>.
+
+     <li>
+      <p>Pop elements from the <a href="#stack">stack of open elements</a>
+       until an element with the same tag name as the token has been popped
+       from the stack.
+    </ol>
+
    <dt>An end tag whose tag name is "form"
 
    <dd>
-    <p>If the <a href="#stack">stack of open elements</a> <a
-     href="#have-an">has an element in scope</a> with the same tag name as
-     that of the token, then <a href="#generate">generate implied end
-     tags</a>.</p>
+    <p>Set the <a href="#form-element"><code title="">form</code> element
+     pointer</a> to null.</p>
 
-    <p>Now, if the <a href="#current4">current node</a> is not an element
-     with the same tag name as that of the token, then this is a <a
+    <p>If the <a href="#stack">stack of open elements</a> does not <a
+     href="#have-an" title="has an element in scope">have an element in
+     scope</a> with the same tag name as that of the token, then this is a <a
      href="#parse0">parse error</a>.</p>
 
-    <p>Otherwise, if the <a href="#current4">current node</a> is an element
-     with the same tag name as that of the token pop that element from the
-     stack.</p>
+    <p>Otherwise, run these steps:</p>
 
-    <p>In any case, set the <a href="#form-element"><code
-     title="">form</code> element pointer</a> to null.</p>
+    <ol>
+     <li>
+      <p><a href="#generate">Generate implied end tags</a>.
 
+     <li>
+      <p>If the <a href="#current4">current node</a> is not an element with
+       the same tag name as that of the token, then this is a <a
+       href="#parse0">parse error</a>.
+
+     <li>
+      <p>Pop elements from the <a href="#stack">stack of open elements</a>
+       until an element with the same tag name as the token has been popped
+       from the stack.
+    </ol>
+
    <dt>An end tag whose tag name is "p"
 
    <dd>
-    <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
-     title="has an element in scope">has a <code>p</code> element in
-     scope</a>, then <a href="#generate">generate implied end tags</a>,
-     except for <code><a href="#p">p</a></code> elements.</p>
-
     <p>If the <a href="#current4">current node</a> is not a <code><a
      href="#p">p</a></code> element, then this is a <a href="#parse0">parse
      error</a>.</p>
@@ -42266,43 +42267,58 @@
    <dt>An end tag whose tag name is one of: "dd", "dt", "li"
 
    <dd>
-    <p>If the <a href="#stack">stack of open elements</a> <a
-     href="#have-an">has an element in scope</a> whose tag name matches the
-     tag name of the token, then <a href="#generate">generate implied end
-     tags</a>, except for elements with the same tag name as the token.</p>
+    <p>If the <a href="#stack">stack of open elements</a> does not <a
+     href="#have-an" title="has an element in scope">have an element in
+     scope</a> with the same tag name as that of the token, then this is a <a
+     href="#parse0">parse error</a>.</p>
 
-    <p>If the <a href="#current4">current node</a> is not an element with the
-     same tag name as the token, then this is a <a href="#parse0">parse
-     error</a>.</p>
+    <p>Otherwise, run these steps:</p>
 
-    <p>If the <a href="#stack">stack of open elements</a> <a
-     href="#have-an">has an element in scope</a> whose tag name matches the
-     tag name of the token, then pop elements from this stack until an
-     element with that tag name has been popped from the stack.</p>
+    <ol>
+     <li>
+      <p><a href="#generate">Generate implied end tags</a>, except for
+       elements with the same tag name as the token.
 
+     <li>
+      <p>If the <a href="#current4">current node</a> is not an element with
+       the same tag name as that of the token, then this is a <a
+       href="#parse0">parse error</a>.
+
+     <li>
+      <p>Pop elements from the <a href="#stack">stack of open elements</a>
+       until an element with the same tag name as the token has been popped
+       from the stack.
+    </ol>
+
    <dt>An end tag whose tag name is one of: "h1", "h2", "h3", "h4", "h5",
     "h6"
 
    <dd>
-    <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
-     title="has an element in scope">has in scope</a> an element whose tag
-     name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then <a
-     href="#generate">generate implied end tags</a>.</p>
+    <p>If the <a href="#stack">stack of open elements</a> does not <a
+     href="#have-an" title="has an element in scope">have an element in
+     scope</a> whose tag name is one of "h1", "h2", "h3", "h4", "h5", or
+     "h6", then this is a <a href="#parse0">parse error</a>.
+     <!-- XXX quirk: Act as if
+    a start tag with the tag name given in the token had been seen,
+    then reprocess the current token. --></p>
 
-    <p>Now, if the <a href="#current4">current node</a> is not an element
-     with the same tag name as that of the token, then this is a <a
-     href="#parse0">parse error</a>.</p>
+    <p>Otherwise, run these steps:</p>
 
-    <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
-     title="has an element in scope">has in scope</a> an element whose tag
-     name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then pop elements
-     from the stack until an element with one of those tag names has been
-     popped from the stack.</p>
-    <!-- XXX quirk:
-    <p>Otherwise, act as if a start tag with the tag name given in
-    the token had been seen, then reprocess the current token.</p>
-    -->
-    </dd>
+    <ol>
+     <li>
+      <p><a href="#generate">Generate implied end tags</a>.
+
+     <li>
+      <p>If the <a href="#current4">current node</a> is not an element with
+       the same tag name as that of the token, then this is a <a
+       href="#parse0">parse error</a>.
+
+     <li>
+      <p>Pop elements from the <a href="#stack">stack of open elements</a>
+       until an element whose tag name is one of "h1", "h2", "h3", "h4",
+       "h5", or "h6" has been popped from the stack.
+    </ol>
+   </dd>
    <!-- ADOPTION AGENCY ELEMENTS
         Mozilla-only: bdo blink del ins sub sup q
         Safari-only: code dfn kbd nobr samp var wbr
@@ -42563,21 +42579,31 @@
     "object"
 
    <dd>
-    <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
-     title="has an element in scope">has in scope</a> an element whose tag
-     name is the same as the tag name of the token, then <a
-     href="#generate">generate implied end tags</a>.</p>
-
-    <p>Now, if the <a href="#current4">current node</a> is not an element
-     with the same tag name as the token, then this is a <a
+    <p>If the <a href="#stack">stack of open elements</a> does not <a
+     href="#have-an" title="has an element in scope">have an element in
+     scope</a> with the same tag name as that of the token, then this is a <a
      href="#parse0">parse error</a>.</p>
 
-    <p>Now, if the <a href="#stack">stack of open elements</a> <a
-     href="#have-an">has an element in scope</a> whose tag name matches the
-     tag name of the token, then pop elements from the stack until that
-     element has been popped from the stack, and <a href="#clear0">clear the
-     list of active formatting elements up to the last marker</a>.</p>
+    <p>Otherwise, run these steps:</p>
 
+    <ol>
+     <li>
+      <p><a href="#generate">Generate implied end tags</a>.
+
+     <li>
+      <p>If the <a href="#current4">current node</a> is not an element with
+       the same tag name as that of the token, then this is a <a
+       href="#parse0">parse error</a>.
+
+     <li>
+      <p>Pop elements from the <a href="#stack">stack of open elements</a>
+       until an element with the same tag name as the token has been popped
+       from the stack.
+
+     <li><a href="#clear0">Clear the list of active formatting elements up to
+      the last marker</a>.
+    </ol>
+
    <dt>A start tag whose tag name is "xmp"
 
    <dd>
@@ -43382,8 +43408,7 @@
 
     <p>Otherwise:</p>
 
-    <p><a href="#generate">Generate implied end tags</a>, except for elements
-     with the same tag name as the token.</p>
+    <p><a href="#generate">Generate implied end tags</a>.</p>
 
     <p>Now, if the <a href="#current4">current node</a> is not an element
      with the same tag name as the token, then this is a <a

Modified: source
===================================================================
--- source	2008-03-03 04:43:26 UTC (rev 1319)
+++ source	2008-03-03 06:31:23 UTC (rev 1320)
@@ -38094,19 +38094,15 @@
   <h5>Closing elements that have implied end tags</h5>
 
   <p>When the steps below require the UA to <dfn>generate implied end
-  tags</dfn>, then, if the <span>current node</span> is a
+  tags</dfn>, then, while the <span>current node</span> is a
   <code>dd</code> element, a <code>dt</code> element, an
-  <code>li</code> element, a <code>p</code> element, a
-  <code>tbody</code> element, a <code>td</code> element, a
-  <code>tfoot</code> element, a <code>th</code> element, a
-  <code>thead</code> element, a <code>tr</code> element, the UA must
-  act as if an end tag with the respective tag name had been seen and
-  then <span>generate implied end tags</span> again.</p>
+  <code>li</code> element, or a <code>p</code> element, the UA must
+  pop the <span>current node</span> off the <span>stack of open
+  elements</span>.</p>
 
-  <p>The step that requires the UA to generate implied end tags but
-  lists an element to exclude from the process, then the UA must
-  perform the above steps as if that element was not in the above
-  list.</p>
+  <p>If a step requires the UA to generate implied end tags but lists
+  an element to exclude from the process, then the UA must perform the
+  above steps as if that element was not in the above list.</p>
 
 
   <h5>The element pointers</h5>
@@ -39357,54 +39353,61 @@
    "listing", "menu", "ol", "pre", "ul"</dt>
    <dd>
 
-    <p>If the <span>stack of open elements</span> <span>has an
-    element in scope</span> with the same tag name as that of the
-    token, then <span>generate implied end tags</span>.</p>
-
-    <p>Now, if the <span>current node</span> is not an element
+    <p>If the <span>stack of open elements</span> does not <span
+    title="has an element in scope">have an element in scope</span>
     with the same tag name as that of the token, then this is a
     <span>parse error</span>.</p>
 
-    <p>If the <span>stack of open elements</span> <span>has an
-    element in scope</span> with the same tag name as that of the
-    token, then pop elements from this stack until an element with
-    that tag name has been popped from the stack.</p>
+    <p>Otherwise, run these steps:</p>
 
-    <!-- XXX quirk (except for in certain cases?):
-    <p>Otherwise, act as if a start tag with the tag name given in
-    the token had been seen, then reprocess the current token.</p>
-    -->
+    <ol>
 
+     <li><p><span>Generate implied end tags</span>.</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>
 
    <dt>An end tag whose tag name is "form"</dt>
    <dd>
 
-    <p>If the <span>stack of open elements</span> <span>has an
-    element in scope</span> with the same tag name as that of the
-    token, then <span>generate implied end tags</span>.</p>
+    <p>Set the <span><code title="">form</code> element pointer</span>
+    to null.</p>
 
-    <p>Now, if the <span>current node</span> is not an element
+    <p>If the <span>stack of open elements</span> does not <span
+    title="has an element in scope">have an element in scope</span>
     with the same tag name as that of the token, then this is a
     <span>parse error</span>.</p>
 
-    <p>Otherwise, if the <span>current node</span> is an element
-    with the same tag name as that of the token pop that element
-    from the stack.</p>
+    <p>Otherwise, run these steps:</p>
 
-    <p>In any case, set the <span><code title="">form</code>
-    element pointer</span> to null.</p>
+    <ol>
 
+     <li><p><span>Generate implied end tags</span>.</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>
 
    <dt>An end tag whose tag name is "p"</dt>
    <dd>
 
-    <p>If the <span>stack of open elements</span> <span title="has
-    an element in scope">has a <code>p</code> element in
-    scope</span>, then <span>generate implied end tags</span>,
-    except for <code>p</code> elements.</p>
-
     <p>If the <span>current node</span> is not a <code>p</code>
     element, then this is a <span>parse error</span>.</p>
 
@@ -39423,46 +39426,57 @@
    <dt>An end tag whose tag name is one of: "dd", "dt", "li"</dt>
    <dd>
 
-    <p>If the <span>stack of open elements</span> <span>has an
-    element in scope</span> whose tag name matches the tag name of
-    the token, then <span>generate implied end tags</span>, except
-    for elements with the same tag name as the token.</p>
+    <p>If the <span>stack of open elements</span> does not <span
+    title="has an element in scope">have an element in scope</span>
+    with the same tag name as that of the token, then this is a
+    <span>parse error</span>.</p>
 
-    <p>If the <span>current node</span> is not an element with the
-    same tag name as the token, then this is a <span>parse
-    error</span>.</p>
+    <p>Otherwise, run these steps:</p>
 
-    <p>If the <span>stack of open elements</span> <span>has an
-    element in scope</span> whose tag name matches the tag name of
-    the token, then pop elements from this stack until an element
-    with that tag name has been popped from the stack.</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>
 
    <dt>An end tag whose tag name is one of: "h1", "h2", "h3",
    "h4", "h5", "h6"</dt>
    <dd>
 
-    <p>If the <span>stack of open elements</span> <span title="has
-    an element in scope">has in scope</span> an element whose tag
-    name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then
-    <span>generate implied end tags</span>.</p>
+    <p>If the <span>stack of open elements</span> does not <span
+    title="has an element in scope">have an element in scope</span>
+    whose tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6",
+    then this is a <span>parse error</span>. <!-- XXX quirk: Act as if
+    a start tag with the tag name given in the token had been seen,
+    then reprocess the current token. --></p>
 
-    <p>Now, 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>
+    <p>Otherwise, run these steps:</p>
 
-    <p>If the <span>stack of open elements</span> <span title="has
-    an element in scope">has in scope</span> an element whose tag
-    name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then pop
-    elements from the stack until an element with one of those tag
-    names has been popped from the stack.</p>
+    <ol>
 
-    <!-- XXX quirk:
-    <p>Otherwise, act as if a start tag with the tag name given in
-    the token had been seen, then reprocess the current token.</p>
-    -->
+     <li><p><span>Generate implied end tags</span>.</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 whose tag name is one of "h1", "h2", "h3", "h4",
+     "h5", or "h6" has been popped from the stack.</p></li>
+
+    </ol>
+
    </dd>
 
    <!-- ADOPTION AGENCY ELEMENTS
@@ -39750,22 +39764,30 @@
    "marquee", "object"</dt>
    <dd>
 
-    <p>If the <span>stack of open elements</span> <span title="has
-    an element in scope">has in scope</span> an element whose tag
-    name is the same as the tag name of the token, then
-    <span>generate implied end tags</span>.</p>
-
-    <p>Now, if the <span>current node</span> is not an element
-    with the same tag name as the token, then this is a
+    <p>If the <span>stack of open elements</span> does not <span
+    title="has an element in scope">have an element in scope</span>
+    with the same tag name as that of the token, then this is a
     <span>parse error</span>.</p>
 
-    <p>Now, if the <span>stack of open elements</span> <span>has
-    an element in scope</span> whose tag name matches the tag name
-    of the token, then pop elements from the stack until that
-    element has been popped from the stack, and <span>clear the
-    list of active formatting elements up to the last
-    marker</span>.</p>
+    <p>Otherwise, run these steps:</p>
 
+    <ol>
+
+     <li><p><span>Generate implied end tags</span>.</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>
+
+     <li><span>Clear the list of active formatting elements up to the
+     last marker</span>.</li>
+
+    </ol>
+
    </dd>
 
    <dt>A start tag whose tag name is "xmp"</dt>
@@ -40066,9 +40088,9 @@
        the tag name of the <span>current node</span>, this is a
        <span>parse error</span>.</p></li>
 
-       <li><p>Pop all the nodes from the <span>current node</span>
-       up to <var title="">node</var>, including <var title="">node</var>, then stop
-       this algorithm.</p></li>
+       <li><p>Pop all the nodes from the <span>current node</span> up
+       to <var title="">node</var>, including <var
+       title="">node</var>, then stop this algorithm.</p></li>
 
       </ol>
 
@@ -40639,8 +40661,7 @@
 
     <p>Otherwise:</p>
 
-    <p><span>Generate implied end tags</span>, except for elements
-    with the same tag name as the token.</p>
+    <p><span>Generate implied end tags</span>.</p>
 
     <p>Now, if the <span>current node</span> is not an element
     with the same tag name as the token, then this is a




More information about the Commit-Watchers mailing list