NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 116 - 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...
Change the algorithm for </form> to work the same as for </div>. Also some sc...
Status: RESOLVED FIXED
Product: Validator.nu
Classification: Unclassified
Component: HTML parser
HEAD
All All
: P2 normal
Assigned To: Henri Sivonen
http://svn.whatwg.org/webapps/source?...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-03 13:15 CET by Nobody
Modified: 2008-03-07 14:29 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nobody 2008-03-03 13:15:08 CET
Index: source
===================================================================
--- source	(revision 1319)
+++ source	(revision 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>
-
-  <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>
+  <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>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>
-
-    <!-- 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><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>
+
+    <ol>
+
+     <li><p><span>Generate implied end tags</span>.</p></li>
 
-    <p>In any case, set the <span><code title="">form</code>
-    element pointer</span> to null.</p>
+     <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,19 +39426,27 @@
    <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>
 
@@ -39443,25 +39454,28 @@
    "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>
-
-    <!-- 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>
-    -->
+    <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 whose tag name is one of "h1", "h2", "h3", "h4",
+     "h5", or "h6" has been popped from the stack.</p></li>
+
+    </ol>
 
    </dd>
 
@@ -39750,21 +39764,29 @@
    "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>
 
@@ -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
Comment 1 Nobody 2009-08-21 10:20:11 CEST
The original summary for this bug was longer than 255 characters, and so it was truncated when Bugzilla was upgraded. The original summary was:

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.