[html5] r1731 - /

whatwg at whatwg.org whatwg at whatwg.org
Fri Jun 6 17:27:54 PDT 2008


Author: ianh
Date: 2008-06-06 17:27:53 -0700 (Fri, 06 Jun 2008)
New Revision: 1731

Modified:
   index
   source
Log:
[cgiowt] (2) add support for the new html elements. fix the handling of optional tags we added recently. also: clarify some notes, remove redundant requirements, clean up some punctuation.

Modified: index
===================================================================
--- index	2008-06-06 19:03:41 UTC (rev 1730)
+++ index	2008-06-07 00:27:53 UTC (rev 1731)
@@ -25,7 +25,7 @@
 
    <h1 id=html-5>HTML 5</h1>
 
-   <h2 class="no-num no-toc" id=draft>Draft Recommendation — 6 June
+   <h2 class="no-num no-toc" id=draft>Draft Recommendation — 7 June
     2008</h2>
 
    <p>You can take part in this work. <a
@@ -5097,7 +5097,7 @@
  Test: http://www.hixie.ch/tests/adhoc/html/flow/image-maps/004-demo.html
  IE6 on Wine treats the following characters like this also: U+1-U+1f,
  U+21-U+2b, U+2d-U+2f, U+3a, U+3c-U+40, U+5b-U+60, U+7b-U+82,
