[html5] r1311 - /

whatwg at whatwg.org whatwg at whatwg.org
Sun Mar 2 17:11:55 PST 2008


Author: ianh
Date: 2008-03-02 17:11:51 -0800 (Sun, 02 Mar 2008)
New Revision: 1311

Modified:
   index
   source
Log:
[e] (0) Move the phase sections lower, move the insertion modes to the same level.

Modified: index
===================================================================
--- index	2008-03-03 01:07:54 UTC (rev 1310)
+++ index	2008-03-03 01:11:51 UTC (rev 1311)
@@ -1602,84 +1602,81 @@
        <li><a href="#tree-construction"><span class=secno>8.2.4 </span>Tree
         construction</a>
         <ul class=toc>
-         <li><a href="#the-initial"><span class=secno>8.2.4.1. </span>The
-          initial phase</a>
-
-         <li><a href="#the-root0"><span class=secno>8.2.4.2. </span>The root
-          element phase</a>
-
-         <li><a href="#the-main"><span class=secno>8.2.4.3. </span>The main
+         <li><a href="#the-main"><span class=secno>8.2.4.1. </span>The main
           phase</a>
           <ul class=toc>
-           <li><a href="#the-stack"><span class=secno>8.2.4.3.1. </span>The
+           <li><a href="#the-stack"><span class=secno>8.2.4.1.1. </span>The
             stack of open elements</a>
 
-           <li><a href="#the-list"><span class=secno>8.2.4.3.2. </span>The
+           <li><a href="#the-list"><span class=secno>8.2.4.1.2. </span>The
             list of active formatting elements</a>
 
-           <li><a href="#creating"><span class=secno>8.2.4.3.3.
+           <li><a href="#creating"><span class=secno>8.2.4.1.3.
             </span>Creating and inserting HTML elements</a>
 
-           <li><a href="#closing"><span class=secno>8.2.4.3.4. </span>Closing
+           <li><a href="#closing"><span class=secno>8.2.4.1.4. </span>Closing
             elements that have implied end tags</a>
 
-           <li><a href="#the-element"><span class=secno>8.2.4.3.5. </span>The
+           <li><a href="#the-element"><span class=secno>8.2.4.1.5. </span>The
             element pointers</a>
 
-           <li><a href="#the-insertion"><span class=secno>8.2.4.3.6.
+           <li><a href="#the-insertion"><span class=secno>8.2.4.1.6.
             </span>The insertion mode</a>
+          </ul>
 
-           <li><a href="#the-before"><span class=secno>8.2.4.3.7. </span>The
-            before head insertion mode</a>
+         <li><a href="#the-initial"><span class=secno>8.2.4.2. </span>The
+          initial phase</a>
 
-           <li><a href="#parsing-main-inhead"><span class=secno>8.2.4.3.8.
-            </span>The in head insertion mode</a>
+         <li><a href="#the-root0"><span class=secno>8.2.4.3. </span>The root
+          element phase</a>
 
-           <li><a href="#parsing-main-inheadnoscript"><span
-            class=secno>8.2.4.3.9. </span>The in head noscript insertion
-            mode</a>
+         <li><a href="#the-before"><span class=secno>8.2.4.4. </span>The
+          before head insertion mode</a>
 
-           <li><a href="#the-after"><span class=secno>8.2.4.3.10. </span>The
-            after head insertion mode</a>
+         <li><a href="#parsing-main-inhead"><span class=secno>8.2.4.5.
+          </span>The in head insertion mode</a>
 
-           <li><a href="#parsing-main-inbody"><span class=secno>8.2.4.3.11.
-            </span>The in body insertion mode</a>
+         <li><a href="#parsing-main-inheadnoscript"><span
+          class=secno>8.2.4.6. </span>The in head noscript insertion mode</a>
+          
 
-           <li><a href="#parsing-main-intable"><span class=secno>8.2.4.3.12.
-            </span>The in table insertion mode</a>
+         <li><a href="#the-after"><span class=secno>8.2.4.7. </span>The after
+          head insertion mode</a>
 
-           <li><a href="#parsing-main-incaption"><span
-            class=secno>8.2.4.3.13. </span>The in caption insertion mode</a>
+         <li><a href="#parsing-main-inbody"><span class=secno>8.2.4.8.
+          </span>The in body insertion mode</a>
 
-           <li><a href="#parsing-main-incolgroup"><span
-            class=secno>8.2.4.3.14. </span>The in column group insertion
-            mode</a>
+         <li><a href="#parsing-main-intable"><span class=secno>8.2.4.9.
+          </span>The in table insertion mode</a>
 
-           <li><a href="#parsing-main-intbody"><span class=secno>8.2.4.3.15.
-            </span>The in table body insertion mode</a>
+         <li><a href="#parsing-main-incaption"><span class=secno>8.2.4.10.
+          </span>The in caption insertion mode</a>
 
-           <li><a href="#parsing-main-intr"><span class=secno>8.2.4.3.16.
-            </span>The in row insertion mode</a>
+         <li><a href="#parsing-main-incolgroup"><span class=secno>8.2.4.11.
+          </span>The in column group insertion mode</a>
 
-           <li><a href="#parsing-main-intd"><span class=secno>8.2.4.3.17.
-            </span>The in cell insertion mode</a>
+         <li><a href="#parsing-main-intbody"><span class=secno>8.2.4.12.
+          </span>The in table body insertion mode</a>
 
-           <li><a href="#parsing-main-inselect"><span class=secno>8.2.4.3.18.
-            </span>The in select insertion mode</a>
+         <li><a href="#parsing-main-intr"><span class=secno>8.2.4.13.
+          </span>The in row insertion mode</a>
 
-           <li><a href="#parsing-main-afterbody"><span
-            class=secno>8.2.4.3.19. </span>The after body insertion mode</a>
+         <li><a href="#parsing-main-intd"><span class=secno>8.2.4.14.
+          </span>The in cell insertion mode</a>
 
-           <li><a href="#parsing-main-inframeset"><span
-            class=secno>8.2.4.3.20. </span>The in frameset insertion mode</a>
-            
+         <li><a href="#parsing-main-inselect"><span class=secno>8.2.4.15.
+          </span>The in select insertion mode</a>
 
-           <li><a href="#parsing-main-afterframeset"><span
-            class=secno>8.2.4.3.21. </span>The after frameset insertion
-            mode</a>
-          </ul>
+         <li><a href="#parsing-main-afterbody"><span class=secno>8.2.4.16.
+          </span>The after body insertion mode</a>
 
-         <li><a href="#the-trailing"><span class=secno>8.2.4.4. </span>The
+         <li><a href="#parsing-main-inframeset"><span class=secno>8.2.4.17.
+          </span>The in frameset insertion mode</a>
+
+         <li><a href="#parsing-main-afterframeset"><span
+          class=secno>8.2.4.18. </span>The after frameset insertion mode</a>
+
+         <li><a href="#the-trailing"><span class=secno>8.2.4.19. </span>The
           trailing end phase</a>
         </ul>
 
@@ -40477,398 +40474,7 @@
    href="#hardwareLimitations">practical concerns</a> will likely force user
    agents to impose nesting depths.
 
-  <h5 id=the-initial><span class=secno>8.2.4.1. </span><dfn
-   id=the-initial0>The initial phase</dfn></h5>
-
-  <p>Initially, the tree construction stage must handle each token emitted
-   from the <a href="#tokenisation0">tokenisation</a> stage as follows:
-
-  <dl class=switch>
-   <dt>A character token that is one of one of U+0009 CHARACTER TABULATION,
-    U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF),
-    <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
-
-   <dd>
-    <p>Ignore the token.</p>
-
-   <dt>A comment token
-
-   <dd>
-    <p>Append a <code>Comment</code> node to the <code>Document</code> object
-     with the <code title="">data</code> attribute set to the data given in
-     the comment token.</p>
-
-   <dt>A DOCTYPE token
-
-   <dd>
-    <p>If the DOCTYPE token's <code title="">name</code> does not
-     case-insensitively match the string "<code title="">HTML</code>", or if
-     the token's public identifier is not missing, or if the token's system
-     identifier is not missing, then there is a <a href="#parse0">parse
-     error</a>. Conformance checkers may, instead of reporting this error,
-     switch to a conformance checking mode for another language (e.g. based
-     on the DOCTYPE token a conformance checker could recognise that the
-     document is an HTML4-era document, and defer to an HTML4 conformance
-     checker.)</p>
-
-    <p>Append a <code>DocumentType</code> node to the <code>Document</code>
-     node, with the <code title="">name</code> attribute set to the name
-     given in the DOCTYPE token; the <code title="">publicId</code> attribute
-     set to the public identifier given in the DOCTYPE token, or the empty
-     string if the public identifier was not set; the <code
-     title="">systemId</code> attribute set to the system identifier given in
-     the DOCTYPE token, or the empty string if the system identifier was not
-     set; and the other attributes specific to <code>DocumentType</code>
-     objects set to null and empty lists as appropriate. Associate the
-     <code>DocumentType</code> node with the <code>Document</code> object so
-     that it is returned as the value of the <code title="">doctype</code>
-     attribute of the <code>Document</code> object.</p>
-
-    <p id=quirks-mode-doctypes>Then, if the DOCTYPE token matches one of the
-     conditions in the following list, then set the document to <a
-     href="#quirks">quirks mode</a>:</p>
-
-    <ul class=brief>
-     <li> The <i>force-quirks flag</i> is set to <i>on</i>.
-
-     <li> The name is set to anything other than "<code
-      title="">HTML</code>".
-
-     <li> The public identifier is set to: "<code title="">+//Silmaril//dtd
-      html Pro v0r11 19970101//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//AdvaSoft
-      Ltd//DTD HTML 3.0 asWedit + extensions//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//AS//DTD HTML
-      3.0 asWedit + extensions//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      2.0 Level 1//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      2.0 Level 2//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      2.0 Strict Level 1//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      2.0 Strict Level 2//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      2.0 Strict//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      2.0//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      2.1E//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      3.0//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      3.0//EN//</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      3.2 Final//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      3.2//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      3//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      Level 0//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      Level 0//EN//2.0</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      Level 1//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      Level 1//EN//2.0</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      Level 2//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      Level 2//EN//2.0</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      Level 3//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      Level 3//EN//3.0</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      Strict Level 0//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      Strict Level 0//EN//2.0</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      Strict Level 1//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      Strict Level 1//EN//2.0</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      Strict Level 2//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      Strict Level 2//EN//2.0</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      Strict Level 3//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      Strict Level 3//EN//3.0</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      Strict//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      Strict//EN//2.0</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
-      Strict//EN//3.0</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD
-      HTML//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD
-      HTML//EN//2.0</code>"
-
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD
-      HTML//EN//3.0</code>"
-
-     <li> The public identifier is set to: "<code title="">-//Metrius//DTD
-      Metrius Presentational//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD
-      Internet Explorer 2.0 HTML Strict//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD
-      Internet Explorer 2.0 HTML//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD
-      Internet Explorer 2.0 Tables//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD
-      Internet Explorer 3.0 HTML Strict//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD
-      Internet Explorer 3.0 HTML//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD
-      Internet Explorer 3.0 Tables//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//Netscape Comm.
-      Corp.//DTD HTML//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//Netscape Comm.
-      Corp.//DTD Strict HTML//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//O'Reilly and
-      Associates//DTD HTML 2.0//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//O'Reilly and
-      Associates//DTD HTML Extended 1.0//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//O'Reilly and
-      Associates//DTD HTML Extended Relaxed 1.0//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//SoftQuad
-      Software//DTD HoTMetaL PRO 6.0::19990601::extensions to HTML
-      4.0//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//SoftQuad//DTD
-      HoTMetaL PRO 4.0::19971010::extensions to HTML 4.0//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//Spyglass//DTD
-      HTML 2.0 Extended//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//SQ//DTD HTML
-      2.0 HoTMetaL + extensions//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//Sun
-      Microsystems Corp.//DTD HotJava HTML//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//Sun
-      Microsystems Corp.//DTD HotJava Strict HTML//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML 3
-      1995-03-24//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML
-      3.2 Draft//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML
-      3.2 Final//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML
-      3.2//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML
-      3.2S Draft//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML
-      4.0 Frameset//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML
-      4.0 Transitional//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML
-      Experimental 19960712//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML
-      Experimental 970421//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD W3
-      HTML//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//W3O//DTD W3
-      HTML 3.0//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//W3O//DTD W3
-      HTML 3.0//EN//</code>"
-
-     <li> The public identifier is set to: "<code title="">-//W3O//DTD W3
-      HTML Strict 3.0//EN//</code>"
-
-     <li> The public identifier is set to: "<code title="">-//WebTechs//DTD
-      Mozilla HTML 2.0//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//WebTechs//DTD
-      Mozilla HTML//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-/W3C/DTD HTML 4.0
-      Transitional/EN</code>"
-
-     <li> The public identifier is set to: "<code title="">HTML</code>"
-
-     <li> The system identifier is set to: "<code
-      title="">http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd</code>"
-      
-
-     <li> The system identifier is missing and the public identifier is set
-      to: "<code title="">-//W3C//DTD HTML 4.01 Frameset//EN</code>"
-
-     <li> The system identifier is missing and the public identifier is set
-      to: "<code title="">-//W3C//DTD HTML 4.01 Transitional//EN</code>"
-    </ul>
-
-    <p>Otherwise, if the DOCTYPE token matches one of the conditions in the
-     following list, then set the document to <a href="#limited">limited
-     quirks mode</a>:</p>
-
-    <ul class=brief>
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD XHTML
-      1.0 Frameset//EN</code>"
-
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD XHTML
-      1.0 Transitional//EN</code>"
-
-     <li> The system identifier is not missing and the public identifier is
-      set to: "<code title="">-//W3C//DTD HTML 4.01 Frameset//EN</code>"
-
-     <li> The system identifier is not missing and the public identifier is
-      set to: "<code title="">-//W3C//DTD HTML 4.01 Transitional//EN</code>"
-    </ul>
-
-    <p>The name, system identifier, and public identifier strings must be
-     compared to the values given in the lists above in a
-     case-insensitive<!-- ASCII --> manner.</p>
-
-    <p>Then, switch to <a href="#the-root1">the root element phase</a> of the
-     tree construction stage.</p>
-
-   <dt>A start tag token
-
-   <dt>An end tag token
-
-   <dt>A character token that is not one of one of U+0009 CHARACTER
-    TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM
-    FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
-
-   <dt>An end-of-file token
-
-   <dd>
-    <p><a href="#parse0">Parse error</a>.</p>
-
-    <p>Set the document to <a href="#quirks">quirks mode</a>.</p>
-
-    <p>Then, switch to <a href="#the-root1">the root element phase</a> of the
-     tree construction stage and reprocess the current token.</p>
-  </dl>
-
-  <h5 id=the-root0><span class=secno>8.2.4.2. </span><dfn id=the-root1>The
-   root element phase</dfn></h5>
-
-  <p>After <a href="#the-initial0">the initial phase</a>, as each token is
-   emitted from the <a href="#tokenisation0">tokenisation</a> stage, it must
-   be processed as described in this section.
-
-  <dl class=switch>
-   <dt>A DOCTYPE token
-
-   <dd>
-    <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
-
-   <dt>A comment token
-
-   <dd>
-    <p>Append a <code>Comment</code> node to the <code>Document</code> object
-     with the <code title="">data</code> attribute set to the data given in
-     the comment token.</p>
-
-   <dt>A character token that is one of one of U+0009 CHARACTER TABULATION,
-    U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF),
-    <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
-
-   <dd>
-    <p>Ignore the token.</p>
-
-   <dt>A character token that is <em>not</em> one of U+0009 CHARACTER
-    TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM
-    FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
-
-   <dt>A start tag token
-
-   <dt>An end tag token
-
-   <dt>An end-of-file token
-
-   <dd>
-    <p id=parser-appcache>If the token is a start tag token with the tag name
-     "html", and it has an attribute "manifest", then run the <a
-     href="#application2"
-     title=concept-appcache-init-with-attribute>application cache selection
-     algorithm</a> with the value of that attribute as the manifest URI.
-     Otherwise, run the <a href="#application3"
-     title=concept-appcache-init-no-attribute>application cache selection
-     algorithm</a> with no manifest.</p>
-
-    <p>Create an <code><a href="#htmlelement">HTMLElement</a></code> node
-     with the tag name <code><a href="#html">html</a></code>, in the <a
-     href="#html-namespace0">HTML namespace</a>. Append it to the
-     <code>Document</code> object. Switch to <a href="#the-main0">the main
-     phase</a> and reprocess the current token.</p>
-
-    <p class=big-issue>Should probably make end tags be ignored, so that
-     "</head><!-- --><html>" puts the comment before the root node
-     (or should we?)</p>
-  </dl>
-
-  <p>The root element can end up being removed from the <code>Document</code>
-   object, e.g. by scripts; nothing in particular happens in such cases,
-   content continues being appended to the nodes as described in the next
-   section.
-
-  <h5 id=the-main><span class=secno>8.2.4.3. </span><dfn id=the-main0>The
+  <h5 id=the-main><span class=secno>8.2.4.1. </span><dfn id=the-main0>The
    main phase</dfn></h5>
 
   <p>After <a href="#the-root1">the root element phase</a>, each token