- U+84-U+89, U+8b, U+8d, U+8f-U`+99, U+9b, U+9d, U+a0-U+bf, U+d7, U+f7,
+ U+84-U+89, U+8b, U+8d, U+8f-U+99, U+9b, U+9d, U+a0-U+bf, U+d7, U+f7,
  U+1f6-U+1f9, U+218-U+24f, U+2a9-U+385, U+387, U+38b, U+38d, U+3a2,
  U+3cf, U+3d7-U+3d9, U+3db, U+3dd, U+3df, U+3e1, U+3f4-U+400, U+40d,
  U+450, U+45d, U+482-U+48f, U+4c5-U+4c6, U+4c9-U+4ca, U+4cd-U+4cf,
@@ -8847,20 +8847,6 @@
    element (if any), and that element's child nodes. Otherwise, the specified
    styles must, if applied, be applied to the entire document.
 
-  <p>If the <code title=attr-style-scoped><a href="#scoped">scoped</a></code>
-   attribute is not specified, the <code><a href="#style1">style</a></code>
-   element must be the child of a <code><a href="#head">head</a></code>
-   element or of a <code><a href="#noscript">noscript</a></code> element that
-   is a child of a <code><a href="#head">head</a></code> element.
-
-  <p>If the <code title=attr-style-scoped><a href="#scoped">scoped</a></code>
-   attribute <em>is</em> specified, then the <code><a
-   href="#style1">style</a></code> element must be the child of a <a
-   href="#flow-content0">flow content</a> element, before any text nodes
-   other than <a href="#inter-element">inter-element whitespace</a>, and
-   before any elements other than other <code><a
-   href="#style1">style</a></code> elements.
-
   <p id=title-on-style>The <dfn id=title3
    title=attr-style-title><code>title</code></dfn> attribute on <code><a
    href="#style1">style</a></code> elements defines <a
@@ -41797,13 +41783,11 @@
    title=syntax-comments>comment</a>, except if the first thing inside the
    <code><a href="#body0">body</a></code> element is a <code><a
    href="#script1">script</a></code> or <code><a
-   href="#style1">style</a></code>
-   element<!-- and the node immediately preceding
-  the <code>body</code> element is a <code>head</code> element whose
-  end tag has been omitted (XXX this last bit is commented out for now
-  because we have the dubious rule in the parser that makes <style>
-  and <script> elements between </head> and <body> end up in the
-  <head> instead of the <body>)-->.</p>
+   href="#style1">style</a></code> element.
+   <!-- Note that even if the </head> end
+  tag is present, the parser makes <style> and <script> elements
+  between </head> and <body> end up in the <head> instead of implying
+  the <body> --></p>
   <!-- </body> -->
 
   <p>A <code><a href="#body0">body</a></code> element's <span
@@ -43143,9 +43127,9 @@
      href="#h3">h3</a></code>, <code><a href="#h4">h4</a></code>, <code><a
      href="#h5">h5</a></code>, <code><a href="#h6">h6</a></code>, <code><a
      href="#head">head</a></code>, <code><a href="#hr">hr</a></code>,
-     <code><a href="#iframe">iframe</a></code>,
-     <code>image</code><!-- XXX ? this isn't an element that can end up
-   on the stack-->,
+     <code><a href="#iframe">iframe</a></code>, <!--
+   <code>image</code>, (commented out because this isn't an element
+   that can end up on the stack, so it doesn't matter) -->
      <code><a href="#img">img</a></code>, <code>input</code>,
      <code>isindex</code>, <code><a href="#li">li</a></code>, <code><a
      href="#link">link</a></code>, <code>listing</code>, <code><a
@@ -45578,7 +45562,8 @@
    end tags</dfn>, then, while the <a href="#current5">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, an <code><a
+   element, an <code>option</code> element, an <code>optgroup</code> element,
+   a <code><a href="#p">p</a></code> element, an <code><a
    href="#rp">rp</a></code> element, or an <code><a href="#rt">rt</a></code>
    element, the UA must pop the <a href="#current5">current node</a> off the
    <a href="#stack">stack of open elements</a>.
@@ -46118,7 +46103,8 @@
      href="#in-body" title="insertion mode: in body">in body</a>"
      <span>insertion mode</span>.</p>
 
-   <dt>A start tag whose tag name is one of: "base", "link"
+   <dt>A start tag whose tag name is one of: "base", "command",
+    "event-source", "link"
 
    <dd>
     <p><a href="#insert0">Insert an HTML element</a> for the token.
@@ -46164,7 +46150,7 @@
     <p>Follow the <a href="#generic0">generic RCDATA parsing algorithm</a>.</p>
 
    <dt>A start tag whose tag name is "noscript", if the <a
-    href="#scripting2">scripting flag</a> is enabled:
+    href="#scripting2">scripting flag</a> is enabled
 
    <dt>A start tag whose tag name is one of: "noframes", "style"
 
@@ -46172,7 +46158,7 @@
     <p>Follow the <a href="#generic">generic CDATA parsing algorithm</a>.</p>
 
    <dt>A start tag whose tag name is "noscript", if the <a
-    href="#scripting2">scripting flag</a> is disabled:
+    href="#scripting2">scripting flag</a> is disabled
 
    <dd>
     <p><a href="#insert0">Insert an HTML element</a> for the token.</p>
@@ -46521,8 +46507,8 @@
      the <a href="#stack">stack of open elements</a>. If it is not, add the
      attribute and its corresponding value to that element.</p>
 
-   <dt>A start tag token whose tag name is one of: "base", "link", "meta",
-    "noframes", "script", "style", "title"
+   <dt>A start tag token whose tag name is one of: "base", "command",
+    "event-source", "link", "meta", "noframes", "script", "style", "title"
 
    <dd>
     <p>Process the token <a href="#using8">using the rules for</a> the "<a
@@ -46600,10 +46586,14 @@
 
     <p class=note>The fake end tag token here can only be ignored in the <a
      href="#fragment">fragment case</a>.</p>
+   </dd>
+   <!-- start tags for non-phrasing flow content elements -->
+   <!-- the normal ones -->
 
-   <dt>A start tag whose tag name is one of: "address", "blockquote",
-    "center", "dir", "div", "dl", "fieldset", "h1", "h2", "h3", "h4", "h5",
-    "h6", "menu", "ol", "p", "ul"
+   <dt>A start tag whose tag name is one of: "address", "article", "aside",
+    "blockquote", "center", "datagrid", "dialog", "dir", "div", "dl",
+    "fieldset", "footer", "h1", "h2", "h3", "h4", "h5", "h6", "header",
+    "menu", "nav", "ol", "p", "section", "ul"
 
    <dd> <!-- As of May 2008 this doesn't match any browser exactly, but is
     as close to what IE does as I can get without doing the non-tree
@@ -46628,6 +46618,8 @@
     -->
     
     <p><a href="#insert0">Insert an HTML element</a> for the token.</p>
+   </dd>
+   <!-- as normal, but drops leading newline -->
 
    <dt>A start tag whose tag name is one of: "pre", "listing"
 
@@ -46643,6 +46635,8 @@
      ignore that token and move on to the next one. (Newlines at the start of
      <code><a href="#pre">pre</a></code> blocks are ignored as an authoring
      convenience.)</p>
+   </dd>
+   <!-- as normal, but interacts with the form element pointer -->
 
    <dt>A start tag whose tag name is "form"
 
@@ -46661,15 +46655,12 @@
     <p><a href="#insert0">Insert an HTML element</a> for the token, and set
      the <code title=form>form</code> element pointer to point to the element
      created.</p>
+   </dd>
+   <!-- as normal, but imply </li> when there's another <li> open in weird cases -->
 
    <dt>A start tag whose tag name is "li"
 
    <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 act as if an end tag with the tag name <code><a
-     href="#p">p</a></code> had been seen.</p>
-
     <p>Run the following algorithm:</p>
 
     <ol>
@@ -46679,42 +46670,44 @@
 
      <li>
       <p>If <var title="">node</var> is an <code><a href="#li">li</a></code>
-       element, then pop all the nodes from the <a href="#current5">current
-       node</a> up to <var title="">node</var>, including <var
-       title="">node</var>, then stop this algorithm. If more than one node
-       is popped, then this is a <a href="#parse1">parse error</a>.
+       element, then act as if an end tag with the tag name <code><a
+       href="#li">li</a></code> had been seen, then jump to the last step.
 
      <li>
       <p>If <var title="">node</var> is not in the <a
        href="#formatting">formatting</a> category, and is not in the <a
        href="#phrasing1">phrasing</a> category, and is not an <code><a
        href="#address">address</a></code> or <code><a
-       href="#div">div</a></code> element, then stop this algorithm.
+       href="#div">div</a></code> element, then jump to the last step.
      </li>
-     <!-- an element <foo> is in this
-     list if the following markup:
+     <!-- an element <foo> is in this list if
+     the following markup:
 
          <!DOCTYPE html><body><ol><li><foo><li>
 
-     ...results in the second <li> not being (in any way) a
-     descendant of the first <li>, or if <foo> is a formatting
-     element that gets reopened later. -->
+     ...results in the second <li> not being (in any way) a descendant
+     of the first <li>, or if <foo> is a formatting element that gets
+     reopened later. -->
 
      <li>
       <p>Otherwise, set <var title="">node</var> to the previous entry in the
        <a href="#stack">stack of open elements</a> and return to step 2.
+
+     <li>
+      <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 act as if an end tag with the tag name
+       <code><a href="#p">p</a></code> had been seen.</p>
+
+      <p>Finally, <a href="#insert0">insert an HTML element</a> for the
+       token.</p>
     </ol>
+   </dd>
+   <!-- as normal, but imply </dt> or </dd> when there's another <dt> or <dd> open in weird cases  -->
 
-    <p>Finally, <a href="#insert0">insert an HTML element</a> for the token.</p>
-
    <dt>A start tag whose tag name is one of: "dd", "dt"
 
    <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 act as if an end tag with the tag name <code><a
-     href="#p">p</a></code> had been seen.</p>
-
     <p>Run the following algorithm:</p>
 
     <ol>
@@ -46724,35 +46717,42 @@
 
      <li>
       <p>If <var title="">node</var> is a <code><a href="#dd">dd</a></code>
-       or <code><a href="#dt">dt</a></code> element, then pop all the nodes
-       from the <a href="#current5">current node</a> up to <var
-       title="">node</var>, including <var title="">node</var>, then stop
-       this algorithm. If more than one node is popped, then this is a <a
-       href="#parse1">parse error</a>.
+       or <code><a href="#dt">dt</a></code> element, then act as if an end
+       tag with the same tag name as <var title="">node</var> had been seen,
+       then jump to the last step.
 
      <li>
       <p>If <var title="">node</var> is not in the <a
        href="#formatting">formatting</a> category, and is not in the <a
        href="#phrasing1">phrasing</a> category, and is not an <code><a
        href="#address">address</a></code> or <code><a
-       href="#div">div</a></code> element, then stop this algorithm.
+       href="#div">div</a></code> element, then jump to the last step.
      </li>
-     <!-- an element <foo> is in this
-     list if the following markup:
+     <!-- an element <foo> is in this list if
+     the following markup:
 
-         <!DOCTYPE html><body><ol><dt><foo><dt>
+         <!DOCTYPE html><body><dl><dt><foo><dt>
 
-     ...results in the second <li> not being (in any way) a
-     descendant of the first <li>, or if <foo> is a formatting
-     element that gets reopened later. -->
+     ...results in the second <dt> not being (in any way) a descendant
+     of the first <dt>, or if <foo> is a formatting element that gets
+     reopened later. -->
 
      <li>
       <p>Otherwise, set <var title="">node</var> to the previous entry in the
        <a href="#stack">stack of open elements</a> and return to step 2.
+
+     <li>
+      <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 act as if an end tag with the tag name
+       <code><a href="#p">p</a></code> had been seen.</p>
+
+      <p>Finally, <a href="#insert0">insert an HTML element</a> for the
+       token.</p>
     </ol>
+   </dd>
+   <!-- same as normal, but effectively ends parsing -->
 
-    <p>Finally, <a href="#insert0">insert an HTML element</a> for the token.</p>
-
    <dt>A start tag whose tag name is "plaintext"
 
    <dd>
@@ -46770,10 +46770,14 @@
      seen, that will be the last token ever seen other than character tokens
      (and the end-of-file token), because there is no way to switch the <a
      href="#content2">content model flag</a> out of the PLAINTEXT state.</p>
+   </dd>
+   <!-- end tags for non-phrasing flow content elements -->
+   <!-- the normal ones -->
 
-   <dt>An end tag whose tag name is one of: "address", "blockquote",
-    "center", "dir", "div", "dl", "fieldset", "listing", "menu", "ol", "pre",
-    "ul"
+   <dt>An end tag whose tag name is one of: "address", "article", "aside",
+    "blockquote", "center", "datagrid", "dialog", "dir", "div", "dl",
+    "fieldset", "footer", "header", "listing", "menu", "nav", "ol", "pre",
+    "section", "ul"
 
    <dd>
     <p>If the <a href="#stack">stack of open elements</a> does not <a
@@ -46797,6 +46801,8 @@
        until an element with the same tag name as the token has been popped
        from the stack.
     </ol>
+   </dd>
+   <!-- as normal, but interacts with the form element pointer -->
 
    <dt>An end tag whose tag name is "form"
 
@@ -46825,23 +46831,39 @@
        until an element with the same tag name as the token has been popped
        from the stack.
     </ol>
+   </dd>
+   <!-- as normal, except </p> implies <p> if there's no <p> in scope, and needs care as the elements have optional tags -->
 
    <dt>An end tag whose tag name is "p"
 
    <dd>
-    <p>If the <a href="#current5">current node</a> is not a <code><a
-     href="#p">p</a></code> element, then this is a <a href="#parse1">parse
-     error</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> with the same tag name as that of the token, then this is a <a
+     href="#parse1">parse error</a>; act as if a start tag with the tag name
+     <code><a href="#p">p</a></code> had been seen, then reprocess the
+     current token.</p>
 
-    <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 pop elements from this stack until the stack no longer
-     <a href="#have-an" title="has an element in scope">has a <code>p</code>
-     element in scope</a>.</p>
+    <p>Otherwise, run these steps:</p>
 
-    <p>Otherwise, act as if a start tag with the tag name <code><a
-     href="#p">p</a></code> had been seen, then reprocess the current token.</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="#current5">current node</a> is not an element with
+       the same tag name as that of the token, then this is a <a
+       href="#parse1">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>
+   </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"
 
    <dd>
@@ -46867,6 +46889,8 @@
        until an element with the same tag name as the token has been popped
        from the stack.
     </ol>
+   </dd>
+   <!-- as normal, except acts as a closer for any of the h1-h6 elements -->
 
    <dt>An end tag whose tag name is one of: "h1", "h2", "h3", "h4", "h5",
     "h6"
@@ -46896,6 +46920,12 @@
        until an element whose tag name is one of "h1", "h2", "h3", "h4",
        "h5", or "h6" has been popped from the stack.
     </ol>
+
+   <dt>An end tag whose tag name is "sarcasm"
+
+   <dd>
+    <p>Take a deep breath, then act as described in the "any other end tag"
+     entry below.</p>
    </dd>
    <!-- ADOPTION AGENCY ELEMENTS
         Mozilla-only: bdo blink del ins sub sup q
@@ -47212,7 +47242,7 @@
      title="insertion mode: in table">in table</a>".</p>
 
    <dt>A start tag whose tag name is one of: "area", "basefont", "bgsound",
-    "br", "embed", "img", "param", "spacer", "wbr"
+    "br", "embed", "img", "spacer", "wbr"
 
    <dd>
     <p><a href="#reconstruct">Reconstruct the active formatting elements</a>,
@@ -47226,6 +47256,17 @@
      flag">Acknowledge the token's <i>self-closing flag</i></a>, if it is
      set.</p>
 
+   <dt>A start tag whose tag name is one of: "param", "source"
+
+   <dd>
+    <p><a href="#insert0">Insert an HTML element</a> for the token.
+     Immediately pop the <a href="#current5">current node</a> off the <a
+     href="#stack">stack of open elements</a>.</p>
+
+    <p><a href="#acknowledged" title="acknowledge self-closing
+     flag">Acknowledge the token's <i>self-closing flag</i></a>, if it is
+     set.</p>
+
    <dt>A start tag whose tag name is "hr"
 
    <dd>
@@ -47380,7 +47421,7 @@
    <dt>A start tag whose tag name is one of: "iframe", "noembed"
 
    <dt>A start tag whose tag name is "noscript", if the <a
-    href="#scripting2">scripting flag</a> is enabled:
+    href="#scripting2">scripting flag</a> is enabled
 
    <dd>
     <p>Follow the <a href="#generic">generic CDATA parsing algorithm</a>.</p>
@@ -47501,31 +47542,30 @@
    </dd>
 -->
 
-   <dt>A start or end tag whose tag name is one of: "caption", "col",
-    "colgroup", "frame", "frameset", "head", "option", "optgroup", "tbody",
-    "td", "tfoot", "th", "thead", "tr"
+   <dt>A start <!--or end--> tag whose tag name is one of: "caption", "col",
+    "colgroup", "frame", "frameset", "head", "tbody", "td", "tfoot", "th",
+    "thead", "tr"</dt>
+   <!--<dt>An end tag whose tag name is one of: "area", "base",
+   "basefont", "bgsound", "command", "embed", "event-source", "hr",
+   "iframe", "image", "img", "input", "isindex", "link", "meta",
+   "noembed", "noframes", "param", "script", "select", "source",
+   "spacer", "style", "table", "textarea", "title", "wbr"</dt>-->
+   <!--
+   add keygen if we add the start tag -->
+   <!--<dt>An end tag whose tag name is "noscript", if the
+   <span>scripting flag</span> is enabled</dt>-->
 
-   <dt>An end tag whose tag name is one of: "area", "basefont", "bgsound",
-    "embed", "hr", "iframe", "image", "img", "input", "isindex", "noembed",
-    "noframes", "param", "select", "spacer", "table", "textarea", "wbr"</dt>
-   <!-- add keygen if we add the start
-   tag -->
-
-   <dt>An end tag whose tag name is "noscript", if the <a
-    href="#scripting2">scripting flag</a> is enabled:
-
    <dd>
     <p><a href="#parse1">Parse error</a>. Ignore the token.</p>
+    <!-- end tags are commented out because since they can never end
+    up on the stack anyway, the default end tag clause will
+    automatically handle them. we don't want to have text in the spec
+    that is just an optimisation, as that detracts from the spec
+    itself -->
+    
 
-   <dt>A start or end tag whose tag name is one of: "event-source",
-    "section", "nav", "article", "aside", "header", "footer", "datagrid",
-    "command"
+   <dt>Any other start tag
 
-   <dd> <!-- XXXX -->
-    <p class=big-issue>Work in progress!</p>
-
-   <dt>A start tag token not covered by the previous entries
-
    <dd>
     <p><a href="#reconstruct">Reconstruct the active formatting elements</a>,
      if any.</p>
@@ -47535,7 +47575,7 @@
     <p class=note>This element will be a <a href="#phrasing1">phrasing</a>
      element.</p>
 
-   <dt>An end tag token not covered by the previous entries
+   <dt>Any other end tag
 
    <dd>
     <p>Run the following algorithm:</p>

Modified: source
===================================================================
--- source	2008-06-06 19:03:41 UTC (rev 1730)
+++ source	2008-06-07 00:27:53 UTC (rev 1731)
@@ -3553,7 +3553,7 @@
  Test: http://www.hixie.ch/tests/adhoc/html/flow/image-maps/004-demo.html
  IE6 on Wine treats the following characters like this also: U+1-U+1f,
  U+21-U+2b, U+2d-U+2f, U+3a, U+3c-U+40, U+5b-U+60, U+7b-U+82,
- U+84-U+89, U+8b, U+8d, U+8f-U`+99, U+9b, U+9d, U+a0-U+bf, U+d7, U+f7,
+ U+84-U+89, U+8b, U+8d, U+8f-U+99, U+9b, U+9d, U+a0-U+bf, U+d7, U+f7,
  U+1f6-U+1f9, U+218-U+24f, U+2a9-U+385, U+387, U+38b, U+38d, U+3a2,
  U+3cf, U+3d7-U+3d9, U+3db, U+3dd, U+3df, U+3e1, U+3f4-U+400, U+40d,
  U+450, U+45d, U+482-U+48f, U+4c5-U+4c6, U+4c9-U+4ca, U+4cd-U+4cf,