@@ -40887,7 +40493,7 @@
    concept (and duplicate the two rules common to all insertion modes into
    all of them).
 
-  <h6 id=the-stack><span class=secno>8.2.4.3.1. </span>The stack of open
+  <h6 id=the-stack><span class=secno>8.2.4.1.1. </span>The stack of open
    elements</h6>
 
   <p>Initially the <dfn id=stack>stack of open elements</dfn> contains just
@@ -41047,7 +40653,7 @@
    misnested formatting elements</a>), the stack is manipulated in a
    random-access fashion.
 
-  <h6 id=the-list><span class=secno>8.2.4.3.2. </span>The list of active
+  <h6 id=the-list><span class=secno>8.2.4.1.2. </span>The list of active
    formatting elements</h6>
 
   <p>Initially the <dfn id=list-of4>list of active formatting elements</dfn>
@@ -41136,7 +40742,7 @@
    <li>Go to step 1.
   </ol>
 
-  <h6 id=creating><span class=secno>8.2.4.3.3. </span>Creating and inserting
+  <h6 id=creating><span class=secno>8.2.4.1.3. </span>Creating and inserting
    HTML elements</h6>
 
   <p>When the steps below require the UA to <dfn id=create title="create an
@@ -41208,7 +40814,7 @@
      error</a>.
   </ol>
 
-  <h6 id=closing><span class=secno>8.2.4.3.4. </span>Closing elements that
+  <h6 id=closing><span class=secno>8.2.4.1.4. </span>Closing elements that
    have implied end tags</h6>
 
   <p>When the steps below require the UA to <dfn id=generate>generate implied
@@ -41229,7 +40835,7 @@
    element to exclude from the process, then the UA must perform the above
    steps as if that element was not in the above list.
 
-  <h6 id=the-element><span class=secno>8.2.4.3.5. </span>The element pointers</h6>
+  <h6 id=the-element><span class=secno>8.2.4.1.5. </span>The element pointers</h6>
 
   <p>Initially the <dfn id=head-element><code title="">head</code> element
    pointer</dfn> and the <dfn id=form-element><code title="">form</code>
@@ -41245,7 +40851,7 @@
    associate with forms in the face of dramatically bad markup, for
    historical reasons.
 
-  <h6 id=the-insertion><span class=secno>8.2.4.3.6. </span>The insertion mode</h6>
+  <h6 id=the-insertion><span class=secno>8.2.4.1.6. </span>The insertion mode</h6>
 
   <p>Initially the <dfn id=insertion0>insertion mode</dfn> is "<a
    href="#before4" title="insertion mode: before head">before head</a>". It
@@ -41421,9 +41027,402 @@
   </ol>
 -->
 