@@ -7204,17 +7204,6 @@
   (if any), and that element's child nodes. Otherwise, the specified
   styles must, if applied, be applied to the entire document.</p>
 
-  <p>If the <code title="attr-style-scoped">scoped</code> attribute is
-  not specified, the <code>style</code> element must be the child of a
-  <code>head</code> element or of a <code>noscript</code> element that
-  is a child of a <code>head</code> element.</p>
-
-  <p>If the <code title="attr-style-scoped">scoped</code> attribute
-  <em>is</em> specified, then the <code>style</code> element must be
-  the child of a <span>flow content</span> element, before any text
-  nodes other than <span>inter-element whitespace</span>, and before
-  any elements other than other <code>style</code> elements.</p>
-
   <p id="title-on-style">The <dfn
   title="attr-style-title"><code>title</code></dfn> attribute on
   <code>style</code> elements defines <span>alternative style sheet
@@ -39414,12 +39403,10 @@
   <span>space character</span> or a <span
   title="syntax-comments">comment</span>, except if the first thing
   inside the <code>body</code> element is a <code>script</code> or
-  <code>style</code> element<!-- and the node immediately preceding
-  the <code>body</code> element is a <code>head</code> element whose
-  end tag has been omitted (XXX this last bit is commented out for now
-  because we have the dubious rule in the parser that makes <style>
-  and <script> elements between </head> and <body> end up in the
-  <head> instead of the <body>)-->.</p>
+  <code>style</code> element. <!-- Note that even if the </head> end
+  tag is present, the parser makes <style> and <script> elements
+  between </head> and <body> end up in the <head> instead of implying
+  the <body> --></p>
 
   <!-- </body> -->
   <p>A <code>body</code> element's <span title="syntax-end-tag">end