-  <h6 id=the-before><span class=secno>8.2.4.3.7. </span>The <dfn id=before4
-   title="insertion mode: before head">before head</dfn> insertion mode</h6>
+  <p>`
 
+  <h5 id=the-initial><span class=secno>8.2.4.2. </span><dfn
+   id=the-initial0>The initial phase</dfn></h5>
+
+  <p>Initially, the tree construction stage must handle each token emitted
+   from the <a href="#tokenisation0">tokenisation</a> stage as follows:
+
+  <dl class=switch>
+   <dt>A character token that is one of one of U+0009 CHARACTER TABULATION,
+    U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF),
+    <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
+
+   <dd>
+    <p>Ignore the token.</p>
+
+   <dt>A comment token
+
+   <dd>
+    <p>Append a <code>Comment</code> node to the <code>Document</code> object
+     with the <code title="">data</code> attribute set to the data given in
+     the comment token.</p>
+
+   <dt>A DOCTYPE token
+
+   <dd>
+    <p>If the DOCTYPE token's <code title="">name</code> does not
+     case-insensitively match the string "<code title="">HTML</code>", or if
+     the token's public identifier is not missing, or if the token's system
+     identifier is not missing, then there is a <a href="#parse0">parse
+     error</a>. Conformance checkers may, instead of reporting this error,
+     switch to a conformance checking mode for another language (e.g. based
+     on the DOCTYPE token a conformance checker could recognise that the
+     document is an HTML4-era document, and defer to an HTML4 conformance
+     checker.)</p>
+
+    <p>Append a <code>DocumentType</code> node to the <code>Document</code>
+     node, with the <code title="">name</code> attribute set to the name
+     given in the DOCTYPE token; the <code title="">publicId</code> attribute
+     set to the public identifier given in the DOCTYPE token, or the empty
+     string if the public identifier was not set; the <code
+     title="">systemId</code> attribute set to the system identifier given in
+     the DOCTYPE token, or the empty string if the system identifier was not
+     set; and the other attributes specific to <code>DocumentType</code>
+     objects set to null and empty lists as appropriate. Associate the
+     <code>DocumentType</code> node with the <code>Document</code> object so
+     that it is returned as the value of the <code title="">doctype</code>
+     attribute of the <code>Document</code> object.</p>
+
+    <p id=quirks-mode-doctypes>Then, if the DOCTYPE token matches one of the
+     conditions in the following list, then set the document to <a
+     href="#quirks">quirks mode</a>:</p>
+
+    <ul class=brief>
+     <li> The <i>force-quirks flag</i> is set to <i>on</i>.
+
+     <li> The name is set to anything other than "<code
+      title="">HTML</code>".
+
+     <li> The public identifier is set to: "<code title="">+//Silmaril//dtd
+      html Pro v0r11 19970101//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//AdvaSoft
+      Ltd//DTD HTML 3.0 asWedit + extensions//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//AS//DTD HTML
+      3.0 asWedit + extensions//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      2.0 Level 1//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      2.0 Level 2//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      2.0 Strict Level 1//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      2.0 Strict Level 2//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      2.0 Strict//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      2.0//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      2.1E//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      3.0//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      3.0//EN//</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      3.2 Final//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      3.2//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      3//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      Level 0//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      Level 0//EN//2.0</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      Level 1//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      Level 1//EN//2.0</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      Level 2//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      Level 2//EN//2.0</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      Level 3//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      Level 3//EN//3.0</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      Strict Level 0//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      Strict Level 0//EN//2.0</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      Strict Level 1//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      Strict Level 1//EN//2.0</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      Strict Level 2//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      Strict Level 2//EN//2.0</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      Strict Level 3//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      Strict Level 3//EN//3.0</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      Strict//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      Strict//EN//2.0</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML
+      Strict//EN//3.0</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD
+      HTML//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD
+      HTML//EN//2.0</code>"
+
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD
+      HTML//EN//3.0</code>"
+
+     <li> The public identifier is set to: "<code title="">-//Metrius//DTD
+      Metrius Presentational//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD
+      Internet Explorer 2.0 HTML Strict//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD
+      Internet Explorer 2.0 HTML//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD
+      Internet Explorer 2.0 Tables//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD
+      Internet Explorer 3.0 HTML Strict//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD
+      Internet Explorer 3.0 HTML//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD
+      Internet Explorer 3.0 Tables//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//Netscape Comm.
+      Corp.//DTD HTML//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//Netscape Comm.
+      Corp.//DTD Strict HTML//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//O'Reilly and
+      Associates//DTD HTML 2.0//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//O'Reilly and
+      Associates//DTD HTML Extended 1.0//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//O'Reilly and
+      Associates//DTD HTML Extended Relaxed 1.0//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//SoftQuad
+      Software//DTD HoTMetaL PRO 6.0::19990601::extensions to HTML
+      4.0//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//SoftQuad//DTD
+      HoTMetaL PRO 4.0::19971010::extensions to HTML 4.0//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//Spyglass//DTD
+      HTML 2.0 Extended//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//SQ//DTD HTML
+      2.0 HoTMetaL + extensions//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//Sun
+      Microsystems Corp.//DTD HotJava HTML//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//Sun
+      Microsystems Corp.//DTD HotJava Strict HTML//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML 3
+      1995-03-24//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML
+      3.2 Draft//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML
+      3.2 Final//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML
+      3.2//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML
+      3.2S Draft//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML
+      4.0 Frameset//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML
+      4.0 Transitional//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML
+      Experimental 19960712//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML
+      Experimental 970421//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD W3
+      HTML//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//W3O//DTD W3
+      HTML 3.0//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//W3O//DTD W3
+      HTML 3.0//EN//</code>"
+
+     <li> The public identifier is set to: "<code title="">-//W3O//DTD W3
+      HTML Strict 3.0//EN//</code>"
+
+     <li> The public identifier is set to: "<code title="">-//WebTechs//DTD
+      Mozilla HTML 2.0//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//WebTechs//DTD
+      Mozilla HTML//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-/W3C/DTD HTML 4.0
+      Transitional/EN</code>"
+
+     <li> The public identifier is set to: "<code title="">HTML</code>"
+
+     <li> The system identifier is set to: "<code
+      title="">http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd</code>"
+      
+
+     <li> The system identifier is missing and the public identifier is set
+      to: "<code title="">-//W3C//DTD HTML 4.01 Frameset//EN</code>"
+
+     <li> The system identifier is missing and the public identifier is set
+      to: "<code title="">-//W3C//DTD HTML 4.01 Transitional//EN</code>"
+    </ul>
+
+    <p>Otherwise, if the DOCTYPE token matches one of the conditions in the
+     following list, then set the document to <a href="#limited">limited
+     quirks mode</a>:</p>
+
+    <ul class=brief>
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD XHTML
+      1.0 Frameset//EN</code>"
+
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD XHTML
+      1.0 Transitional//EN</code>"
+
+     <li> The system identifier is not missing and the public identifier is
+      set to: "<code title="">-//W3C//DTD HTML 4.01 Frameset//EN</code>"
+
+     <li> The system identifier is not missing and the public identifier is
+      set to: "<code title="">-//W3C//DTD HTML 4.01 Transitional//EN</code>"
+    </ul>
+
+    <p>The name, system identifier, and public identifier strings must be
+     compared to the values given in the lists above in a
+     case-insensitive<!-- ASCII --> manner.</p>
+
+    <p>Then, switch to <a href="#the-root1">the root element phase</a> of the
+     tree construction stage.</p>
+
+   <dt>A start tag token
+
+   <dt>An end tag token
+
+   <dt>A character token that is not one of one of U+0009 CHARACTER
+    TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM
+    FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
+
+   <dt>An end-of-file token
+
+   <dd>
+    <p><a href="#parse0">Parse error</a>.</p>
+
+    <p>Set the document to <a href="#quirks">quirks mode</a>.</p>
+
+    <p>Then, switch to <a href="#the-root1">the root element phase</a> of the
+     tree construction stage and reprocess the current token.</p>
+  </dl>
+
+  <h5 id=the-root0><span class=secno>8.2.4.3. </span><dfn id=the-root1>The
+   root element phase</dfn></h5>
+
+  <p>After <a href="#the-initial0">the initial phase</a>, as each token is
+   emitted from the <a href="#tokenisation0">tokenisation</a> stage, it must
+   be processed as described in this section.
+
+  <dl class=switch>
+   <dt>A DOCTYPE token
+
+   <dd>
+    <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+
+   <dt>A comment token
+
+   <dd>
+    <p>Append a <code>Comment</code> node to the <code>Document</code> object
+     with the <code title="">data</code> attribute set to the data given in
+     the comment token.</p>
+
+   <dt>A character token that is one of one of U+0009 CHARACTER TABULATION,
+    U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF),
+    <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
+
+   <dd>
+    <p>Ignore the token.</p>
+
+   <dt>A character token that is <em>not</em> one of U+0009 CHARACTER
+    TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM
+    FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
+
+   <dt>A start tag token
+
+   <dt>An end tag token
+
+   <dt>An end-of-file token
+
+   <dd>
+    <p id=parser-appcache>If the token is a start tag token with the tag name
+     "html", and it has an attribute "manifest", then run the <a
+     href="#application2"
+     title=concept-appcache-init-with-attribute>application cache selection
+     algorithm</a> with the value of that attribute as the manifest URI.
+     Otherwise, run the <a href="#application3"
+     title=concept-appcache-init-no-attribute>application cache selection
+     algorithm</a> with no manifest.</p>
+
+    <p>Create an <code><a href="#htmlelement">HTMLElement</a></code> node
+     with the tag name <code><a href="#html">html</a></code>, in the <a
+     href="#html-namespace0">HTML namespace</a>. Append it to the
+     <code>Document</code> object. Switch to <a href="#the-main0">the main
+     phase</a> and reprocess the current token.</p>
+
+    <p class=big-issue>Should probably make end tags be ignored, so that
+     "</head><!-- --><html>" puts the comment before the root node
+     (or should we?)</p>
+  </dl>
+
+  <p>The root element can end up being removed from the <code>Document</code>
+   object, e.g. by scripts; nothing in particular happens in such cases,
+   content continues being appended to the nodes as described in the next
+   section.
+
+  <h5 id=the-before><span class=secno>8.2.4.4. </span>The <dfn id=before4
+   title="insertion mode: before head">before head</dfn> insertion mode</h5>
+
   <p>Handle the token as follows:
 
   <dl class=switch>
@@ -41514,8 +41513,8 @@
      after head">after head</a>" <a href="#insertion0">insertion mode</a>.</p>
   </dl>
 
-  <h6 id=parsing-main-inhead><span class=secno>8.2.4.3.8. </span>The <dfn
-   id=in-head title="insertion mode: in head">in head</dfn> insertion mode</h6>
+  <h5 id=parsing-main-inhead><span class=secno>8.2.4.5. </span>The <dfn
+   id=in-head title="insertion mode: in head">in head</dfn> insertion mode</h5>
 
   <p>Handle the token as follows.
 
@@ -41765,9 +41764,9 @@
      get put into the head. Do we want to copy that?</p>
   </dl>
 
-  <h6 id=parsing-main-inheadnoscript><span class=secno>8.2.4.3.9. </span>The
+  <h5 id=parsing-main-inheadnoscript><span class=secno>8.2.4.6. </span>The
    <dfn id=in-head0 title="insertion mode: in head noscript">in head
-   noscript</dfn> insertion mode</h6>
+   noscript</dfn> insertion mode</h5>
 
   <p>Handle the token as follows.
 
@@ -41833,8 +41832,8 @@
      name "noscript" had been seen and reprocess the current token.</p>
   </dl>
 
-  <h6 id=the-after><span class=secno>8.2.4.3.10. </span>The <dfn id=after4
-   title="insertion mode: after head">after head</dfn> insertion mode</h6>
+  <h5 id=the-after><span class=secno>8.2.4.7. </span>The <dfn id=after4
+   title="insertion mode: after head">after head</dfn> insertion mode</h5>
 
   <p>Handle the token as follows:
 
@@ -41916,8 +41915,8 @@
      had been seen, and then reprocess the current token.</p>
   </dl>
 
-  <h6 id=parsing-main-inbody><span class=secno>8.2.4.3.11. </span>The <dfn
-   id=in-body title="insertion mode: in body">in body</dfn> insertion mode</h6>
+  <h5 id=parsing-main-inbody><span class=secno>8.2.4.8. </span>The <dfn
+   id=in-body title="insertion mode: in body">in body</dfn> insertion mode</h5>
 
   <p>Handle the token as follows:
 
@@ -42872,8 +42871,8 @@
     </ol>
   </dl>
 
-  <h6 id=parsing-main-intable><span class=secno>8.2.4.3.12. </span>The <dfn
-   id=in-table title="insertion mode: in table">in table</dfn> insertion mode</h6>
+  <h5 id=parsing-main-intable><span class=secno>8.2.4.9. </span>The <dfn
+   id=in-table title="insertion mode: in table">in table</dfn> insertion mode</h5>
 
   <dl class=switch>
    <dt>An end-of-file token
@@ -43049,9 +43048,9 @@
    href="#html">html</a></code> element after this process is a <a
    href="#fragment">fragment case</a>.
 
-  <h6 id=parsing-main-incaption><span class=secno>8.2.4.3.13. </span>The <dfn
+  <h5 id=parsing-main-incaption><span class=secno>8.2.4.10. </span>The <dfn
    id=in-caption title="insertion mode: in caption">in caption</dfn>
-   insertion mode</h6>
+   insertion mode</h5>
 
   <p>Handle the token as follows.
 
@@ -43109,9 +43108,9 @@
      was "<a href="#in-body" title="insertion mode: in body">in body</a>".</p>
   </dl>
 
-  <h6 id=parsing-main-incolgroup><span class=secno>8.2.4.3.14. </span>The
-   <dfn id=in-column title="insertion mode: in column group">in column
-   group</dfn> insertion mode</h6>
+  <h5 id=parsing-main-incolgroup><span class=secno>8.2.4.11. </span>The <dfn
+   id=in-column title="insertion mode: in column group">in column group</dfn>
+   insertion mode</h5>
 
   <p>Handle the token as follows.
 
@@ -43185,9 +43184,9 @@
      href="#fragment">fragment case</a>.</p>
   </dl>
 
-  <h6 id=parsing-main-intbody><span class=secno>8.2.4.3.15. </span>The <dfn
+  <h5 id=parsing-main-intbody><span class=secno>8.2.4.12. </span>The <dfn
    id=in-table0 title="insertion mode: in table body">in table body</dfn>
-   insertion mode</h6>
+   insertion mode</h5>
 
   <p>Handle the token as follows.
 
@@ -43275,8 +43274,8 @@
    href="#html">html</a></code> element after this process is a <a
    href="#fragment">fragment case</a>.
 
-  <h6 id=parsing-main-intr><span class=secno>8.2.4.3.16. </span>The <dfn
-   id=in-row title="insertion mode: in row">in row</dfn> insertion mode</h6>
+  <h5 id=parsing-main-intr><span class=secno>8.2.4.13. </span>The <dfn
+   id=in-row title="insertion mode: in row">in row</dfn> insertion mode</h5>
 
   <p>Handle the token as follows.
 
@@ -43364,8 +43363,8 @@
    href="#html">html</a></code> element after this process is a <a
    href="#fragment">fragment case</a>.
 
-  <h6 id=parsing-main-intd><span class=secno>8.2.4.3.17. </span>The <dfn
-   id=in-cell title="insertion mode: in cell">in cell</dfn> insertion mode</h6>
+  <h5 id=parsing-main-intd><span class=secno>8.2.4.14. </span>The <dfn
+   id=in-cell title="insertion mode: in cell">in cell</dfn> insertion mode</h5>
 
   <p>Handle the token as follows.
 
@@ -43463,9 +43462,9 @@
    neither when the <a href="#insertion0">insertion mode</a> is "<a
    href="#in-cell" title="insertion mode: in cell">in cell</a>".
 
-  <h6 id=parsing-main-inselect><span class=secno>8.2.4.3.18. </span>The <dfn
+  <h5 id=parsing-main-inselect><span class=secno>8.2.4.15. </span>The <dfn
    id=in-select title="insertion mode: in select">in select</dfn> insertion
-   mode</h6>
+   mode</h5>
 
   <p>Handle the token as follows:
 
@@ -43582,9 +43581,9 @@
     <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
   </dl>
 
-  <h6 id=parsing-main-afterbody><span class=secno>8.2.4.3.19. </span>The <dfn
+  <h5 id=parsing-main-afterbody><span class=secno>8.2.4.16. </span>The <dfn
    id=after5 title="insertion mode: after body">after body</dfn> insertion
-   mode</h6>
+   mode</h5>
 
   <p>Handle the token as follows:
 
@@ -43644,9 +43643,9 @@
      title="insertion mode: in body">in body</a>" and reprocess the token.</p>
   </dl>
 
-  <h6 id=parsing-main-inframeset><span class=secno>8.2.4.3.20. </span>The
-   <dfn id=in-frameset title="insertion mode: in frameset">in frameset</dfn>
-   insertion mode</h6>
+  <h5 id=parsing-main-inframeset><span class=secno>8.2.4.17. </span>The <dfn
+   id=in-frameset title="insertion mode: in frameset">in frameset</dfn>
+   insertion mode</h5>
 
   <p>Handle the token as follows:
 
@@ -43727,9 +43726,9 @@
     <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
   </dl>
 
-  <h6 id=parsing-main-afterframeset><span class=secno>8.2.4.3.21. </span>The
+  <h5 id=parsing-main-afterframeset><span class=secno>8.2.4.18. </span>The
    <dfn id=after6 title="insertion mode: after frameset">after frameset</dfn>
-   insertion mode</h6>
+   insertion mode</h5>
 
   <p>Handle the token as follows:
 
@@ -43788,7 +43787,7 @@
    that do support frames but want to show the NOFRAMES content. Supporting
    the former is easy; supporting the latter is harder.
 
-  <h5 id=the-trailing><span class=secno>8.2.4.4. </span><dfn
+  <h5 id=the-trailing><span class=secno>8.2.4.19. </span><dfn
    id=the-trailing0>The trailing end phase</dfn></h5>
 
   <p>After <a href="#the-main0">the main phase</a>, as each token is emitted

Modified: source
===================================================================
--- source	2008-03-03 01:07:54 UTC (rev 1310)
+++ source	2008-03-03 01:11:51 UTC (rev 1311)
@@ -37759,243 +37759,6 @@
   depths.</p>
 
 
-  <h5><dfn>The initial phase</dfn></h5>
-
-  <p>Initially, the tree construction stage must handle each token
-  emitted from the <span>tokenisation</span> stage as follows:</p>
-
-  <dl class="switch">
-
-   <dt>A character token that is one of one of U+0009 CHARACTER
-   TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
-   FORM FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020
-   SPACE</dt>
-   <dd>
-    <p>Ignore the token.</p>
-   </dd>
-
-   <dt>A comment token</dt>
-   <dd>
-    <p>Append a <code>Comment</code> node to the <code>Document</code>
-    object with the <code title="">data</code> attribute set to the
-    data given in the comment token.</p>
-   </dd>
-
-   <dt>A DOCTYPE token</dt>
-   <dd>
-
-    <p>If the DOCTYPE token's <code title="">name</code> does not
-    case-insensitively match the string "<code title="">HTML</code>",
-    or if the token's public identifier is not missing, or if the
-    token's system identifier is not missing, then there is a
-    <span>parse error</span>. Conformance checkers may, instead of
-    reporting this error, switch to a conformance checking mode for
-    another language (e.g. based on the DOCTYPE token a conformance
-    checker could recognise that the document is an HTML4-era
-    document, and defer to an HTML4 conformance checker.)</p>
-
-    <p>Append a <code>DocumentType</code> node to the
-    <code>Document</code> node, with the <code title="">name</code>
-    attribute set to the name given in the DOCTYPE token; the <code
-    title="">publicId</code> attribute set to the public identifier
-    given in the DOCTYPE token, or the empty string if the public
-    identifier was not set; the <code title="">systemId</code>
-    attribute set to the system identifier given in the DOCTYPE token,
-    or the empty string if the system identifier was not set; and the
-    other attributes specific to <code>DocumentType</code> objects set
-    to null and empty lists as appropriate. Associate the
-    <code>DocumentType</code> node with the <code>Document</code>
-    object so that it is returned as the value of the <code
-    title="">doctype</code> attribute of the <code>Document</code>
-    object.</p>
-
-    <p id="quirks-mode-doctypes">Then, if the DOCTYPE
-    token matches one of the conditions in the following list, then
-    set the document to <span>quirks mode</span>:</p>
-
-    <ul class="brief">
-     <li> The <i>force-quirks flag</i> is set to <i>on</i>. </li>
-     <li> The name is set to anything other than "<code title="">HTML</code>". </li>
-     <li> The public identifier is set to: "<code title="">+//Silmaril//dtd html Pro v0r11 19970101//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//AdvaSoft Ltd//DTD HTML 3.0 asWedit + extensions//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//AS//DTD HTML 3.0 asWedit + extensions//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 2.0 Level 1//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 2.0 Level 2//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 2.0 Strict Level 1//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 2.0 Strict Level 2//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 2.0 Strict//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 2.0//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 2.1E//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 3.0//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 3.0//EN//</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 3.2 Final//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 3.2//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 3//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Level 0//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Level 0//EN//2.0</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Level 1//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Level 1//EN//2.0</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Level 2//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Level 2//EN//2.0</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Level 3//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Level 3//EN//3.0</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict Level 0//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict Level 0//EN//2.0</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict Level 1//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict Level 1//EN//2.0</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict Level 2//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict Level 2//EN//2.0</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict Level 3//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict Level 3//EN//3.0</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict//EN//2.0</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict//EN//3.0</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML//EN//2.0</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML//EN//3.0</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//Metrius//DTD Metrius Presentational//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD Internet Explorer 2.0 HTML Strict//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD Internet Explorer 2.0 HTML//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD Internet Explorer 2.0 Tables//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD Internet Explorer 3.0 HTML Strict//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD Internet Explorer 3.0 HTML//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD Internet Explorer 3.0 Tables//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//Netscape Comm. Corp.//DTD HTML//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//Netscape Comm. Corp.//DTD Strict HTML//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//O'Reilly and Associates//DTD HTML 2.0//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//O'Reilly and Associates//DTD HTML Extended 1.0//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//O'Reilly and Associates//DTD HTML Extended Relaxed 1.0//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//SoftQuad Software//DTD HoTMetaL PRO 6.0::19990601::extensions to HTML 4.0//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//SoftQuad//DTD HoTMetaL PRO 4.0::19971010::extensions to HTML 4.0//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//Spyglass//DTD HTML 2.0 Extended//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//SQ//DTD HTML 2.0 HoTMetaL + extensions//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//Sun Microsystems Corp.//DTD HotJava HTML//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//Sun Microsystems Corp.//DTD HotJava Strict HTML//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML 3 1995-03-24//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML 3.2 Draft//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML 3.2 Final//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML 3.2//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML 3.2S Draft//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML 4.0 Frameset//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML 4.0 Transitional//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML Experimental 19960712//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML Experimental 970421//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD W3 HTML//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//W3O//DTD W3 HTML 3.0//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//W3O//DTD W3 HTML 3.0//EN//</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//W3O//DTD W3 HTML Strict 3.0//EN//</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//WebTechs//DTD Mozilla HTML 2.0//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//WebTechs//DTD Mozilla HTML//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-/W3C/DTD HTML 4.0 Transitional/EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">HTML</code>" </li>
-     <li> The system identifier is set to: "<code title="">http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd</code>" </li>
-     <li> The system identifier is missing and the public identifier is set to: "<code title="">-//W3C//DTD HTML 4.01 Frameset//EN</code>" </li>
-     <li> The system identifier is missing and the public identifier is set to: "<code title="">-//W3C//DTD HTML 4.01 Transitional//EN</code>" </li>
-    </ul>
-
-    <p>Otherwise, if the DOCTYPE
-    token matches one of the conditions in the following list, then
-    set the document to <span>limited quirks mode</span>:</p>
-
-    <ul class="brief">
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD XHTML 1.0 Frameset//EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">-//W3C//DTD XHTML 1.0 Transitional//EN</code>" </li>
-     <li> The system identifier is not missing and the public identifier is set to: "<code title="">-//W3C//DTD HTML 4.01 Frameset//EN</code>" </li>
-     <li> The system identifier is not missing and the public identifier is set to: "<code title="">-//W3C//DTD HTML 4.01 Transitional//EN</code>" </li>
-    </ul>
-
-    <p>The name, system identifier, and public identifier strings must
-    be compared to the values given in the lists above in a
-    case-insensitive<!-- ASCII --> manner.</p>
-
-    <p>Then, switch to <span>the root element phase</span> of the tree
-    construction stage.</p>
-
-   </dd>
-
-   <dt>A start tag token</dt>
-   <dt>An end tag token</dt>
-   <dt>A character token that is not one of one of U+0009 CHARACTER
-   TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
-   FORM FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
-   <dt>An end-of-file token</dt>
-   <dd>
-
-    <p><span>Parse error</span>.</p>
-
-    <p>Set the document to <span>quirks mode</span>.</p>
-
-    <p>Then, switch to <span>the root element phase</span> of the tree
-    construction stage and reprocess the current token.</p>
-
-   </dd>
-
-  </dl>
-
-
-  <h5><dfn>The root element phase</dfn></h5>
-
-  <p>After <span>the initial phase</span>, as each token is emitted
-  from the <span>tokenisation</span> stage, it must be processed as
-  described in this section.</p>
-
-  <dl class="switch">
-
-   <dt>A DOCTYPE token</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>A comment token</dt>
-   <dd>
-    <p>Append a <code>Comment</code> node to the <code>Document</code>
-    object with the <code title="">data</code> attribute set to the
-    data given in the comment token.</p>
-   </dd>
-
-   <dt>A character token that is one of one of U+0009 CHARACTER
-   TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
-   FORM FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020
-   SPACE</dt>
-   <dd>
-    <p>Ignore the token.</p>
-   </dd>
-
-   <dt>A character token that is <em>not</em> one of U+0009 CHARACTER
-   TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
-   FORM FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
-   <dt>A start tag token</dt>
-   <dt>An end tag token</dt>
-   <dt>An end-of-file token</dt>
-   <dd>
-
-    <p id="parser-appcache">If the token is a start tag token with the
-    tag name "html", and it has an attribute "manifest", then run
-    the <span title="concept-appcache-init-with-attribute">application
-    cache selection algorithm</span> with the value of that attribute
-    as the manifest URI. Otherwise, run the <span
-    title="concept-appcache-init-no-attribute">application cache
-    selection algorithm</span> with no manifest.</p>
-
-    <p>Create an <code>HTMLElement</code> node with the tag name
-    <code>html</code>, in the <span>HTML namespace</span>. Append it
-    to the <code>Document</code> object. Switch to <span>the main
-    phase</span> and reprocess the current token.</p>
-
-    <p class="big-issue">Should probably make end tags be ignored, so
-    that "</head><!-- --><html>" puts the comment before the
-    root node (or should we?)</p>
-
-   </dd>
-
-  </dl>
-
-  <p>The root element can end up being removed from the
-  <code>Document</code> object, e.g. by scripts; nothing in particular
-  happens in such cases, content continues being appended to the nodes
-  as described in the next section.</p>
-
-
   <h5><dfn>The main phase</dfn></h5>
 
   <p>After <span>the root element phase</span>, each token emitted
@@ -38514,10 +38277,247 @@
 
   </ol>
 -->
+`
 