@@ -40723,19 +40710,19 @@
    <code>fieldset</code>, <code>form</code>, <code>frame</code>,
    <code>frameset</code>, <code>h1</code>, <code>h2</code>,
    <code>h3</code>, <code>h4</code>, <code>h5</code>, <code>h6</code>,
-   <code>head</code>, <code>hr</code>, <code>iframe</code>,
-   <code>image</code><!-- XXX ? this isn't an element that can end up
-   on the stack-->, <code>img</code>, <code>input</code>,
-   <code>isindex</code>, <code>li</code>, <code>link</code>,
-   <code>listing</code>, <code>menu</code>, <code>meta</code>,
-   <code>noembed</code>, <code>noframes</code>, <code>noscript</code>,
-   <code>ol</code>, <code>optgroup</code>, <code>option</code>,
-   <code>p</code>, <code>param</code>, <code>plaintext</code>,
-   <code>pre</code>, <code>script</code>, <code>select</code>,
-   <code>spacer</code>, <code>style</code>, <code>tbody</code>,
-   <code>textarea</code>, <code>tfoot</code>, <code>thead</code>,
-   <code>title</code>, <code>tr</code>, <code>ul</code>, and
-   <code>wbr</code>.</p></dd>
+   <code>head</code>, <code>hr</code>, <code>iframe</code>, <!--
+   <code>image</code>, (commented out because this isn't an element
+   that can end up on the stack, so it doesn't matter) -->
+   <code>img</code>, <code>input</code>, <code>isindex</code>,
+   <code>li</code>, <code>link</code>, <code>listing</code>,
+   <code>menu</code>, <code>meta</code>, <code>noembed</code>,
+   <code>noframes</code>, <code>noscript</code>, <code>ol</code>,
+   <code>optgroup</code>, <code>option</code>, <code>p</code>,
+   <code>param</code>, <code>plaintext</code>, <code>pre</code>,
+   <code>script</code>, <code>select</code>, <code>spacer</code>,
+   <code>style</code>, <code>tbody</code>, <code>textarea</code>,
+   <code>tfoot</code>, <code>thead</code>, <code>title</code>,
+   <code>tr</code>, <code>ul</code>, and <code>wbr</code>.</p></dd>
 
    <dt><dfn>Scoping</dfn></dt>
    <dd><p>The following HTML elements introduce new <span title="has
@@ -42807,7 +42794,8 @@
   <p>When the steps below require the UA to <dfn>generate implied end
   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, an
+  <code>li</code> element, an <code>option</code> element, an
+  <code>optgroup</code> element, a <code>p</code> element, an
   <code>rp</code> element, or an <code>rt</code> element, the UA must
   pop the <span>current node</span> off the <span>stack of open
   elements</span>.</p>
@@ -43225,7 +43213,8 @@
     mode</span>.</p>
    </dd>
 
-   <dt>A start tag whose tag name is one of: "base", "link"</dt>
+   <dt>A start tag whose tag name is one of: "base", "command",
+   "event-source", "link"</dt>
    <dd>
 
     <p><span>Insert an HTML element</span> for the token. Immediately
@@ -43272,13 +43261,13 @@
     <p>Follow the <span>generic RCDATA parsing algorithm</span>.</p>
    </dd>
 
-   <dt>A start tag whose tag name is "noscript", if the <span>scripting flag</span> is enabled:</dt>
+   <dt>A start tag whose tag name is "noscript", if the <span>scripting flag</span> is enabled</dt>
    <dt>A start tag whose tag name is one of: "noframes", "style"</dt>
    <dd>
     <p>Follow the <span>generic CDATA parsing algorithm</span>.</p>
    </dd>
 
-   <dt>A start tag whose tag name is "noscript", if the <span>scripting flag</span> is disabled:</dt>
+   <dt>A start tag whose tag name is "noscript", if the <span>scripting flag</span> is disabled</dt>
    <dd>
 
     <p><span>Insert an HTML element</span> for the token.</p>
@@ -43656,8 +43645,9 @@
     add the attribute and its corresponding value to that element.</p>
    </dd>
 
-   <dt>A start tag token whose tag name is one of: "base", "link",
-   "meta", "noframes", "script", "style", "title"</dt>
+   <dt>A start tag token whose tag name is one of: "base", "command",
+   "event-source", "link", "meta", "noframes", "script", "style",
+   "title"</dt>
    <dd>
     <p>Process the token <span>using the rules for</span> the "<span
     title="insertion mode: in head">in head</span>" <span>insertion
@@ -43737,9 +43727,13 @@
 
    </dd>
 
-   <dt>A start tag whose tag name is one of: "address", "blockquote",
-   "center", "dir", "div", "dl", "fieldset", "h1", "h2", "h3", "h4",
-   "h5", "h6", "menu", "ol", "p", "ul"</dt>
+   <!-- start tags for non-phrasing flow content elements -->
+
+   <!-- the normal ones -->
+   <dt>A start tag whose tag name is one of: "address", "article",
+   "aside", "blockquote", "center", "datagrid", "dialog", "dir",
+   "div", "dl", "fieldset", "footer", "h1", "h2", "h3", "h4", "h5",
+   "h6", "header", "menu", "nav", "ol", "p", "section", "ul"</dt>
    <dd>
 
     <!-- As of May 2008 this doesn't match any browser exactly, but is
@@ -43769,6 +43763,7 @@
 
    </dd>
 
+   <!-- as normal, but drops leading newline -->
    <dt>A start tag whose tag name is one of: "pre", "listing"</dt>
    <dd>
 
@@ -43786,6 +43781,7 @@
 
    </dd>
 
+   <!-- as normal, but interacts with the form element pointer -->
    <dt>A start tag whose tag name is "form"</dt>
    <dd>
 
@@ -43806,14 +43802,10 @@
 
    </dd>
 
+   <!-- as normal, but imply </li> when there's another <li> open in weird cases -->
    <dt>A start tag whose tag name is "li"</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 act as if an end tag with the tag name
-    <code>p</code> had been seen.</p>
-
     <p>Run the following algorithm:</p>
 
     <ol>
@@ -43821,44 +43813,47 @@
      <li><p>Initialise <var title="">node</var> to be the <span>current
      node</span> (the bottommost node of the stack).</p></li>
 
-     <li><p>If <var title="">node</var> is an <code>li</code>
-     element, then 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. If more than
-     one node is popped, then this is a <span>parse
-     error</span>.</p></li>
+     <li><p>If <var title="">node</var> is an <code>li</code> element,
+     then act as if an end tag with the tag name <code>li</code> had
+     been seen, then jump to the last step.</p></li>
 
      <li><p>If <var title="">node</var> is not in the
      <span>formatting</span> category, and is not in the
      <span>phrasing</span> category, and is not an
-     <code>address</code> or <code>div</code> element, then stop
-     this algorithm.</p></li> <!-- an element <foo> is in this
-     list if the following markup:
+     <code>address</code> or <code>div</code> element, then jump to
+     the last step.</p></li> <!-- an element <foo> is in this list if
+     the following markup:
 
          <!DOCTYPE html><body><ol><li><foo><li>
 
-     ...results in the second <li> not being (in any way) a
-     descendant of the first <li>, or if <foo> is a formatting
-     element that gets reopened later. -->
+     ...results in the second <li> not being (in any way) a descendant
+     of the first <li>, or if <foo> is a formatting element that gets
+     reopened later. -->
 
-     <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.</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 2.</p></li>
 
+     <li>
+
+      <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 act as if an end tag with the tag name
+      <code>p</code> had been seen.</p>
+
+      <p>Finally, <span>insert an HTML element</span> for the
+      token.</p>
+
+     </li>
+
     </ol>
 
-    <p>Finally, <span>insert an HTML element</span> for the token.</p>
-
    </dd>
 
+   <!-- as normal, but imply </dt> or </dd> when there's another <dt> or <dd> open in weird cases  -->
    <dt>A start tag whose tag name is one of: "dd", "dt"</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 act as if an end tag with the tag name
-    <code>p</code> had been seen.</p>
-
     <p>Run the following algorithm:</p>
 
     <ol>
@@ -43867,35 +43862,44 @@
      node</span> (the bottommost node of the stack).</p></li>
 
      <li><p>If <var title="">node</var> is a <code>dd</code> or
-     <code>dt</code> element, then 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.
-     If more than one node is popped, then this is a <span>parse
-     error</span>.</p></li>
+     <code>dt</code> element, then act as if an end tag with the same
+     tag name as <var title="">node</var> had been seen, then jump to
+     the last step.</p></li>
 
      <li><p>If <var title="">node</var> is not in the
      <span>formatting</span> category, and is not in the
      <span>phrasing</span> category, and is not an
-     <code>address</code> or <code>div</code> element, then stop
-     this algorithm.</p></li> <!-- an element <foo> is in this
-     list if the following markup:
+     <code>address</code> or <code>div</code> element, then jump to
+     the last step.</p></li> <!-- an element <foo> is in this list if
+     the following markup:
 
-         <!DOCTYPE html><body><ol><dt><foo><dt>
+         <!DOCTYPE html><body><dl><dt><foo><dt>
 
-     ...results in the second <li> not being (in any way) a
-     descendant of the first <li>, or if <foo> is a formatting
-     element that gets reopened later. -->
+     ...results in the second <dt> not being (in any way) a descendant
+     of the first <dt>, or if <foo> is a formatting element that gets
+     reopened later. -->
 
-     <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.</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 2.</p></li>
 
+     <li>
+
+      <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 act as if an end tag with the tag name
+      <code>p</code> had been seen.</p>
+
+      <p>Finally, <span>insert an HTML element</span> for the
+      token.</p>
+
+     </li>
+
     </ol>
 
-    <p>Finally, <span>insert an HTML element</span> for the token.</p>
-
    </dd>
 
+   <!-- same as normal, but effectively ends parsing -->
    <dt>A start tag whose tag name is "plaintext"</dt>
    <dd>
 
@@ -43917,9 +43921,13 @@
 
    </dd>
 
-   <dt>An end tag whose tag name is one of: "address",
-   "blockquote", "center", "dir", "div", "dl", "fieldset",
-   "listing", "menu", "ol", "pre", "ul"</dt>
+   <!-- end tags for non-phrasing flow content elements -->
+
+   <!-- the normal ones -->
+   <dt>An end tag whose tag name is one of: "address", "article",
+   "aside", "blockquote", "center", "datagrid", "dialog", "dir",
+   "div", "dl", "fieldset", "footer", "header", "listing", "menu",
+   "nav", "ol", "pre", "section", "ul"</dt>
    <dd>
 
     <p>If the <span>stack of open elements</span> does not <span
@@ -43945,6 +43953,7 @@
 
    </dd>
 
+   <!-- as normal, but interacts with the form element pointer -->
    <dt>An end tag whose tag name is "form"</dt>
    <dd>
 
@@ -43974,24 +43983,37 @@
 
    </dd>
 
+   <!-- as normal, except </p> implies <p> if there's no <p> in scope, and needs care as the elements have optional tags -->
    <dt>An end tag whose tag name is "p"</dt>
    <dd>
 
-    <p>If the <span>current node</span> is not a <code>p</code>
-    element, then this is a <span>parse error</span>.</p>
-
-    <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 pop elements from this stack until the
-    stack no longer <span title="has an element in scope">has a
-    <code>p</code> element in scope</span>.</p>
-
-    <p>Otherwise, act as if a start tag with the tag name
+    <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>; act as if a start tag with the tag name
     <code>p</code> had been seen, then reprocess the current
     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>
    <dd>
 
@@ -44019,8 +44041,8 @@
 
    </dd>
 
-   <dt>An end tag whose tag name is one of: "h1", "h2", "h3",
-   "h4", "h5", "h6"</dt>
+   <!-- as normal, except acts as a closer for any of the h1-h6 elements -->
+   <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> does not <span
@@ -44048,6 +44070,12 @@
 
    </dd>
 
+   <dt>An end tag whose tag name is "sarcasm"</dt>
+   <dd>
+    <p>Take a deep breath, then act as described in the "any other end
+    tag" entry below.</p>
+   </dd>
+
    <!-- ADOPTION AGENCY ELEMENTS
         Mozilla-only: bdo blink del ins sub sup q
         Safari-only: code dfn kbd nobr samp var wbr
@@ -44394,7 +44422,7 @@
    </dd>
 
    <dt>A start tag whose tag name is one of: "area", "basefont",
-   "bgsound", "br", "embed", "img", "param", "spacer", "wbr"</dt>
+   "bgsound", "br", "embed", "img", "spacer", "wbr"</dt>
    <dd>
 
     <p><span>Reconstruct the active formatting elements</span>, if
@@ -44409,6 +44437,18 @@
 
    </dd>
 
+   <dt>A start tag whose tag name is one of: "param", "source"</dt>
+   <dd>
+
+    <p><span>Insert an HTML element</span> for the token. Immediately
+    pop the <span>current node</span> off the <span>stack of open
+    elements</span>.</p>
+
+    <p><span title="acknowledge self-closing flag">Acknowledge the
+    token's <i>self-closing flag</i></span>, if it is set.</p>
+
+   </dd>
+
    <dt>A start tag whose tag name is "hr"</dt>
    <dd>
 
@@ -44576,7 +44616,7 @@
    </dd>
 
    <dt>A start tag whose tag name is one of: "iframe", "noembed"</dt>
-   <dt>A start tag whose tag name is "noscript", if the <span>scripting flag</span> is enabled:</dt>
+   <dt>A start tag whose tag name is "noscript", if the <span>scripting flag</span> is enabled</dt>
    <dd>
     <p>Follow the <span>generic CDATA parsing algorithm</span>.</p>
    </dd>
@@ -44701,34 +44741,30 @@
 
    </dd>
 -->
-   <dt>A start or end tag whose tag name is one of: "caption", "col",
-   "colgroup", "frame", "frameset", "head", "option", "optgroup",
-   "tbody", "td", "tfoot", "th", "thead", "tr"</dt>
-   <dt>An end tag whose tag name is one of: "area", "basefont",
-   "bgsound", "embed", "hr", "iframe", "image", "img", "input",
-   "isindex", "noembed", "noframes", "param", "select", "spacer",
-   "table", "textarea", "wbr"</dt> <!-- add keygen if we add the start
-   tag -->
-   <dt>An end tag whose tag name is "noscript", if the <span>scripting flag</span> is enabled:</dt>
+
+   <dt>A start <!--or end--> tag whose tag name is one of: "caption",
+   "col", "colgroup", "frame", "frameset", "head", "tbody", "td",
+   "tfoot", "th", "thead", "tr"</dt>
+   <!--<dt>An end tag whose tag name is one of: "area", "base",
+   "basefont", "bgsound", "command", "embed", "event-source", "hr",
+   "iframe", "image", "img", "input", "isindex", "link", "meta",
+   "noembed", "noframes", "param", "script", "select", "source",
+   "spacer", "style", "table", "textarea", "title", "wbr"</dt>--> <!--
+   add keygen if we add the start tag -->
+   <!--<dt>An end tag whose tag name is "noscript", if the
+   <span>scripting flag</span> is enabled</dt>-->
    <dd>
     <p><span>Parse error</span>. Ignore the token.</p>
+    <!-- end tags are commented out because since they can never end
+    up on the stack anyway, the default end tag clause will
+    automatically handle them. we don't want to have text in the spec
+    that is just an optimisation, as that detracts from the spec
+    itself -->
    </dd>
 
-   <dt>A start or end tag whose tag name is one of:
-   "event-source", "section", "nav", "article", "aside", "header",
-   "footer", "datagrid", "command"</dt>
-
+   <dt>Any other start tag</dt>
    <dd>
 
-    <!-- XXXX -->
-
-    <p class="big-issue">Work in progress!</p>
-
-   </dd>
-
-   <dt>A start tag token not covered by the previous entries</dt>
-   <dd>
-
     <p><span>Reconstruct the active formatting elements</span>, if
     any.</p>
 
@@ -44739,7 +44775,7 @@
 
    </dd>
 
-   <dt>An end tag token not covered by the previous entries</dt>
+   <dt>Any other end tag</dt>
    <dd>
 
     <p>Run the following algorithm:</p>




More information about the Commit-Watchers mailing list