+  <h5><dfn>The initial phase</dfn></h5>
 
-  <h6>The <dfn title="insertion mode: before head">before head</dfn> insertion mode</h6>
+  <p>Initially, the tree construction stage must handle each token
+  emitted from the <span>tokenisation</span> stage as follows:</p>
 
+  <dl class="switch">
+
+   <dt>A character token that is one of one of U+0009 CHARACTER
+   TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
+   FORM FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020
+   SPACE</dt>
+   <dd>
+    <p>Ignore the token.</p>
+   </dd>
+
+   <dt>A comment token</dt>
+   <dd>
+    <p>Append a <code>Comment</code> node to the <code>Document</code>
+    object with the <code title="">data</code> attribute set to the
+    data given in the comment token.</p>
+   </dd>
+
+   <dt>A DOCTYPE token</dt>
+   <dd>
+
+    <p>If the DOCTYPE token's <code title="">name</code> does not
+    case-insensitively match the string "<code title="">HTML</code>",
+    or if the token's public identifier is not missing, or if the
+    token's system identifier is not missing, then there is a
+    <span>parse error</span>. Conformance checkers may, instead of
+    reporting this error, switch to a conformance checking mode for
+    another language (e.g. based on the DOCTYPE token a conformance
+    checker could recognise that the document is an HTML4-era
+    document, and defer to an HTML4 conformance checker.)</p>
+
+    <p>Append a <code>DocumentType</code> node to the
+    <code>Document</code> node, with the <code title="">name</code>
+    attribute set to the name given in the DOCTYPE token; the <code
+    title="">publicId</code> attribute set to the public identifier
+    given in the DOCTYPE token, or the empty string if the public
+    identifier was not set; the <code title="">systemId</code>
+    attribute set to the system identifier given in the DOCTYPE token,
+    or the empty string if the system identifier was not set; and the
+    other attributes specific to <code>DocumentType</code> objects set
+    to null and empty lists as appropriate. Associate the
+    <code>DocumentType</code> node with the <code>Document</code>
+    object so that it is returned as the value of the <code
+    title="">doctype</code> attribute of the <code>Document</code>
+    object.</p>
+
+    <p id="quirks-mode-doctypes">Then, if the DOCTYPE
+    token matches one of the conditions in the following list, then
+    set the document to <span>quirks mode</span>:</p>
+
+    <ul class="brief">
+     <li> The <i>force-quirks flag</i> is set to <i>on</i>. </li>
+     <li> The name is set to anything other than "<code title="">HTML</code>". </li>
+     <li> The public identifier is set to: "<code title="">+//Silmaril//dtd html Pro v0r11 19970101//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//AdvaSoft Ltd//DTD HTML 3.0 asWedit + extensions//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//AS//DTD HTML 3.0 asWedit + extensions//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 2.0 Level 1//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 2.0 Level 2//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 2.0 Strict Level 1//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 2.0 Strict Level 2//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 2.0 Strict//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 2.0//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 2.1E//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 3.0//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 3.0//EN//</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 3.2 Final//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 3.2//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 3//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Level 0//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Level 0//EN//2.0</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Level 1//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Level 1//EN//2.0</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Level 2//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Level 2//EN//2.0</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Level 3//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Level 3//EN//3.0</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict Level 0//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict Level 0//EN//2.0</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict Level 1//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict Level 1//EN//2.0</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict Level 2//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict Level 2//EN//2.0</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict Level 3//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict Level 3//EN//3.0</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict//EN//2.0</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict//EN//3.0</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML//EN//2.0</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//IETF//DTD HTML//EN//3.0</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//Metrius//DTD Metrius Presentational//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD Internet Explorer 2.0 HTML Strict//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD Internet Explorer 2.0 HTML//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD Internet Explorer 2.0 Tables//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD Internet Explorer 3.0 HTML Strict//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD Internet Explorer 3.0 HTML//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//Microsoft//DTD Internet Explorer 3.0 Tables//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//Netscape Comm. Corp.//DTD HTML//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//Netscape Comm. Corp.//DTD Strict HTML//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//O'Reilly and Associates//DTD HTML 2.0//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//O'Reilly and Associates//DTD HTML Extended 1.0//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//O'Reilly and Associates//DTD HTML Extended Relaxed 1.0//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//SoftQuad Software//DTD HoTMetaL PRO 6.0::19990601::extensions to HTML 4.0//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//SoftQuad//DTD HoTMetaL PRO 4.0::19971010::extensions to HTML 4.0//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//Spyglass//DTD HTML 2.0 Extended//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//SQ//DTD HTML 2.0 HoTMetaL + extensions//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//Sun Microsystems Corp.//DTD HotJava HTML//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//Sun Microsystems Corp.//DTD HotJava Strict HTML//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML 3 1995-03-24//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML 3.2 Draft//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML 3.2 Final//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML 3.2//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML 3.2S Draft//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML 4.0 Frameset//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML 4.0 Transitional//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML Experimental 19960712//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD HTML Experimental 970421//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD W3 HTML//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//W3O//DTD W3 HTML 3.0//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//W3O//DTD W3 HTML 3.0//EN//</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//W3O//DTD W3 HTML Strict 3.0//EN//</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//WebTechs//DTD Mozilla HTML 2.0//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//WebTechs//DTD Mozilla HTML//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-/W3C/DTD HTML 4.0 Transitional/EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">HTML</code>" </li>
+     <li> The system identifier is set to: "<code title="">http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd</code>" </li>
+     <li> The system identifier is missing and the public identifier is set to: "<code title="">-//W3C//DTD HTML 4.01 Frameset//EN</code>" </li>
+     <li> The system identifier is missing and the public identifier is set to: "<code title="">-//W3C//DTD HTML 4.01 Transitional//EN</code>" </li>
+    </ul>
+
+    <p>Otherwise, if the DOCTYPE
+    token matches one of the conditions in the following list, then
+    set the document to <span>limited quirks mode</span>:</p>
+
+    <ul class="brief">
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD XHTML 1.0 Frameset//EN</code>" </li>
+     <li> The public identifier is set to: "<code title="">-//W3C//DTD XHTML 1.0 Transitional//EN</code>" </li>
+     <li> The system identifier is not missing and the public identifier is set to: "<code title="">-//W3C//DTD HTML 4.01 Frameset//EN</code>" </li>
+     <li> The system identifier is not missing and the public identifier is set to: "<code title="">-//W3C//DTD HTML 4.01 Transitional//EN</code>" </li>
+    </ul>
+
+    <p>The name, system identifier, and public identifier strings must
+    be compared to the values given in the lists above in a
+    case-insensitive<!-- ASCII --> manner.</p>
+
+    <p>Then, switch to <span>the root element phase</span> of the tree
+    construction stage.</p>
+
+   </dd>
+
+   <dt>A start tag token</dt>
+   <dt>An end tag token</dt>
+   <dt>A character token that is not one of one of U+0009 CHARACTER
+   TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
+   FORM FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
+   <dt>An end-of-file token</dt>
+   <dd>
+
+    <p><span>Parse error</span>.</p>
+
+    <p>Set the document to <span>quirks mode</span>.</p>
+
+    <p>Then, switch to <span>the root element phase</span> of the tree
+    construction stage and reprocess the current token.</p>
+
+   </dd>
+
+  </dl>
+
+
+  <h5><dfn>The root element phase</dfn></h5>
+
+  <p>After <span>the initial phase</span>, as each token is emitted
+  from the <span>tokenisation</span> stage, it must be processed as
+  described in this section.</p>
+
+  <dl class="switch">
+
+   <dt>A DOCTYPE token</dt>
+   <dd>
+    <p><span>Parse error</span>. Ignore the token.</p>
+   </dd>
+
+   <dt>A comment token</dt>
+   <dd>
+    <p>Append a <code>Comment</code> node to the <code>Document</code>
+    object with the <code title="">data</code> attribute set to the
+    data given in the comment token.</p>
+   </dd>
+
+   <dt>A character token that is one of one of U+0009 CHARACTER
+   TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
+   FORM FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020
+   SPACE</dt>
+   <dd>
+    <p>Ignore the token.</p>
+   </dd>
+
+   <dt>A character token that is <em>not</em> one of U+0009 CHARACTER
+   TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
+   FORM FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
+   <dt>A start tag token</dt>
+   <dt>An end tag token</dt>
+   <dt>An end-of-file token</dt>
+   <dd>
+
+    <p id="parser-appcache">If the token is a start tag token with the
+    tag name "html", and it has an attribute "manifest", then run
+    the <span title="concept-appcache-init-with-attribute">application
+    cache selection algorithm</span> with the value of that attribute
+    as the manifest URI. Otherwise, run the <span
+    title="concept-appcache-init-no-attribute">application cache
+    selection algorithm</span> with no manifest.</p>
+
+    <p>Create an <code>HTMLElement</code> node with the tag name
+    <code>html</code>, in the <span>HTML namespace</span>. Append it
+    to the <code>Document</code> object. Switch to <span>the main
+    phase</span> and reprocess the current token.</p>
+
+    <p class="big-issue">Should probably make end tags be ignored, so
+    that "</head><!-- --><html>" puts the comment before the
+    root node (or should we?)</p>
+
+   </dd>
+
+  </dl>
+
+  <p>The root element can end up being removed from the
+  <code>Document</code> object, e.g. by scripts; nothing in particular
+  happens in such cases, content continues being appended to the nodes
+  as described in the next section.</p>
+
+
+  <h5>The <dfn title="insertion mode: before head">before head</dfn> insertion mode</h5>
+
   <p>Handle the token as follows:</p>
 
   <dl class="switch">
@@ -38625,7 +38625,7 @@
   </dl>
 
 
-  <h6 id="parsing-main-inhead">The <dfn title="insertion mode: in head">in head</dfn> insertion mode</h6>
+  <h5 id="parsing-main-inhead">The <dfn title="insertion mode: in head">in head</dfn> insertion mode</h5>
 
   <p>Handle the token as follows.</p>
 
@@ -38889,7 +38889,7 @@
   </dl>
 
 
-  <h6 id="parsing-main-inheadnoscript">The <dfn title="insertion mode: in head noscript">in head noscript</dfn> insertion mode</h6>
+  <h5 id="parsing-main-inheadnoscript">The <dfn title="insertion mode: in head noscript">in head noscript</dfn> insertion mode</h5>
 
   <p>Handle the token as follows.</p>
 
@@ -38958,7 +38958,7 @@
   </dl>
 
 
-  <h6>The <dfn title="insertion mode: after head">after head</dfn> insertion mode</h6>
+  <h5>The <dfn title="insertion mode: after head">after head</dfn> insertion mode</h5>
 
   <p>Handle the token as follows:</p>
 
@@ -39050,7 +39050,7 @@
   </dl>
 
 
-  <h6 id="parsing-main-inbody">The <dfn title="insertion mode: in body">in body</dfn> insertion mode</h6>
+  <h5 id="parsing-main-inbody">The <dfn title="insertion mode: in body">in body</dfn> insertion mode</h5>
 
   <p>Handle the token as follows:</p>
 
@@ -40087,7 +40087,7 @@
   </dl>
 
 
-  <h6 id="parsing-main-intable">The <dfn title="insertion mode: in table">in table</dfn> insertion mode</h6>
+  <h5 id="parsing-main-intable">The <dfn title="insertion mode: in table">in table</dfn> insertion mode</h5>
 
   <dl class="switch">
 
@@ -40275,7 +40275,7 @@
   case</span>.</p>
 
 
-  <h6 id="parsing-main-incaption">The <dfn title="insertion mode: in caption">in caption</dfn> insertion mode</h6>
+  <h5 id="parsing-main-incaption">The <dfn title="insertion mode: in caption">in caption</dfn> insertion mode</h5>
 
   <p>Handle the token as follows.</p>
 
@@ -40339,7 +40339,7 @@
   </dl>
 
 
-  <h6 id="parsing-main-incolgroup">The <dfn title="insertion mode: in column group">in column group</dfn> insertion mode</h6>
+  <h5 id="parsing-main-incolgroup">The <dfn title="insertion mode: in column group">in column group</dfn> insertion mode</h5>
 
   <p>Handle the token as follows.</p>
 
@@ -40421,7 +40421,7 @@
   </dl>
 
 
-  <h6 id="parsing-main-intbody">The <dfn title="insertion mode: in table body">in table body</dfn> insertion mode</h6>
+  <h5 id="parsing-main-intbody">The <dfn title="insertion mode: in table body">in table body</dfn> insertion mode</h5>
 
   <p>Handle the token as follows.</p>
 
@@ -40518,7 +40518,7 @@
   case</span>.</p>
 
 
-  <h6 id="parsing-main-intr">The <dfn title="insertion mode: in row">in row</dfn> insertion mode</h6>
+  <h5 id="parsing-main-intr">The <dfn title="insertion mode: in row">in row</dfn> insertion mode</h5>
 
   <p>Handle the token as follows.</p>
 
@@ -40617,7 +40617,7 @@
   case</span>.</p>
 
 
-  <h6 id="parsing-main-intd">The <dfn title="insertion mode: in cell">in cell</dfn> insertion mode</h6>
+  <h5 id="parsing-main-intd">The <dfn title="insertion mode: in cell">in cell</dfn> insertion mode</h5>
 
   <p>Handle the token as follows.</p>
 
@@ -40724,7 +40724,7 @@
   cell</span>".</p>
 
 
-  <h6 id="parsing-main-inselect">The <dfn title="insertion mode: in select">in select</dfn> insertion mode</h6>
+  <h5 id="parsing-main-inselect">The <dfn title="insertion mode: in select">in select</dfn> insertion mode</h5>
 
   <p>Handle the token as follows:</p>
 
@@ -40861,7 +40861,7 @@
   </dl>
 
 
-  <h6 id="parsing-main-afterbody">The <dfn title="insertion mode: after body">after body</dfn> insertion mode</h6>
+  <h5 id="parsing-main-afterbody">The <dfn title="insertion mode: after body">after body</dfn> insertion mode</h5>
 
   <p>Handle the token as follows:</p>
 
@@ -40928,7 +40928,7 @@
   </dl>
 
 
-  <h6 id="parsing-main-inframeset">The <dfn title="insertion mode: in frameset">in frameset</dfn> insertion mode</h6>
+  <h5 id="parsing-main-inframeset">The <dfn title="insertion mode: in frameset">in frameset</dfn> insertion mode</h5>
 
   <p>Handle the token as follows:</p>
 
@@ -41015,7 +41015,7 @@
   </dl>
 
 
-  <h6 id="parsing-main-afterframeset">The <dfn title="insertion mode: after frameset">after frameset</dfn> insertion mode</h6>
+  <h5 id="parsing-main-afterframeset">The <dfn title="insertion mode: after frameset">after frameset</dfn> insertion mode</h5>
 
   <p>Handle the token as follows:</p>
 




More information about the Commit-Watchers mailing list