[html5] r1790 - /

whatwg at whatwg.org whatwg at whatwg.org
Thu Jun 19 02:27:29 PDT 2008


Author: ianh
Date: 2008-06-19 02:27:25 -0700 (Thu, 19 Jun 2008)
New Revision: 1790

Modified:
   index
   source
Log:
[e] (0) Giant reorg to move things to more appropriate places so that there's a logical place for a URLs section. Please let me know what you think.

Modified: index
===================================================================
--- index	2008-06-18 23:31:17 UTC (rev 1789)
+++ index	2008-06-19 09:27:25 UTC (rev 1790)
@@ -25,7 +25,7 @@
 
    <h1 id=html-5>HTML 5</h1>
 
-   <h2 class="no-num no-toc" id=draft>Draft Recommendation — 18 June
+   <h2 class="no-num no-toc" id=draft>Draft Recommendation — 19 June
     2008</h2>
 
    <p>You can take part in this work. <a
@@ -159,1684 +159,1694 @@
   <ul class=toc>
    <li><a href="#introduction"><span class=secno>1. </span>Introduction</a>
     <ul class=toc>
-     <li><a href="#scope"><span class=secno>1.1 </span>Scope</a>
+     <li><a href="#background"><span class=secno>1.1 </span>Background</a>
+
+     <li><a href="#scope"><span class=secno>1.2 </span>Scope</a>
+
+     <li><a href="#relationships"><span class=secno>1.3 </span>Relationships
+      to other specifications</a>
       <ul class=toc>
-       <li><a href="#relationship"><span class=secno>1.1.1
+       <li><a href="#relationship"><span class=secno>1.3.1
         </span>Relationship to HTML 4.01 and DOM2 HTML</a>
 
-       <li><a href="#relationship0"><span class=secno>1.1.2
+       <li><a href="#relationship0"><span class=secno>1.3.2
         </span>Relationship to XHTML 1.x</a>
 
-       <li><a href="#relationship1"><span class=secno>1.1.3
+       <li><a href="#relationship1"><span class=secno>1.3.3
         </span>Relationship to XHTML2</a>
 
-       <li><a href="#relationship2"><span class=secno>1.1.4
+       <li><a href="#relationship2"><span class=secno>1.3.4
         </span>Relationship to Web Forms 2.0 and XForms</a>
 
-       <li><a href="#relationship3"><span class=secno>1.1.5
+       <li><a href="#relationship3"><span class=secno>1.3.5
         </span>Relationship to XUL, Flash, Silverlight, and other proprietary
         UI languages</a>
       </ul>
 
-     <li><a href="#structure"><span class=secno>1.2 </span>Structure of this
+     <li><a href="#html-vs"><span class=secno>1.4 </span>HTML vs XHTML</a>
+
+     <li><a href="#structure"><span class=secno>1.5 </span>Structure of this
       specification</a>
       <ul class=toc>
-       <li><a href="#how-to"><span class=secno>1.2.1 </span>How to read this
+       <li><a href="#how-to"><span class=secno>1.5.1 </span>How to read this
         specification</a>
       </ul>
+    </ul>
 
-     <li><a href="#conformance"><span class=secno>1.3 </span>Conformance
+   <li><a href="#infrastructure"><span class=secno>2. </span>Common
+    infrastructure</a>
+    <ul class=toc>
+     <li><a href="#conformance"><span class=secno>2.1 </span>Conformance
       requirements</a>
       <ul class=toc>
-       <li><a href="#common"><span class=secno>1.3.1 </span>Common
-        conformance requirements for APIs exposed to JavaScript</a>
-
-       <li><a href="#dependencies"><span class=secno>1.3.2
+       <li><a href="#dependencies"><span class=secno>2.1.1
         </span>Dependencies</a>
 
-       <li><a href="#features"><span class=secno>1.3.3 </span>Features
+       <li><a href="#features"><span class=secno>2.1.2 </span>Features
         defined in other specifications</a>
+
+       <li><a href="#common"><span class=secno>2.1.3 </span>Common
+        conformance requirements for APIs exposed to JavaScript</a>
       </ul>
 
-     <li><a href="#terminology"><span class=secno>1.4 </span>Terminology</a>
+     <li><a href="#terminology"><span class=secno>2.2 </span>Terminology</a>
+
+     <li><a href="#urls"><span class=secno>2.3 </span>URLs</a>
       <ul class=toc>
-       <li><a href="#html-vs"><span class=secno>1.4.1 </span>HTML vs
-        XHTML</a>
+       <li><a href="#interfaces"><span class=secno>2.3.1 </span>Interfaces
+        for URI manipulation</a>
       </ul>
-    </ul>
 
-   <li><a href="#dom"><span class=secno>2. </span>The Document Object
-    Model</a>
-    <ul class=toc>
-     <li><a href="#documents"><span class=secno>2.1 </span>Documents</a>
+     <li><a href="#common0"><span class=secno>2.4 </span>Common
+      microsyntaxes</a>
       <ul class=toc>
-       <li><a href="#security"><span class=secno>2.1.1 </span>Security</a>
+       <li><a href="#common1"><span class=secno>2.4.1 </span>Common parser
+        idioms</a>
 
-       <li><a href="#resource"><span class=secno>2.1.2 </span>Resource
-        metadata management</a>
+       <li><a href="#boolean"><span class=secno>2.4.2 </span>Boolean
+        attributes</a>
+
+       <li><a href="#numbers"><span class=secno>2.4.3 </span>Numbers</a>
+        <ul class=toc>
+         <li><a href="#unsigned"><span class=secno>2.4.3.1. </span>Unsigned
+          integers</a>
+
+         <li><a href="#signed"><span class=secno>2.4.3.2. </span>Signed
+          integers</a>
+
+         <li><a href="#real-numbers"><span class=secno>2.4.3.3. </span>Real
+          numbers</a>
+
+         <li><a href="#ratios"><span class=secno>2.4.3.4. </span>Ratios</a>
+
+         <li><a href="#percentages-and-dimensions"><span class=secno>2.4.3.5.
+          </span>Percentages and dimensions</a>
+
+         <li><a href="#lists"><span class=secno>2.4.3.6. </span>Lists of
+          integers</a>
+        </ul>
+
+       <li><a href="#dates"><span class=secno>2.4.4 </span>Dates and
+        times</a>
+        <ul class=toc>
+         <li><a href="#specific"><span class=secno>2.4.4.1. </span>Specific
+          moments in time</a>
+
+         <li><a href="#vaguer"><span class=secno>2.4.4.2. </span>Vaguer
+          moments in time</a>
+        </ul>
+
+       <li><a href="#time-offsets"><span class=secno>2.4.5 </span>Time
+        offsets</a>
+
+       <li><a href="#tokens"><span class=secno>2.4.6 </span>Tokens</a>
+
+       <li><a href="#keywords"><span class=secno>2.4.7 </span>Keywords and
+        enumerated attributes</a>
+
+       <li><a href="#syntax-references"><span class=secno>2.4.8
+        </span>References</a>
       </ul>
 
-     <li><a href="#elements"><span class=secno>2.2 </span>Elements</a>
+     <li><a href="#common2"><span class=secno>2.5 </span>Common DOM
+      interfaces</a>
       <ul class=toc>
-       <li><a href="#reflecting"><span class=secno>2.2.1 </span>Reflecting
+       <li><a href="#reflecting"><span class=secno>2.5.1 </span>Reflecting
         content attributes in DOM attributes</a>
-      </ul>
 
-     <li><a href="#common0"><span class=secno>2.3 </span>Common DOM
-      interfaces</a>
-      <ul class=toc>
-       <li><a href="#collections"><span class=secno>2.3.1
+       <li><a href="#collections"><span class=secno>2.5.2
         </span>Collections</a>
         <ul class=toc>
-         <li><a href="#htmlcollection"><span class=secno>2.3.1.1.
+         <li><a href="#htmlcollection"><span class=secno>2.5.2.1.
           </span>HTMLCollection</a>
 
-         <li><a href="#htmlformcontrolscollection"><span class=secno>2.3.1.2.
+         <li><a href="#htmlformcontrolscollection"><span class=secno>2.5.2.2.
           </span>HTMLFormControlsCollection</a>
 
-         <li><a href="#htmloptionscollection"><span class=secno>2.3.1.3.
+         <li><a href="#htmloptionscollection"><span class=secno>2.5.2.3.
           </span>HTMLOptionsCollection</a>
         </ul>
 
-       <li><a href="#domtokenlist"><span class=secno>2.3.2
+       <li><a href="#domtokenlist"><span class=secno>2.5.3
         </span>DOMTokenList</a>
 
-       <li><a href="#domstringmap"><span class=secno>2.3.3
+       <li><a href="#domstringmap"><span class=secno>2.5.4
         </span>DOMStringMap</a>
 
-       <li><a href="#dom-feature"><span class=secno>2.3.4 </span>DOM feature
+       <li><a href="#dom-feature"><span class=secno>2.5.5 </span>DOM feature
         strings</a>
       </ul>
 
-     <li><a href="#dom-tree"><span class=secno>2.4 </span>DOM tree
-      accessors</a>
-
-     <li><a href="#dynamic"><span class=secno>2.5 </span>Dynamic markup
-      insertion</a>
+     <li><a href="#content-type-sniffing"><span class=secno>2.6
+      </span>Determining the type of a resource</a>
       <ul class=toc>
-       <li><a href="#controlling"><span class=secno>2.5.1 </span>Controlling
-        the input stream</a>
+       <li><a href="#content-type"><span class=secno>2.6.1
+        </span>Content-Type metadata</a>
 
-       <li><a href="#dynamic0"><span class=secno>2.5.2 </span>Dynamic markup
-        insertion in HTML</a>
+       <li><a href="#content-type0"><span class=secno>2.6.2
+        </span>Content-Type sniffing: Web pages</a>
 
-       <li><a href="#dynamic1"><span class=secno>2.5.3 </span>Dynamic markup
-        insertion in XML</a>
+       <li><a href="#content-type1"><span class=secno>2.6.3
+        </span>Content-Type sniffing: text or binary</a>
+
+       <li><a href="#content-type2"><span class=secno>2.6.4
+        </span>Content-Type sniffing: unknown type</a>
+
+       <li><a href="#content-type3"><span class=secno>2.6.5
+        </span>Content-Type sniffing: image</a>
+
+       <li><a href="#content-type4"><span class=secno>2.6.6
+        </span>Content-Type sniffing: feed or HTML</a>
       </ul>
-
-     <li><a href="#apis-in"><span class=secno>2.6 </span>APIs in HTML
-      documents</a>
     </ul>
 
-   <li><a href="#semantics"><span class=secno>3. </span>Semantics and
-    structure of HTML elements</a>
+   <li><a href="#dom"><span class=secno>3. </span>Semantics and structure of
+    HTML documents</a>
     <ul class=toc>
      <li><a href="#semantics-intro"><span class=secno>3.1
       </span>Introduction</a>
 
-     <li><a href="#common1"><span class=secno>3.2 </span>Common
-      microsyntaxes</a>
+     <li><a href="#documents"><span class=secno>3.2 </span>Documents</a>
       <ul class=toc>
-       <li><a href="#common2"><span class=secno>3.2.1 </span>Common parser
-        idioms</a>
+       <li><a href="#documents0"><span class=secno>3.2.1 </span>Documents in
+        the DOM</a>
 
-       <li><a href="#boolean"><span class=secno>3.2.2 </span>Boolean
-        attributes</a>
+       <li><a href="#security"><span class=secno>3.2.2 </span>Security</a>
 
-       <li><a href="#numbers"><span class=secno>3.2.3 </span>Numbers</a>
-        <ul class=toc>
-         <li><a href="#unsigned"><span class=secno>3.2.3.1. </span>Unsigned
-          integers</a>
+       <li><a href="#resource"><span class=secno>3.2.3 </span>Resource
+        metadata management</a>
 
-         <li><a href="#signed"><span class=secno>3.2.3.2. </span>Signed
-          integers</a>
+       <li><a href="#dom-tree"><span class=secno>3.2.4 </span>DOM tree
+        accessors</a>
+      </ul>
 
-         <li><a href="#real-numbers"><span class=secno>3.2.3.3. </span>Real
-          numbers</a>
+     <li><a href="#elements"><span class=secno>3.3 </span>Elements</a>
+      <ul class=toc>
+       <li><a href="#semantics0"><span class=secno>3.3.1 </span>Semantics</a>
+        
 
-         <li><a href="#ratios"><span class=secno>3.2.3.4. </span>Ratios</a>
+       <li><a href="#elements0"><span class=secno>3.3.2 </span>Elements in
+        the DOM</a>
 
-         <li><a href="#percentages-and-dimensions"><span class=secno>3.2.3.5.
-          </span>Percentages and dimensions</a>
+       <li><a href="#global"><span class=secno>3.3.3 </span>Global
+        attributes</a>
+        <ul class=toc>
+         <li><a href="#the-id"><span class=secno>3.3.3.1. </span>The
+          <code>id</code> attribute</a>
 
-         <li><a href="#lists"><span class=secno>3.2.3.6. </span>Lists of
-          integers</a>
-        </ul>
+         <li><a href="#the-title"><span class=secno>3.3.3.2. </span>The
+          <code>title</code> attribute</a>
 
-       <li><a href="#dates"><span class=secno>3.2.4 </span>Dates and
-        times</a>
-        <ul class=toc>
-         <li><a href="#specific"><span class=secno>3.2.4.1. </span>Specific
-          moments in time</a>
+         <li><a href="#the-lang"><span class=secno>3.3.3.3. </span>The
+          <code>lang</code> (HTML only) and <code>xml:lang</code> (XML only)
+          attributes</a>
 
-         <li><a href="#vaguer"><span class=secno>3.2.4.2. </span>Vaguer
-          moments in time</a>
-        </ul>
+         <li><a href="#the-xmlbase"><span class=secno>3.3.3.4. </span>The
+          <code>xml:base</code> attribute (XML only)</a>
 
-       <li><a href="#time-offsets"><span class=secno>3.2.5 </span>Time
-        offsets</a>
+         <li><a href="#the-dir"><span class=secno>3.3.3.5. </span>The
+          <code>dir</code> attribute</a>
 
-       <li><a href="#tokens"><span class=secno>3.2.6 </span>Tokens</a>
+         <li><a href="#classes"><span class=secno>3.3.3.6. </span>The
+          <code>class</code> attribute</a>
 
-       <li><a href="#keywords"><span class=secno>3.2.7 </span>Keywords and
-        enumerated attributes</a>
+         <li><a href="#the-style"><span class=secno>3.3.3.7. </span>The
+          <code>style</code> attribute</a>
 
-       <li><a href="#syntax-references"><span class=secno>3.2.8
-        </span>References</a>
-
-       <li><a href="#urls"><span class=secno>3.2.9 </span>URLs</a>
+         <li><a href="#embedding"><span class=secno>3.3.3.8. </span>Embedding
+          custom non-visible data</a>
+        </ul>
       </ul>
 
-     <li><a href="#documents0"><span class=secno>3.3 </span>Documents and
-      document fragments</a>
+     <li><a href="#content"><span class=secno>3.4 </span>Content models</a>
       <ul class=toc>
-       <li><a href="#semantics0"><span class=secno>3.3.1 </span>Semantics</a>
-        
-
-       <li><a href="#structure0"><span class=secno>3.3.2 </span>Structure</a>
-        
-
-       <li><a href="#kinds"><span class=secno>3.3.3 </span>Kinds of
+       <li><a href="#kinds"><span class=secno>3.4.1 </span>Kinds of
         content</a>
         <ul class=toc>
-         <li><a href="#metadata"><span class=secno>3.3.3.1. </span>Metadata
+         <li><a href="#metadata"><span class=secno>3.4.1.1. </span>Metadata
           content</a>
 
-         <li><a href="#flow-content"><span class=secno>3.3.3.2. </span>Flow
+         <li><a href="#flow-content"><span class=secno>3.4.1.2. </span>Flow
           content</a>
 
-         <li><a href="#sectioning"><span class=secno>3.3.3.3.
+         <li><a href="#sectioning"><span class=secno>3.4.1.3.
           </span>Sectioning content</a>
 
-         <li><a href="#heading"><span class=secno>3.3.3.4. </span>Heading
+         <li><a href="#heading"><span class=secno>3.4.1.4. </span>Heading
           content</a>
 
-         <li><a href="#phrasing"><span class=secno>3.3.3.5. </span>Phrasing
+         <li><a href="#phrasing"><span class=secno>3.4.1.5. </span>Phrasing
           content</a>
 
-         <li><a href="#embedded"><span class=secno>3.3.3.6. </span>Embedded
+         <li><a href="#embedded"><span class=secno>3.4.1.6. </span>Embedded
           content</a>
 
-         <li><a href="#interactive0"><span class=secno>3.3.3.7.
+         <li><a href="#interactive0"><span class=secno>3.4.1.7.
           </span>Interactive content</a>
         </ul>
 
-       <li><a href="#transparent"><span class=secno>3.3.4 </span>Transparent
+       <li><a href="#transparent"><span class=secno>3.4.2 </span>Transparent
         content models</a>
-
-       <li><a href="#paragraphs"><span class=secno>3.3.5
-        </span>Paragraphs</a>
       </ul>
 
-     <li><a href="#global"><span class=secno>3.4 </span>Global attributes</a>
-      
-      <ul class=toc>
-       <li><a href="#the-id"><span class=secno>3.4.1 </span>The
-        <code>id</code> attribute</a>
+     <li><a href="#paragraphs"><span class=secno>3.5 </span>Paragraphs</a>
 
-       <li><a href="#the-title"><span class=secno>3.4.2 </span>The
-        <code>title</code> attribute</a>
+     <li><a href="#apis-in"><span class=secno>3.6 </span>APIs in HTML
+      documents</a>
 
-       <li><a href="#the-lang"><span class=secno>3.4.3 </span>The
-        <code>lang</code> (HTML only) and <code>xml:lang</code> (XML only)
-        attributes</a>
+     <li><a href="#dynamic"><span class=secno>3.7 </span>Dynamic markup
+      insertion</a>
+      <ul class=toc>
+       <li><a href="#controlling"><span class=secno>3.7.1 </span>Controlling
+        the input stream</a>
 
-       <li><a href="#the-xmlbase"><span class=secno>3.4.4 </span>The
-        <code>xml:base</code> attribute (XML only)</a>
+       <li><a href="#dynamic0"><span class=secno>3.7.2 </span>Dynamic markup
+        insertion in HTML</a>
 
-       <li><a href="#the-dir"><span class=secno>3.4.5 </span>The
-        <code>dir</code> attribute</a>
-
-       <li><a href="#classes"><span class=secno>3.4.6 </span>The
-        <code>class</code> attribute</a>
-
-       <li><a href="#the-style"><span class=secno>3.4.7 </span>The
-        <code>style</code> attribute</a>
-
-       <li><a href="#embedding"><span class=secno>3.4.8 </span>Embedding
-        custom non-visible data</a>
+       <li><a href="#dynamic1"><span class=secno>3.7.3 </span>Dynamic markup
+        insertion in XML</a>
       </ul>
+    </ul>
 
-     <li><a href="#the-root"><span class=secno>3.5 </span>The root
+   <li><a href="#semantics"><span class=secno>4. </span>The elements of
+    HTML</a>
+    <ul class=toc>
+     <li><a href="#the-root"><span class=secno>4.1 </span>The root
       element</a>
       <ul class=toc>
-       <li><a href="#the-html"><span class=secno>3.5.1 </span>The
+       <li><a href="#the-html"><span class=secno>4.1.1 </span>The
         <code>html</code> element</a>
       </ul>
 
-     <li><a href="#document"><span class=secno>3.6 </span>Document
+     <li><a href="#document"><span class=secno>4.2 </span>Document
       metadata</a>
       <ul class=toc>
-       <li><a href="#the-head"><span class=secno>3.6.1 </span>The
+       <li><a href="#the-head"><span class=secno>4.2.1 </span>The
         <code>head</code> element</a>
 
-       <li><a href="#the-title0"><span class=secno>3.6.2 </span>The
+       <li><a href="#the-title0"><span class=secno>4.2.2 </span>The
         <code>title</code> element</a>
 
-       <li><a href="#the-base"><span class=secno>3.6.3 </span>The
+       <li><a href="#the-base"><span class=secno>4.2.3 </span>The
         <code>base</code> element</a>
 
-       <li><a href="#the-link"><span class=secno>3.6.4 </span>The
+       <li><a href="#the-link"><span class=secno>4.2.4 </span>The
         <code>link</code> element</a>
 
-       <li><a href="#meta"><span class=secno>3.6.5 </span>The
+       <li><a href="#meta"><span class=secno>4.2.5 </span>The
         <code>meta</code> element</a>
         <ul class=toc>
-         <li><a href="#standard"><span class=secno>3.6.5.1. </span>Standard
+         <li><a href="#standard"><span class=secno>4.2.5.1. </span>Standard
           metadata names</a>
 
-         <li><a href="#other"><span class=secno>3.6.5.2. </span>Other
+         <li><a href="#other"><span class=secno>4.2.5.2. </span>Other
           metadata names</a>
 
-         <li><a href="#pragma"><span class=secno>3.6.5.3. </span>Pragma
+         <li><a href="#pragma"><span class=secno>4.2.5.3. </span>Pragma
           directives</a>
 
-         <li><a href="#charset"><span class=secno>3.6.5.4. </span>Specifying
+         <li><a href="#charset"><span class=secno>4.2.5.4. </span>Specifying
           the document's character encoding</a>
         </ul>
 
-       <li><a href="#the-style0"><span class=secno>3.6.6 </span>The
+       <li><a href="#the-style0"><span class=secno>4.2.6 </span>The
         <code>style</code> element</a>
 
-       <li><a href="#styling"><span class=secno>3.6.7 </span>Styling</a>
+       <li><a href="#styling"><span class=secno>4.2.7 </span>Styling</a>
       </ul>
 
-     <li><a href="#sections"><span class=secno>3.7 </span>Sections</a>
+     <li><a href="#sections"><span class=secno>4.3 </span>Sections</a>
       <ul class=toc>
-       <li><a href="#the-body"><span class=secno>3.7.1 </span>The
+       <li><a href="#the-body"><span class=secno>4.3.1 </span>The
         <code>body</code> element</a>
 
-       <li><a href="#the-section"><span class=secno>3.7.2 </span>The
+       <li><a href="#the-section"><span class=secno>4.3.2 </span>The
         <code>section</code> element</a>
 
-       <li><a href="#the-nav"><span class=secno>3.7.3 </span>The
+       <li><a href="#the-nav"><span class=secno>4.3.3 </span>The
         <code>nav</code> element</a>
 
-       <li><a href="#the-article"><span class=secno>3.7.4 </span>The
+       <li><a href="#the-article"><span class=secno>4.3.4 </span>The
         <code>article</code> element</a>
 
-       <li><a href="#the-aside"><span class=secno>3.7.5 </span>The
+       <li><a href="#the-aside"><span class=secno>4.3.5 </span>The
         <code>aside</code> element</a>
 
-       <li><a href="#the-h1"><span class=secno>3.7.6 </span>The
+       <li><a href="#the-h1"><span class=secno>4.3.6 </span>The
         <code>h1</code>, <code>h2</code>, <code>h3</code>, <code>h4</code>,
         <code>h5</code>, and <code>h6</code> elements</a>
 
-       <li><a href="#the-header"><span class=secno>3.7.7 </span>The
+       <li><a href="#the-header"><span class=secno>4.3.7 </span>The
         <code>header</code> element</a>
 
-       <li><a href="#the-footer"><span class=secno>3.7.8 </span>The
+       <li><a href="#the-footer"><span class=secno>4.3.8 </span>The
         <code>footer</code> element</a>
 
-       <li><a href="#the-address"><span class=secno>3.7.9 </span>The
+       <li><a href="#the-address"><span class=secno>4.3.9 </span>The
         <code>address</code> element</a>
 
-       <li><a href="#headings"><span class=secno>3.7.10 </span>Headings and
+       <li><a href="#headings"><span class=secno>4.3.10 </span>Headings and
         sections</a>
         <ul class=toc>
-         <li><a href="#outlines"><span class=secno>3.7.10.1. </span>Creating
+         <li><a href="#outlines"><span class=secno>4.3.10.1. </span>Creating
           an outline</a>
 
-         <li><a href="#distinguishing"><span class=secno>3.7.10.2.
+         <li><a href="#distinguishing"><span class=secno>4.3.10.2.
           </span>Distinguishing site-wide headings from page headings</a>
         </ul>
       </ul>
 
-     <li><a href="#grouping"><span class=secno>3.8 </span>Grouping
+     <li><a href="#grouping"><span class=secno>4.4 </span>Grouping
       content</a>
       <ul class=toc>
-       <li><a href="#the-p"><span class=secno>3.8.1 </span>The <code>p</code>
+       <li><a href="#the-p"><span class=secno>4.4.1 </span>The <code>p</code>
         element</a>
 
-       <li><a href="#the-hr"><span class=secno>3.8.2 </span>The
+       <li><a href="#the-hr"><span class=secno>4.4.2 </span>The
         <code>hr</code> element</a>
 
-       <li><a href="#the-br"><span class=secno>3.8.3 </span>The
+       <li><a href="#the-br"><span class=secno>4.4.3 </span>The
         <code>br</code> element</a>
 
-       <li><a href="#the-pre"><span class=secno>3.8.4 </span>The
+       <li><a href="#the-pre"><span class=secno>4.4.4 </span>The
         <code>pre</code> element</a>
 
-       <li><a href="#the-dialog"><span class=secno>3.8.5 </span>The
+       <li><a href="#the-dialog"><span class=secno>4.4.5 </span>The
         <code>dialog</code> element</a>
 
-       <li><a href="#the-blockquote"><span class=secno>3.8.6 </span>The
+       <li><a href="#the-blockquote"><span class=secno>4.4.6 </span>The
         <code>blockquote</code> element</a>
 
-       <li><a href="#the-ol"><span class=secno>3.8.7 </span>The
+       <li><a href="#the-ol"><span class=secno>4.4.7 </span>The
         <code>ol</code> element</a>
 
-       <li><a href="#the-ul"><span class=secno>3.8.8 </span>The
+       <li><a href="#the-ul"><span class=secno>4.4.8 </span>The
         <code>ul</code> element</a>
 
-       <li><a href="#the-li"><span class=secno>3.8.9 </span>The
+       <li><a href="#the-li"><span class=secno>4.4.9 </span>The
         <code>li</code> element</a>
 
-       <li><a href="#the-dl"><span class=secno>3.8.10 </span>The
+       <li><a href="#the-dl"><span class=secno>4.4.10 </span>The
         <code>dl</code> element</a>
 
-       <li><a href="#the-dt"><span class=secno>3.8.11 </span>The
+       <li><a href="#the-dt"><span class=secno>4.4.11 </span>The
         <code>dt</code> element</a>
 
-       <li><a href="#the-dd"><span class=secno>3.8.12 </span>The
+       <li><a href="#the-dd"><span class=secno>4.4.12 </span>The
         <code>dd</code> element</a>
       </ul>
 
-     <li><a href="#text-level"><span class=secno>3.9 </span>Text-level
+     <li><a href="#text-level"><span class=secno>4.5 </span>Text-level
       semantics</a>
       <ul class=toc>
-       <li><a href="#the-a"><span class=secno>3.9.1 </span>The <code>a</code>
+       <li><a href="#the-a"><span class=secno>4.5.1 </span>The <code>a</code>
         element</a>
 
-       <li><a href="#the-q"><span class=secno>3.9.2 </span>The <code>q</code>
+       <li><a href="#the-q"><span class=secno>4.5.2 </span>The <code>q</code>
         element</a>
 
-       <li><a href="#the-cite"><span class=secno>3.9.3 </span>The
+       <li><a href="#the-cite"><span class=secno>4.5.3 </span>The
         <code>cite</code> element</a>
 
-       <li><a href="#the-em"><span class=secno>3.9.4 </span>The
+       <li><a href="#the-em"><span class=secno>4.5.4 </span>The
         <code>em</code> element</a>
 
-       <li><a href="#the-strong"><span class=secno>3.9.5 </span>The
+       <li><a href="#the-strong"><span class=secno>4.5.5 </span>The
         <code>strong</code> element</a>
 
-       <li><a href="#the-small"><span class=secno>3.9.6 </span>The
+       <li><a href="#the-small"><span class=secno>4.5.6 </span>The
         <code>small</code> element</a>
 
-       <li><a href="#the-mark"><span class=secno>3.9.7 </span>The
+       <li><a href="#the-mark"><span class=secno>4.5.7 </span>The
         <code>mark</code> element</a>
 
-       <li><a href="#the-dfn"><span class=secno>3.9.8 </span>The
+       <li><a href="#the-dfn"><span class=secno>4.5.8 </span>The
         <code>dfn</code> element</a>
 
-       <li><a href="#the-abbr"><span class=secno>3.9.9 </span>The
+       <li><a href="#the-abbr"><span class=secno>4.5.9 </span>The
         <code>abbr</code> element</a>
 
-       <li><a href="#the-time"><span class=secno>3.9.10 </span>The
+       <li><a href="#the-time"><span class=secno>4.5.10 </span>The
         <code>time</code> element</a>
 
-       <li><a href="#the-progress"><span class=secno>3.9.11 </span>The
+       <li><a href="#the-progress"><span class=secno>4.5.11 </span>The
         <code>progress</code> element</a>
 
-       <li><a href="#the-meter"><span class=secno>3.9.12 </span>The
+       <li><a href="#the-meter"><span class=secno>4.5.12 </span>The
         <code>meter</code> element</a>
 
-       <li><a href="#the-code"><span class=secno>3.9.13 </span>The
+       <li><a href="#the-code"><span class=secno>4.5.13 </span>The
         <code>code</code> element</a>
 
-       <li><a href="#the-var"><span class=secno>3.9.14 </span>The
+       <li><a href="#the-var"><span class=secno>4.5.14 </span>The
         <code>var</code> element</a>
 
-       <li><a href="#the-samp"><span class=secno>3.9.15 </span>The
+       <li><a href="#the-samp"><span class=secno>4.5.15 </span>The
         <code>samp</code> element</a>
 
-       <li><a href="#the-kbd"><span class=secno>3.9.16 </span>The
+       <li><a href="#the-kbd"><span class=secno>4.5.16 </span>The
         <code>kbd</code> element</a>
 
-       <li><a href="#the-sub"><span class=secno>3.9.17 </span>The
+       <li><a href="#the-sub"><span class=secno>4.5.17 </span>The
         <code>sub</code> and <code>sup</code> elements</a>
 
-       <li><a href="#the-span"><span class=secno>3.9.18 </span>The
+       <li><a href="#the-span"><span class=secno>4.5.18 </span>The
         <code>span</code> element</a>
 
-       <li><a href="#the-i"><span class=secno>3.9.19 </span>The
+       <li><a href="#the-i"><span class=secno>4.5.19 </span>The
         <code>i</code> element</a>
 
-       <li><a href="#the-b"><span class=secno>3.9.20 </span>The
+       <li><a href="#the-b"><span class=secno>4.5.20 </span>The
         <code>b</code> element</a>
 
-       <li><a href="#the-bdo"><span class=secno>3.9.21 </span>The
+       <li><a href="#the-bdo"><span class=secno>4.5.21 </span>The
         <code>bdo</code> element</a>
 
-       <li><a href="#the-ruby"><span class=secno>3.9.22 </span>The
+       <li><a href="#the-ruby"><span class=secno>4.5.22 </span>The
         <code>ruby</code> element</a>
 
-       <li><a href="#the-rt"><span class=secno>3.9.23 </span>The
+       <li><a href="#the-rt"><span class=secno>4.5.23 </span>The
         <code>rt</code> element</a>
 
-       <li><a href="#the-rp"><span class=secno>3.9.24 </span>The
+       <li><a href="#the-rp"><span class=secno>4.5.24 </span>The
         <code>rp</code> element</a>
 
-       <li><a href="#usage"><span class=secno>3.9.25 </span>Usage summary</a>
+       <li><a href="#usage"><span class=secno>4.5.25 </span>Usage summary</a>
         
 
-       <li><a href="#footnotes"><span class=secno>3.9.26 </span>Footnotes</a>
+       <li><a href="#footnotes"><span class=secno>4.5.26 </span>Footnotes</a>
         
       </ul>
 
-     <li><a href="#edits"><span class=secno>3.10 </span>Edits</a>
+     <li><a href="#edits"><span class=secno>4.6 </span>Edits</a>
       <ul class=toc>
-       <li><a href="#the-ins"><span class=secno>3.10.1 </span>The
+       <li><a href="#the-ins"><span class=secno>4.6.1 </span>The
         <code>ins</code> element</a>
 
-       <li><a href="#the-del"><span class=secno>3.10.2 </span>The
+       <li><a href="#the-del"><span class=secno>4.6.2 </span>The
         <code>del</code> element</a>
 
-       <li><a href="#attributes"><span class=secno>3.10.3 </span>Attributes
+       <li><a href="#attributes"><span class=secno>4.6.3 </span>Attributes
         common to <code>ins</code> and <code>del</code> elements</a>
 
-       <li><a href="#edits0"><span class=secno>3.10.4 </span>Edits and
+       <li><a href="#edits0"><span class=secno>4.6.4 </span>Edits and
         paragraphs</a>
 
-       <li><a href="#edits1"><span class=secno>3.10.5 </span>Edits and
+       <li><a href="#edits1"><span class=secno>4.6.5 </span>Edits and
         lists</a>
       </ul>
 
-     <li><a href="#embedded0"><span class=secno>3.11 </span>Embedded
+     <li><a href="#embedded0"><span class=secno>4.7 </span>Embedded
       content</a>
       <ul class=toc>
-       <li><a href="#the-figure"><span class=secno>3.11.1 </span>The
+       <li><a href="#the-figure"><span class=secno>4.7.1 </span>The
         <code>figure</code> element</a>
 
-       <li><a href="#the-img"><span class=secno>3.11.2 </span>The
+       <li><a href="#the-img"><span class=secno>4.7.2 </span>The
         <code>img</code> element</a>
 
-       <li><a href="#the-iframe"><span class=secno>3.11.3 </span>The
+       <li><a href="#the-iframe"><span class=secno>4.7.3 </span>The
         <code>iframe</code> element</a>
 
-       <li><a href="#the-embed"><span class=secno>3.11.4 </span>The
+       <li><a href="#the-embed"><span class=secno>4.7.4 </span>The
         <code>embed</code> element</a>
 
-       <li><a href="#the-object"><span class=secno>3.11.5 </span>The
+       <li><a href="#the-object"><span class=secno>4.7.5 </span>The
         <code>object</code> element</a>
 
-       <li><a href="#the-param"><span class=secno>3.11.6 </span>The
+       <li><a href="#the-param"><span class=secno>4.7.6 </span>The
         <code>param</code> element</a>
 
-       <li><a href="#video"><span class=secno>3.11.7 </span>The
+       <li><a href="#video"><span class=secno>4.7.7 </span>The
         <code>video</code> element</a>
         <ul class=toc>
-         <li><a href="#video0"><span class=secno>3.11.7.1. </span>Video and
+         <li><a href="#video0"><span class=secno>4.7.7.1. </span>Video and
           audio codecs for <code>video</code> elements</a>
         </ul>
 
-       <li><a href="#audio"><span class=secno>3.11.8 </span>The
+       <li><a href="#audio"><span class=secno>4.7.8 </span>The
         <code>audio</code> element</a>
         <ul class=toc>
-         <li><a href="#audio0"><span class=secno>3.11.8.1. </span>Audio
-          codecs for <code>audio</code> elements</a>
+         <li><a href="#audio0"><span class=secno>4.7.8.1. </span>Audio codecs
+          for <code>audio</code> elements</a>
         </ul>
 
-       <li><a href="#the-source"><span class=secno>3.11.9 </span>The
+       <li><a href="#the-source"><span class=secno>4.7.9 </span>The
         <code>source</code> element</a>
 
-       <li><a href="#media"><span class=secno>3.11.10 </span>Media
+       <li><a href="#media"><span class=secno>4.7.10 </span>Media
         elements</a>
         <ul class=toc>
-         <li><a href="#error"><span class=secno>3.11.10.1. </span>Error
+         <li><a href="#error"><span class=secno>4.7.10.1. </span>Error
           codes</a>
 
-         <li><a href="#location"><span class=secno>3.11.10.2. </span>Location
+         <li><a href="#location"><span class=secno>4.7.10.2. </span>Location
           of the media resource</a>
 
-         <li><a href="#network0"><span class=secno>3.11.10.3. </span>Network
+         <li><a href="#network0"><span class=secno>4.7.10.3. </span>Network
           states</a>
 
-         <li><a href="#loading"><span class=secno>3.11.10.4. </span>Loading
+         <li><a href="#loading"><span class=secno>4.7.10.4. </span>Loading
           the media resource</a>
 
-         <li><a href="#offsets"><span class=secno>3.11.10.5. </span>Offsets
+         <li><a href="#offsets"><span class=secno>4.7.10.5. </span>Offsets
           into the media resource</a>
 
-         <li><a href="#the-ready"><span class=secno>3.11.10.6. </span>The
+         <li><a href="#the-ready"><span class=secno>4.7.10.6. </span>The
           ready states</a>
 
-         <li><a href="#playing"><span class=secno>3.11.10.7. </span>Playing
+         <li><a href="#playing"><span class=secno>4.7.10.7. </span>Playing
           the media resource</a>
 
-         <li><a href="#seeking"><span class=secno>3.11.10.8.
+         <li><a href="#seeking"><span class=secno>4.7.10.8.
           </span>Seeking</a>
 
-         <li><a href="#cue-ranges"><span class=secno>3.11.10.9. </span>Cue
+         <li><a href="#cue-ranges"><span class=secno>4.7.10.9. </span>Cue
           ranges</a>
 
-         <li><a href="#user-interface"><span class=secno>3.11.10.10.
+         <li><a href="#user-interface"><span class=secno>4.7.10.10.
           </span>User interface</a>
 
-         <li><a href="#time-ranges"><span class=secno>3.11.10.11. </span>Time
+         <li><a href="#time-ranges"><span class=secno>4.7.10.11. </span>Time
           ranges</a>
 
-         <li><a href="#byte-ranges"><span class=secno>3.11.10.12. </span>Byte
+         <li><a href="#byte-ranges"><span class=secno>4.7.10.12. </span>Byte
           ranges</a>
 
-         <li><a href="#mediaevents"><span class=secno>3.11.10.13.
-          </span>Event summary</a>
+         <li><a href="#mediaevents"><span class=secno>4.7.10.13. </span>Event
+          summary</a>
 
-         <li><a href="#security0"><span class=secno>3.11.10.14.
+         <li><a href="#security0"><span class=secno>4.7.10.14.
           </span>Security and privacy considerations</a>
         </ul>
 
-       <li><a href="#the-canvas"><span class=secno>3.11.11 </span>The
+       <li><a href="#the-canvas"><span class=secno>4.7.11 </span>The
         <code>canvas</code> element</a>
         <ul class=toc>
-         <li><a href="#the-2d"><span class=secno>3.11.11.1. </span>The 2D
+         <li><a href="#the-2d"><span class=secno>4.7.11.1. </span>The 2D
           context</a>
           <ul class=toc>
-           <li><a href="#the-canvas0"><span class=secno>3.11.11.1.1.
+           <li><a href="#the-canvas0"><span class=secno>4.7.11.1.1.
             </span>The canvas state</a>
 
-           <li><a href="#transformations"><span class=secno>3.11.11.1.2.
+           <li><a href="#transformations"><span class=secno>4.7.11.1.2.
             </span>Transformations</a>
 
-           <li><a href="#compositing"><span class=secno>3.11.11.1.3.
+           <li><a href="#compositing"><span class=secno>4.7.11.1.3.
             </span>Compositing</a>
 
-           <li><a href="#colors"><span class=secno>3.11.11.1.4. </span>Colors
+           <li><a href="#colors"><span class=secno>4.7.11.1.4. </span>Colors
             and styles</a>
 
-           <li><a href="#line-styles"><span class=secno>3.11.11.1.5.
+           <li><a href="#line-styles"><span class=secno>4.7.11.1.5.
             </span>Line styles</a>
 
-           <li><a href="#shadows"><span class=secno>3.11.11.1.6.
+           <li><a href="#shadows"><span class=secno>4.7.11.1.6.
             </span>Shadows</a>
 
-           <li><a href="#simple"><span class=secno>3.11.11.1.7. </span>Simple
+           <li><a href="#simple"><span class=secno>4.7.11.1.7. </span>Simple
             shapes (rectangles)</a>
 
-           <li><a href="#complex"><span class=secno>3.11.11.1.8.
+           <li><a href="#complex"><span class=secno>4.7.11.1.8.
             </span>Complex shapes (paths)</a>
 
-           <li><a href="#text"><span class=secno>3.11.11.1.9. </span>Text</a>
-            
+           <li><a href="#text"><span class=secno>4.7.11.1.9. </span>Text</a>
 
-           <li><a href="#images"><span class=secno>3.11.11.1.10.
+           <li><a href="#images"><span class=secno>4.7.11.1.10.
             </span>Images</a>
 
-           <li><a href="#pixel"><span class=secno>3.11.11.1.11. </span>Pixel
+           <li><a href="#pixel"><span class=secno>4.7.11.1.11. </span>Pixel
             manipulation</a>
 
-           <li><a href="#drawing"><span class=secno>3.11.11.1.12.
+           <li><a href="#drawing"><span class=secno>4.7.11.1.12.
             </span>Drawing model</a>
           </ul>
 
-         <li><a href="#color"><span class=secno>3.11.11.2. </span>Color
-          spaces and color correction</a>
+         <li><a href="#color"><span class=secno>4.7.11.2. </span>Color spaces
+          and color correction</a>
 
-         <li><a href="#security1"><span class=secno>3.11.11.3.
-          </span>Security with <code>canvas</code> elements</a>
+         <li><a href="#security1"><span class=secno>4.7.11.3. </span>Security
+          with <code>canvas</code> elements</a>
         </ul>
 
-       <li><a href="#the-map"><span class=secno>3.11.12 </span>The
+       <li><a href="#the-map"><span class=secno>4.7.12 </span>The
         <code>map</code> element</a>
 
-       <li><a href="#the-area"><span class=secno>3.11.13 </span>The
+       <li><a href="#the-area"><span class=secno>4.7.13 </span>The
         <code>area</code> element</a>
 
-       <li><a href="#image-maps"><span class=secno>3.11.14 </span>Image
+       <li><a href="#image-maps"><span class=secno>4.7.14 </span>Image
         maps</a>
 
-       <li><a href="#mathml"><span class=secno>3.11.15 </span>MathML</a>
+       <li><a href="#mathml"><span class=secno>4.7.15 </span>MathML</a>
 
-       <li><a href="#svg"><span class=secno>3.11.16 </span>SVG</a>
+       <li><a href="#svg"><span class=secno>4.7.16 </span>SVG</a>
 
-       <li><a href="#dimension"><span class=secno>3.11.17 </span>Dimension
+       <li><a href="#dimension"><span class=secno>4.7.17 </span>Dimension
         attributes</a>
       </ul>
 
-     <li><a href="#tabular"><span class=secno>3.12 </span>Tabular data</a>
+     <li><a href="#tabular"><span class=secno>4.8 </span>Tabular data</a>
       <ul class=toc>
-       <li><a href="#table-intro"><span class=secno>3.12.1
+       <li><a href="#table-intro"><span class=secno>4.8.1
         </span>Introduction</a>
 
-       <li><a href="#the-table"><span class=secno>3.12.2 </span>The
+       <li><a href="#the-table"><span class=secno>4.8.2 </span>The
         <code>table</code> element</a>
 
-       <li><a href="#the-caption"><span class=secno>3.12.3 </span>The
+       <li><a href="#the-caption"><span class=secno>4.8.3 </span>The
         <code>caption</code> element</a>
 
-       <li><a href="#the-colgroup"><span class=secno>3.12.4 </span>The
+       <li><a href="#the-colgroup"><span class=secno>4.8.4 </span>The
         <code>colgroup</code> element</a>
 
-       <li><a href="#the-col"><span class=secno>3.12.5 </span>The
+       <li><a href="#the-col"><span class=secno>4.8.5 </span>The
         <code>col</code> element</a>
 
-       <li><a href="#the-tbody"><span class=secno>3.12.6 </span>The
+       <li><a href="#the-tbody"><span class=secno>4.8.6 </span>The
         <code>tbody</code> element</a>
 
-       <li><a href="#the-thead"><span class=secno>3.12.7 </span>The
+       <li><a href="#the-thead"><span class=secno>4.8.7 </span>The
         <code>thead</code> element</a>
 
-       <li><a href="#the-tfoot"><span class=secno>3.12.8 </span>The
+       <li><a href="#the-tfoot"><span class=secno>4.8.8 </span>The
         <code>tfoot</code> element</a>
 
-       <li><a href="#the-tr"><span class=secno>3.12.9 </span>The
+       <li><a href="#the-tr"><span class=secno>4.8.9 </span>The
         <code>tr</code> element</a>
 
-       <li><a href="#the-td"><span class=secno>3.12.10 </span>The
+       <li><a href="#the-td"><span class=secno>4.8.10 </span>The
         <code>td</code> element</a>
 
-       <li><a href="#the-th"><span class=secno>3.12.11 </span>The
+       <li><a href="#the-th"><span class=secno>4.8.11 </span>The
         <code>th</code> element</a>
 
-       <li><a href="#attributes0"><span class=secno>3.12.12 </span>Attributes
+       <li><a href="#attributes0"><span class=secno>4.8.12 </span>Attributes
         common to <code>td</code> and <code>th</code> elements</a>
 
-       <li><a href="#processing"><span class=secno>3.12.13 </span>Processing
+       <li><a href="#processing"><span class=secno>4.8.13 </span>Processing
         model</a>
         <ul class=toc>
-         <li><a href="#forming"><span class=secno>3.12.13.1. </span>Forming a
+         <li><a href="#forming"><span class=secno>4.8.13.1. </span>Forming a
           table</a>
 
          <li><a href="#header-and-data-cell-semantics"><span
-          class=secno>3.12.13.2. </span>Forming relationships between data
+          class=secno>4.8.13.2. </span>Forming relationships between data
           cells and header cells</a>
         </ul>
       </ul>
 
-     <li><a href="#forms"><span class=secno>3.13 </span>Forms</a>
+     <li><a href="#forms"><span class=secno>4.9 </span>Forms</a>
       <ul class=toc>
-       <li><a href="#the-form"><span class=secno>3.13.1 </span>The
+       <li><a href="#the-form"><span class=secno>4.9.1 </span>The
         <code>form</code> element</a>
 
-       <li><a href="#the-fieldset"><span class=secno>3.13.2 </span>The
+       <li><a href="#the-fieldset"><span class=secno>4.9.2 </span>The
         <code>fieldset</code> element</a>
 
-       <li><a href="#the-input"><span class=secno>3.13.3 </span>The
+       <li><a href="#the-input"><span class=secno>4.9.3 </span>The
         <code>input</code> element</a>
 
-       <li><a href="#the-button"><span class=secno>3.13.4 </span>The
+       <li><a href="#the-button"><span class=secno>4.9.4 </span>The
         <code>button</code> element</a>
 
-       <li><a href="#the-label"><span class=secno>3.13.5 </span>The
+       <li><a href="#the-label"><span class=secno>4.9.5 </span>The
         <code>label</code> element</a>
 
-       <li><a href="#the-select"><span class=secno>3.13.6 </span>The
+       <li><a href="#the-select"><span class=secno>4.9.6 </span>The
         <code>select</code> element</a>
 
-       <li><a href="#the-datalist"><span class=secno>3.13.7 </span>The
+       <li><a href="#the-datalist"><span class=secno>4.9.7 </span>The
         <code>datalist</code> element</a>
 
-       <li><a href="#the-optgroup"><span class=secno>3.13.8 </span>The
+       <li><a href="#the-optgroup"><span class=secno>4.9.8 </span>The
         <code>optgroup</code> element</a>
 
-       <li><a href="#the-option"><span class=secno>3.13.9 </span>The
+       <li><a href="#the-option"><span class=secno>4.9.9 </span>The
         <code>option</code> element</a>
 
-       <li><a href="#the-textarea"><span class=secno>3.13.10 </span>The
+       <li><a href="#the-textarea"><span class=secno>4.9.10 </span>The
         <code>textarea</code> element</a>
 
-       <li><a href="#the-output"><span class=secno>3.13.11 </span>The
+       <li><a href="#the-output"><span class=secno>4.9.11 </span>The
         <code>output</code> element</a>
 
-       <li><a href="#processing0"><span class=secno>3.13.12 </span>Processing
+       <li><a href="#processing0"><span class=secno>4.9.12 </span>Processing
         model</a>
         <ul class=toc>
-         <li><a href="#form-submission"><span class=secno>3.13.12.1.
+         <li><a href="#form-submission"><span class=secno>4.9.12.1.
           </span>Form submission</a>
         </ul>
       </ul>
 
-     <li><a href="#scripting0"><span class=secno>3.14 </span>Scripting</a>
+     <li><a href="#scripting0"><span class=secno>4.10 </span>Scripting</a>
       <ul class=toc>
-       <li><a href="#script"><span class=secno>3.14.1 </span>The
+       <li><a href="#script"><span class=secno>4.10.1 </span>The
         <code>script</code> element</a>
         <ul class=toc>
-         <li><a href="#scriptingLanguages"><span class=secno>3.14.1.1.
+         <li><a href="#scriptingLanguages"><span class=secno>4.10.1.1.
           </span>Scripting languages</a>
         </ul>
 
-       <li><a href="#the-noscript"><span class=secno>3.14.2 </span>The
+       <li><a href="#the-noscript"><span class=secno>4.10.2 </span>The
         <code>noscript</code> element</a>
 
-       <li><a href="#the-event-source"><span class=secno>3.14.3 </span>The
+       <li><a href="#the-event-source"><span class=secno>4.10.3 </span>The
         <code>event-source</code> element</a>
       </ul>
 
-     <li><a href="#interactive-elements"><span class=secno>3.15
+     <li><a href="#interactive-elements"><span class=secno>4.11
       </span>Interactive elements</a>
       <ul class=toc>
-       <li><a href="#the-details"><span class=secno>3.15.1 </span>The
+       <li><a href="#the-details"><span class=secno>4.11.1 </span>The
         <code>details</code> element</a>
 
-       <li><a href="#datagrid"><span class=secno>3.15.2 </span>The
+       <li><a href="#datagrid"><span class=secno>4.11.2 </span>The
         <code>datagrid</code> element</a>
         <ul class=toc>
-         <li><a href="#the-datagrid"><span class=secno>3.15.2.1. </span>The
+         <li><a href="#the-datagrid"><span class=secno>4.11.2.1. </span>The
           <code>datagrid</code> data model</a>
 
-         <li><a href="#how-rows"><span class=secno>3.15.2.2. </span>How rows
+         <li><a href="#how-rows"><span class=secno>4.11.2.2. </span>How rows
           are identified</a>
 
-         <li><a href="#the-data"><span class=secno>3.15.2.3. </span>The data
+         <li><a href="#the-data"><span class=secno>4.11.2.3. </span>The data
           provider interface</a>
 
-         <li><a href="#the-default"><span class=secno>3.15.2.4. </span>The
+         <li><a href="#the-default"><span class=secno>4.11.2.4. </span>The
           default data provider</a>
           <ul class=toc>
            <li><a href="#commonDefaultDataGridMethodDefinitions"><span
-            class=secno>3.15.2.4.1. </span>Common default data provider
+            class=secno>4.11.2.4.1. </span>Common default data provider
             method definitions for cells</a>
           </ul>
 
-         <li><a href="#populating"><span class=secno>3.15.2.5.
+         <li><a href="#populating"><span class=secno>4.11.2.5.
           </span>Populating the <code>datagrid</code> element</a>
 
-         <li><a href="#updating"><span class=secno>3.15.2.6. </span>Updating
+         <li><a href="#updating"><span class=secno>4.11.2.6. </span>Updating
           the <code>datagrid</code></a>
 
-         <li><a href="#requirements"><span class=secno>3.15.2.7.
+         <li><a href="#requirements"><span class=secno>4.11.2.7.
           </span>Requirements for interactive user agents</a>
 
-         <li><a href="#the-selection"><span class=secno>3.15.2.8. </span>The
+         <li><a href="#the-selection"><span class=secno>4.11.2.8. </span>The
           selection</a>
 
-         <li><a href="#columns"><span class=secno>3.15.2.9. </span>Columns
+         <li><a href="#columns"><span class=secno>4.11.2.9. </span>Columns
           and captions</a>
         </ul>
 
-       <li><a href="#the-command"><span class=secno>3.15.3 </span>The
+       <li><a href="#the-command"><span class=secno>4.11.3 </span>The
         <code>command</code> element</a>
 
-       <li><a href="#menus"><span class=secno>3.15.4 </span>The
+       <li><a href="#menus"><span class=secno>4.11.4 </span>The
         <code>menu</code> element</a>
         <ul class=toc>
-         <li><a href="#menus-intro"><span class=secno>3.15.4.1.
+         <li><a href="#menus-intro"><span class=secno>4.11.4.1.
           </span>Introduction</a>
 
-         <li><a href="#building"><span class=secno>3.15.4.2. </span>Building
+         <li><a href="#building"><span class=secno>4.11.4.2. </span>Building
           menus and tool bars</a>
 
-         <li><a href="#context"><span class=secno>3.15.4.3. </span>Context
+         <li><a href="#context"><span class=secno>4.11.4.3. </span>Context
           menus</a>
 
-         <li><a href="#toolbars"><span class=secno>3.15.4.4.
+         <li><a href="#toolbars"><span class=secno>4.11.4.4.
           </span>Toolbars</a>
         </ul>
 
-       <li><a href="#commands"><span class=secno>3.15.5 </span>Commands</a>
+       <li><a href="#commands"><span class=secno>4.11.5 </span>Commands</a>
         <ul class=toc>
-         <li><a href="#using"><span class=secno>3.15.5.1. </span>Using the
+         <li><a href="#using"><span class=secno>4.11.5.1. </span>Using the
           <code>a</code> element to define a command</a>
 
-         <li><a href="#using0"><span class=secno>3.15.5.2. </span>Using the
+         <li><a href="#using0"><span class=secno>4.11.5.2. </span>Using the
           <code>button</code> element to define a command</a>
 
-         <li><a href="#using1"><span class=secno>3.15.5.3. </span>Using the
+         <li><a href="#using1"><span class=secno>4.11.5.3. </span>Using the
           <code>input</code> element to define a command</a>
 
-         <li><a href="#using2"><span class=secno>3.15.5.4. </span>Using the
+         <li><a href="#using2"><span class=secno>4.11.5.4. </span>Using the
           <code>option</code> element to define a command</a>
 
-         <li><a href="#using3"><span class=secno>3.15.5.5. </span>Using the
+         <li><a href="#using3"><span class=secno>4.11.5.5. </span>Using the
           <code>command</code> element to define a command</a>
         </ul>
       </ul>
 
-     <li><a href="#datatemplate"><span class=secno>3.16 </span>Data
+     <li><a href="#datatemplate"><span class=secno>4.12 </span>Data
       Templates</a>
       <ul class=toc>
-       <li><a href="#introduction0"><span class=secno>3.16.1
+       <li><a href="#introduction0"><span class=secno>4.12.1
         </span>Introduction</a>
 
-       <li><a href="#the-datatemplate"><span class=secno>3.16.2 </span>The
+       <li><a href="#the-datatemplate"><span class=secno>4.12.2 </span>The
         <code>datatemplate</code> element</a>
 
-       <li><a href="#the-rule"><span class=secno>3.16.3 </span>The
+       <li><a href="#the-rule"><span class=secno>4.12.3 </span>The
         <code>rule</code> element</a>
 
-       <li><a href="#the-nest"><span class=secno>3.16.4 </span>The
+       <li><a href="#the-nest"><span class=secno>4.12.4 </span>The
         <code>nest</code> element</a>
 
-       <li><a href="#global0"><span class=secno>3.16.5 </span>Global
+       <li><a href="#global0"><span class=secno>4.12.5 </span>Global
         attributes for data templates</a>
 
-       <li><a href="#processing1"><span class=secno>3.16.6 </span>Processing
+       <li><a href="#processing1"><span class=secno>4.12.6 </span>Processing
         model</a>
         <ul class=toc>
-         <li><a href="#the-originalcontent"><span class=secno>3.16.6.1.
+         <li><a href="#the-originalcontent"><span class=secno>4.12.6.1.
           </span>The <code title=dom-originalContent>originalContent</code>
           DOM attribute</a>
 
-         <li><a href="#the-template"><span class=secno>3.16.6.2. </span>The
+         <li><a href="#the-template"><span class=secno>4.12.6.2. </span>The
           <code title=attr-template>template</code> attribute</a>
 
-         <li><a href="#the-ref"><span class=secno>3.16.6.3. </span>The <code
+         <li><a href="#the-ref"><span class=secno>4.12.6.3. </span>The <code
           title=attr-ref>ref</code> attribute</a>
 
-         <li><a href="#the-nodedatatemplate"><span class=secno>3.16.6.4.
+         <li><a href="#the-nodedatatemplate"><span class=secno>4.12.6.4.
           </span>The <code>NodeDataTemplate</code> interface</a>
 
-         <li><a href="#mutations"><span class=secno>3.16.6.5.
+         <li><a href="#mutations"><span class=secno>4.12.6.5.
           </span>Mutations</a>
 
-         <li><a href="#updating0"><span class=secno>3.16.6.6. </span>Updating
+         <li><a href="#updating0"><span class=secno>4.12.6.6. </span>Updating
           the generated content</a>
         </ul>
       </ul>
 
-     <li><a href="#miscellaneous"><span class=secno>3.17 </span>Miscellaneous
+     <li><a href="#miscellaneous"><span class=secno>4.13 </span>Miscellaneous
       elements</a>
       <ul class=toc>
-       <li><a href="#the-legend"><span class=secno>3.17.1 </span>The
+       <li><a href="#the-legend"><span class=secno>4.13.1 </span>The
         <code>legend</code> element</a>
 
-       <li><a href="#the-div"><span class=secno>3.17.2 </span>The
+       <li><a href="#the-div"><span class=secno>4.13.2 </span>The
         <code>div</code> element</a>
       </ul>
     </ul>
 
-   <li><a href="#web-browsers"><span class=secno>4. </span>Web browsers</a>
+   <li><a href="#browsers"><span class=secno>5. </span>Web browsers</a>
     <ul class=toc>
-     <li><a href="#windows"><span class=secno>4.1 </span>Browsing
+     <li><a href="#windows"><span class=secno>5.1 </span>Browsing
       contexts</a>
       <ul class=toc>
-       <li><a href="#nested"><span class=secno>4.1.1 </span>Nested browsing
+       <li><a href="#nested"><span class=secno>5.1.1 </span>Nested browsing
         contexts</a>
 
-       <li><a href="#auxiliary"><span class=secno>4.1.2 </span>Auxiliary
+       <li><a href="#auxiliary"><span class=secno>5.1.2 </span>Auxiliary
         browsing contexts</a>
 
-       <li><a href="#secondary"><span class=secno>4.1.3 </span>Secondary
+       <li><a href="#secondary"><span class=secno>5.1.3 </span>Secondary
         browsing contexts</a>
 
-       <li><a href="#security2"><span class=secno>4.1.4 </span>Security</a>
+       <li><a href="#security2"><span class=secno>5.1.4 </span>Security</a>
 
-       <li><a href="#threads"><span class=secno>4.1.5 </span>Threads</a>
+       <li><a href="#threads"><span class=secno>5.1.5 </span>Threads</a>
 
-       <li><a href="#browsing"><span class=secno>4.1.6 </span>Browsing
+       <li><a href="#browsing"><span class=secno>5.1.6 </span>Browsing
         context names</a>
       </ul>
 
-     <li><a href="#the-default0"><span class=secno>4.2 </span>The default
+     <li><a href="#the-default0"><span class=secno>5.2 </span>The default
       view</a>
       <ul class=toc>
-       <li><a href="#security3"><span class=secno>4.2.1 </span>Security</a>
+       <li><a href="#security3"><span class=secno>5.2.1 </span>Security</a>
 
-       <li><a href="#constructors"><span class=secno>4.2.2
+       <li><a href="#constructors"><span class=secno>5.2.2
         </span>Constructors</a>
 
-       <li><a href="#apis-for"><span class=secno>4.2.3 </span>APIs for
+       <li><a href="#apis-for"><span class=secno>5.2.3 </span>APIs for
         creating and navigating browsing contexts by name</a>
 
-       <li><a href="#accessing"><span class=secno>4.2.4 </span>Accessing
+       <li><a href="#accessing"><span class=secno>5.2.4 </span>Accessing
         other browsing contexts</a>
       </ul>
 
-     <li><a href="#origin"><span class=secno>4.3 </span>Origin</a>
+     <li><a href="#origin"><span class=secno>5.3 </span>Origin</a>
       <ul class=toc>
-       <li><a href="#relaxing"><span class=secno>4.3.1 </span>Relaxing the
+       <li><a href="#relaxing"><span class=secno>5.3.1 </span>Relaxing the
         same-origin restriction</a>
 
-       <li><a href="#the-string"><span class=secno>4.3.2 </span>The string
+       <li><a href="#the-string"><span class=secno>5.3.2 </span>The string
         representing the script's domain in IDNA format</a>
       </ul>
 
-     <li><a href="#scripting"><span class=secno>4.4 </span>Scripting</a>
+     <li><a href="#scripting"><span class=secno>5.4 </span>Scripting</a>
       <ul class=toc>
-       <li><a href="#script0"><span class=secno>4.4.1 </span>Script execution
+       <li><a href="#script0"><span class=secno>5.4.1 </span>Script execution
         contexts</a>
 
-       <li><a href="#security4"><span class=secno>4.4.2 </span>Security
+       <li><a href="#security4"><span class=secno>5.4.2 </span>Security
         exceptions</a>
 
-       <li><a href="#javascript-protocol"><span class=secno>4.4.3 </span>The
+       <li><a href="#javascript-protocol"><span class=secno>5.4.3 </span>The
         <code title="">javascript:</code> protocol</a>
 
-       <li><a href="#events"><span class=secno>4.4.4 </span>Events</a>
+       <li><a href="#events"><span class=secno>5.4.4 </span>Events</a>
         <ul class=toc>
-         <li><a href="#event-handler-attributes"><span class=secno>4.4.4.1.
+         <li><a href="#event-handler-attributes"><span class=secno>5.4.4.1.
           </span>Event handler attributes</a>
 
-         <li><a href="#event"><span class=secno>4.4.4.2. </span>Event
+         <li><a href="#event"><span class=secno>5.4.4.2. </span>Event
           firing</a>
 
-         <li><a href="#events0"><span class=secno>4.4.4.3. </span>Events and
+         <li><a href="#events0"><span class=secno>5.4.4.3. </span>Events and
           the <code>Window</code> object</a>
 
-         <li><a href="#runtime-script-errors"><span class=secno>4.4.4.4.
+         <li><a href="#runtime-script-errors"><span class=secno>5.4.4.4.
           </span>Runtime script errors</a>
         </ul>
       </ul>
 
-     <li><a href="#user-prompts"><span class=secno>4.5 </span>User
+     <li><a href="#user-prompts"><span class=secno>5.5 </span>User
       prompts</a>
       <ul class=toc>
-       <li><a href="#simple0"><span class=secno>4.5.1 </span>Simple
+       <li><a href="#simple0"><span class=secno>5.5.1 </span>Simple
         dialogs</a>
 
-       <li><a href="#printing"><span class=secno>4.5.2 </span>Printing</a>
+       <li><a href="#printing"><span class=secno>5.5.2 </span>Printing</a>
 
-       <li><a href="#dialogs"><span class=secno>4.5.3 </span>Dialogs
+       <li><a href="#dialogs"><span class=secno>5.5.3 </span>Dialogs
         implemented using separate documents</a>
 
-       <li><a href="#notifications"><span class=secno>4.5.4
+       <li><a href="#notifications"><span class=secno>5.5.4
         </span>Notifications</a>
       </ul>
 
-     <li><a href="#browser"><span class=secno>4.6 </span>Browser state</a>
+     <li><a href="#browser"><span class=secno>5.6 </span>Browser state</a>
       <ul class=toc>
-       <li><a href="#custom-handlers"><span class=secno>4.6.1 </span>Custom
+       <li><a href="#custom-handlers"><span class=secno>5.6.1 </span>Custom
         protocol and content handlers</a>
         <ul class=toc>
-         <li><a href="#security5"><span class=secno>4.6.1.1. </span>Security
+         <li><a href="#security5"><span class=secno>5.6.1.1. </span>Security
           and privacy</a>
 
-         <li><a href="#sample-handler-impl"><span class=secno>4.6.1.2.
+         <li><a href="#sample-handler-impl"><span class=secno>5.6.1.2.
           </span>Sample user interface</a>
         </ul>
       </ul>
 
-     <li><a href="#offline"><span class=secno>4.7 </span>Offline Web
+     <li><a href="#offline"><span class=secno>5.7 </span>Offline Web
       applications</a>
       <ul class=toc>
-       <li><a href="#introduction1"><span class=secno>4.7.1
+       <li><a href="#introduction1"><span class=secno>5.7.1
         </span>Introduction</a>
 
-       <li><a href="#appcache"><span class=secno>4.7.2 </span>Application
+       <li><a href="#appcache"><span class=secno>5.7.2 </span>Application
         caches</a>
 
-       <li><a href="#manifests"><span class=secno>4.7.3 </span>The cache
+       <li><a href="#manifests"><span class=secno>5.7.3 </span>The cache
         manifest syntax</a>
         <ul class=toc>
-         <li><a href="#writing"><span class=secno>4.7.3.1. </span>Writing
+         <li><a href="#writing"><span class=secno>5.7.3.1. </span>Writing
           cache manifests</a>
 
-         <li><a href="#parsing0"><span class=secno>4.7.3.2. </span>Parsing
+         <li><a href="#parsing0"><span class=secno>5.7.3.2. </span>Parsing
           cache manifests</a>
         </ul>
 
-       <li><a href="#updating1"><span class=secno>4.7.4 </span>Updating an
+       <li><a href="#updating1"><span class=secno>5.7.4 </span>Updating an
         application cache</a>
 
-       <li><a href="#processing2"><span class=secno>4.7.5 </span>Processing
+       <li><a href="#processing2"><span class=secno>5.7.5 </span>Processing
         model</a>
         <ul class=toc>
-         <li><a href="#changes"><span class=secno>4.7.5.1. </span>Changes to
+         <li><a href="#changes"><span class=secno>5.7.5.1. </span>Changes to
           the networking model</a>
         </ul>
 
-       <li><a href="#application"><span class=secno>4.7.6 </span>Application
+       <li><a href="#application"><span class=secno>5.7.6 </span>Application
         cache API</a>
 
-       <li><a href="#browser0"><span class=secno>4.7.7 </span>Browser
+       <li><a href="#browser0"><span class=secno>5.7.7 </span>Browser
         state</a>
       </ul>
 
-     <li><a href="#history"><span class=secno>4.8 </span>Session history and
+     <li><a href="#history"><span class=secno>5.8 </span>Session history and
       navigation</a>
       <ul class=toc>
-       <li><a href="#the-session"><span class=secno>4.8.1 </span>The session
+       <li><a href="#the-session"><span class=secno>5.8.1 </span>The session
         history of browsing contexts</a>
 
-       <li><a href="#the-history"><span class=secno>4.8.2 </span>The
+       <li><a href="#the-history"><span class=secno>5.8.2 </span>The
         <code>History</code> interface</a>
 
-       <li><a href="#activating"><span class=secno>4.8.3 </span>Activating
+       <li><a href="#activating"><span class=secno>5.8.3 </span>Activating
         state object entries</a>
 
-       <li><a href="#the-location"><span class=secno>4.8.4 </span>The
+       <li><a href="#the-location"><span class=secno>5.8.4 </span>The
         <code>Location</code> interface</a>
         <ul class=toc>
-         <li><a href="#security6"><span class=secno>4.8.4.1.
+         <li><a href="#security6"><span class=secno>5.8.4.1.
           </span>Security</a>
         </ul>
 
-       <li><a href="#history-notes"><span class=secno>4.8.5
+       <li><a href="#history-notes"><span class=secno>5.8.5
         </span>Implementation notes for session history</a>
       </ul>
 
-     <li><a href="#browsing0"><span class=secno>4.9 </span>Browsing the
+     <li><a href="#browsing0"><span class=secno>5.9 </span>Browsing the
       Web</a>
       <ul class=toc>
-       <li><a href="#navigating"><span class=secno>4.9.1 </span>Navigating
+       <li><a href="#navigating"><span class=secno>5.9.1 </span>Navigating
         across documents</a>
 
-       <li><a href="#read-html"><span class=secno>4.9.2 </span>Page load
+       <li><a href="#read-html"><span class=secno>5.9.2 </span>Page load
         processing model for HTML files</a>
 
-       <li><a href="#read-xml"><span class=secno>4.9.3 </span>Page load
+       <li><a href="#read-xml"><span class=secno>5.9.3 </span>Page load
         processing model for XML files</a>
 
-       <li><a href="#read-text"><span class=secno>4.9.4 </span>Page load
+       <li><a href="#read-text"><span class=secno>5.9.4 </span>Page load
         processing model for text files</a>
 
-       <li><a href="#read-image"><span class=secno>4.9.5 </span>Page load
+       <li><a href="#read-image"><span class=secno>5.9.5 </span>Page load
         processing model for images</a>
 
-       <li><a href="#read-plugin"><span class=secno>4.9.6 </span>Page load
+       <li><a href="#read-plugin"><span class=secno>5.9.6 </span>Page load
         processing model for content that uses plugins</a>
 
-       <li><a href="#read-ua-inline"><span class=secno>4.9.7 </span>Page load
+       <li><a href="#read-ua-inline"><span class=secno>5.9.7 </span>Page load
         processing model for inline content that doesn't have a DOM</a>
 
-       <li><a href="#scroll-to-fragid"><span class=secno>4.9.8
+       <li><a href="#scroll-to-fragid"><span class=secno>5.9.8
         </span>Navigating to a fragment identifier</a>
 
-       <li><a href="#history0"><span class=secno>4.9.9 </span>History
+       <li><a href="#history0"><span class=secno>5.9.9 </span>History
         traversal</a>
       </ul>
 
-     <li><a href="#content-type-sniffing"><span class=secno>4.10
-      </span>Determining the type of a new resource in a browsing context</a>
-      
-      <ul class=toc>
-       <li><a href="#content-type0"><span class=secno>4.10.1
-        </span>Content-Type sniffing: text or binary</a>
-
-       <li><a href="#content-type1"><span class=secno>4.10.2
-        </span>Content-Type sniffing: unknown type</a>
-
-       <li><a href="#content-type2"><span class=secno>4.10.3
-        </span>Content-Type sniffing: image</a>
-
-       <li><a href="#content-type3"><span class=secno>4.10.4
-        </span>Content-Type sniffing: feed or HTML</a>
-
-       <li><a href="#content-type"><span class=secno>4.10.5
-        </span>Content-Type metadata</a>
-      </ul>
-
-     <li><a href="#structured"><span class=secno>4.11 </span>Structured
+     <li><a href="#structured"><span class=secno>5.10 </span>Structured
       client-side storage</a>
       <ul class=toc>
-       <li><a href="#storage"><span class=secno>4.11.1 </span>Storing
+       <li><a href="#storage"><span class=secno>5.10.1 </span>Storing
         name/value pairs</a>
         <ul class=toc>
-         <li><a href="#introduction2"><span class=secno>4.11.1.1.
+         <li><a href="#introduction2"><span class=secno>5.10.1.1.
           </span>Introduction</a>
 
-         <li><a href="#the-storage"><span class=secno>4.11.1.2. </span>The
+         <li><a href="#the-storage"><span class=secno>5.10.1.2. </span>The
           <code>Storage</code> interface</a>
 
-         <li><a href="#the-sessionstorage"><span class=secno>4.11.1.3.
+         <li><a href="#the-sessionstorage"><span class=secno>5.10.1.3.
           </span>The <code title=dom-sessionStorage>sessionStorage</code>
           attribute</a>
 
-         <li><a href="#the-localstorage"><span class=secno>4.11.1.4.
+         <li><a href="#the-localstorage"><span class=secno>5.10.1.4.
           </span>The <code title=dom-localStorage>localStorage</code>
           attribute</a>
 
-         <li><a href="#the-storage0"><span class=secno>4.11.1.5. </span>The
+         <li><a href="#the-storage0"><span class=secno>5.10.1.5. </span>The
           <code title=event-storage>storage</code> event</a>
           <ul class=toc>
-           <li><a href="#event0"><span class=secno>4.11.1.5.1. </span>Event
+           <li><a href="#event0"><span class=secno>5.10.1.5.1. </span>Event
             definition</a>
           </ul>
 
-         <li><a href="#threads0"><span class=secno>4.11.1.6.
+         <li><a href="#threads0"><span class=secno>5.10.1.6.
           </span>Threads</a>
         </ul>
 
-       <li><a href="#sql"><span class=secno>4.11.2 </span>Database
+       <li><a href="#sql"><span class=secno>5.10.2 </span>Database
         storage</a>
         <ul class=toc>
-         <li><a href="#introduction3"><span class=secno>4.11.2.1.
+         <li><a href="#introduction3"><span class=secno>5.10.2.1.
           </span>Introduction</a>
 
-         <li><a href="#databases"><span class=secno>4.11.2.2.
+         <li><a href="#databases"><span class=secno>5.10.2.2.
           </span>Databases</a>
 
-         <li><a href="#executing"><span class=secno>4.11.2.3.
+         <li><a href="#executing"><span class=secno>5.10.2.3.
           </span>Executing SQL statements</a>
 
-         <li><a href="#database"><span class=secno>4.11.2.4. </span>Database
+         <li><a href="#database"><span class=secno>5.10.2.4. </span>Database
           query results</a>
 
-         <li><a href="#errors"><span class=secno>4.11.2.5. </span>Errors</a>
+         <li><a href="#errors"><span class=secno>5.10.2.5. </span>Errors</a>
 
-         <li><a href="#processing3"><span class=secno>4.11.2.6.
+         <li><a href="#processing3"><span class=secno>5.10.2.6.
           </span>Processing model</a>
         </ul>
 
-       <li><a href="#disk-space"><span class=secno>4.11.3 </span>Disk
+       <li><a href="#disk-space"><span class=secno>5.10.3 </span>Disk
         space</a>
 
-       <li><a href="#privacy"><span class=secno>4.11.4 </span>Privacy</a>
+       <li><a href="#privacy"><span class=secno>5.10.4 </span>Privacy</a>
         <ul class=toc>
-         <li><a href="#user-tracking"><span class=secno>4.11.4.1. </span>User
+         <li><a href="#user-tracking"><span class=secno>5.10.4.1. </span>User
           tracking</a>
 
-         <li><a href="#cookie"><span class=secno>4.11.4.2. </span>Cookie
+         <li><a href="#cookie"><span class=secno>5.10.4.2. </span>Cookie
           resurrection</a>
         </ul>
 
-       <li><a href="#security7"><span class=secno>4.11.5 </span>Security</a>
+       <li><a href="#security7"><span class=secno>5.10.5 </span>Security</a>
         <ul class=toc>
-         <li><a href="#dns-spoofing"><span class=secno>4.11.5.1. </span>DNS
+         <li><a href="#dns-spoofing"><span class=secno>5.10.5.1. </span>DNS
           spoofing attacks</a>
 
-         <li><a href="#cross-directory"><span class=secno>4.11.5.2.
+         <li><a href="#cross-directory"><span class=secno>5.10.5.2.
           </span>Cross-directory attacks</a>
 
-         <li><a href="#implementation"><span class=secno>4.11.5.3.
+         <li><a href="#implementation"><span class=secno>5.10.5.3.
           </span>Implementation risks</a>
 
-         <li><a href="#sql-and"><span class=secno>4.11.5.4. </span>SQL and
+         <li><a href="#sql-and"><span class=secno>5.10.5.4. </span>SQL and
           user agents</a>
 
-         <li><a href="#sql-injection"><span class=secno>4.11.5.5. </span>SQL
+         <li><a href="#sql-injection"><span class=secno>5.10.5.5. </span>SQL
           injection</a>
         </ul>
       </ul>
 
-     <li><a href="#links"><span class=secno>4.12 </span>Links</a>
+     <li><a href="#links"><span class=secno>5.11 </span>Links</a>
       <ul class=toc>
-       <li><a href="#hyperlink"><span class=secno>4.12.1 </span>Hyperlink
+       <li><a href="#hyperlink"><span class=secno>5.11.1 </span>Hyperlink
         elements</a>
 
-       <li><a href="#following"><span class=secno>4.12.2 </span>Following
+       <li><a href="#following"><span class=secno>5.11.2 </span>Following
         hyperlinks</a>
         <ul class=toc>
-         <li><a href="#hyperlink0"><span class=secno>4.12.2.1.
+         <li><a href="#hyperlink0"><span class=secno>5.11.2.1.
           </span>Hyperlink auditing</a>
         </ul>
 
-       <li><a href="#linkTypes"><span class=secno>4.12.3 </span>Link
+       <li><a href="#linkTypes"><span class=secno>5.11.3 </span>Link
         types</a>
         <ul class=toc>
-         <li><a href="#link-type"><span class=secno>4.12.3.1. </span>Link
+         <li><a href="#link-type"><span class=secno>5.11.3.1. </span>Link
           type "<code>alternate</code>"</a>
 
-         <li><a href="#link-type0"><span class=secno>4.12.3.2. </span>Link
+         <li><a href="#link-type0"><span class=secno>5.11.3.2. </span>Link
           type "<code>archives</code>"</a>
 
-         <li><a href="#link-type1"><span class=secno>4.12.3.3. </span>Link
+         <li><a href="#link-type1"><span class=secno>5.11.3.3. </span>Link
           type "<code>author</code>"</a>
 
-         <li><a href="#link-type2"><span class=secno>4.12.3.4. </span>Link
+         <li><a href="#link-type2"><span class=secno>5.11.3.4. </span>Link
           type "<code>bookmark</code>"</a>
 
-         <li><a href="#link-type3"><span class=secno>4.12.3.5. </span>Link
+         <li><a href="#link-type3"><span class=secno>5.11.3.5. </span>Link
           type "<code>external</code>"</a>
 
-         <li><a href="#link-type4"><span class=secno>4.12.3.6. </span>Link
+         <li><a href="#link-type4"><span class=secno>5.11.3.6. </span>Link
           type "<code>feed</code>"</a>
 
-         <li><a href="#link-type5"><span class=secno>4.12.3.7. </span>Link
+         <li><a href="#link-type5"><span class=secno>5.11.3.7. </span>Link
           type "<code>help</code>"</a>
 
-         <li><a href="#rel-icon"><span class=secno>4.12.3.8. </span>Link type
+         <li><a href="#rel-icon"><span class=secno>5.11.3.8. </span>Link type
           "<code>icon</code>"</a>
 
-         <li><a href="#link-type6"><span class=secno>4.12.3.9. </span>Link
+         <li><a href="#link-type6"><span class=secno>5.11.3.9. </span>Link
           type "<code>license</code>"</a>
 
-         <li><a href="#link-type7"><span class=secno>4.12.3.10. </span>Link
+         <li><a href="#link-type7"><span class=secno>5.11.3.10. </span>Link
           type "<code>nofollow</code>"</a>
 
-         <li><a href="#link-type8"><span class=secno>4.12.3.11. </span>Link
+         <li><a href="#link-type8"><span class=secno>5.11.3.11. </span>Link
           type "<code>noreferrer</code>"</a>
 
-         <li><a href="#link-type9"><span class=secno>4.12.3.12. </span>Link
+         <li><a href="#link-type9"><span class=secno>5.11.3.12. </span>Link
           type "<code>pingback</code>"</a>
 
-         <li><a href="#link-type10"><span class=secno>4.12.3.13. </span>Link
+         <li><a href="#link-type10"><span class=secno>5.11.3.13. </span>Link
           type "<code>prefetch</code>"</a>
 
-         <li><a href="#link-type11"><span class=secno>4.12.3.14. </span>Link
+         <li><a href="#link-type11"><span class=secno>5.11.3.14. </span>Link
           type "<code>search</code>"</a>
 
-         <li><a href="#link-type12"><span class=secno>4.12.3.15. </span>Link
+         <li><a href="#link-type12"><span class=secno>5.11.3.15. </span>Link
           type "<code>stylesheet</code>"</a>
 
-         <li><a href="#link-type13"><span class=secno>4.12.3.16. </span>Link
+         <li><a href="#link-type13"><span class=secno>5.11.3.16. </span>Link
           type "<code>sidebar</code>"</a>
 
-         <li><a href="#link-type14"><span class=secno>4.12.3.17. </span>Link
+         <li><a href="#link-type14"><span class=secno>5.11.3.17. </span>Link
           type "<code>tag</code>"</a>
 
-         <li><a href="#hierarchical"><span class=secno>4.12.3.18.
+         <li><a href="#hierarchical"><span class=secno>5.11.3.18.
           </span>Hierarchical link types</a>
           <ul class=toc>
-           <li><a href="#link-type15"><span class=secno>4.12.3.18.1.
+           <li><a href="#link-type15"><span class=secno>5.11.3.18.1.
             </span>Link type "<code>index</code>"</a>
 
-           <li><a href="#link-type16"><span class=secno>4.12.3.18.2.
+           <li><a href="#link-type16"><span class=secno>5.11.3.18.2.
             </span>Link type "<code>up</code>"</a>
           </ul>
 
-         <li><a href="#sequential"><span class=secno>4.12.3.19.
+         <li><a href="#sequential"><span class=secno>5.11.3.19.
           </span>Sequential link types</a>
           <ul class=toc>
-           <li><a href="#link-type17"><span class=secno>4.12.3.19.1.
+           <li><a href="#link-type17"><span class=secno>5.11.3.19.1.
             </span>Link type "<code>first</code>"</a>
 
-           <li><a href="#link-type18"><span class=secno>4.12.3.19.2.
+           <li><a href="#link-type18"><span class=secno>5.11.3.19.2.
             </span>Link type "<code>last</code>"</a>
 
-           <li><a href="#link-type19"><span class=secno>4.12.3.19.3.
+           <li><a href="#link-type19"><span class=secno>5.11.3.19.3.
             </span>Link type "<code>next</code>"</a>
 
-           <li><a href="#link-type20"><span class=secno>4.12.3.19.4.
+           <li><a href="#link-type20"><span class=secno>5.11.3.19.4.
             </span>Link type "<code>prev</code>"</a>
           </ul>
 
-         <li><a href="#other0"><span class=secno>4.12.3.20. </span>Other link
+         <li><a href="#other0"><span class=secno>5.11.3.20. </span>Other link
           types</a>
         </ul>
       </ul>
-
-     <li><a href="#interfaces"><span class=secno>4.13 </span>Interfaces for
-      URI manipulation</a>
     </ul>
 
-   <li><a href="#editing"><span class=secno>5. </span>User Interaction</a>
+   <li><a href="#editing"><span class=secno>6. </span>User Interaction</a>
     <ul class=toc>
-     <li><a href="#editing-intro"><span class=secno>5.1
+     <li><a href="#editing-intro"><span class=secno>6.1
       </span>Introduction</a>
 
-     <li><a href="#the-irrelevant"><span class=secno>5.2 </span>The
+     <li><a href="#the-irrelevant"><span class=secno>6.2 </span>The
       <code>irrelevant</code> attribute</a>
 
-     <li><a href="#activation"><span class=secno>5.3 </span>Activation</a>
+     <li><a href="#activation"><span class=secno>6.3 </span>Activation</a>
 
-     <li><a href="#scrolling"><span class=secno>5.4 </span>Scrolling elements
+     <li><a href="#scrolling"><span class=secno>6.4 </span>Scrolling elements
       into view</a>
 
-     <li><a href="#focus"><span class=secno>5.5 </span>Focus</a>
+     <li><a href="#focus"><span class=secno>6.5 </span>Focus</a>
       <ul class=toc>
-       <li><a href="#focus-management"><span class=secno>5.5.1 </span>Focus
+       <li><a href="#focus-management"><span class=secno>6.5.1 </span>Focus
         management</a>
 
-       <li><a href="#sequential0"><span class=secno>5.5.2 </span>Sequential
+       <li><a href="#sequential0"><span class=secno>6.5.2 </span>Sequential
         focus navigation</a>
       </ul>
 
-     <li><a href="#selection"><span class=secno>5.6 </span>The text selection
+     <li><a href="#selection"><span class=secno>6.6 </span>The text selection
       APIs</a>
       <ul class=toc>
-       <li><a href="#documentSelection"><span class=secno>5.6.1 </span>APIs
+       <li><a href="#documentSelection"><span class=secno>6.6.1 </span>APIs
         for the browsing context selection</a>
 
-       <li><a href="#textFieldSelection"><span class=secno>5.6.2 </span>APIs
+       <li><a href="#textFieldSelection"><span class=secno>6.6.2 </span>APIs
         for the text field selections</a>
       </ul>
 
-     <li><a href="#contenteditable"><span class=secno>5.7 </span>The <code
+     <li><a href="#contenteditable"><span class=secno>6.7 </span>The <code
       title=attr-contenteditable>contenteditable</code> attribute</a>
       <ul class=toc>
-       <li><a href="#user-editing"><span class=secno>5.7.1 </span>User
+       <li><a href="#user-editing"><span class=secno>6.7.1 </span>User
         editing actions</a>
 
-       <li><a href="#making"><span class=secno>5.7.2 </span>Making entire
+       <li><a href="#making"><span class=secno>6.7.2 </span>Making entire
         documents editable</a>
       </ul>
 
-     <li><a href="#dnd"><span class=secno>5.8 </span>Drag and drop</a>
+     <li><a href="#dnd"><span class=secno>6.8 </span>Drag and drop</a>
       <ul class=toc>
-       <li><a href="#introduction4"><span class=secno>5.8.1
+       <li><a href="#introduction4"><span class=secno>6.8.1
         </span>Introduction</a>
 
-       <li><a href="#the-dragevent"><span class=secno>5.8.2 </span>The
+       <li><a href="#the-dragevent"><span class=secno>6.8.2 </span>The
         <code>DragEvent</code> and <code>DataTransfer</code> interfaces</a>
 
-       <li><a href="#events1"><span class=secno>5.8.3 </span>Events fired
+       <li><a href="#events1"><span class=secno>6.8.3 </span>Events fired
         during a drag-and-drop action</a>
 
-       <li><a href="#drag-and-drop"><span class=secno>5.8.4
+       <li><a href="#drag-and-drop"><span class=secno>6.8.4
         </span>Drag-and-drop processing model</a>
         <ul class=toc>
-         <li><a href="#when-the"><span class=secno>5.8.4.1. </span>When the
+         <li><a href="#when-the"><span class=secno>6.8.4.1. </span>When the
           drag-and-drop operation starts or ends in another document</a>
 
-         <li><a href="#when-the0"><span class=secno>5.8.4.2. </span>When the
+         <li><a href="#when-the0"><span class=secno>6.8.4.2. </span>When the
           drag-and-drop operation starts or ends in another application</a>
         </ul>
 
-       <li><a href="#the-draggable"><span class=secno>5.8.5 </span>The
+       <li><a href="#the-draggable"><span class=secno>6.8.5 </span>The
         <code>draggable</code> attribute</a>
 
-       <li><a href="#copy-and"><span class=secno>5.8.6 </span>Copy and
+       <li><a href="#copy-and"><span class=secno>6.8.6 </span>Copy and
         paste</a>
         <ul class=toc>
-         <li><a href="#copy-to"><span class=secno>5.8.6.1. </span>Copy to
+         <li><a href="#copy-to"><span class=secno>6.8.6.1. </span>Copy to
           clipboard</a>
 
-         <li><a href="#cut-to"><span class=secno>5.8.6.2. </span>Cut to
+         <li><a href="#cut-to"><span class=secno>6.8.6.2. </span>Cut to
           clipboard</a>
 
-         <li><a href="#paste"><span class=secno>5.8.6.3. </span>Paste from
+         <li><a href="#paste"><span class=secno>6.8.6.3. </span>Paste from
           clipboard</a>
 
-         <li><a href="#paste0"><span class=secno>5.8.6.4. </span>Paste from
+         <li><a href="#paste0"><span class=secno>6.8.6.4. </span>Paste from
           selection</a>
         </ul>
 
-       <li><a href="#security8"><span class=secno>5.8.7 </span>Security risks
+       <li><a href="#security8"><span class=secno>6.8.7 </span>Security risks
         in the drag-and-drop model</a>
       </ul>
 
-     <li><a href="#undo"><span class=secno>5.9 </span>Undo history</a>
+     <li><a href="#undo"><span class=secno>6.9 </span>Undo history</a>
       <ul class=toc>
-       <li><a href="#the-undomanager"><span class=secno>5.9.1 </span>The
+       <li><a href="#the-undomanager"><span class=secno>6.9.1 </span>The
         <code>UndoManager</code> interface</a>
 
-       <li><a href="#undo-moving"><span class=secno>5.9.2 </span>Undo: moving
+       <li><a href="#undo-moving"><span class=secno>6.9.2 </span>Undo: moving
         back in the undo transaction history</a>
 
-       <li><a href="#redo-moving"><span class=secno>5.9.3 </span>Redo: moving
+       <li><a href="#redo-moving"><span class=secno>6.9.3 </span>Redo: moving
         forward in the undo transaction history</a>
 
-       <li><a href="#the-undomanagerevent"><span class=secno>5.9.4 </span>The
+       <li><a href="#the-undomanagerevent"><span class=secno>6.9.4 </span>The
         <code>UndoManagerEvent</code> interface and the <code
         title=event-undo>undo</code> and <code title=event-redo>redo</code>
         events</a>
 
-       <li><a href="#implementation0"><span class=secno>5.9.5
+       <li><a href="#implementation0"><span class=secno>6.9.5
         </span>Implementation notes</a>
       </ul>
 
-     <li><a href="#command"><span class=secno>5.10 </span>Command APIs</a>
+     <li><a href="#command"><span class=secno>6.10 </span>Command APIs</a>
     </ul>
 
-   <li><a href="#comms"><span class=secno>6. </span>Communication</a>
+   <li><a href="#comms"><span class=secno>7. </span>Communication</a>
     <ul class=toc>
-     <li><a href="#event1"><span class=secno>6.1 </span>Event definitions</a>
+     <li><a href="#event1"><span class=secno>7.1 </span>Event definitions</a>
       
 
-     <li><a href="#server-sent-events"><span class=secno>6.2
+     <li><a href="#server-sent-events"><span class=secno>7.2
       </span>Server-sent DOM events</a>
       <ul class=toc>
-       <li><a href="#the-remoteeventtarget"><span class=secno>6.2.1
+       <li><a href="#the-remoteeventtarget"><span class=secno>7.2.1
         </span>The <code>RemoteEventTarget</code> interface</a>
 
-       <li><a href="#connecting"><span class=secno>6.2.2 </span>Connecting to
+       <li><a href="#connecting"><span class=secno>7.2.2 </span>Connecting to
         an event stream</a>
 
-       <li><a href="#parsing1"><span class=secno>6.2.3 </span>Parsing an
+       <li><a href="#parsing1"><span class=secno>7.2.3 </span>Parsing an
         event stream</a>
 
-       <li><a href="#event-stream-interpretation"><span class=secno>6.2.4
+       <li><a href="#event-stream-interpretation"><span class=secno>7.2.4
         </span>Interpreting an event stream</a>
 
-       <li><a href="#notes"><span class=secno>6.2.5 </span>Notes</a>
+       <li><a href="#notes"><span class=secno>7.2.5 </span>Notes</a>
       </ul>
 
-     <li><a href="#network"><span class=secno>6.3 </span>Network
+     <li><a href="#network"><span class=secno>7.3 </span>Network
       connections</a>
       <ul class=toc>
-       <li><a href="#network-intro"><span class=secno>6.3.1
+       <li><a href="#network-intro"><span class=secno>7.3.1
         </span>Introduction</a>
 
-       <li><a href="#the-connection"><span class=secno>6.3.2 </span>The
+       <li><a href="#the-connection"><span class=secno>7.3.2 </span>The
         <code>Connection</code> interface</a>
 
-       <li><a href="#connection"><span class=secno>6.3.3 </span>Connection
+       <li><a href="#connection"><span class=secno>7.3.3 </span>Connection
         Events</a>
 
-       <li><a href="#tcp-connections"><span class=secno>6.3.4 </span>TCP
+       <li><a href="#tcp-connections"><span class=secno>7.3.4 </span>TCP
         connections</a>
 
-       <li><a href="#broadcast"><span class=secno>6.3.5 </span>Broadcast
+       <li><a href="#broadcast"><span class=secno>7.3.5 </span>Broadcast
         connections</a>
         <ul class=toc>
-         <li><a href="#broadcasting"><span class=secno>6.3.5.1.
+         <li><a href="#broadcasting"><span class=secno>7.3.5.1.
           </span>Broadcasting over TCP/IP</a>
 
-         <li><a href="#bluetooth-broadcast"><span class=secno>6.3.5.2.
+         <li><a href="#bluetooth-broadcast"><span class=secno>7.3.5.2.
           </span>Broadcasting over Bluetooth</a>
 
-         <li><a href="#irda-broadcast"><span class=secno>6.3.5.3.
+         <li><a href="#irda-broadcast"><span class=secno>7.3.5.3.
           </span>Broadcasting over IrDA</a>
         </ul>
 
-       <li><a href="#peer-to-peer"><span class=secno>6.3.6
+       <li><a href="#peer-to-peer"><span class=secno>7.3.6
         </span>Peer-to-peer connections</a>
         <ul class=toc>
-         <li><a href="#peer-to-peer0"><span class=secno>6.3.6.1.
+         <li><a href="#peer-to-peer0"><span class=secno>7.3.6.1.
           </span>Peer-to-peer connections over TCP/IP</a>
 
-         <li><a href="#bluetooth-peer"><span class=secno>6.3.6.2.
+         <li><a href="#bluetooth-peer"><span class=secno>7.3.6.2.
           </span>Peer-to-peer connections over Bluetooth</a>
 
-         <li><a href="#irda-peer"><span class=secno>6.3.6.3.
+         <li><a href="#irda-peer"><span class=secno>7.3.6.3.
           </span>Peer-to-peer connections over IrDA</a>
         </ul>
 
-       <li><a href="#the-common"><span class=secno>6.3.7 </span>The common
+       <li><a href="#the-common"><span class=secno>7.3.7 </span>The common
         protocol for TCP-based connections</a>
         <ul class=toc>
-         <li><a href="#clients"><span class=secno>6.3.7.1. </span>Clients
+         <li><a href="#clients"><span class=secno>7.3.7.1. </span>Clients
           connecting over TCP</a>
 
-         <li><a href="#servers"><span class=secno>6.3.7.2. </span>Servers
+         <li><a href="#servers"><span class=secno>7.3.7.2. </span>Servers
           accepting connections over TCP</a>
 
-         <li><a href="#sending"><span class=secno>6.3.7.3. </span>Sending and
+         <li><a href="#sending"><span class=secno>7.3.7.3. </span>Sending and
           receiving data over TCP</a>
         </ul>
 
-       <li><a href="#network-security"><span class=secno>6.3.8
+       <li><a href="#network-security"><span class=secno>7.3.8
         </span>Security</a>
 
-       <li><a href="#network-other-specs"><span class=secno>6.3.9
+       <li><a href="#network-other-specs"><span class=secno>7.3.9
         </span>Relationship to other standards</a>
       </ul>
 
-     <li><a href="#crossDocumentMessages"><span class=secno>6.4
+     <li><a href="#crossDocumentMessages"><span class=secno>7.4
       </span>Cross-document messaging</a>
       <ul class=toc>
-       <li><a href="#processing4"><span class=secno>6.4.1 </span>Processing
+       <li><a href="#processing4"><span class=secno>7.4.1 </span>Processing
         model</a>
       </ul>
     </ul>
 
-   <li><a href="#repetition"><span class=secno>7. </span>Repetition
+   <li><a href="#repetition"><span class=secno>8. </span>Repetition
     templates</a>
 
-   <li><a href="#syntax"><span class=secno>8. </span>The HTML syntax</a>
+   <li><a href="#syntax"><span class=secno>9. </span>The HTML syntax</a>
     <ul class=toc>
-     <li><a href="#writing0"><span class=secno>8.1 </span>Writing HTML
+     <li><a href="#writing0"><span class=secno>9.1 </span>Writing HTML
       documents</a>
       <ul class=toc>
-       <li><a href="#the-doctype"><span class=secno>8.1.1 </span>The
+       <li><a href="#the-doctype"><span class=secno>9.1.1 </span>The
         DOCTYPE</a>
 
-       <li><a href="#elements0"><span class=secno>8.1.2 </span>Elements</a>
+       <li><a href="#elements1"><span class=secno>9.1.2 </span>Elements</a>
         <ul class=toc>
-         <li><a href="#start"><span class=secno>8.1.2.1. </span>Start
+         <li><a href="#start"><span class=secno>9.1.2.1. </span>Start
           tags</a>
 
-         <li><a href="#end-tags"><span class=secno>8.1.2.2. </span>End
+         <li><a href="#end-tags"><span class=secno>9.1.2.2. </span>End
           tags</a>
 
-         <li><a href="#attributes1"><span class=secno>8.1.2.3.
+         <li><a href="#attributes1"><span class=secno>9.1.2.3.
           </span>Attributes</a>
 
-         <li><a href="#optional"><span class=secno>8.1.2.4. </span>Optional
+         <li><a href="#optional"><span class=secno>9.1.2.4. </span>Optional
           tags</a>
 
-         <li><a href="#element-restrictions"><span class=secno>8.1.2.5.
+         <li><a href="#element-restrictions"><span class=secno>9.1.2.5.
           </span>Restrictions on content models</a>
 
-         <li><a href="#cdata-rcdata-restrictions"><span class=secno>8.1.2.6.
+         <li><a href="#cdata-rcdata-restrictions"><span class=secno>9.1.2.6.
           </span>Restrictions on the contents of CDATA and RCDATA
           elements</a>
         </ul>
 
-       <li><a href="#text0"><span class=secno>8.1.3 </span>Text</a>
+       <li><a href="#text0"><span class=secno>9.1.3 </span>Text</a>
         <ul class=toc>
-         <li><a href="#newlines"><span class=secno>8.1.3.1.
+         <li><a href="#newlines"><span class=secno>9.1.3.1.
           </span>Newlines</a>
         </ul>
 
-       <li><a href="#character"><span class=secno>8.1.4 </span>Character
+       <li><a href="#character"><span class=secno>9.1.4 </span>Character
         references</a>
 
-       <li><a href="#cdata"><span class=secno>8.1.5 </span>CDATA blocks</a>
+       <li><a href="#cdata"><span class=secno>9.1.5 </span>CDATA blocks</a>
 
-       <li><a href="#comments"><span class=secno>8.1.6 </span>Comments</a>
+       <li><a href="#comments"><span class=secno>9.1.6 </span>Comments</a>
       </ul>
 
-     <li><a href="#parsing"><span class=secno>8.2 </span>Parsing HTML
+     <li><a href="#parsing"><span class=secno>9.2 </span>Parsing HTML
       documents</a>
       <ul class=toc>
-       <li><a href="#overview"><span class=secno>8.2.1 </span>Overview of the
+       <li><a href="#overview"><span class=secno>9.2.1 </span>Overview of the
         parsing model</a>
 
-       <li><a href="#the-input0"><span class=secno>8.2.2 </span>The input
+       <li><a href="#the-input0"><span class=secno>9.2.2 </span>The input
         stream</a>
         <ul class=toc>
-         <li><a href="#determining"><span class=secno>8.2.2.1.
+         <li><a href="#determining"><span class=secno>9.2.2.1.
           </span>Determining the character encoding</a>
 
-         <li><a href="#character0"><span class=secno>8.2.2.2.
+         <li><a href="#character0"><span class=secno>9.2.2.2.
           </span>Character encoding requirements</a>
 
-         <li><a href="#preprocessing"><span class=secno>8.2.2.3.
+         <li><a href="#preprocessing"><span class=secno>9.2.2.3.
           </span>Preprocessing the input stream</a>
 
-         <li><a href="#changing"><span class=secno>8.2.2.4. </span>Changing
+         <li><a href="#changing"><span class=secno>9.2.2.4. </span>Changing
           the encoding while parsing</a>
         </ul>
 
-       <li><a href="#parse"><span class=secno>8.2.3 </span>Parse state</a>
+       <li><a href="#parse"><span class=secno>9.2.3 </span>Parse state</a>
         <ul class=toc>
-         <li><a href="#the-insertion"><span class=secno>8.2.3.1. </span>The
+         <li><a href="#the-insertion"><span class=secno>9.2.3.1. </span>The
           insertion mode</a>
 
-         <li><a href="#the-stack"><span class=secno>8.2.3.2. </span>The stack
+         <li><a href="#the-stack"><span class=secno>9.2.3.2. </span>The stack
           of open elements</a>
 
-         <li><a href="#the-list"><span class=secno>8.2.3.3. </span>The list
+         <li><a href="#the-list"><span class=secno>9.2.3.3. </span>The list
           of active formatting elements</a>
 
-         <li><a href="#the-element"><span class=secno>8.2.3.4. </span>The
+         <li><a href="#the-element"><span class=secno>9.2.3.4. </span>The
           element pointers</a>
 
-         <li><a href="#the-scripting"><span class=secno>8.2.3.5. </span>The
+         <li><a href="#the-scripting"><span class=secno>9.2.3.5. </span>The
           scripting state</a>
         </ul>
 
-       <li><a href="#tokenisation"><span class=secno>8.2.4
+       <li><a href="#tokenisation"><span class=secno>9.2.4
         </span>Tokenisation</a>
         <ul class=toc>
-         <li><a href="#tokenising"><span class=secno>8.2.4.1.
+         <li><a href="#tokenising"><span class=secno>9.2.4.1.
           </span>Tokenising character references</a>
         </ul>
 
-       <li><a href="#tree-construction"><span class=secno>8.2.5 </span>Tree
+       <li><a href="#tree-construction"><span class=secno>9.2.5 </span>Tree
         construction</a>
         <ul class=toc>
-         <li><a href="#creating"><span class=secno>8.2.5.1. </span>Creating
+         <li><a href="#creating"><span class=secno>9.2.5.1. </span>Creating
           and inserting elements</a>
 
-         <li><a href="#closing"><span class=secno>8.2.5.2. </span>Closing
+         <li><a href="#closing"><span class=secno>9.2.5.2. </span>Closing
           elements that have implied end tags</a>
 
-         <li><a href="#foster"><span class=secno>8.2.5.3. </span>Foster
+         <li><a href="#foster"><span class=secno>9.2.5.3. </span>Foster
           parenting</a>
 
-         <li><a href="#the-initial"><span class=secno>8.2.5.4. </span>The
+         <li><a href="#the-initial"><span class=secno>9.2.5.4. </span>The
           "initial" insertion mode</a>
 
-         <li><a href="#the-before"><span class=secno>8.2.5.5. </span>The
+         <li><a href="#the-before"><span class=secno>9.2.5.5. </span>The
           "before html" insertion mode</a>
 
-         <li><a href="#the-before0"><span class=secno>8.2.5.6. </span>The
+         <li><a href="#the-before0"><span class=secno>9.2.5.6. </span>The
           "before head" insertion mode</a>
 
-         <li><a href="#parsing-main-inhead"><span class=secno>8.2.5.7.
+         <li><a href="#parsing-main-inhead"><span class=secno>9.2.5.7.
           </span>The "in head" insertion mode</a>
 
          <li><a href="#parsing-main-inheadnoscript"><span
-          class=secno>8.2.5.8. </span>The "in head noscript" insertion
+          class=secno>9.2.5.8. </span>The "in head noscript" insertion
           mode</a>
 
-         <li><a href="#the-after"><span class=secno>8.2.5.9. </span>The
+         <li><a href="#the-after"><span class=secno>9.2.5.9. </span>The
           "after head" insertion mode</a>
 
-         <li><a href="#parsing-main-inbody"><span class=secno>8.2.5.10.
+         <li><a href="#parsing-main-inbody"><span class=secno>9.2.5.10.
           </span>The "in body" insertion mode</a>
 
-         <li><a href="#parsing-main-intable"><span class=secno>8.2.5.11.
+         <li><a href="#parsing-main-intable"><span class=secno>9.2.5.11.
           </span>The "in table" insertion mode</a>
 
-         <li><a href="#parsing-main-incaption"><span class=secno>8.2.5.12.
+         <li><a href="#parsing-main-incaption"><span class=secno>9.2.5.12.
           </span>The "in caption" insertion mode</a>
 
-         <li><a href="#parsing-main-incolgroup"><span class=secno>8.2.5.13.
+         <li><a href="#parsing-main-incolgroup"><span class=secno>9.2.5.13.
           </span>The "in column group" insertion mode</a>
 
-         <li><a href="#parsing-main-intbody"><span class=secno>8.2.5.14.
+         <li><a href="#parsing-main-intbody"><span class=secno>9.2.5.14.
           </span>The "in table body" insertion mode</a>
 
-         <li><a href="#parsing-main-intr"><span class=secno>8.2.5.15.
+         <li><a href="#parsing-main-intr"><span class=secno>9.2.5.15.
           </span>The "in row" insertion mode</a>
 
-         <li><a href="#parsing-main-intd"><span class=secno>8.2.5.16.
+         <li><a href="#parsing-main-intd"><span class=secno>9.2.5.16.
           </span>The "in cell" insertion mode</a>
 
-         <li><a href="#parsing-main-inselect"><span class=secno>8.2.5.17.
+         <li><a href="#parsing-main-inselect"><span class=secno>9.2.5.17.
           </span>The "in select" insertion mode</a>
 
          <li><a href="#parsing-main-inselectintable"><span
-          class=secno>8.2.5.18. </span>The "in select in table" insertion
+          class=secno>9.2.5.18. </span>The "in select in table" insertion
           mode</a>
 
-         <li><a href="#parsing-main-inforeign"><span class=secno>8.2.5.19.
+         <li><a href="#parsing-main-inforeign"><span class=secno>9.2.5.19.
           </span>The "in foreign content" insertion mode</a>
 
-         <li><a href="#parsing-main-afterbody"><span class=secno>8.2.5.20.
+         <li><a href="#parsing-main-afterbody"><span class=secno>9.2.5.20.
           </span>The "after body" insertion mode</a>
 
-         <li><a href="#parsing-main-inframeset"><span class=secno>8.2.5.21.
+         <li><a href="#parsing-main-inframeset"><span class=secno>9.2.5.21.
           </span>The "in frameset" insertion mode</a>
 
          <li><a href="#parsing-main-afterframeset"><span
-          class=secno>8.2.5.22. </span>The "after frameset" insertion
+          class=secno>9.2.5.22. </span>The "after frameset" insertion
           mode</a>
 
-         <li><a href="#the-after0"><span class=secno>8.2.5.23. </span>The
+         <li><a href="#the-after0"><span class=secno>9.2.5.23. </span>The
           "after after body" insertion mode</a>
 
-         <li><a href="#the-after1"><span class=secno>8.2.5.24. </span>The
+         <li><a href="#the-after1"><span class=secno>9.2.5.24. </span>The
           "after after frameset" insertion mode</a>
         </ul>
 
-       <li><a href="#the-end"><span class=secno>8.2.6 </span>The end</a>
+       <li><a href="#the-end"><span class=secno>9.2.6 </span>The end</a>
       </ul>
 
-     <li><a href="#namespaces"><span class=secno>8.3 </span>Namespaces</a>
+     <li><a href="#namespaces"><span class=secno>9.3 </span>Namespaces</a>
 
-     <li><a href="#serializing"><span class=secno>8.4 </span>Serializing HTML
+     <li><a href="#serializing"><span class=secno>9.4 </span>Serializing HTML
       fragments</a>
 
-     <li><a href="#parsing2"><span class=secno>8.5 </span>Parsing HTML
+     <li><a href="#parsing2"><span class=secno>9.5 </span>Parsing HTML
       fragments</a>
 
-     <li><a href="#named"><span class=secno>8.6 </span>Named character
+     <li><a href="#named"><span class=secno>9.6 </span>Named character
       references</a>
     </ul>
 
-   <li><a href="#rendering"><span class=secno>9. </span>Rendering and
+   <li><a href="#rendering"><span class=secno>10. </span>Rendering and
     user-agent behavior</a>
     <ul class=toc>
-     <li><a href="#rendering0"><span class=secno>9.1 </span>Rendering and the
-      DOM</a>
+     <li><a href="#rendering0"><span class=secno>10.1 </span>Rendering and
+      the DOM</a>
 
-     <li><a href="#rendering1"><span class=secno>9.2 </span>Rendering and
+     <li><a href="#rendering1"><span class=secno>10.2 </span>Rendering and
       menus/toolbars</a>
       <ul class=toc>
-       <li><a href="#the-icon"><span class=secno>9.2.1 </span>The 'icon'
+       <li><a href="#the-icon"><span class=secno>10.2.1 </span>The 'icon'
         property</a>
       </ul>
 
-     <li><a href="#obsolete"><span class=secno>9.3 </span>Obsolete elements,
+     <li><a href="#obsolete"><span class=secno>10.3 </span>Obsolete elements,
       attributes, and APIs</a>
       <ul class=toc>
-       <li><a href="#the-body0"><span class=secno>9.3.1 </span>The
+       <li><a href="#the-body0"><span class=secno>10.3.1 </span>The
         <code>body</code> element</a>
 
-       <li><a href="#the-applet"><span class=secno>9.3.2 </span>The
+       <li><a href="#the-applet"><span class=secno>10.3.2 </span>The
         <code>applet</code> element</a>
       </ul>
     </ul>
 
-   <li><a href="#no"><span class=secno>10. </span>Things that you can't do
+   <li><a href="#no"><span class=secno>11. </span>Things that you can't do
     with this specification because they are better handled using other
     technologies that are further described herein</a>
     <ul class=toc>
-     <li><a href="#localization"><span class=secno>10.1
+     <li><a href="#localization"><span class=secno>11.1
       </span>Localization</a>
 
-     <li><a href="#declarative"><span class=secno>10.2 </span>Declarative 2D
+     <li><a href="#declarative"><span class=secno>11.2 </span>Declarative 2D
       vector graphics and animation</a>
 
-     <li><a href="#declarative0"><span class=secno>10.3 </span>Declarative 3D
+     <li><a href="#declarative0"><span class=secno>11.3 </span>Declarative 3D
       scenes</a>
 
-     <li><a href="#timers"><span class=secno>10.4 </span>Timers</a>
+     <li><a href="#timers"><span class=secno>11.4 </span>Timers</a>
     </ul>
 
    <li class=no-num><a href="#index">Index</a>
@@ -1851,6 +1861,8 @@
 
   <h2 id=introduction><span class=secno>1. </span>Introduction</h2>
 
+  <h3 id=background><span class=secno>1.1 </span>Background</h3>
+
   <p><em>This section is non-normative.</em>
 
   <p>The World Wide Web's markup language has always been HTML. HTML was
@@ -1863,7 +1875,7 @@
    rectify this, while at the same time updating the HTML specifications to
    address issues raised in the past few years.
 
-  <h3 id=scope><span class=secno>1.1 </span>Scope</h3>
+  <h3 id=scope><span class=secno>1.2 </span>Scope</h3>
 
   <p><em>This section is non-normative.</em>
 
@@ -1907,7 +1919,10 @@
    solutions for such sophisticated applications (for example the MacOS X
    Core APIs) are even further ahead.
 
-  <h4 id=relationship><span class=secno>1.1.1 </span>Relationship to HTML
+  <h3 id=relationships><span class=secno>1.3 </span>Relationships to other
+   specifications</h3>
+
+  <h4 id=relationship><span class=secno>1.3.1 </span>Relationship to HTML
    4.01 and DOM2 HTML</h4>
 
   <p><em>This section is non-normative.</em>
@@ -1919,7 +1934,7 @@
    backwards-compatibility is retained. <a href="#refsHTML4">[HTML4]</a> <a
    href="#refsDOM2HTML">[DOM2HTML]</a>
 
-  <h4 id=relationship0><span class=secno>1.1.2 </span>Relationship to XHTML
+  <h4 id=relationship0><span class=secno>1.3.2 </span>Relationship to XHTML
    1.x</h4>
 
   <p><em>This section is non-normative.</em>
@@ -1940,7 +1955,7 @@
    those who do need such a mechanism are encouraged to continue using the
    XHTML 1.1 line of specifications.
 
-  <h4 id=relationship1><span class=secno>1.1.3 </span>Relationship to XHTML2</h4>
+  <h4 id=relationship1><span class=secno>1.3.3 </span>Relationship to XHTML2</h4>
 
   <p><em>This section is non-normative.</em>
 
@@ -1961,7 +1976,7 @@
   <p>XHTML2 and this specification use different namespaces and therefore can
    both be implemented in the same XML processor.
 
-  <h4 id=relationship2><span class=secno>1.1.4 </span>Relationship to Web
+  <h4 id=relationship2><span class=secno>1.3.4 </span>Relationship to Web
    Forms 2.0 and XForms</h4>
 
   <p><em>This section is non-normative.</em>
@@ -1977,7 +1992,7 @@
    in the Web Forms 2.0 draft will apply to this specification. <a
    href="#refsXForms">[XForms]</a>
 
-  <h4 id=relationship3><span class=secno>1.1.5 </span>Relationship to XUL,
+  <h4 id=relationship3><span class=secno>1.3.5 </span>Relationship to XUL,
    Flash, Silverlight, and other proprietary UI languages</h4>
 
   <p><em>This section is non-normative.</em>
@@ -1987,46 +2002,91 @@
    language, HTML provides for a solution to the same problems without the
    risk of vendor lock-in.
 
-  <h3 id=structure><span class=secno>1.2 </span>Structure of this
+  <h3 id=html-vs><span class=secno>1.4 </span>HTML vs XHTML</h3>
+
+  <p><em>This section is non-normative.</em>
+
+  <p>This specification defines an abstract language for describing documents
+   and applications, and some APIs for interacting with in-memory
+   representations of resources that use this language.
+
+  <p>The in-memory representation is known as "DOM5 HTML", or "the DOM" for
+   short.
+
+  <p>There are various concrete syntaxes that can be used to transmit
+   resources that use this abstract language, two of which are defined in
+   this specification.
+
+  <p>The first such concrete syntax is "HTML5". This is the format
+   recommended for most authors. It is compatible with all legacy Web
+   browsers. If a document is transmitted with the MIME type <code
+   title="">text/html</code>, then it will be processed as an "HTML5"
+   document by Web browsers.
+
+  <p>The second concrete syntax uses XML, and is known as "XHTML5". When a
+   document is transmitted with an XML MIME type, such as <code
+   title="">application/xhtml+xml</code>, then it is processed by an XML
+   processor by Web browsers, and treated as an "XHTML5" document. Authors
+   are reminded that the processing for XML and HTML differs; in particular,
+   even minor syntax errors will prevent an XML document from being rendered
+   fully, whereas they would be ignored in the "HTML5" syntax.
+
+  <p>The "DOM5 HTML", "HTML5", and "XHTML5" representations cannot all
+   represent the same content. For example, namespaces cannot be represented
+   using "HTML5", but they are supported in "DOM5 HTML" and "XHTML5".
+   Similarly, documents that use the <code><a
+   href="#noscript">noscript</a></code> feature can be represented using
+   "HTML5", but cannot be represented with "XHTML5" and "DOM5 HTML". Comments
+   that contain the string "<code title="">--></code>" can be represented
+   in "DOM5 HTML" but not in "HTML5" and "XHTML5". And so forth.
+
+  <h3 id=structure><span class=secno>1.5 </span>Structure of this
    specification</h3>
 
   <p><em>This section is non-normative.</em>
 
-  <p>This specification is divided into the following important sections:
+  <p>This specification is divided into the following major sections:
 
   <dl>
-   <dt><a href="#dom">The DOM</a>
+   <dt><a href="#infrastructure">Common Infrastructure</a>
 
-   <dd>The DOM, or Document Object Model, provides a base for the rest of the
-    specification.
+   <dd>The conformance classes, algorithms, definitions, and the common
+    underpinnings of the rest of the specification.
 
-   <dt><a href="#semantics">The Semantics</a>
+   <dt><a href="#dom">The DOM</a>
 
    <dd>Documents are built from elements. These elements form a tree using
-    the DOM. Each element also has a predefined meaning, which is explained
-    in this section. User agent requirements for how to handle each element
-    are also given, along with rules for authors on how to use the element.
+    the DOM. This section defines the features of this DOM, as well as
+    introducing the features common to all elements, and the concepts used in
+    defining elements.
 
-   <dt><a href="#windows">Browsing Contexts</a>
+   <dt><a href="#semantics">Elements</a>
 
+   <dd>Each element has a predefined meaning, which is explained in this
+    section. User agent requirements for how to handle each element are also
+    given, along with rules for authors on how to use the element.
+
+   <dt><a href="#browsers">Web Browsers</a>
+
    <dd>HTML documents do not exist in a vacuum — this section defines
     many of the features that affect environments that deal with multiple
     pages, links between pages, and running scripts.
 
-   <dt>APIs
+   <dt><a href="#editing">User Interaction</a>
 
-   <dd><a href="#editing">User interaction</a>: HTML documents can provide a
-    number of mechanisms for users to interact with and modify content, which
-    are described in this section.
+   <dd>HTML documents can provide a number of mechanisms for users to
+    interact with and modify content, which are described in this section.
 
-   <dd><a href="#comms">The Communication APIs</a>: Applications written in
-    HTML often require mechanisms to communicate with remote servers, as well
-    as communicating with other applications from different domains running
-    on the same client.
+   <dt><a href="#comms">The Communication APIs</a>
 
-   <dd><a href="#repetition">Repetition Templates</a>: A mechanism to support
-    repeating sections in forms.
+   <dd>Applications written in HTML often require mechanisms to communicate
+    with remote servers, as well as communicating with other applications
+    from different domains running on the same client.
 
+   <dt><a href="#repetition">Repetition Templates</a>
+
+   <dd>A mechanism to support repeating sections in forms.
+
    <dt><a href="#syntax">The Language Syntax</a>
 
    <dd>All of these features would be for naught if they couldn't be
@@ -2039,15 +2099,17 @@
    href="#rendering">rendering rules</a> for Web browsers and listing <a
    href="#no">areas that are out of scope</a> for this specification.
 
-  <h4 id=how-to><span class=secno>1.2.1 </span>How to read this specification</h4>
+  <h4 id=how-to><span class=secno>1.5.1 </span>How to read this specification</h4>
 
   <p>This specification should be read like all other specifications. First,
    it should be read cover-to-cover, multiple times. Then, it should be read
    backwards at least once. Then it should be read by picking random sections
    from the contents list and following all the cross-references.
 
-  <h3 id=conformance><span class=secno>1.3 </span>Conformance requirements</h3>
+  <h2 id=infrastructure><span class=secno>2. </span>Common infrastructure</h2>
 
+  <h3 id=conformance><span class=secno>2.1 </span>Conformance requirements</h3>
+
   <p>All diagrams, examples, and notes in this specification are
    non-normative, as are all sections explicitly marked non-normative.
    Everything else in this specification is normative.
@@ -2320,40 +2382,8 @@
    be treated as if they contained just an empty text node for the purposes
    of the algorithms defined in this specification.
 
-  <h4 id=common><span class=secno>1.3.1 </span>Common conformance
-   requirements for APIs exposed to JavaScript</h4>
+  <h4 id=dependencies><span class=secno>2.1.1 </span>Dependencies</h4>
 
-  <p class=big-issue>A lot of arrays/lists/<a href="#collections0"
-   title=collections>collection</a>s in this spec assume zero-based indexes
-   but use the term "<var title="">index</var>th" liberally. We should define
-   those to be zero-based and be clearer about this.
-
-  <p>Unless otherwise specified, if a DOM attribute that is a floating point
-   number type (<code title="">float</code>) is assigned an Infinity or
-   Not-a-Number value, a <code title=big-issue>NOT_SUPPORTED_ERR</code>
-   exception must be raised.
-
-  <p>Unless otherwise specified, if a method with an argument that is a
-   floating point number type (<code title="">float</code>) is passed an
-   Infinity or Not-a-Number value, a <code
-   title=big-issue>NOT_SUPPORTED_ERR</code> exception must be raised.</p>
-  <!-- XXX DOMB -->
-
-  <p>Unless otherwise specified, if a method is passed fewer arguments than
-   is defined for that method in its IDL definition, a <code
-   title=big-issue>NOT_SUPPORTED_ERR</code> exception must be raised.</p>
-  <!-- XXX DOMB -->
-
-  <p>Unless otherwise specified, if a method is passed more arguments than is
-   defined for that method in its IDL definition, the excess arguments must
-   be ignored.</p>
-  <!-- XXX When updating this spec for
-  Bindings-For-DOM-compliance, also remove or consider the equivalent
-  requirement in the canvas section for toDataURL() and
-  getContext(). -->
-
-  <h4 id=dependencies><span class=secno>1.3.2 </span>Dependencies</h4>
-
   <p>This specification relies on several other underlying specifications.
 
   <dl>
@@ -2383,6 +2413,12 @@
    <dt>DOM
 
    <dd>
+    <p>The Document Object Model (DOM) is a representation — a model
+     — of a document and its content. The DOM is not just an API; the
+     conformance criteria of HTML implementations are defined, in this
+     specification, in terms of operations on the DOM. <a
+     href="#refsDOM3CORE">[DOM3CORE]</a></p>
+
     <p>Implementations must support some version of DOM Core and DOM Events,
      because this specification is defined in terms of the DOM, and some of
      the features are defined as extensions to the DOM Core interfaces. <a
@@ -2417,9 +2453,11 @@
    on character encodings, image formats, audio formats, and video formats in
    the respective sections.
 
-  <h4 id=features><span class=secno>1.3.3 </span>Features defined in other
+  <h4 id=features><span class=secno>2.1.2 </span>Features defined in other
    specifications</h4>
 
+  <p class=big-issue>this section will be removed at some point
+
   <p>Some elements are defined in terms of their DOM <dfn
    id=textcontent><code>textContent</code></dfn> attribute. This is an
    attribute defined on the <code>Node</code> interface in DOM3 Core. <a
@@ -2450,11 +2488,46 @@
   <p class=big-issue>See <a
    href="http://dev.w3.org/cvsweb/~checkout~/csswg/cssom/Overview.html?content-type=text/html;%20charset=utf-8">http://dev.w3.org/cvsweb/~checkout~/csswg/cssom/Overview.html?content-type=text/html;%20charset=utf-8</a>
 
-  <h3 id=terminology><span class=secno>1.4 </span>Terminology</h3>
+  <h4 id=common><span class=secno>2.1.3 </span>Common conformance
+   requirements for APIs exposed to JavaScript</h4>
 
+  <p class=big-issue>This section will eventually be removed in favour of
+   WebIDL.
+
+  <p class=big-issue>A lot of arrays/lists/<a href="#collections0"
+   title=collections>collection</a>s in this spec assume zero-based indexes
+   but use the term "<var title="">index</var>th" liberally. We should define
+   those to be zero-based and be clearer about this.
+
+  <p>Unless otherwise specified, if a DOM attribute that is a floating point
+   number type (<code title="">float</code>) is assigned an Infinity or
+   Not-a-Number value, a <code title=big-issue>NOT_SUPPORTED_ERR</code>
+   exception must be raised.
+
+  <p>Unless otherwise specified, if a method with an argument that is a
+   floating point number type (<code title="">float</code>) is passed an
+   Infinity or Not-a-Number value, a <code
+   title=big-issue>NOT_SUPPORTED_ERR</code> exception must be raised.</p>
+  <!-- XXX DOMB -->
+
+  <p>Unless otherwise specified, if a method is passed fewer arguments than
+   is defined for that method in its IDL definition, a <code
+   title=big-issue>NOT_SUPPORTED_ERR</code> exception must be raised.</p>
+  <!-- XXX DOMB -->
+
+  <p>Unless otherwise specified, if a method is passed more arguments than is
+   defined for that method in its IDL definition, the excess arguments must
+   be ignored.</p>
+  <!-- XXX When updating this spec for
+  Bindings-For-DOM-compliance, also remove or consider the equivalent
+  requirement in the canvas section for toDataURL() and
+  getContext(). -->
+
+  <h3 id=terminology><span class=secno>2.2 </span>Terminology</h3>
+
   <p>This specification refers to both HTML and XML attributes and DOM
    attributes, often in the same context. When it is not clear which is being
-   referred to, they are referred to as <dfn id=content>content
+   referred to, they are referred to as <dfn id=content0>content
    attributes</dfn> for HTML and XML attributes, and <dfn
    id=dom-attributes>DOM attributes</dfn> for those from the DOM. Similarly,
    the term "properties" is used for both ECMAScript object properties and
@@ -2464,7 +2537,7 @@
   <p id=html-namespace>To ease migration from HTML to XHTML, UAs conforming
    to this specification will place elements in HTML in the
    <code>http://www.w3.org/1999/xhtml</code> namespace, at least for the
-   purposes of the DOM and CSS. The term "<dfn id=elements1>elements in the
+   purposes of the DOM and CSS. The term "<dfn id=elements2>elements in the
    HTML namespace</dfn>", or "<dfn id=html-elements>HTML elements</dfn>" for
    short, when used in this specification, thus refers to both HTML and XHTML
    elements.
@@ -2474,6 +2547,27 @@
    namespace, and all attributes defined or mentioned in this specification
    have no namespace (they are in the per-element partition).
 
+  <p>When an XML name, such as an attribute or element name, is referred to
+   in the form <code><var title="">prefix</var>:<var
+   title="">localName</var></code>, as in <code>xml:id</code> or
+   <code>svg:rect</code>, it refers to a name with the local name <var
+   title="">localName</var> and the namespace given by the prefix, as defined
+   by the following table:
+
+  <dl>
+   <dt><code title="">xml</code>
+
+   <dd><code>http://www.w3.org/XML/1998/namespace</code>
+
+   <dt><code title="">html</code>
+
+   <dd><code>http://www.w3.org/1999/xhtml</code>
+
+   <dt><code title="">svg</code>
+
+   <dd><code>http://www.w3.org/2000/svg</code>
+  </dl>
+
   <p>The term <a href="#html-">HTML documents</a> is sometimes used in
    contrast with <a href="#xml-documents">XML documents</a> to specifically
    mean documents that were parsed using an <a href="#html-0">HTML parser</a>
@@ -2520,37 +2614,12 @@
    after it is in the DOM. A user agent must not mutate the DOM in such
    situations.
 
-  <p>When an XML name, such as an attribute or element name, is referred to
-   in the form <code><var title="">prefix</var>:<var
-   title="">localName</var></code>, as in <code>xml:id</code> or
-   <code>svg:rect</code>, it refers to a name with the local name <var
-   title="">localName</var> and the namespace given by the prefix, as defined
-   by the following table:
-
-  <dl>
-   <dt><code title="">xml</code>
-
-   <dd><code>http://www.w3.org/XML/1998/namespace</code>
-
-   <dt><code title="">html</code>
-
-   <dd><code>http://www.w3.org/1999/xhtml</code>
-
-   <dt><code title="">svg</code>
-
-   <dd><code>http://www.w3.org/2000/svg</code>
-  </dl>
-
   <p>For simplicity, terms such as <em>shown</em>, <em>displayed</em>, and
    <em>visible</em> might sometimes be used when referring to the way a
    document is rendered to the user. These terms are not meant to imply a
    visual medium; they must be considered to apply to other media in
    equivalent ways.
 
-  <p>DOM interfaces defined in this specification use Web IDL. User agents
-   must implement these interfaces as defined by the Web IDL specification.
-   <a href="#refsWEBIDL">[WEBIDL]</a>
-
   <p>The construction "a <code>Foo</code> object", where <code>Foo</code> is
    actually an interface, is sometimes used instead of the more accurate "an
    object implementing the interface <code>Foo</code>".
@@ -2609,1896 +2678,335 @@
    letting the user interact with Web pages where that would involve invoking
    any script.
 
-  <h4 id=html-vs><span class=secno>1.4.1 </span>HTML vs XHTML</h4>
+  <h3 id=urls><span class=secno>2.3 </span>URLs</h3>
+  <!-- XXXURL -->
 
-  <p><em>This section is non-normative.</em>
-
-  <p>This specification defines an abstract language for describing documents
-   and applications, and some APIs for interacting with in-memory
-   representations of resources that use this language.
-
-  <p>The in-memory representation is known as "DOM5 HTML", or "the DOM" for
-   short.
-
-  <p>There are various concrete syntaxes that can be used to transmit
-   resources that use this abstract language, two of which are defined in
-   this specification.
-
-  <p>The first such concrete syntax is "HTML5". This is the format
-   recommended for most authors. It is compatible with all legacy Web
-   browsers. If a document is transmitted with the MIME type <code
-   title="">text/html</code>, then it will be processed as an "HTML5"
-   document by Web browsers.
-
-  <p>The second concrete syntax uses XML, and is known as "XHTML5". When a
-   document is transmitted with an XML MIME type, such as <code
-   title="">application/xhtml+xml</code>, then it is processed by an XML
-   processor by Web browsers, and treated as an "XHTML5" document. Authors
-   are reminded that the processing for XML and HTML differs; in particular,
-   even minor syntax errors will prevent an XML document from being rendered
-   fully, whereas they would be ignored in the "HTML5" syntax.
-
-  <p>The "DOM5 HTML", "HTML5", and "XHTML5" representations cannot all
-   represent the same content. For example, namespaces cannot be represented
-   using "HTML5", but they are supported in "DOM5 HTML" and "XHTML5".
-   Similarly, documents that use the <code><a
-   href="#noscript">noscript</a></code> feature can be represented using
-   "HTML5", but cannot be represented with "XHTML5" and "DOM5 HTML". Comments
-   that contain the string "<code title="">--></code>" can be represented
-   in "DOM5 HTML" but not in "HTML5" and "XHTML5". And so forth.
-
-  <h2 id=dom><span class=secno>2. </span>The Document Object Model</h2>
-
-  <p>The Document Object Model (DOM) is a representation — a model
-   — of a document and its content. <a
-   href="#refsDOM3CORE">[DOM3CORE]</a> The DOM is not just an API; the
-   conformance criteria of HTML implementations are defined, in this
-   specification, in terms of operations on the DOM.
-
-  <p>This specification defines the language represented in the DOM by
-   features together called DOM5 HTML. DOM5 HTML consists of DOM Core
-   <code>Document</code> nodes and DOM Core <code>Element</code> nodes, along
-   with text nodes and other content.
-
-  <p>Elements in the DOM represent things; that is, they have intrinsic
-   <em>meaning</em>, also known as semantics.
-
-  <p class=example>For example, an <code><a href="#ol">ol</a></code> element
-   represents an ordered list.
-
-  <p>In addition, documents and elements in the DOM host APIs that extend the
-   DOM Core APIs, providing new features to application developers using DOM5
-   HTML.
-
-  <h3 id=documents><span class=secno>2.1 </span>Documents</h3>
-
-  <p>Every XML and HTML document in an HTML UA is represented by a
-   <code>Document</code> object. <a href="#refsDOM3CORE">[DOM3CORE]</a>
-
-  <p><code>Document</code> objects are assumed to be <dfn
-   id=xml-documents>XML documents</dfn> unless they are flagged as being <dfn
-   id=html->HTML documents</dfn> when they are created. Whether a document is
-   an <a href="#html-" title="HTML documents">HTML document</a> or an <a
-   href="#xml-documents" title="XML documents">XML document</a> affects the
-   behavior of certain APIs, as well as a few CSS rendering rules. <a
-   href="#refsCSS21">[CSS21]</a>
-
-  <p class=note>A <code>Document</code> object created by the <code
-   title="">createDocument()</code> API on the <code>DOMImplementation</code>
-   object is initially an <a href="#xml-documents" title="XML documents">XML
-   document</a>, but can be made into an <a href="#html-" title="HTML
-   documents">HTML document</a> by calling <code title=dom-document-open><a
-   href="#open">document.open()</a></code> on it.
-
-  <p>All <code>Document</code> objects (in user agents implementing this
-   specification) must also implement the <code><a
-   href="#htmldocument">HTMLDocument</a></code> interface, available using
-   binding-specific methods. (This is the case whether or not the document in
-   question is an <a href="#html-" title="HTML documents">HTML document</a>
-   or indeed whether it contains any <a href="#html-elements">HTML
-   elements</a> at all.) <code>Document</code> objects must also implement
-   the document-level interface of any other namespaces found in the document
-   that the UA supports. For example, if an HTML implementation also supports
-   SVG, then the <code>Document</code> object must implement <code><a
-   href="#htmldocument">HTMLDocument</a></code> and <code>SVGDocument</code>.
-
-  <p class=note>Because the <code><a
-   href="#htmldocument">HTMLDocument</a></code> interface is now obtained
-   using binding-specific casting methods instead of simply being the primary
-   interface of the document object, it is no longer defined as inheriting
-   from <code>Document</code>.
-
-  <pre class=idl>interface <dfn id=htmldocument>HTMLDocument</dfn> {
-  // <a href="#resource0">resource metadata management</a>
-  [PutForwards=href] readonly attribute <a href="#location2">Location</a> <a href="#location0" title=dom-document-location>location</a>;
-  readonly attribute DOMString <a href="#url" title=dom-document-URL>URL</a>;
-           attribute DOMString <a href="#domain" title=dom-document-domain>domain</a>;
-  readonly attribute DOMString <a href="#referrer" title=dom-document-referrer>referrer</a>;
-           attribute DOMString <a href="#cookie0" title=dom-document-cookie>cookie</a>;
-  readonly attribute DOMString <a href="#lastmodified" title=dom-document-lastModified>lastModified</a>;
-  readonly attribute DOMString <a href="#compatmode" title=dom-document-compatMode>compatMode</a>;
-           attribute DOMString <a href="#charset0" title=dom-document-charset>charset</a>;
-  readonly attribute DOMString <a href="#characterset" title=dom-document-characterSet>characterSet</a>;
-  readonly attribute DOMString <a href="#defaultcharset" title=dom-document-defaultCharset>defaultCharset</a>;
-  readonly attribute DOMString <a href="#readystate" title=dom-document-readyState>readyState</a>;
-
-  // <a href="#dom-tree0">DOM tree accessors</a>
-           attribute DOMString <a href="#document.title" title=dom-document-title>title</a>;
-           attribute DOMString <a href="#dir1" title=dom-document-dir>dir</a>;
-           attribute <a href="#htmlelement">HTMLElement</a> <a href="#body" title=dom-document-body>body</a>;
-  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#images0" title=dom-document-images>images</a>;
-  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#embeds" title=dom-document-embeds>embeds</a>;
-  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#plugins" title=dom-document-plugins>plugins</a>;
-  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#links0" title=dom-document-links>links</a>;
-  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#forms0" title=dom-document-forms>forms</a>;
-  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#anchors" title=dom-document-anchors>anchors</a>;
-  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#scripts" title=dom-document-scripts>scripts</a>;
-  NodeList <a href="#getelementsbyname" title=dom-document-getElementsByName>getElementsByName</a>(in DOMString elementName);
-  NodeList <a href="#getelementsbyclassname" title=dom-document-getElementsByClassName>getElementsByClassName</a>(in DOMString classNames);
-
-  // <a href="#dynamic2">dynamic markup insertion</a>
-           attribute DOMString <a href="#innerhtml" title=dom-innerHTML>innerHTML</a>;
-  <a href="#htmldocument">HTMLDocument</a> <a href="#open" title=dom-document-open>open</a>();
-  <a href="#htmldocument">HTMLDocument</a> <a href="#open" title=dom-document-open>open</a>(in DOMString type);
-  <a href="#htmldocument">HTMLDocument</a> <a href="#open" title=dom-document-open>open</a>(in DOMString type, in DOMString replace);
-  <a href="#window">Window</a> <a href="#open" title=dom-document-open>open</a>(in DOMString url, in DOMString name, in DOMString features);
-  <a href="#window">Window</a> <a href="#open" title=dom-document-open>open</a>(in DOMString url, in DOMString name, in DOMString features, in boolean replace);
-  void <a href="#close" title=dom-document-close>close</a>();
-  void <a href="#document.write" title=dom-document-write>write</a>(in DOMString text);
-  void <a href="#document.writeln..." title=dom-document-writeln>writeln</a>(in DOMString text);
-
-  // <a href="#user-interaction">user interaction</a>
-  <a href="#selection1">Selection</a> <a href="#getselection0" title=dom-document-getSelection>getSelection</a>();
-  readonly attribute <span>Element</span> <a href="#activeelement" title=dom-document-activeElement>activeElement</a>;
-  boolean <a href="#hasfocus" title=dom-document-hasFocus>hasFocus</a>();
-           attribute boolean <a href="#designMode" title=dom-document-designMode>designMode</a>;
-  boolean <a href="#execCommand" title=dom-document-execCommand>execCommand</a>(in DOMString commandId);
-  boolean <a href="#execCommand" title=dom-document-execCommand>execCommand</a>(in DOMString commandId, in boolean showUI);
-  boolean <a href="#execCommand" title=dom-document-execCommand>execCommand</a>(in DOMString commandId, in boolean showUI, in DOMString value);
-  boolean <a href="#querycommandenabled" title=dom-document-queryCommandEnabled>queryCommandEnabled</a>(in DOMString commandId);
-  boolean <a href="#querycommandindeterm" title=dom-document-queryCommandIndeterm>queryCommandIndeterm</a>(in DOMString commandId);
-  boolean <a href="#querycommandstate" title=dom-document-queryCommandState>queryCommandState</a>(in DOMString commandId);
-  boolean <a href="#querycommandsupported" title=dom-document-queryCommandSupported>queryCommandSupported</a>(in DOMString commandId);
-  DOMString <a href="#querycommandvalue" title=dom-document-queryCommandValue>queryCommandValue</a>(in DOMString commandId);
-  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#commands0" title=dom-document-commands>commands</a>;
-};</pre>
-
-  <p>Since the <code><a href="#htmldocument">HTMLDocument</a></code>
-   interface holds methods and attributes related to a number of disparate
-   features, the members of this interface are described in various different
-   sections.
-
-  <h4 id=security><span class=secno>2.1.1 </span>Security</h4>
-
-  <p>User agents must raise a <a href="#security9">security exception</a>
-   whenever any of the members of an <code><a
-   href="#htmldocument">HTMLDocument</a></code> object are accessed by
-   scripts whose <a href="#effective3">effective script origin</a> is not the
-   <a href="#same-origin" title="same origin">same</a> as the
-   <code>Document</code>'s <a href="#effective3">effective script origin</a>.
-
-  <h4 id=resource><span class=secno>2.1.2 </span><dfn id=resource0>Resource
-   metadata management</dfn></h4>
-
-  <p>The <dfn id=url title=dom-document-URL><code>URL</code></dfn> attribute
-   must return <span>the document's address</span><!--
-  XXXDOCURL xref -->.
-
-  <p>The <dfn id=referrer
-   title=dom-document-referrer><code>referrer</code></dfn> attribute must
-   return either the <span title="the document's
-   address">address</span><!-- XXXDOXURL xref --> of the <a
-   href="#active">active document</a> of the <a href="#source0">source
-   browsing context</a> at the time the navigation was started (that is, the
-   page which <a href="#navigate" title=navigate>navigated</a> the <a
-   href="#browsing1">browsing context</a> to the current document), or the
-   empty string if there is no such originating page, or if the UA has been
-   configured not to report referrers in this case, or if the navigation was
-   initiated for a <a href="#hyperlinks">hyperlink</a> with a <code
-   title=rel-noreferrer><a href="#noreferrer">noreferrer</a></code> keyword.
-
-  <p class=note>In the case of HTTP, the <code title=dom-document-referrer><a
-   href="#referrer">referrer</a></code> DOM attribute will match the <code
-   title="">Referer</code> (sic) header that was sent when fetching the
-   current page.
-
-  <p class=note>Typically user agents are configured to not report referrers
-   in the case where the referrer uses an encrypted protocol and the current
-   page does not (e.g. when navigating from an <code title="">https:</code>
-   page to an <code title="">http:</code> page).
-
-  <hr>
-
-  <p>The <dfn id=cookie0 title=dom-document-cookie><code>cookie</code></dfn>
-   attribute represents the cookies of the resource.</p>
-  <!-- XXX this needs work; e.g. document.open() should return the
-  cookies of the document that called document.open(), not of
-  about:blank or the document that had .open() called on, as I
-  understand it. -->
-
-  <p id=sandboxCookies>On getting, if the <a href="#sandboxed2">sandboxed
-   origin browsing context flag</a> is set on the <a
-   href="#browsing1">browsing context</a> of the document, the user agent
-   must raise a <a href="#security9">security exception</a>. Otherwise, it
-   must return the same string as the value of the <code
-   title="">Cookie</code> HTTP header it would include if fetching the
-   resource indicated by <span>the document's
-   address</span><!-- XXXDOCURL --> over HTTP, as per RFC 2109 section 4.3.4.
-   <a href="#refsRFC2109">[RFC2109]</a>
-
-  <p>On setting, if the <a href="#sandboxed2">sandboxed origin browsing
-   context flag</a> is set on the <a href="#browsing1">browsing context</a>
-   of the document, the user agent must raise a <a href="#security9">security
-   exception</a>. Otherwise, the user agent must act as it would when
-   processing cookies if it had just attempted to fetch <span>the document's
-   address</span><!-- XXXDOCURL --> over HTTP, and had received a response
-   with a <code>Set-Cookie</code> header whose value was the specified value,
-   as per RFC 2109 sections 4.3.1, 4.3.2, and 4.3.3. <a
-   href="#refsRFC2109">[RFC2109]</a>
-
-  <p class=note>Since the <code title=dom-document-cookie><a
-   href="#cookie0">cookie</a></code> attribute is accessible across frames,
-   the path restrictions on cookies are only a tool to help manage which
-   cookies are sent to which parts of the site, and are not in any way a
-   security feature.
-
-  <hr>
-
-  <p>The <dfn id=lastmodified
-   title=dom-document-lastModified><code>lastModified</code></dfn> attribute,
-   on getting, must return the date and time of the <code>Document</code>'s
-   source file's last modification, in the user's local timezone, in the
-   following format:
-
-  <ol>
-   <li> The month component of the date.
-
-   <li> A U+002F SOLIDUS character ('/').
-
-   <li> The day component of the date.
-
-   <li> A U+002F SOLIDUS character ('/').
-
-   <li> The year component of the date.
-
-   <li> A U+0020 SPACE character.
-
-   <li> The hours component of the time.
-
-   <li> A U+003A COLON character (':').
-
-   <li> The minutes component of the time.
-
-   <li> A U+003A COLON character (':').
-
-   <li> The seconds component of the time.
-  </ol>
-
-  <p>All the numeric components above, other than the year, must be given as
-   two digits in the range U+0030 DIGIT ZERO to U+0039 DIGIT NINE
-   representing the number in base ten, zero-padded if necessary.
-
-  <p>The <code>Document</code>'s source file's last modification date and
-   time must be derived from relevant features of the networking protocols
-   used, e.g. from the value of the HTTP <code title="">Last-Modified</code>
-   header of the document, or from metadata in the file system for local
-   files. If the last modification date and time are not known, the attribute
-   must return the string <code title="">01/01/1970 00:00:00</code>.
-
-  <p>A <code>Document</code> is always set to one of three modes: <dfn
-   id=no-quirks>no quirks mode</dfn>, the default; <dfn id=quirks>quirks
-   mode</dfn>, used typically for legacy documents; and <dfn
-   id=limited>limited quirks mode</dfn>, also known as "almost standards"
-   mode. The mode is only ever changed from the default by the <a
-   href="#html-0">HTML parser</a>, based on the presence, absence, or value
-   of the DOCTYPE string.
-
-  <p>The <dfn id=compatmode
-   title=dom-document-compatMode><code>compatMode</code></dfn> DOM attribute
-   must return the literal string "<code title="">CSS1Compat</code>" unless
-   the document has been set to <a href="#quirks">quirks mode</a> by the <a
-   href="#html-0">HTML parser</a>, in which case it must instead return the
-   literal string "<code title="">BackCompat</code>".
-
   <div class=big-issue>
-   <p>As far as parsing goes, the quirks I know of are:</p>
+   <p>This section will do the following:</p>
 
    <ul>
-    <li>Comment parsing is different.
+    <li>define URL as IRI and replace all uses of URIs and IRIs in the rest
+     of the spec with URL
 
-    <li><code><a href="#p">p</a></code> can contain <code><a
-     href="#table">table</a></code>
+    <li>define "valid URL" in terms of valid URIs and IRIs and replace that
+     concept through the spec to a pointer here, getting rid of references to
+     <a href="#refsRFC3986">[RFC3986]</a> <a
+     href="#refsRFC3987">[RFC3987]</a> outside this section
 
-    <li>Safari and IE have special parsing rules for <% ... %> (even in
-     standards mode, though clearly this should be quirks-only).
-   </ul>
-  </div>
+    <li>define "valid URL reference" in terms of valid URI references and IRI
+     references and replace that concept through the spec to a pointer here,
+     getting rid of references to <a href="#refsRFC3986">[RFC3986]</a> <a
+     href="#refsRFC3987">[RFC3987]</a> outside this section
 
-  <p>Documents have an associated <dfn id=character1 title="document's
-   character encoding">character encoding</dfn>. When a <code>Document</code>
-   object is created, the <a href="#character1">document's character
-   encoding</a> must be initialized to UTF-16. Various algorithms during page
-   loading affect this value, as does the <code title=dom-document-charset><a
-   href="#charset0">charset</a></code> setter. <a
-   href="#refsIANACHARSET">[IANACHARSET]</a> <!-- XXX
-  http://www.iana.org/assignments/character-sets -->
+    <li>define how to parse URLs (maybe by deferring to RFCs)
 
-  <p>The <dfn id=charset0
-   title=dom-document-charset><code>charset</code></dfn> DOM attribute must,
-   on getting, return the preferred MIME name of the <a
-   href="#character1">document's character encoding</a>. On setting, if the
-   new value is an IANA-registered alias for a character encoding, the <a
-   href="#character1">document's character encoding</a> must be set to that
-   character encoding. (Otherwise, nothing happens.)
+    <li>
+     <p>define how to handle URIs that contain non-ascii characters (and it's
+      not the same as handling as IRIs, especially if the character encoding
+      of the document isn't UTF-8)</p>
 
-  <p>The <dfn id=characterset
-   title=dom-document-characterSet><code>characterSet</code></dfn> DOM
-   attribute must, on getting, return the preferred MIME name of the <a
-   href="#character1">document's character encoding</a>.
+     <p>First parse it (we need to define that. For some schemes it's not per
+      spec -- e.g. apparently for ftp: we should split from hosts on ';').
+      Then handle each bit as follows:</p>
 
-  <p>The <dfn id=defaultcharset
-   title=dom-document-defaultCharset><code>defaultCharset</code></dfn> DOM
-   attribute must, on getting, return the preferred MIME name of a character
-   encoding, possibly the user's default encoding, or an encoding associated
-   with the user's current geographical location, or any arbitrary encoding
-   name.
+     <p>scheme: no further processing (treat %-escaped characters literally,
+      treat unicode characters as unicode characters).</p>
 
-  <p>Each document has a <dfn id=current>current document readiness</dfn>.
-   When a <code>Document</code> object is created, it must have its <a
-   href="#current">current document readiness</a> set to the string
-   "loading". Various algorithms during page loading affect this value. When
-   the value is set, the user agent must <a href="#firing2">fire a simple
-   event</a> called <code
-   title=event-readystatechanged>readystatechanged</code> at the
-   <code>Document</code> object.</p>
-  <!-- XXX define
-  document.onreadystatechange -->
+     <p>host: expand %-encoded bytes to Unicode as UTF-8, treat unicode
+      characters as per IDN.</p>
 
-  <p>The <dfn id=readystate
-   title=dom-document-readyState><code>readyState</code></dfn> DOM attribute
-   must, on getting, return the <a href="#current">current document
-   readiness</a>.
+     <p>path: don't expand %-encoded bytes. Re-encode unicode to UTF-8 and
+      percent-encode.</p>
 
-  <h3 id=elements><span class=secno>2.2 </span>Elements</h3>
+     <p>query: don't expand %-encoded bytes. Re-encode unicode to the page's
+      encoding. Do not percent-encode.</p>
 
-  <p>The nodes representing <a href="#html-elements">HTML elements</a> in the
-   DOM must implement, and expose to scripts, the interfaces listed for them
-   in the relevant sections of this specification. This includes <a
-   href="#xhtml5">XHTML</a> elements in <a href="#xml-documents">XML
-   documents</a>, even when those documents are in another context (e.g.
-   inside an XSLT transform).
+    <li>define how to resolve relative URLs in markup attributes (using
+     XMLBase as defined elsewhere right now)
 
-  <p>The basic interface, from which all the <a href="#html-elements">HTML
-   elements</a>' interfaces inherit, and which must be used by elements that
-   have no additional requirements, is the <code><a
-   href="#htmlelement">HTMLElement</a></code> interface.
+    <li>define how to resolve relative URLs in APIs, using the <dfn
+     id=scripts>script's base URI</dfn> maybe
 
-  <pre
-   class=idl>interface <dfn id=htmlelement>HTMLElement</dfn> : <span>Element</span> {
-  // <a href="#dom-tree0">DOM tree accessors</a>
-  NodeList <a href="#getelementsbyclassname0" title=dom-getElementsByClassName>getElementsByClassName</a>(in DOMString classNames);
+    <li>define what it means to resolve a relative URL when the base URL
+     doesn't have a path hierarchy (e.g. data:, javascript:, about:blank
+     URLs)
 
-  // <a href="#dynamic2">dynamic markup insertion</a>
-           attribute DOMString <a href="#innerhtml" title=dom-innerHTML>innerHTML</a>;
+    <li>define "an <dfn id=elements3>element's base URI</dfn>" and make the
+     various places that talk about a base URI in the context of an element
+     use that definition
 
-  // <span>metadata attributes</span>
-           attribute DOMString <a href="#id0" title=dom-id>id</a>;
-           attribute DOMString <a href="#title0" title=dom-title>title</a>;
-           attribute DOMString <a href="#lang0" title=dom-lang>lang</a>;
-           attribute DOMString <a href="#dir0" title=dom-dir>dir</a>;
-           attribute <span>DOMString</span> <a href="#classname" title=dom-className>className</a>;
-  readonly attribute <a href="#domtokenlist0">DOMTokenList</a> <a href="#classlist" title=dom-classList>classList</a>;
-  readonly attribute <a href="#domstringmap0">DOMStringMap</a> <a href="#dataset" title=dom-dataset>dataset</a>;
+    <li>make the language used to refer to resolving a base URI consistent
+     throughout, maybe make it hyperlink to a definition each time
 
-  // <a href="#user-interaction">user interaction</a>
-           attribute boolean <a href="#irrelevant0" title=dom-irrelevant>irrelevant</a>;
-  void <a href="#click1" title=dom-click>click</a>();
-  void <a href="#scrollintoview" title=dom-scrollIntoView>scrollIntoView</a>();
-  void <a href="#scrollintoview" title=dom-scrollIntoView>scrollIntoView</a>(in boolean top);
-           attribute long <a href="#tabindex0" title=dom-tabindex>tabIndex</a>;
-  void <a href="#focus0" title=dom-focus>focus</a>();
-  void <a href="#blur" title=dom-blur>blur</a>();
-           attribute boolean <a href="#draggable0" title=dom-draggable>draggable</a>;
-           attribute DOMString <a href="#contenteditable1" title=dom-contentEditable>contentEditable</a>;
-  readonly attribute DOMString <a href="#iscontenteditable" title=dom-isContentEditable>isContentEditable</a>;
-           attribute <a href="#htmlmenuelement">HTMLMenuElement</a> <a href="#contextmenu0" title=dom-contextMenu>contextMenu</a>;
+    <li>define a cheap, interoperable mechanism for URL attributes and
+     anything else that relies on xml:base and the base element to handle
+     dynamic changes to those attributes and elements, possibly by defining
+     some mechanism which causes changes to be ignored in some reliable way.
+     <!--
+On Sat, 1 Mar 2008, Anne van Kesteren wrote:
+>
+> Note that the new base URI would only take effect once you actually did
+> something with a potentially affected object. For instance, <img> would
+> not start loading a new image if the base URI changes. <img>.src =
+> <img>.getAttribute("src") could start loading a new resource however if
+> the base URI changed since the initial load.
 
-  // <span>styling</span>
-  readonly attribute <span>CSSStyleDeclaration</span> <a href="#style0" title=dom-style>style</a>;
+On Sat, 1 Mar 2008, Jonas Sicking wrote:
+> 
+> Well, that was my intention with the initial proposal. But Hixie pointed    
+> out that "did something" is a very hard thing to define. For example on 
+> a <a href="...">, does the user hovering the node count? Does resizing
+> the window count? Does removing the node from the DOM and reinserting it
+> count?
 
-  // <span>data templates</span>
-           attribute DOMString <a href="#template0" title=dom-template>template</a>;
-  readonly attribute HTMLDataTemplateElement <a href="#templateelement" title=dom-templateElement>templateElement</a>;
-           attribute DOMString <a href="#ref0" title=dom-ref>ref</a>;
-  readonly attribute Node <a href="#refnode" title=dom-refNode>refNode</a>;
-           attribute DOMString <a href="#registrationmark0" title=dom-registrationMark>registrationMark</a>;
-  readonly attribute DocumentFragment <a href="#originalcontent" title=dom-originalContent>originalContent</a>;
+On Sat, 1 Mar 2008, Maciej Stachowiak wrote:
+> 
+> How about requiring that the base used is the one in effect when a given
+> relative URI is resolved, and define that URIs for resource-loading 
+> elements are resolved at the time the relevant attribute is set or
+> parsed (but for hyperlinks, at the time it is dereferenced). That is        
+> easy to implement, interoperable, and reasonably predictable. It makes
+> sense that changing <base> would affect future loads but not trigger
+> reloads of already loaded or already in progress resources.
 
-  // <a href="#event4">event handler DOM attributes</a>
-           attribute <span>EventListener</span> <a href="#onabort" title=handler-onabort>onabort</a>;
-           attribute <span>EventListener</span> <a href="#onbeforeunload" title=handler-onbeforeunload>onbeforeunload</a>;
-           attribute <span>EventListener</span> <a href="#onblur" title=handler-onblur>onblur</a>;
-           attribute <span>EventListener</span> <a href="#onchange" title=handler-onchange>onchange</a>;
-           attribute <span>EventListener</span> <a href="#onclick" title=handler-onclick>onclick</a>;
-           attribute <span>EventListener</span> <a href="#oncontextmenu" title=handler-oncontextmenu>oncontextmenu</a>;
-           attribute <span>EventListener</span> <a href="#ondblclick" title=handler-ondblclick>ondblclick</a>;
-           attribute <span>EventListener</span> <a href="#ondrag" title=handler-ondrag>ondrag</a>;
-           attribute <span>EventListener</span> <a href="#ondragend" title=handler-ondragend>ondragend</a>;
-           attribute <span>EventListener</span> <a href="#ondragenter" title=handler-ondragenter>ondragenter</a>;
-           attribute <span>EventListener</span> <a href="#ondragleave" title=handler-ondragleave>ondragleave</a>;
-           attribute <span>EventListener</span> <a href="#ondragover" title=handler-ondragover>ondragover</a>;
-           attribute <span>EventListener</span> <a href="#ondragstart" title=handler-ondragstart>ondragstart</a>;
-           attribute <span>EventListener</span> <a href="#ondrop" title=handler-ondrop>ondrop</a>;
-           attribute <span>EventListener</span> <a href="#onerror" title=handler-onerror>onerror</a>;
-           attribute <span>EventListener</span> <a href="#onfocus" title=handler-onfocus>onfocus</a>;
-           attribute <span>EventListener</span> <a href="#onkeydown" title=handler-onkeydown>onkeydown</a>;
-           attribute <span>EventListener</span> <a href="#onkeypress" title=handler-onkeypress>onkeypress</a>;
-           attribute <span>EventListener</span> <a href="#onkeyup" title=handler-onkeyup>onkeyup</a>;
-           attribute <span>EventListener</span> <a href="#onload" title=handler-onload>onload</a>;
-           attribute <span>EventListener</span> <a href="#onmessage" title=handler-onmessage>onmessage</a>;
-           attribute <span>EventListener</span> <a href="#onmousedown" title=handler-onmousedown>onmousedown</a>;
-           attribute <span>EventListener</span> <a href="#onmousemove" title=handler-onmousemove>onmousemove</a>;
-           attribute <span>EventListener</span> <a href="#onmouseout" title=handler-onmouseout>onmouseout</a>;
-           attribute <span>EventListener</span> <a href="#onmouseover" title=handler-onmouseover>onmouseover</a>;
-           attribute <span>EventListener</span> <a href="#onmouseup" title=handler-onmouseup>onmouseup</a>;
-           attribute <span>EventListener</span> <a href="#onmousewheel" title=handler-onmousewheel>onmousewheel</a>;
-           attribute <span>EventListener</span> <a href="#onresize" title=handler-onresize>onresize</a>;
-           attribute <span>EventListener</span> <a href="#onscroll" title=handler-onscroll>onscroll</a>;
-           attribute <span>EventListener</span> <a href="#onselect" title=handler-onselect>onselect</a>;
-           attribute <span>EventListener</span> <a href="#onstorage" title=handler-onstorage>onstorage</a>;
-           attribute <span>EventListener</span> <a href="#onsubmit" title=handler-onsubmit>onsubmit</a>;
-           attribute <span>EventListener</span> <a href="#onunload" title=handler-onunload>onunload</a>;
+possibly "in the event that the xml:base or base href attribute is
+changed, user agents may, whenever convenient, pretend, for the sake
+of url resolution, that it has not changed"
 
-};</pre>
-
-  <p>As with the <code><a href="#htmldocument">HTMLDocument</a></code>
-   interface, the <code><a href="#htmlelement">HTMLElement</a></code>
-   interface holds methods and attributes related to a number of disparate
-   features, and the members of this interface are therefore described in
-   various different sections of this specification.
-
-  <h4 id=reflecting><span class=secno>2.2.1 </span>Reflecting content
-   attributes in DOM attributes</h4>
-
-  <p>Some <span title="DOM attribute">DOM attributes</span> are defined to
-   <dfn id=reflect>reflect</dfn> a particular <span>content attribute</span>.
-   This means that on getting, the DOM attribute returns the current value of
-   the content attribute, and on setting, the DOM attribute changes the value
-   of the content attribute to the given value.</p>
-  <!-- XXXURL refer to URLs and use the "resolve to absolute URL"
-  algorithm -->
-
-  <p>If a reflecting DOM attribute is a <code>DOMString</code> attribute
-   whose content attribute is defined to contain a URI, then on getting, the
-   DOM attribute must return the value of the content attribute, resolved to
-   an absolute URI, and on setting, must set the content attribute to the
-   specified literal value. If the content attribute is absent, the DOM
-   attribute must return the default value, if the content attribute has one,
-   or else the empty string.</p>
-  <!-- XXXURL refer to URLs and use the "resolve to absolute URL"
-  algorithm -->
-
-  <p>If a reflecting DOM attribute is a <code>DOMString</code> attribute
-   whose content attribute is defined to contain one or more URIs, then on
-   getting, the DOM attribute must <span title="split the string on
-   spaces">split the content attribute on spaces</span> and return the
-   concatenation of each token URI, resolved to an absolute URI, with a
-   single U+0020 SPACE character between each URI; if the content attribute
-   is absent, the DOM attribute must return the default value, if the content
-   attribute has one, or else the empty string. On setting, the DOM attribute
-   must set the content attribute to the specified literal value.
-
-  <p>If a reflecting DOM attribute is a <code>DOMString</code> whose content
-   attribute is an <a href="#enumerated">enumerated attribute</a>, and the
-   DOM attribute is <dfn id=limited0>limited to only known values</dfn>,
-   then, on getting, the DOM attribute must return the conforming value
-   associated with the state the attribute is in (in its canonical case), or
-   the empty string if the attribute is in a state that has no associated
-   keyword value; and on setting, if the new value case-insensitively matches
-   one of the keywords given for that attribute, then the content attribute
-   must be set to the conforming value associated with the state that the
-   attribute would be in if set to the given new value, otherwise, if the new
-   value is the empty string, then the content attribute must be removed,
-   otherwise, the setter must raise a <code>SYNTAX_ERR</code> exception.
-
-  <p>If a reflecting DOM attribute is a <code>DOMString</code> but doesn't
-   fall into any of the above categories, then the getting and setting must
-   be done in a transparent, case-preserving manner.
-
-  <p>If a reflecting DOM attribute is a boolean attribute, then on getting
-   the DOM attribute must return true if the attribute is set, and false if
-   it is absent. On setting, the content attribute must be removed if the DOM
-   attribute is set to false, and must be set to have the same value as its
-   name if the DOM attribute is set to true. (This corresponds to the rules
-   for <a href="#boolean0" title="boolean attribute">boolean content
-   attributes</a>.)
-
-  <p>If a reflecting DOM attribute is a signed integer type
-   (<code>long</code>) then, on getting, the content attribute must be parsed
-   according to <a href="#rules0" title="rules for parsing integers">the
-   rules for parsing signed integers</a>, and if that is successful, the
-   resulting value must be returned. If, on the other hand, it fails, or if
-   the attribute is absent, then the default value must be returned instead,
-   or 0 if there is no default value. On setting, the given value must be
-   converted to the shortest possible string representing the number as a <a
-   href="#valid0">valid integer</a> in base ten and then that string must be
-   used as the new content attribute value.
-
-  <p>If a reflecting DOM attribute is an <em>unsigned</em> integer type
-   (<code>unsigned long</code>) then, on getting, the content attribute must
-   be parsed according to <a href="#rules" title="rules for parsing
-   non-negative integers">the rules for parsing unsigned integers</a>, and if
-   that is successful, the resulting value must be returned. If, on the other
-   hand, it fails, or if the attribute is absent, the default value must be
-   returned instead, or 0 if there is no default value. On setting, the given
-   value must be converted to the shortest possible string representing the
-   number as a <a href="#valid">valid non-negative integer</a> in base ten
-   and then that string must be used as the new content attribute value.
-
-  <p>If a reflecting DOM attribute is an unsigned integer type
-   (<code>unsigned long</code>) that is <dfn id=limited1>limited to only
-   positive non-zero numbers</dfn>, then the behavior is similar to the
-   previous case, but zero is not allowed. On getting, the content attribute
-   must first be parsed according to <a href="#rules" title="rules for
-   parsing non-negative integers">the rules for parsing unsigned
-   integers</a>, and if that is successful, the resulting value must be
-   returned. If, on the other hand, it fails, or if the attribute is absent,
-   the default value must be returned instead, or 1 if there is no default
-   value. On setting, if the value is zero, the user agent must fire an
-   <code>INDEX_SIZE_ERR</code> exception. Otherwise, the given value must be
-   converted to the shortest possible string representing the number as a <a
-   href="#valid">valid non-negative integer</a> in base ten and then that
-   string must be used as the new content attribute value.
-
-  <p>If a reflecting DOM attribute is a floating point number type
-   (<code>float</code>) and the content attribute is defined to contain a
-   time offset, then, on getting, the content attribute must be parsed
-   according to <a href="#rules4" title="rules for parsing time offsets">the
-   rules for parsing time offsets</a>, and if that is successful, the
-   resulting value, in seconds, must be returned. If that fails, or if the
-   attribute is absent, the default value must be returned, or the
-   not-a-number value (NaN) if there is no default value. On setting, the
-   given value, interpreted as a time offset in seconds, must be converted to
-   a string using the <a href="#time-offset">time offset serialization
-   rules</a>, and that string must be used as the new content attribute
-   value.
-
-  <p>If a reflecting DOM attribute is a floating point number type
-   (<code>float</code>) and it doesn't fall into one of the earlier
-   categories, then, on getting, the content attribute must be parsed
-   according to <a href="#rules1" title="rules for parsing floating point
-   number values">the rules for parsing floating point number values</a>, and
-   if that is successful, the resulting value must be returned. If, on the
-   other hand, it fails, or if the attribute is absent, the default value
-   must be returned instead, or 0.0 if there is no default value. On setting,
-   the given value must be converted to the shortest possible string
-   representing the number as a <a href="#valid1">valid floating point
-   number</a> in base ten and then that string must be used as the new
-   content attribute value.
-
-  <p>If a reflecting DOM attribute is of the type <code><a
-   href="#domtokenlist0">DOMTokenList</a></code>, then on getting it must
-   return a <code><a href="#domtokenlist0">DOMTokenList</a></code> object
-   whose underlying string is the element's corresponding content attribute.
-   When the <code><a href="#domtokenlist0">DOMTokenList</a></code> object
-   mutates its underlying string, the content attribute must itself be
-   immediately mutated. When the attribute is absent, then the string
-   represented by the <code><a href="#domtokenlist0">DOMTokenList</a></code>
-   object is the empty string; when the object mutates this empty string, the
-   user agent must first add the corresponding content attribute, and then
-   mutate that attribute instead. <code><a
-   href="#domtokenlist0">DOMTokenList</a></code> attributes are always
-   read-only. The same <code><a href="#domtokenlist0">DOMTokenList</a></code>
-   object must be returned every time for each attribute.
-
-  <p>If a reflecting DOM attribute has the type <code><a
-   href="#htmlelement">HTMLElement</a></code>, or an interface that descends
-   from <code><a href="#htmlelement">HTMLElement</a></code>, then, on
-   getting, it must run the following algorithm (stopping at the first point
-   where a value is returned):
-
-  <ol>
-   <li>If the corresponding content attribute is absent, then the DOM
-    attribute must return null.
-
-   <li>Let <var title="">candidate</var> be the element that the <code
-    title="">document.getElementById()</code> method would find if it was
-    passed as its argument the current value of the corresponding content
-    attribute.
-
-   <li>If <var title="">candidate</var> is null, or if it is not
-    type-compatible with the DOM attribute, then the DOM attribute must
-    return null.
-
-   <li>Otherwise, it must return <var title="">candidate</var>.
-  </ol>
-
-  <p>On setting, if the given element has an <code title=attr-id><a
-   href="#id">id</a></code> attribute, then the content attribute must be set
-   to the value of that <code title=attr-id><a href="#id">id</a></code>
-   attribute. Otherwise, the DOM attribute must be set to the empty string.</p>
-  <!-- XXX or raise an exception? -->
-
-  <h3 id=common0><span class=secno>2.3 </span>Common DOM interfaces</h3>
-
-  <h4 id=collections><span class=secno>2.3.1 </span>Collections</h4>
-
-  <p>The <code><a href="#htmlcollection0">HTMLCollection</a></code>, <code><a
-   href="#htmlformcontrolscollection0">HTMLFormControlsCollection</a></code>,
-   and <code><a
-   href="#htmloptionscollection0">HTMLOptionsCollection</a></code> interfaces
-   represent various lists of DOM nodes. Collectively, objects implementing
-   these interfaces are called <dfn id=collections0>collections</dfn>.
-
-  <p>When a <a href="#collections0" title=collections>collection</a> is
-   created, a filter and a root are associated with the collection.
-
-  <p class=example>For example, when the <code><a
-   href="#htmlcollection0">HTMLCollection</a></code> object for the <code
-   title=dom-document-images><a href="#images0">document.images</a></code>
-   attribute is created, it is associated with a filter that selects only
-   <code><a href="#img">img</a></code> elements, and rooted at the root of
-   the document.
-
-  <p>The <a href="#collections0" title=collections>collection</a> then <dfn
-   id=represents title="represented by the collection">represents</dfn> a <a
-   href="#live">live</a> view of the subtree rooted at the collection's root,
-   containing only nodes that match the given filter. The view is linear. In
-   the absence of specific requirements to the contrary, the nodes within the
-   collection must be sorted in <a href="#tree-order">tree order</a>.
-
-  <p class=note>The <code title=dom-table-rows><a
-   href="#rows">rows</a></code> list is not in tree order.
-
-  <p>An attribute that returns a collection must return the same object every
-   time it is retrieved.
-
-  <h5 id=htmlcollection><span class=secno>2.3.1.1. </span>HTMLCollection</h5>
-
-  <p>The <code><a href="#htmlcollection0">HTMLCollection</a></code> interface
-   represents a generic <a href="#collections0"
-   title=collections>collection</a> of elements.
-
-  <pre class=idl>interface <dfn id=htmlcollection0>HTMLCollection</dfn> {
-  readonly attribute unsigned long <a href="#length" title=dom-HTMLCollection-length>length</a>;
-  [IndexGetter] Element <a href="#itemindex" title=dom-HTMLCollection-item>item</a>(in unsigned long index);
-  [NameGetter] Element <a href="#nameditem" title=dom-HTMLCollection-namedItem>namedItem</a>(in DOMString name);
-};</pre>
-
-  <p>The <dfn id=length
-   title=dom-HTMLCollection-length><code>length</code></dfn> attribute must
-   return the number of nodes <a href="#represents">represented by the
-   collection</a>.
-
-  <p>The <dfn id=itemindex title=dom-HTMLCollection-item><code>item(<var
-   title="">index</var>)</code></dfn> method must return the <var
-   title="">index</var>th node in the collection. If there is no <var
-   title="">index</var>th node in the collection, then the method must return
-   null.
-
-  <p>The <dfn id=nameditem
-   title=dom-HTMLCollection-namedItem><code>namedItem(<var
-   title="">key</var>)</code></dfn> method must return the first node in the
-   collection that matches the following requirements:
-
-  <ul>
-   <li>It is an <code><a href="#a">a</a></code>, <code><a
-    href="#applet">applet</a></code>, <code><a href="#area">area</a></code>,
-    <code>form</code>, <code><a href="#img">img</a></code>, or <code><a
-    href="#object">object</a></code> element with a <code
-    title=attr-name>name</code> attribute equal to <var title="">key</var>,
-    or,
-
-   <li>It is an <a href="#html-elements" title="HTML elements">HTML
-    element</a> of any kind with an <code title=attr-id><a
-    href="#id">id</a></code> attribute equal to <var title="">key</var>.
-    (Non-HTML elements, even if they have IDs, are not searched for the
-    purposes of <code title=dom-HTMLCollection-namedItem><a
-    href="#nameditem">namedItem()</a></code>.)
-  </ul>
-
-  <p>If no such elements are found, then the method must return null.
-
-  <h5 id=htmlformcontrolscollection><span class=secno>2.3.1.2.
-   </span>HTMLFormControlsCollection</h5>
-
-  <p>The <code><a
-   href="#htmlformcontrolscollection0">HTMLFormControlsCollection</a></code>
-   interface represents a <a href="#collections0"
-   title=collections>collection</a> of form controls.
-
-  <pre
-   class=idl>interface <dfn id=htmlformcontrolscollection0>HTMLFormControlsCollection</dfn> {
-  readonly attribute unsigned long <a href="#length0" title=dom-HTMLFormControlsCollection-length>length</a>;
-  [IndexGetter] <a href="#htmlelement">HTMLElement</a> <a href="#itemindex0" title=dom-HTMLFormControlsCollection-item>item</a>(in unsigned long index);
-  [NameGetter] Object <a href="#nameditem0" title=dom-HTMLFormControlsCollection-namedItem>namedItem</a>(in DOMString name);
-};</pre>
-
-  <p>The <dfn id=length0
-   title=dom-HTMLFormControlsCollection-length><code>length</code></dfn>
-   attribute must return the number of nodes <a
-   href="#represents">represented by the collection</a>.
-
-  <p>The <dfn id=itemindex0
-   title=dom-HTMLFormControlsCollection-item><code>item(<var
-   title="">index</var>)</code></dfn> method must return the <var
-   title="">index</var>th node in the collection. If there is no <var
-   title="">index</var>th node in the collection, then the method must return
-   null.
-
-  <p>The <dfn id=nameditem0
-   title=dom-HTMLFormControlsCollection-namedItem><code>namedItem(<var
-   title="">key</var>)</code></dfn> method must act according to the
-   following algorithm:
-
-  <ol>
-   <li>If, at the time the method is called, there is exactly one node in the
-    collection that has either an <code title=attr-id><a
-    href="#id">id</a></code> attribute or a <code title=attr-name>name</code>
-    attribute equal to <var title="">key</var>, then return that node and
-    stop the algorithm.
-
-   <li>Otherwise, if there are no nodes in the collection that have either an
-    <code title=attr-id><a href="#id">id</a></code> attribute or a <code
-    title=attr-name>name</code> attribute equal to <var title="">key</var>,
-    then return null and stop the algorithm.
-
-   <li>Otherwise, create a <code>NodeList</code> object representing a live
-    view of the <code><a
-    href="#htmlformcontrolscollection0">HTMLFormControlsCollection</a></code>
-    object, further filtered so that the only nodes in the
-    <code>NodeList</code> object are those that have either an <code
-    title=attr-id><a href="#id">id</a></code> attribute or a <code
-    title=attr-name>name</code> attribute equal to <var title="">key</var>.
-    The nodes in the <code>NodeList</code> object must be sorted in <a
-    href="#tree-order">tree order</a>.
-
-   <li>Return that <code>NodeList</code> object.
-  </ol>
-  <!--
-http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E...%0A%3Cform%20name%3D%22a%22%3E%3Cinput%20id%3D%22x%22%20name%3D%22y%22%3E%3Cinput%20name%3D%22x%22%20id%3D%22y%22%3E%3C/form%3E%0A%3Cscript%3E%0A%20%20var%20x%3B%0A%20%20w%28x%20%3D%20document.forms%5B%27a%27%5D%5B%27x%27%5D%29%3B%0A%20%20w%28x.length%29%3B%0A%20%20x%5B0%5D.parentNode.removeChild%28x%5B0%5D%29%3B%0A%20%20w%28x.length%29%3B%0A%20%20w%28x%20%3D%3D%20document.forms%5B%27a%27%5D%5B%27x%27%5D%29%3B%0A%3C/script%3E%0A
+possibly define "base uri change notification behaviour" for all
+elements with URI attributes, and then define changing base href and
+xml:base to activate that behaviour on all elements in the affected
+subtree. Also make this algorithm get called when a node from another
+document is inserted into an HTML document. (we could define that
+you're allowed to do that, in the absence of a DOM Core update)
 -->
+     
+   </ul>
+  </div>
+  <!-- XXXURL change to URL -->
 
-  <h5 id=htmloptionscollection><span class=secno>2.3.1.3.
-   </span>HTMLOptionsCollection</h5>
+  <h4 id=interfaces><span class=secno>2.3.1 </span>Interfaces for URI
+   manipulation</h4>
+  <!-- XXXURL change to URL -->
 
-  <p>The <code><a
-   href="#htmloptionscollection0">HTMLOptionsCollection</a></code> interface
-   represents a list of <code>option</code> elements.
+  <p>An interface that has a complement of <dfn id=uri-decomposition>URI
+   decomposition attributes</dfn> will have seven attributes with the
+   following definitions:
 
-  <pre
-   class=idl>interface <dfn id=htmloptionscollection0>HTMLOptionsCollection</dfn> {
-           attribute unsigned long <a href="#length1" title=dom-HTMLOptionsCollection-length>length</a>;
-  [IndexGetter] HTMLOptionElement <a href="#itemindex1" title=dom-HTMLOptionsCollection-item>item</a>(in unsigned long index);
-  [NameGetter] Object <a href="#nameditem1" title=dom-HTMLOptionsCollection-namedItem>namedItem</a>(in DOMString name);
-};</pre>
+  <pre class=idl>
+           attribute DOMString <a href="#protocol" title=dom-uda-protocol>protocol</a>;
+           attribute DOMString <a href="#host" title=dom-uda-host>host</a>;
+           attribute DOMString <a href="#hostname" title=dom-uda-hostname>hostname</a>;
+           attribute DOMString <a href="#port" title=dom-uda-port>port</a>;
+           attribute DOMString <a href="#pathname" title=dom-uda-pathname>pathname</a>;
+           attribute DOMString <a href="#search" title=dom-uda-search>search</a>;
+           attribute DOMString <a href="#hash" title=dom-uda-hash>hash</a>;
+</pre>
+  <!-- XXXURL change to URL -->
 
-  <p>On getting, the <dfn id=length1
-   title=dom-HTMLOptionsCollection-length><code>length</code></dfn> attribute
-   must return the number of nodes <a href="#represents">represented by the
-   collection</a>.
+  <p>The attributes defined to be URI decomposition attributes must act as
+   described for the attributes with the same corresponding names in this
+   section.</p>
+  <!-- XXXURL change to URL -->
 
-  <p>On setting, the behavior depends on whether the new value is equal to,
-   greater than, or less than the number of nodes <a
-   href="#represents">represented by the collection</a> at that time. If the
-   number is the same, then setting the attribute must do nothing. If the new
-   value is greater, then <var title="">n</var> new <code>option</code>
-   elements with no attributes and no child nodes must be appended to the
-   <code>select</code> element on which the <code><a
-   href="#htmloptionscollection0">HTMLOptionsCollection</a></code> is rooted,
-   where <var title="">n</var> is the difference between the two numbers (new
-   value minus old value). If the new value is lower, then the last <var
-   title="">n</var> nodes in the collection must be removed from their parent
-   nodes, where <var title="">n</var> is the difference between the two
-   numbers (old value minus new value).
+  <p>In addition, an interface with a complement of URI decomposition
+   attributes will define an <dfn id=input
+   title=concept-uda-input>input</dfn>, which is a URI that the attributes
+   act on, and a <dfn id=common3 title=concept-uda-setter>common setter
+   action</dfn>, which is a set of steps invoked when any of the attributes'
+   setters are invoked.</p>
+  <!-- XXXURL change to URL -->
 
-  <p class=note>Setting <code title=dom-HTMLOptionsCollection-length><a
-   href="#length1">length</a></code> never removes or adds any
-   <code>optgroup</code> elements, and never adds new children to existing
-   <code>optgroup</code> elements (though it can remove children from them).
+  <p>The seven URI decomposition attributes have similar requirements.</p>
+  <!-- XXXURL change to URL -->
 
-  <p>The <dfn id=itemindex1
-   title=dom-HTMLOptionsCollection-item><code>item(<var
-   title="">index</var>)</code></dfn> method must return the <var
-   title="">index</var>th node in the collection. If there is no <var
-   title="">index</var>th node in the collection, then the method must return
-   null.
+  <p>On getting, if the <a href="#input" title=concept-uda-input>input</a>
+   fulfills the condition given in the "getter condition" column
+   corresponding to the attribute in the table below, the user agent must
+   return the part of the <a href="#input" title=concept-uda-input>input</a>
+   URI given in the "component" column, with any prefixes specified in the
+   "prefix" column appropriately added to the start of the string and any
+   suffixes specified in the "suffix" column appropriately added to the end
+   of the string. Otherwise, the attribute must return the empty string.</p>
+  <!-- XXXURL change to URL; algorithms or something? -->
 
-  <p>The <dfn id=nameditem1
-   title=dom-HTMLOptionsCollection-namedItem><code>namedItem(<var
-   title="">key</var>)</code></dfn> method must act according to the
-   following algorithm:
+  <p>On setting, the new value must first be mutated as described by the
+   "setter preprocessor" column, then mutated by %-escaping any characters in
+   the new value that are not valid in the relevant component as given by the
+   "component" column. Then, if the resulting new value fulfills the
+   condition given in the "setter condition" column, the user agent must make
+   a new string <var title="">output</var> by replacing the component of the
+   URI given by the "component" column in the <a href="#input"
+   title=concept-uda-input>input</a> URI with the new value; otherwise, the
+   user agent must let <var title="">output</var> be equal to the <a
+   href="#input" title=concept-uda-input>input</a>. Finally, the user agent
+   must invoke the <a href="#common3" title=concept-uda-setter>common setter
+   action</a> with the value of <var title="">output</var>.</p>
+  <!-- XXXURL change to URL -->
 
-  <ol>
-   <li>If, at the time the method is called, there is exactly one node in the
-    collection that has either an <code title=attr-id><a
-    href="#id">id</a></code> attribute or a <code title=attr-name>name</code>
-    attribute equal to <var title="">key</var>, then return that node and
-    stop the algorithm.
+  <p>When replacing a component in the URI, if the component is part of an
+   optional group in the URI syntax consisting of a character followed by the
+   component, the component (including its prefix character) must be included
+   even if the new value is the empty string.
 
-   <li>Otherwise, if there are no nodes in the collection that have either an
-    <code title=attr-id><a href="#id">id</a></code> attribute or a <code
-    title=attr-name>name</code> attribute equal to <var title="">key</var>,
-    then return null and stop the algorithm.
+  <p class=note>The previous paragraph applies in particular to the "<code
+   title="">:</code>" before a <port> component, the "<code
+   title="">?</code>" before a <query> component, and the "<code
+   title="">#</code>" before a <fragment> component.</p>
+  <!-- XXXURL change to URL; algorithms -->
 
-   <li>Otherwise, create a <code>NodeList</code> object representing a live
-    view of the <code><a
-    href="#htmloptionscollection0">HTMLOptionsCollection</a></code> object,
-    further filtered so that the only nodes in the <code>NodeList</code>
-    object are those that have either an <code title=attr-id><a
-    href="#id">id</a></code> attribute or a <code
-    title=attr-option-name>name</code> attribute equal to <var
-    title="">key</var>. The nodes in the <code>NodeList</code> object must be
-    sorted in <a href="#tree-order">tree order</a>.
+  <p>The rules for parsing and constructing URIs are described in RFC 3986
+   and RFC 3987. <a href="#refsRFC3986">[RFC3986]</a> <a
+   href="#refsRFC3987">[RFC3987]</a>
 
-   <li>Return that <code>NodeList</code> object.
-  </ol>
-  <!-- see also http://ln.hixie.ch/?start=1161042744&count=1 -->
-
-  <p class=big-issue>We may want to add <code>add()</code> and
-   <code>remove()</code> methods here too because IE implements
-   HTMLSelectElement and HTMLOptionsCollection on the same object, and so
-   people use them almost interchangeably in the wild.
-
-  <h4 id=domtokenlist><span class=secno>2.3.2 </span>DOMTokenList</h4>
-
-  <p>The <code><a href="#domtokenlist0">DOMTokenList</a></code> interface
-   represents an interface to an underlying string that consists of an <a
-   href="#unordered">unordered set of unique space-separated tokens</a>.
-
-  <p>Which string underlies a particular <code><a
-   href="#domtokenlist0">DOMTokenList</a></code> object is defined when the
-   object is created. It might be a content attribute (e.g. the string that
-   underlies the <code title=dom-classList><a
-   href="#classlist">classList</a></code> object is the <code
-   title=attr-class><a href="#class">class</a></code> attribute), or it might
-   be an anonymous string (e.g. when a <code><a
-   href="#domtokenlist0">DOMTokenList</a></code> object is passed to an
-   author-implemented callback in the <code><a
-   href="#datagrid0">datagrid</a></code> APIs).
-
-  <pre
-   class=idl>[<a href="#stringify" title=dom-tokenlist-toString>Stringifies</a>] interface <dfn id=domtokenlist0>DOMTokenList</dfn> {
-  readonly attribute unsigned long <a href="#length2" title=dom-tokenlist-length>length</a>;
-  [IndexGetter] DOMString <a href="#itemindex2" title=dom-tokenlist-item>item</a>(in unsigned long index);
-  boolean <a href="#hastoken" title=dom-tokenlist-has>has</a>(in DOMString token);
-  void <a href="#addtoken" title=dom-tokenlist-add>add</a>(in DOMString token);
-  void <a href="#remove" title=dom-tokenlist-remove>remove</a>(in DOMString token);
-  boolean <a href="#toggle" title=dom-tokenlist-toggle>toggle</a>(in DOMString token);
-};</pre>
-
-  <p>The <dfn id=length2 title=dom-tokenlist-length><code>length</code></dfn>
-   attribute must return the number of <em>unique</em> tokens that result
-   from <a href="#split" title="split a string on spaces">splitting the
-   underlying string on spaces</a>.
-
-  <p>The <dfn id=itemindex2 title=dom-tokenlist-item><code>item(<var
-   title="">index</var>)</code></dfn> method must <a href="#split"
-   title="split a string on spaces">split the underlying string on
-   spaces</a>, sort the resulting list of tokens by Unicode
-   codepoint<!-- XXX that's
-  basically nonsense. What sort order do we want here? It should be
-  the cheapest one possible that is well-defined for all Unicode. -->,
-   remove exact duplicates, and then return the <var title="">index</var>th
-   item in this list. If <var title="">index</var> is equal to or greater
-   than the number of tokens, then the method must return null.
-
-  <p>The <dfn id=hastoken title=dom-tokenlist-has><code>has(<var
-   title="">token</var>)</code></dfn> method must run the following
-   algorithm:
-
-  <ol>
-   <li>If the <var title="">token</var> argument contains any <a
-    href="#space" title="space character">space characters</a>, then raise an
-    <code>INVALID_CHARACTER_ERR</code> exception and stop the algorithm.
-
-   <li>Otherwise, <a href="#split" title="split a string on spaces">split the
-    underlying string on spaces</a> to get the list of tokens in the object's
-    underlying string.
-
-   <li>If the token indicated by <var title="">token</var> is one of the
-    tokens in the object's underlying string then return true and stop this
-    algorithm.
-
-   <li>Otherwise, return false.
-  </ol>
-
-  <p>The <dfn id=addtoken title=dom-tokenlist-add><code>add(<var
-   title="">token</var>)</code></dfn> method must run the following
-   algorithm:
-
-  <ol>
-   <li>If the <var title="">token</var> argument contains any <a
-    href="#space" title="space character">space characters</a>, then raise an
-    <code>INVALID_CHARACTER_ERR</code> exception and stop the algorithm.
-
-   <li>Otherwise, <a href="#split" title="split a string on spaces">split the
-    underlying string on spaces</a> to get the list of tokens in the object's
-    underlying string.
-
-   <li>If the given <var title="">token</var> is already one of the tokens in
-    the <code><a href="#domtokenlist0">DOMTokenList</a></code> object's
-    underlying string then stop the algorithm.
-
-   <li>Otherwise, if the <code><a
-    href="#domtokenlist0">DOMTokenList</a></code> object's underlying string
-    is not the empty string and the last character of that string is not a <a
-    href="#space">space character</a>, then append a U+0020 SPACE character
-    to the end of that string.
-
-   <li>Append the value of <var title="">token</var> to the end of the
-    <code><a href="#domtokenlist0">DOMTokenList</a></code> object's
-    underlying string.
-  </ol>
-
-  <p>The <dfn id=remove title=dom-tokenlist-remove><code>remove(<var
-   title="">token</var>)</code></dfn> method must run the following
-   algorithm:
-
-  <ol>
-   <li>If the <var title="">token</var> argument contains any <a
-    href="#space" title="space character">space characters</a>, then raise an
-    <code>INVALID_CHARACTER_ERR</code> exception and stop the algorithm.
-
-   <li>Otherwise, <a href="#remove0" title="remove a token from a
-    string">remove the given <var title="">token</var> from the underlying
-    string</a>.
-  </ol>
-
-  <p>The <dfn id=toggle title=dom-tokenlist-toggle><code>toggle(<var
-   title="">token</var>)</code></dfn> method must run the following
-   algorithm:
-
-  <ol>
-   <li>If the <var title="">token</var> argument contains any <a
-    href="#space" title="space character">space characters</a>, then raise an
-    <code>INVALID_CHARACTER_ERR</code> exception and stop the algorithm.
-
-   <li>Otherwise, <a href="#split" title="split a string on spaces">split the
-    underlying string on spaces</a> to get the list of tokens in the object's
-    underlying string.
-
-   <li>If the given <var title="">token</var> is already one of the tokens in
-    the <code><a href="#domtokenlist0">DOMTokenList</a></code> object's
-    underlying string then <a href="#remove0" title="remove a token from a
-    string">remove the given <var title="">token</var> from the underlying
-    string</a>, and stop the algorithm, returning false.
-
-   <li>Otherwise, if the <code><a
-    href="#domtokenlist0">DOMTokenList</a></code> object's underlying string
-    is not the empty string and the last character of that string is not a <a
-    href="#space">space character</a>, then append a U+0020 SPACE character
-    to the end of that string.
-
-   <li>Append the value of <var title="">token</var> to the end of the
-    <code><a href="#domtokenlist0">DOMTokenList</a></code> object's
-    underlying string.
-
-   <li>Return true.
-  </ol>
-
-  <p>Objects implementing the <code><a
-   href="#domtokenlist0">DOMTokenList</a></code> interface must <dfn
-   id=stringify title=dom-tokenlist-toString>stringify</dfn> to the object's
-   underlying string representation.
-
-  <h4 id=domstringmap><span class=secno>2.3.3 </span>DOMStringMap</h4>
-
-  <p>The <code><a href="#domstringmap0">DOMStringMap</a></code> interface
-   represents a set of name-value pairs. When a <code><a
-   href="#domstringmap0">DOMStringMap</a></code> object is instanced, it is
-   associated with three algorithms, one for getting values from names, one
-   for setting names to certain values, and one for deleting names.
-
-  <p class=big-issue>The names of the methods on this interface are temporary
-   and will be fixed when the Web IDL / "Language Bindings for DOM
-   Specifications" spec is ready to handle this case.
-
-  <pre class=idl>interface <dfn id=domstringmap0>DOMStringMap</dfn> {
-  [NameGetter] DOMString <a href="#xxx1name" title=dom-stringmap-XXX1>XXX1</a>(in DOMString name); <!-- XXX DOMB -->
-  [NameSetter] void <a href="#xxx2name" title=dom-stringmap-XXX2>XXX2</a>(in DOMString name, in DOMString value); <!-- XXX DOMB -->
-  [XXX] boolean <a href="#xxx3name" title=dom-stringmap-XXX3>XXX3</a>(in DOMString name); <!-- XXX DOMB -->
-};</pre>
-
-  <p>The <dfn id=xxx1name title=dom-stringmap-XXX1><code>XXX1(<var
-   title="">name</var>)</code></dfn> method must call the algorithm for
-   getting values from names, passing <var title="">name</var> as the name,
-   and must return the corresponding value, or null if <var
-   title="">name</var> has no corresponding value.
-
-  <p>The <dfn id=xxx2name title=dom-stringmap-XXX2><code>XXX2(<var
-   title="">name</var>, <var title="">value</var>)</code></dfn> method must
-   call the algorithm for setting names to certain values, passing <var
-   title="">name</var> as the name and <var title="">value</var> as the
-   value.
-
-  <p>The <dfn id=xxx3name title=dom-stringmap-XXX3><code>XXX3(<var
-   title="">name</var>)</code></dfn> method must call the algorithm for
-   deleting names, passing <var title="">name</var> as the name, and must
-   return true.
-
-  <h4 id=dom-feature><span class=secno>2.3.4 </span>DOM feature strings</h4>
-
-  <p>DOM3 Core defines mechanisms for checking for interface support, and for
-   obtaining implementations of interfaces, using <a
-   href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMFeatures">feature
-   strings</a>. <a href="#refsDOM3CORE">[DOM3CORE]</a>
-
-  <p>A DOM application can use the <dfn id=hasfeature
-   title=hasFeature><code>hasFeature(<var title="">feature</var>, <var
-   title="">version</var>)</code></dfn> method of the
-   <code>DOMImplementation</code> interface with parameter values "<code
-   title="">HTML</code>" and "<code>5.0</code>" (respectively) to determine
-   whether or not this module is supported by the implementation. In addition
-   to the feature string "<code title="">HTML</code>", the feature string
-   "<code title="">XHTML</code>" (with version string "<code>5.0</code>") can
-   be used to check if the implementation supports XHTML. User agents should
-   respond with a true value when the <code><a
-   href="#hasfeature">hasFeature</a></code> method is queried with these
-   values. Authors are cautioned, however, that UAs returning true might not
-   be perfectly compliant, and that UAs returning false might well have
-   support for features in this specification; in general, therefore, use of
-   this method is discouraged.
-
-  <p>The values "<code title="">HTML</code>" and "<code
-   title="">XHTML</code>" (both with version "<code>5.0</code>") should also
-   be supported in the context of the <code>getFeature()</code> and
-   <code>isSupported()</code> methods, as defined by DOM3 Core.
-
-  <p class=note>The interfaces defined in this specification are not always
-   supersets of the interfaces defined in DOM2 HTML; some features that were
-   formerly deprecated, poorly supported, rarely used or considered
-   unnecessary have been removed. Therefore it is not guaranteed that an
-   implementation that supports "<code title="">HTML</code>"
-   "<code>5.0</code>" also supports "<code title="">HTML</code>"
-   "<code>2.0</code>".
-
-  <h3 id=dom-tree><span class=secno>2.4 </span><dfn id=dom-tree0>DOM tree
-   accessors</dfn></h3>
-
-  <p><dfn id=the-html0>The <code>html</code> element</dfn> of a document is
-   the document's root element, if there is one and it's an <code><a
-   href="#html">html</a></code> element, or null otherwise.
-
-  <p><dfn id=the-head0>The <code>head</code> element</dfn> of a document is
-   the first <code><a href="#head">head</a></code> element that is a child of
-   <a href="#the-html0">the <code>html</code> element</a>, if there is one,
-   or null otherwise.
-
-  <p><dfn id=the-title1>The <code>title</code> element</dfn> of a document is
-   the first <code><a href="#title1">title</a></code> element in the document
-   (in tree order), if there is one, or null otherwise.
-
-  <p>The <dfn id=document.title
-   title=dom-document-title><code>title</code></dfn> attribute must, on
-   getting, run the following algorithm:
-
-  <ol>
-   <li>
-    <p>If the <a href="#root-element">root element</a> is an <code>svg</code>
-     element in the "<code title="">http://www.w3.org/2000/svg</code>"
-     namespace, and the user agent supports SVG, then the getter must return
-     the value that would have been returned by the DOM attribute of the same
-     name on the <code>SVGDocument</code> interface.
-
-   <li>
-    <p>Otherwise, it must return a concatenation of the data of all the child
-     <a href="#text-node" title="text node">text nodes</a> of <a
-     href="#the-title1">the <code>title</code> element</a>, in tree order, or
-     the empty string if <a href="#the-title1">the <code>title</code>
-     element</a> is null.
-  </ol>
-
-  <p>On setting, the following algorithm must be run:
-
-  <ol>
-   <li>
-    <p>If the <a href="#root-element">root element</a> is an <code>svg</code>
-     element in the "<code title="">http://www.w3.org/2000/svg</code>"
-     namespace, and the user agent supports SVG, then the setter must defer
-     to the setter for the DOM attribute of the same name on the
-     <code>SVGDocument</code> interface. Stop the algorithm here.
-
-   <li>If <a href="#the-title1">the <code>title</code> element</a> is null
-    and <a href="#the-head0">the <code>head</code> element</a> is null, then
-    the attribute must do nothing. Stop the algorithm here.
-
-   <li>If <a href="#the-title1">the <code>title</code> element</a> is null,
-    then a new <code><a href="#title1">title</a></code> element must be
-    created and appended to <a href="#the-head0">the <code>head</code>
-    element</a>.
-
-   <li>The children of <a href="#the-title1">the <code>title</code>
-    element</a> (if any) must all be removed.
-
-   <li>A single <code>Text</code> node whose data is the new value being
-    assigned must be appended to <a href="#the-title1">the <code>title</code>
-    element</a>.
-  </ol>
-
-  <p>The <code title=dom-document-title><a
-   href="#document.title">title</a></code> attribute on the <code><a
-   href="#htmldocument">HTMLDocument</a></code> interface should shadow the
-   attribute of the same name on the <code>SVGDocument</code> interface when
-   the user agent supports both HTML and SVG.
-
-  <p><dfn id=the-body1>The body element</dfn> of a document is the first
-   child of <a href="#the-html0">the <code>html</code> element</a> that is
-   either a <code><a href="#body0">body</a></code> element or a
-   <code>frameset</code> element. If there is no such element, it is null. If
-   the body element is null, then when the specification requires that events
-   be fired at "the body element", they must instead be fired at the
-   <code>Document</code> object.
-
-  <p>The <dfn id=body title=dom-document-body><code>body</code></dfn>
-   attribute, on getting, must return <a href="#the-body1">the body
-   element</a> of the document (either a <code><a
-   href="#body0">body</a></code> element, a <code>frameset</code> element, or
-   null). On setting, the following algorithm must be run:
-
-  <ol>
-   <li>If the new value is not a <code><a href="#body0">body</a></code> or
-    <code>frameset</code> element, then raise a
-    <code>HIERARCHY_REQUEST_ERR</code> exception and abort these steps.
-
-   <li>Otherwise, if the new value is the same as <a href="#the-body1">the
-    body element</a>, do nothing. Abort these steps.
-
-   <li>Otherwise, if <a href="#the-body1">the body element</a> is not null,
-    then replace that element with the new value in the DOM, as if the root
-    element's <code title="">replaceChild()</code> method had been called
-    with the new value and <a href="#the-body1" title="the body element">the
-    incumbent body element</a> as its two arguments respectively, then abort
-    these steps.
-
-   <li>Otherwise, the <a href="#the-body1">the body element</a> is null.
-    Append the new value to the root element.
-  </ol>
-  <!--XXX
-    http://lxr.mozilla.org/seamonkey/source/content/html/document/src/nsHTMLDocument.cpp
-    search for ::GetBody ::SetBody
-    http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/html/HTMLDocument.cpp
-    search for ::setBody
-    http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/dom/Document.cpp
-    search for ::body
-  -->
-
-  <p>The <dfn id=images0 title=dom-document-images><code>images</code></dfn>
-   attribute must return an <code><a
-   href="#htmlcollection0">HTMLCollection</a></code> rooted at the
-   <code>Document</code> node, whose filter matches only <code><a
-   href="#img">img</a></code> elements.
-
-  <p>The <dfn id=embeds title=dom-document-embeds><code>embeds</code></dfn>
-   attribute must return an <code><a
-   href="#htmlcollection0">HTMLCollection</a></code> rooted at the
-   <code>Document</code> node, whose filter matches only <code><a
-   href="#embed">embed</a></code> elements.
-
-  <p>The <dfn id=plugins
-   title=dom-document-plugins><code>plugins</code></dfn> attribute must
-   return the same object as that returned by the <code
-   title=dom-document-embeds><a href="#embeds">embeds</a></code> attribute.
-
-  <p>The <dfn id=links0 title=dom-document-links><code>links</code></dfn>
-   attribute must return an <code><a
-   href="#htmlcollection0">HTMLCollection</a></code> rooted at the
-   <code>Document</code> node, whose filter matches only <code><a
-   href="#a">a</a></code> elements with <code title=attr-hyperlink-href><a
-   href="#href6">href</a></code> attributes and <code><a
-   href="#area">area</a></code> elements with <code
-   title=attr-hyperlink-href><a href="#href6">href</a></code> attributes.
-
-  <p>The <dfn id=forms0 title=dom-document-forms><code>forms</code></dfn>
-   attribute must return an <code><a
-   href="#htmlcollection0">HTMLCollection</a></code> rooted at the
-   <code>Document</code> node, whose filter matches only <code>form</code>
-   elements.
-
-  <p>The <dfn id=anchors
-   title=dom-document-anchors><code>anchors</code></dfn> attribute must
-   return an <code><a href="#htmlcollection0">HTMLCollection</a></code>
-   rooted at the <code>Document</code> node, whose filter matches only
-   <code><a href="#a">a</a></code> elements with <code
-   title=attr-a-name>name</code> attributes.</p>
-  <!-- XXX note that such elements are
-  non-conforming -->
-
-  <p>The <dfn id=scripts
-   title=dom-document-scripts><code>scripts</code></dfn> attribute must
-   return an <code><a href="#htmlcollection0">HTMLCollection</a></code>
-   rooted at the <code>Document</code> node, whose filter matches only
-   <code><a href="#script1">script</a></code> elements.
-
-  <p>The <dfn id=getelementsbyname
-   title=dom-document-getElementsByName><code>getElementsByName(<var
-   title="">name</var>)</code></dfn> method a string <var
-   title="">name</var>, and must return a live <code>NodeList</code>
-   containing all the <code><a href="#a">a</a></code>, <code><a
-   href="#applet">applet</a></code>, <code>button</code>, <code>form</code>,
-   <!-- frame? frameset?
-  XXX--><code><a href="#iframe">iframe</a></code>,
-   <code><a href="#img">img</a></code>, <code>input</code>, <code><a
-   href="#map">map</a></code>, <code><a href="#meta0">meta</a></code>,
-   <code><a href="#object">object</a></code>,<!-- param?
-  XXX-->
-   <code>select</code>, and <code>textarea</code> elements in that document
-   that have a <code title="">name</code> attribute whose value is
-   equal<!-- XXX case sensitivity --> to the <var title="">name</var>
-   argument.</p>
-  <!-- XXX what about XHTML? -->
-
-  <p>The <dfn id=getelementsbyclassname
-   title=dom-document-getElementsByClassName><code>getElementsByClassName(<var
-   title="">classNames</var>)</code></dfn> method takes a string that
-   contains an <a href="#unordered">unordered set of unique space-separated
-   tokens</a> representing classes. When called, the method must return a
-   live <code>NodeList</code> object containing all the elements in the
-   document that have all the classes specified in that argument, having
-   obtained the classes by <a href="#split" title="split a string on
-   spaces">splitting a string on spaces</a>. If there are no tokens specified
-   in the argument, then the method must return an empty
-   <code>NodeList</code>.
-
-  <p>The <dfn id=getelementsbyclassname0
-   title=dom-getElementsByClassName><code>getElementsByClassName()</code></dfn>
-   method on the <code><a href="#htmlelement">HTMLElement</a></code>
-   interface must return a live <code>NodeList</code> with the nodes that the
-   <code><a href="#htmldocument">HTMLDocument</a></code> <code
-   title=dom-document-getElementsByClassName><a
-   href="#getelementsbyclassname">getElementsByClassName()</a></code> method
-   would return when passed the same argument(s), excluding any elements that
-   are not descendants of the <code><a
-   href="#htmlelement">HTMLElement</a></code> object on which the method was
-   invoked.
-
-  <p>HTML, SVG, and MathML elements define which classes they are in by
-   having an attribute in the per-element partition with the name <code
-   title="">class</code> containing a space-separated list of classes to
-   which the element belongs. Other specifications may also allow elements in
-   their namespaces to be labeled as being in specific classes. UAs must not
-   assume that all attributes of the name <code title="">class</code> for
-   elements in any namespace work in this way, however, and must not assume
-   that such attributes, when used as global attributes, label other elements
-   as being in specific classes.
-
-  <div class=example>
-   <p>Given the following XHTML fragment:</p>
-
-   <pre><div id="example">
- <p id="p1" class="aaa bbb"/>
- <p id="p2" class="aaa ccc"/>
- <p id="p3" class="bbb ccc"/>
-</div></pre>
-
-   <p>A call to
-    <code>document.getElementById('example').getElementsByClassName('aaa')</code>
-    would return a <code>NodeList</code> with the two paragraphs
-    <code>p1</code> and <code>p2</code> in it.</p>
-
-   <p>A call to <code>getElementsByClassName('ccc bbb')</code> would
-    only return one node, however, namely <code>p3</code>. A call to
-    <code>document.getElementById('example').getElementsByClassName('bbb  ccc ')</code>
-    would return the same thing.</p>
-
-   <p>A call to <code>getElementsByClassName('aaa,bbb')</code> would return
-    no nodes; none of the elements above are in the "aaa,bbb" class.</p>
-  </div>
-  <!-- XXX
->         * xGetParentElementByClassName(rootElement, className, tagName) -
-> Navigates upwards until we hit a parent element with the given class name and
-> optional tag name.
--->
-
-  <p class=note>The <code title=dom-document-dir><a
-   href="#dir1">dir</a></code> attribute on the <code><a
-   href="#htmldocument">HTMLDocument</a></code> interface is defined along
-   with the <code title=attr-dir><a href="#dir">dir</a></code> content
-   attribute.
-
-  <h3 id=dynamic><span class=secno>2.5 </span><dfn id=dynamic2>Dynamic markup
-   insertion</dfn></h3>
-
-  <p>The <code title=dom-document-write><a
-   href="#document.write">document.write()</a></code> family of methods and
-   the <code title=dom-innerHTML><a href="#innerhtml">innerHTML</a></code>
-   family of DOM attributes enable script authors to dynamically insert
-   markup into the document.
-
-  <p class=issue>bz argues that innerHTML should be called something else on
-   XML documents and XML elements. Is the sanity worth the migration pain?
-
-  <p>Because these APIs interact with the parser, their behavior varies
-   depending on whether they are used with <a href="#html-">HTML
-   documents</a> (and the <a href="#html-0">HTML parser</a>) or XHTML in <a
-   href="#xml-documents">XML documents</a> (and the <span>XML parser</span>).
-   The following table cross-references the various versions of these APIs.
-
   <table>
    <thead>
     <tr>
-     <td>
+     <th>Attribute
 
-     <th><dfn id=document.write
-      title=dom-document-write><code>document.write()</code></dfn>
+     <th>Component
 
-     <th><dfn id=innerhtml title=dom-innerHTML><code>innerHTML</code></dfn>
+     <th>Getter Condition
 
-   <tbody>
-    <tr>
-     <th>For documents that are <a href="#html-">HTML documents</a>
+     <th>Prefix
 
-     <td><a href="#document.write..."
-      title=dom-document-write-HTML><code>document.write()</code> in HTML</a>
+     <th>Suffix
 
-     <td><a href="#innerhtml0"
-      title=dom-innerHTML-HTML><code>innerHTML</code> in HTML</a>
+     <th>Setter Preprocessor
 
+     <th>Setter Condition
+
+   <tbody>
     <tr>
-     <th>For documents that are <a href="#xml-documents">XML documents</a>
+     <td><dfn id=protocol title=dom-uda-protocol><code>protocol</code></dfn>
 
-     <td><a href="#document.write0"
-      title=dom-document-write-XML><code>document.write()</code> in XML</a>
+     <td><scheme>
 
-     <td><a href="#innerhtml1" title=dom-innerHTML-XML><code>innerHTML</code>
-      in XML</a>
-  </table>
+     <td>—
 
-  <p>Regardless of the parsing mode, the <dfn id=document.writeln...
-   title=dom-document-writeln><code>document.writeln(...)</code></dfn> method
-   must call the <code title=dom-document-write><a
-   href="#document.write">document.write()</a></code> method with the same
-   argument(s), and then call the <code title=dom-document-write><a
-   href="#document.write">document.write()</a></code> method with, as its
-   argument, a string consisting of a single line feed character (U+000A).
+     <td>—
 
-  <h4 id=controlling><span class=secno>2.5.1 </span>Controlling the input
-   stream</h4>
+     <td>U+003A COLON ("<code title="">:</code>")
 
-  <p>The <dfn id=open title=dom-document-open><code>open()</code></dfn>
-   method comes in several variants with different numbers of arguments.
+     <td>Remove all trailing U+003A COLON ("<code title="">:</code>")
+      characters
 
-  <p>When called with two or fewer arguments, the method must act as follows:
+     <td>The new value is not the empty string
 
-  <ol>
-   <li>
-    <p>Let <var title="">type</var> be the value of the first argument, if
-     there is one, or "<code>text/html</code>" otherwise.
+    <tr>
+     <td><dfn id=host title=dom-uda-host><code>host</code></dfn>
 
-   <li>
-    <p>Let <var title="">replace</var> be true if there is a second argument
-     and it has the value "replace"<!-- case-insensitive. XXX
-   -->, and
-     false otherwise.
+     <td><a href="#lthostportgt"><hostport></a>
 
-   <li>
-    <p>If the document has an <span>active parser</span><!-- XXX xref
-    -->
-     that isn't a <a href="#script-created">script-created parser</a>, and
-     the <a href="#insertion">insertion point</a> associated with that
-     parser's <a href="#input0">input stream</a> is not undefined (that is,
-     it <em>does</em> point to somewhere in the input stream), then the
-     method does nothing. Abort these steps and return the
-     <code>Document</code> object on which the method was invoked.</p>
+     <td><a href="#input" title=concept-uda-input>input</a> is hierarchical
+      and uses a server-based naming authority
 
-    <p class=note>This basically causes <code title=dom-document-open><a
-     href="#open">document.open()</a></code> to be ignored when it's called
-     in an inline script found during the parsing of data sent over the
-     network, while still letting it have an effect when called
-     asynchronously or on a document that is itself being spoon-fed using
-     these APIs.</p>
+     <td>—
 
-   <li>
-    <p class=big-issue>onbeforeunload, onunload, reset timers, empty event
-     queue, kill any pending transactions, XMLHttpRequests, etc
-   </li>
-   <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E...%3Ciframe%20src%3D%22document%22%3E%3C%2Fiframe%3E%0A%3Cscript%3Eonload%20%3D%20function%20()%20{%20f%20%3D%20document.getElementsByTagName(%27iframe%27)[0]%3B%20d%20%3D%20f.contentDocument%3B%20}%3C%2Fscript%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22w(d.documentElement.innerHTML)%22%20value%3D%22dump%22%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22d.body.bgColor%3D%27red%27%22%20value%3D%22color%22%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22f.style.border%3D%27lime%20solid%27%22%20value%3D%22color%20frame%22%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22d.open()%3B%20d.write(%27%3Cp%3Etest%3C%2Fp%3E%27)%3B%20d.close()%22%20value%3D%22replace%22%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22d.open()%3B%20d.write(%27%3Cp%3E%3Cscript%3Ei%20%3D%200%3B%20setInterval(%26quot%3Bparent.w(i%2B%2B)%26quot%3B%2C%20500)%3C%2Fscript%3E%3C%2Fp%3E%27)%3B%20d.close()%22%20value%3D%22replace%20with%20timer%22%3E%0A -->
+     <td>—
 
-   <li>
-    <p>If the document has an <span>active parser</span><!--XXX
-   xref-->,
-     then stop that parser, and throw away any pending content in the input
-     stream. <span class=big-issue>what about if it doesn't, because it's
-     either like a text/plain, or Atom, or PDF, or XHTML, or image document,
-     or something?</span>
-   </li>
-   <!-- XXX see
-   also innerHTML in HTML -->
+     <td>—
 
-   <li>
-    <p>Remove all child nodes of the document.
+     <td>—
 
-   <li>
-    <p>Change the <a href="#character1">document's character encoding</a> to
-     UTF-16.
+    <tr>
+     <td><dfn id=hostname title=dom-uda-hostname><code>hostname</code></dfn>
 
-   <li>
-    <p>Create a new <a href="#html-0">HTML parser</a> and associate it with
-     the document. This is a <dfn id=script-created>script-created
-     parser</dfn> (meaning that it can be closed by the <code
-     title=dom-document-open><a href="#open">document.open()</a></code> and
-     <code title=dom-document-close><a
-     href="#close">document.close()</a></code> methods, and that the
-     tokeniser will wait for an explicit call to <code
-     title=dom-document-close><a href="#close">document.close()</a></code>
-     before emitting an end-of-file token).
+     <td><host>/<ihost>
 
-   <li>Mark the document as being an <a href="#html-" title="HTML
-    documents">HTML document</a> (it might already be so-marked).</li>
-   <!-- text/plain handling -->
+     <td><a href="#input" title=concept-uda-input>input</a> is hierarchical
+      and uses a server-based naming authority
 
-   <li>
-    <p>If <var title="">type</var> does not have the value
-     "<code>text/html</code>"<!-- XXX matched how?
-   -->, then act as if the
-     tokeniser had emitted a <code><a href="#pre">pre</a></code> element
-     start tag, then set the <a href="#html-0">HTML parser</a>'s <a
-     href="#tokenisation0">tokenisation</a> stage's <a
-     href="#content2">content model flag</a> to <em>PLAINTEXT</em>.
+     <td>—
 
-   <li>
-    <p>If <var title="">replace</var> is false, then:
+     <td>—
 
-    <ol>
-     <li>Remove all the entries in the <a href="#browsing1">browsing
-      context</a>'s <a href="#session">session history</a> after the <a
-      href="#current1">current entry</a> in its <code>Document</code>'s
-      <code><a href="#history2">History</a></code> object
+     <td>Remove all leading U+002F SOLIDUS ("<code title="">/</code>")
+      characters
 
-     <li>Remove any earlier entries that share the same <code>Document</code>
+     <td>—
 
-     <li>Add a new entry just before the last entry that is associated with
-      the text that was parsed by the previous parser associated with the
-      <code>Document</code> object, as well as the state of the document at
-      the start of these steps. (This allows the user to step backwards in
-      the session history to see the page before it was blown away by the
-      <code title=dom-document-open><a
-      href="#open">document.open()</a></code> call.)
-    </ol>
+    <tr>
+     <td><dfn id=port title=dom-uda-port><code>port</code></dfn>
 
-   <li>
-    <p>Finally, set the <a href="#insertion">insertion point</a> to point at
-     just before the end of the <a href="#input0">input stream</a> (which at
-     this point will be empty).
+     <td><port>
 
-   <li>
-    <p>Return the <code>Document</code> on which the method was invoked.
-  </ol>
+     <td><a href="#input" title=concept-uda-input>input</a> is hierarchical
+      and uses a server-based naming authority
 
-  <p class=big-issue>We shouldn't hard-code <code>text/plain</code> there. We
-   should do it some other way, e.g. hand off to the section on
-   content-sniffing and handling of incoming data streams, the part that
-   defines how this all works when stuff comes over the network.</p>
-  <!-- XXX Should we support XML/XHTML as a type to that method? -->
+     <td>—
 
-  <p>When called with three or more arguments, the <code
-   title=dom-document-open><a href="#open">open()</a></code> method on the
-   <code><a href="#htmldocument">HTMLDocument</a></code> object must call the
-   <code title=dom-open><a href="#open2">open()</a></code> method on the
-   <code><a href="#window">Window</a></code> interface of the object returned
-   by the <code title=dom-document-defaultView>defaultView</code> attribute
-   of the <code>DocumentView</code> interface of the <code><a
-   href="#htmldocument">HTMLDocument</a></code> object, with the same
-   arguments as the original call to the <code title=dom-document-open><a
-   href="#open">open()</a></code> method, and return whatever that method
-   returned. If the <code title=dom-document-defaultView>defaultView</code>
-   attribute of the <code>DocumentView</code> interface of the <code><a
-   href="#htmldocument">HTMLDocument</a></code> object is null, then the
-   method must raise an <code>INVALID_ACCESS_ERR</code> exception.
+     <td>—
 
-  <p>The <dfn id=close title=dom-document-close><code>close()</code></dfn>
-   method must do nothing if there is no <a
-   href="#script-created">script-created parser</a> associated with the
-   document. If there is such a parser, then, when the method is called, the
-   user agent must insert an <a href="#explicit0">explicit "EOF"
-   character</a> at the <a href="#insertion">insertion point</a> of the
-   parser's <a href="#input0">input stream</a>.
+     <td>Remove any characters in the new value that are not in the range
+      U+0030 DIGIT ZERO .. U+0039 DIGIT NINE. If the resulting string is
+      empty, set it to a single U+0030 DIGIT ZERO character ('0').
 
-  <h4 id=dynamic0><span class=secno>2.5.2 </span>Dynamic markup insertion in
-   HTML</h4>
+     <td>—
 
-  <p>In HTML, the <dfn id=document.write...
-   title=dom-document-write-HTML><code>document.write(...)</code></dfn>
-   method must act as follows:
+    <tr>
+     <td><dfn id=pathname title=dom-uda-pathname><code>pathname</code></dfn>
 
-  <ol>
-   <li>
-    <p>If the <a href="#insertion">insertion point</a> is undefined, the
-     <code title=dom-document-open><a href="#open">open()</a></code> method
-     must be called (with no arguments) on the <code
-     title=Document>document</code> object. The <a
-     href="#insertion">insertion point</a> will point at just before the end
-     of the (empty) <a href="#input0">input stream</a>.</p>
+     <td><abs_path>
 
-   <li>
-    <p>The string consisting of the concatenation of all the arguments to the
-     method must be inserted into the <a href="#input0">input
-     stream</a><!-- XXX xref --> just before the <a
-     href="#insertion">insertion point</a>.</p>
+     <td><a href="#input" title=concept-uda-input>input</a> is hierarchical
 
-   <li>
-    <p>If there is <a href="#the-script" title="the script that will execute
-     as soon as the parser resumes">a script that will execute as soon as the
-     parser resumes</a>, then the method must now return without further
-     processing of the <a href="#input0">input stream</a>.</p>
+     <td>—
 
-   <li>
-    <p>Otherwise, the tokeniser must process the characters that were
-     inserted, one at a time, processing resulting tokens as they are
-     emitted, and stopping when the tokeniser reaches the insertion point or
-     when the processing of the tokeniser is aborted by the tree construction
-     stage (this can happen if a <code><a href="#script1">script</a></code>
-     start tag token is emitted by the tokeniser).
+     <td>—
 
-    <p class=note>If the <code title=dom-document-write-HTML><a
-     href="#document.write...">document.write()</a></code> method was called
-     from script executing inline (i.e. executing because the parser parsed a
-     set of <code><a href="#script1">script</a></code> tags), then this is a
-     <a href="#nestedParsing">reentrant invocation of the parser</a>.</p>
+     <td>If it has no leading U+002F SOLIDUS ("<code title="">/</code>")
+      character, prepend a U+002F SOLIDUS ("<code title="">/</code>")
+      character to the new value
 
-   <li>
-    <p>Finally, the method must return.</p>
-  </ol>
+     <td>—
 
-  <p>In HTML, the <dfn id=innerhtml0
-   title=dom-innerHTML-HTML><code>innerHTML</code></dfn> DOM attribute of all
-   <code><a href="#htmlelement">HTMLElement</a></code> and <code><a
-   href="#htmldocument">HTMLDocument</a></code> nodes returns a serialization
-   of the node's children using the <span>HTML syntax</span><!-- XXX xref
-  -->.
-   On setting, it replaces the node's children with new nodes that result
-   from parsing the given value. The formal definitions follow.
+    <tr>
+     <td><dfn id=search title=dom-uda-search><code>search</code></dfn>
 
-  <p>On getting, the <code title=dom-innerHTML-HTML><a
-   href="#innerhtml0">innerHTML</a></code> DOM attribute must return the
-   result of running the <a href="#html-fragment">HTML fragment serialization
-   algorithm</a> on the node.
+     <td><query>
 
-  <p>On setting, if the node is a document, the <code
-   title=dom-innerHTML-HTML><a href="#innerhtml0">innerHTML</a></code> DOM
-   attribute must run the following algorithm:
+     <td><a href="#input" title=concept-uda-input>input</a> is hierarchical
 
-  <ol>
-   <li>
-    <p>If the document has an <span>active parser</span><!--XXX
-    xref-->,
-     then stop that parser, and throw away any pending content in the input
-     stream. <span class=big-issue>what about if it doesn't, because it's
-     either like a text/plain, or Atom, or PDF, or XHTML, or image document,
-     or something?</span></p>
-    <!-- XXX see
-    also document.open() -->
+     <td>U+003F QUESTION MARK ("<code title="">?</code>")
 
-   <li>
-    <p>Remove the children nodes of the <code>Document</code> whose <code
-     title=dom-innerHTML-HTML><a href="#innerhtml0">innerHTML</a></code>
-     attribute is being set.</p>
+     <td>—
 
-   <li>
-    <p>Create a new <a href="#html-0">HTML parser</a>, in its initial state,
-     and associate it with the <code>Document</code> node.</p>
-   </li>
-   <!-- redundant, the document is forcibly already so labeled if we get here
-   <li>
+     <td>Remove one leading U+003F QUESTION MARK ("<code title="">?</code>")
+      character, if any
 
-    <p>Mark the <code>Document</code> object as being an <span
-    title="HTML documents">HTML document</span>.</p>
+     <td>—
 
-   </li>
--->
+    <tr>
+     <td><dfn id=hash title=dom-uda-hash><code>hash</code></dfn>
 
-   <li>
-    <p>Place into the <a href="#input0">input stream</a> for the <a
-     href="#html-0">HTML parser</a> just created the string being assigned
-     into the <code title=dom-innerHTML-HTML><a
-     href="#innerhtml0">innerHTML</a></code> attribute.</p>
+     <td><fragment>
 
-   <li>
-    <p>Start the parser and let it run until it has consumed all the
-     characters just inserted into the input stream. (The
-     <code>Document</code> node will have been populated with elements and a
-     <code title=event-load><a href="#load0">load</a></code> event will have
-     fired on <a href="#the-body1" title="the body element">its body
-     element</a>.)</p>
-  </ol>
+     <td>Fragment identifier is longer than zero characters
 
-  <p>Otherwise, if the node is an element, then setting the <code
-   title=dom-innerHTML-HTML><a href="#innerhtml0">innerHTML</a></code> DOM
-   attribute must cause the following algorithm to run instead:
+     <td>U+0023 NUMBER SIGN ("<code title="">#</code>")
 
-  <ol>
-   <li>
-    <p>Invoke the <a href="#html-fragment0">HTML fragment parsing
-     algorithm</a>, with the element whose <code title=dom-innerHTML-HTML><a
-     href="#innerhtml0">innerHTML</a></code> attribute is being set as the
-     <var title="">context</var> element, and the string being assigned into
-     the <code title=dom-innerHTML-HTML><a
-     href="#innerhtml0">innerHTML</a></code> attribute as the <var
-     title="">input</var>. Let <var title="">new children</var> be the result
-     of this algorithm.</p>
+     <td>—
 
-   <li>
-    <p>Remove the children of the element whose <code
-     title=dom-innerHTML-HTML><a href="#innerhtml0">innerHTML</a></code>
-     attribute is being set.</p>
+     <td>Remove one leading U+0023 NUMBER SIGN ("<code title="">#</code>")
+      character, if any
 
-   <li>
-    <p>Let <var title="">target document</var> be the <code
-     title="">ownerDocument</code> of the <code>Element</code> node whose
-     <code title=dom-innerHTML-HTML><a
-     href="#innerhtml0">innerHTML</a></code> attribute is being set.</p>
+     <td>—
+  </table>
 
-   <li>
-    <p>Set the <code title="">ownerDocument</code> of all the nodes in <var
-     title="">new children</var> to the <var title="">target document</var>.</p>
-
-   <li>
-    <p>Append all the <var title="">new children</var> nodes to the node
-     whose <code title=dom-innerHTML-HTML><a
-     href="#innerhtml0">innerHTML</a></code> attribute is being set,
-     preserving their order.</p>
-  </ol>
-
-  <p class=note><code><a href="#script1">script</a></code> elements inserted
-   using <code title=dom-innerHTML-HTML><a
-   href="#innerhtml0">innerHTML</a></code> do not execute when they are
-   inserted.</p>
-  <!-- XXX must make sure we spec that innerHTML causes mutation
-  events to fire, but document.write() doesn't. (the latter is already
-  req-stated in the parser section, btw) -->
-  <!-- http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/innerhtml.asp -->
-  <!-- http://lxr.mozilla.org/seamonkey/source/content/html/content/src/nsGenericHTMLElement.cpp#879
-       note script execution disabled
-       http://lxr.mozilla.org/seamonkey/source/content/base/src/nsContentUtils.cpp#3308
-       http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/html/HTMLElement.cpp#L295
-       http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/html/HTMLElement.cpp#L242
-       http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/html/HTMLTokenizer.cpp#L1742
-   -->
-
-  <h4 id=dynamic1><span class=secno>2.5.3 </span>Dynamic markup insertion in
-   XML</h4>
-
-  <p>In an XML context, the <dfn id=document.write0
-   title=dom-document-write-XML><code>document.write()</code></dfn> method
-   must raise an <code>INVALID_ACCESS_ERR</code> exception.</p>
+  <p>The <dfn id=lthostportgt><hostport></dfn> component is defined as
+   being the <host>/<ihost> component, followed by a colon and
+   the <port> component, but with the colon and <port> component
+   omitted if the given port matches the default port for the protocol given
+   by the <scheme> component.</p>
   <!--
-  For XHTML: content must be well-formed. Where does
-  it insert? Immediately after the script that called document.write()?</p>
-  how do we handle async scripts vs sync scripts?
-
-Consider:
-data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ document.write('<foo>Test</foo>'); ]]></script>
-data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ alert('test'); alert(document.write); try { document.write('<foo>Test</foo>'); alert(document.childNodes.length); } catch (e) { alert(e); } ]]></script>
-
+  http://www.hixie.ch/tests/adhoc/dom/level0/location/components/
+  http://lxr.mozilla.org/seamonkey/source/dom/src/base/nsLocation.cpp
+  http://wp.netscape.com/eng/mozilla/3.0/handbook/javascript/ref_h-l.htm#84722
 -->
 
-  <p>On the other hand, however, the <dfn id=innerhtml1
-   title=dom-innerHTML-XML><code>innerHTML</code></dfn> attribute is indeed
-   usable in an XML context.
+  <h3 id=common0><span class=secno>2.4 </span>Common microsyntaxes</h3>
 
-  <p>In an XML context, the <code title=dom-innerHTML-XML><a
-   href="#innerhtml1">innerHTML</a></code> DOM attribute on <code><a
-   href="#htmlelement">HTMLElement</a></code>s must return a string in the
-   form of an <a href="http://www.w3.org/TR/xml/#wf-entities">internal
-   general parsed entity</a>, and on <code><a
-   href="#htmldocument">HTMLDocument</a></code>s must return a string in the
-   form of a <a href="http://www.w3.org/TR/xml/#sec-well-formed">document
-   entity</a>. The string returned must be XML namespace-well-formed and must
-   be an isomorphic serialization of all of that node's child nodes, in
-   document order. User agents may adjust prefixes and namespace declarations
-   in the serialization (and indeed might be forced to do so in some cases to
-   obtain namespace-well-formed XML). For the <code
-   title=dom-innerHTML-XML><a href="#innerhtml1">innerHTML</a></code>
-   attribute on <code><a href="#htmlelement">HTMLElement</a></code> objects,
-   if any of the elements in the serialization are in no namespace, the
-   default namespace in scope for those elements must be explicitly declared
-   as the empty string.<!-- because otherwise round-tripping might break
-  since it'll pick up the surrounding default ns when setting -->
-   (This doesn't apply to the <code title=dom-innerHTML-XML><a
-   href="#innerhtml1">innerHTML</a></code> attribute on <code><a
-   href="#htmldocument">HTMLDocument</a></code> objects.) <a
-   href="#refsXML">[XML]</a> <a href="#refsXMLNS">[XMLNS]</a>
-
-  <p>If any of the following cases are found in the DOM being serialized, the
-   user agent must raise an <code>INVALID_STATE_ERR</code> exception:
-
-  <ul>
-   <li>A <code>Document</code> node with no child element nodes.
-
-   <li>A <code>DocumentType</code> node that has an external subset public
-    identifier or an external subset system identifier that contains both a
-    U+0022 QUOTATION MARK ('"') and a U+0027 APOSTROPHE ("'").
-
-   <li>A node with a prefix or local name containing a U+003A COLON (":").
-
-   <li>An <code>Attr</code> node, <code>Text</code> node,
-    <code>CDATASection</code> node, <code>Comment</code> node, or
-    <code>ProcessingInstruction</code> node whose data contains characters
-    that are not matched by the XML <code title="">Char</code> production. <a
-    href="#refsXML">[XML]</a>
-
-   <li>A <code>CDATASection</code> node whose data contains the string "<code
-    title="">]]></code>".
-
-   <li>A <code>Comment</code> node whose data contains two adjacent U+002D
-    HYPHEN-MINUS (-) characters or ends with such a character.
-
-   <li>A <code>ProcessingInstruction</code> node whose target name is the
-    string "<code title="">xml</code>" (case insensitively)<!--
-   ASCII -->.
-
-   <li>A <code>ProcessingInstruction</code> node whose target name contains a
-    U+003A COLON (":").
-
-   <li>A <code>ProcessingInstruction</code> node whose data contains the
-    string "<code title="">?></code>".
-  </ul>
-
-  <p class=note>These are the only ways to make a DOM unserializable. The DOM
-   enforces all the other XML constraints; for example, trying to set an
-   attribute with a name that contains an equals sign (=) will raised an
-   <code>INVALID_CHARACTER_ERR</code> exception.
-
-  <p>On setting, in an XML context, the <code title=dom-innerHTML-XML><a
-   href="#innerhtml1">innerHTML</a></code> DOM attribute on <code><a
-   href="#htmlelement">HTMLElement</a></code>s and <code><a
-   href="#htmldocument">HTMLDocument</a></code>s must run the following
-   algorithm:
-
-  <ol>
-   <li>
-    <p>The user agent must create a new <span>XML parser</span>.</p>
-
-   <li>
-    <p>If the <code title=dom-innerHTML-XML><a
-     href="#innerhtml1">innerHTML</a></code> attribute is being set on an
-     element, the user agent must <span>feed the parser</span> just created
-     the string corresponding to the start tag of that element, declaring all
-     the namespace prefixes that are in scope on that element in the DOM, as
-     well as declaring the default namespace (if any) that is in scope on
-     that element in the DOM.</p>
-
-   <li>
-    <p>The user agent must <span>feed the parser</span> just created the
-     string being assigned into the <code title=dom-innerHTML-XML><a
-     href="#innerhtml1">innerHTML</a></code> attribute.</p>
-
-   <li>
-    <p>If the <code title=dom-innerHTML-XML><a
-     href="#innerhtml1">innerHTML</a></code> attribute is being set on an
-     element, the user agent must <span>feed the parser</span> the string
-     corresponding to the end tag of that element.</p>
-
-   <li>
-    <p>If the parser found a well-formedness error, the attribute's setter
-     must raise a <code>SYNTAX_ERR</code> exception and abort these steps.</p>
-
-   <li>
-    <p>The user agent must remove the children nodes of the node whose <code
-     title=dom-innerHTML-XML><a href="#innerhtml1">innerHTML</a></code>
-     attribute is being set.</p>
-
-   <li>
-    <p>If the attribute is being set on a <code>Document</code> node, let
-     <var title="">new children</var> be the children of the document,
-     preserving their order. Otherwise, the attribute is being set on an
-     <code>Element</code> node; let <var title="">new children</var> be the
-     children of the document's root element, preserving their order.</p>
-
-   <li>
-    <p>If the attribute is being set on a <code>Document</code> node, let
-     <var title="">target document</var> be that <code>Document</code> node.
-     Otherwise, the attribute is being set on an <code>Element</code> node;
-     let <var title="">target document</var> be the <code
-     title="">ownerDocument</code> of that <code>Element</code>.</p>
-
-   <li>
-    <p>Set the <code title="">ownerDocument</code> of all the nodes in <var
-     title="">new children</var> to the <var title="">target document</var>.</p>
-
-   <li>
-    <p>Append all the <var title="">new children</var> nodes to the node
-     whose <code title=dom-innerHTML-XML><a
-     href="#innerhtml1">innerHTML</a></code> attribute is being set,
-     preserving their order.</p>
-  </ol>
-
-  <p class=note><code><a href="#script1">script</a></code> elements inserted
-   using <code title=dom-innerHTML-XML><a
-   href="#innerhtml1">innerHTML</a></code> do not execute when they are
-   inserted.
-
-  <h3 id=apis-in><span class=secno>2.6 </span>APIs in HTML documents</h3>
-  <!-- XXX case-sensitivity training required here. -->
-
-  <p>For <a href="#html-">HTML documents</a>, and for <a
-   href="#html-elements">HTML elements</a> in <a href="#html-">HTML
-   documents</a>, certain APIs defined in DOM3 Core become case-insensitive
-   or case-changing, as sometimes defined in DOM3 Core, and as summarized or
-   required below. <a href="#refsDOM3CORE">[DOM3CORE]</a>.
-
-  <p>This does not apply to <a href="#xml-documents">XML documents</a> or to
-   elements that are not in the <a href="#html-namespace0">HTML namespace</a>
-   despite being in <a href="#html-">HTML documents</a>.
-
-  <dl>
-   <dt><code title="">Element.tagName</code>, <code
-    title="">Node.nodeName</code>, and <code title="">Node.localName</code>
-
-   <dd>
-    <p>These attributes return tag names in all uppercase<!-- XXX
-    xref-->
-     and attribute names in all lowercase<!-- XXX xref -->, regardless of the
-     case with which they were created.</p>
-
-   <dt><code title="">Document.createElement()</code>
-
-   <dd>
-    <p>The canonical form of HTML markup is all-lowercase; thus, this method
-     will lowercase<!-- XXX xref --> the argument before creating the
-     requisite element. Also, the element created must be in the <a
-     href="#html-namespace0">HTML namespace</a>.</p>
-
-    <p class=note>This doesn't apply to <code
-     title="">Document.createElementNS()</code>. Thus, it is possible, by
-     passing this last method a tag name in the wrong case, to create an
-     element that claims to have the tag name of an element defined in this
-     specification, but doesn't support its interfaces, because it really has
-     another tag name not accessible from the DOM APIs.</p>
-
-   <dt><code title="">Element.setAttributeNode()</code>
-
-   <dd>
-    <p>When an <code>Attr</code> node is set on an <a href="#html-elements"
-     title="HTML elements">HTML element</a>, it must have its name
-     lowercased<!-- XXX xref --> before the element is affected.</p>
-
-    <p class=note>This doesn't apply to <code
-     title="">Document.setAttributeNodeNS()</code>.</p>
-
-   <dt><code title="">Element.setAttribute()</code>
-
-   <dd>
-    <p>When an attribute is set on an <a href="#html-elements" title="HTML
-     elements">HTML element</a>, the name argument must be
-     lowercased<!-- XXX xref
-    --> before the element is affected.</p>
-
-    <p class=note>This doesn't apply to <code
-     title="">Document.setAttributeNS()</code>.</p>
-
-   <dt><code title="">Document.getElementsByTagName()</code> and <code
-    title="">Element.getElementsByTagName()</code>
-
-   <dd>
-    <p>These methods (but not their namespaced counterparts) must compare the
-     given argument case-insensitively<!-- XXX xref --> when looking at <a
-     href="#html-elements" title="HTML elements">HTML elements</a>, and
-     case-sensitively otherwise.</p>
-
-    <p class=note>Thus, in an <a href="#html-" title="HTML documents">HTML
-     document</a> with nodes in multiple namespaces, these methods will be
-     both case-sensitive and case-insensitive at the same time.</p>
-
-   <dt><code title="">Document.renameNode()</code>
-
-   <dd>
-    <p>If the new namespace is the <a href="#html-namespace0">HTML
-     namespace</a>, then the new qualified name must be lowercased before the
-     rename takes place.<!-- XXX xref --></p>
-  </dl>
-
-  <h2 id=semantics><span class=secno>3. </span>Semantics and structure of
-   HTML elements</h2>
-
-  <h3 id=semantics-intro><span class=secno>3.1 </span>Introduction</h3>
-
-  <p><em>This section is non-normative.</em>
-
-  <p class=big-issue>An introduction to marking up a document.
-
-  <h3 id=common1><span class=secno>3.2 </span>Common microsyntaxes</h3>
-
   <p>There are various places in HTML that accept particular data types, such
    as dates or numbers. This section describes what the conformance criteria
    for content in those formats is, and how to parse them.</p>
@@ -4509,7 +3017,7 @@
    attribute values are clearly defined either in terms of microsyntaxes or
    in terms of other specs, or as "Text" or some such.
 
-  <h4 id=common2><span class=secno>3.2.1 </span>Common parser idioms</h4>
+  <h4 id=common1><span class=secno>2.4.1 </span>Common parser idioms</h4>
 
   <p>The <dfn id=space title="space character">space characters</dfn>, for
    the purposes of this specification, are U+0020 SPACE, U+0009 CHARACTER
@@ -4555,7 +3063,7 @@
    the Unicode character class Zs. In both cases, the collected characters
    are not used. <a href="#refsUNICODE">[UNICODE]</a>
 
-  <h4 id=boolean><span class=secno>3.2.2 </span>Boolean attributes</h4>
+  <h4 id=boolean><span class=secno>2.4.2 </span>Boolean attributes</h4>
 
   <p>A number of attributes in HTML5 are <dfn id=boolean0 title="boolean
    attribute">boolean attributes</dfn>. The presence of a boolean attribute
@@ -4566,9 +3074,9 @@
    or a value that is a case-insensitive <!-- XXX ASCII --> match for the
    attribute's canonical name, with no leading or trailing whitespace.
 
-  <h4 id=numbers><span class=secno>3.2.3 </span>Numbers</h4>
+  <h4 id=numbers><span class=secno>2.4.3 </span>Numbers</h4>
 
-  <h5 id=unsigned><span class=secno>3.2.3.1. </span>Unsigned integers</h5>
+  <h5 id=unsigned><span class=secno>2.4.3.1. </span>Unsigned integers</h5>
 
   <p>A string is a <dfn id=valid>valid non-negative integer</dfn> if it
    consists of one of more characters in the range U+0030 DIGIT ZERO (0) to
@@ -4629,7 +3137,7 @@
     <p>Return <var title="">value</var>.
   </ol>
 
-  <h5 id=signed><span class=secno>3.2.3.2. </span>Signed integers</h5>
+  <h5 id=signed><span class=secno>2.4.3.2. </span>Signed integers</h5>
 
   <p>A string is a <dfn id=valid0>valid integer</dfn> if it consists of one
    of more characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE
@@ -4707,7 +3215,7 @@
      title="">value</var>, otherwise return 0-<var title="">value</var>.
   </ol>
 
-  <h5 id=real-numbers><span class=secno>3.2.3.3. </span>Real numbers</h5>
+  <h5 id=real-numbers><span class=secno>2.4.3.3. </span>Real numbers</h5>
 
   <p>A string is a <dfn id=valid1>valid floating point number</dfn> if it
    consists of one of more characters in the range U+0030 DIGIT ZERO (0) to
@@ -4829,7 +3337,7 @@
      title="">value</var>, otherwise return 0-<var title="">value</var>.
   </ol>
 
-  <h5 id=ratios><span class=secno>3.2.3.4. </span>Ratios</h5>
+  <h5 id=ratios><span class=secno>2.4.3.4. </span>Ratios</h5>
 
   <p class=note>The algorithms described in this section are used by the
    <code><a href="#progress">progress</a></code> and <code><a
@@ -4977,7 +3485,7 @@
    <li>Return <var title="">number</var>.
   </ol>
 
-  <h5 id=percentages-and-dimensions><span class=secno>3.2.3.5.
+  <h5 id=percentages-and-dimensions><span class=secno>2.4.3.5.
    </span>Percentages and dimensions</h5>
 
   <p class=big-issue><dfn id=valid3>valid positive non-zero integers</dfn>
@@ -4985,7 +3493,7 @@
    height/width on img, embed, object — lengths in css pixels or
    percentages)
 
-  <h5 id=lists><span class=secno>3.2.3.6. </span>Lists of integers</h5>
+  <h5 id=lists><span class=secno>2.4.3.6. </span>Lists of integers</h5>
 
   <p>A <dfn id=valid4>valid list of integers</dfn> is a number of <a
    href="#valid0" title="valid integer">valid integers</a> separated by
@@ -5266,7 +3774,7 @@
     <p>Return the <var title="">numbers</var> list and abort.
   </ol>
 
-  <h4 id=dates><span class=secno>3.2.4 </span>Dates and times</h4>
+  <h4 id=dates><span class=secno>2.4.4 </span>Dates and times</h4>
 
   <p>In the algorithms below, the <dfn id=number>number of days in month <var
    title="">month</var> of year <var title="">year</var></dfn> is:
@@ -5277,7 +3785,7 @@
    4 but not by 100; and <em>28</em> otherwise. This takes into account leap
    years in the Gregorian calendar. <a href="#refsGREGORIAN">[GREGORIAN]</a>
 
-  <h5 id=specific><span class=secno>3.2.4.1. </span>Specific moments in time</h5>
+  <h5 id=specific><span class=secno>2.4.4.1. </span>Specific moments in time</h5>
 
   <p>A string is a <dfn id=valid5>valid datetime</dfn> if it has four digits
    (representing the year), a literal hyphen, two digits (representing the
@@ -5593,7 +4101,7 @@
     <p>Return <var title="">time</var> and <var title="">timezone</var>.
   </ol>
 
-  <h5 id=vaguer><span class=secno>3.2.4.2. </span>Vaguer moments in time</h5>
+  <h5 id=vaguer><span class=secno>2.4.4.2. </span>Vaguer moments in time</h5>
 
   <p>This section defines <dfn id=date-or title="date or time string">date or
    time strings</dfn>. There are two kinds, <dfn id=date-or0 title="date or
@@ -5975,14 +4483,14 @@
     <p>Abort these steps (the string is parsed).
   </ol>
 
-  <h4 id=time-offsets><span class=secno>3.2.5 </span>Time offsets</h4>
+  <h4 id=time-offsets><span class=secno>2.4.5 </span>Time offsets</h4>
 
   <p class=big-issue><dfn id=valid6>valid time offset</dfn>, <dfn
    id=rules4>rules for parsing time offsets</dfn>, <dfn id=time-offset>time
    offset serialization rules</dfn>; in the format "5d4h3m2s1ms" or "3m 9.2s"
    or "00:00:00.00" or similar.
 
-  <h4 id=tokens><span class=secno>3.2.6 </span>Tokens</h4>
+  <h4 id=tokens><span class=secno>2.4.6 </span>Tokens</h4>
 
   <p>A <dfn id=set-of>set of space-separated tokens</dfn> is a set of zero or
    more words separated by one or more <a href="#space" title="space
@@ -6046,7 +4554,7 @@
     <p>Return <var title="">tokens</var>.
   </ol>
 
-  <p>When a user agent has to <dfn id=remove0>remove a token from a
+  <p>When a user agent has to <dfn id=remove>remove a token from a
    string</dfn>, it must use the following algorithm:
 
   <ol>
@@ -6126,7 +4634,7 @@
    to a single space, except at the start and end of the string, where such
    spaces are removed.
 
-  <h4 id=keywords><span class=secno>3.2.7 </span>Keywords and enumerated
+  <h4 id=keywords><span class=secno>2.4.7 </span>Keywords and enumerated
    attributes</h4>
 
   <p>Some attributes are defined as taking one of a finite set of keywords.
@@ -6172,7 +4680,7 @@
    <em>missing value default</em>), but for various reasons that isn't the
    way this specification actually defines it.
 
-  <h4 id=syntax-references><span class=secno>3.2.8 </span>References</h4>
+  <h4 id=syntax-references><span class=secno>2.4.8 </span>References</h4>
 
   <p>A <dfn id=valid7>valid hash-name reference</dfn> to an element of type
    <var title="">type</var> is a string consisting of a U+0023 NUMBER SIGN
@@ -6204,122 +4712,1954 @@
      case-insensitively matches <var title="">s</var>.
   </ol>
 
-  <h4 id=urls><span class=secno>3.2.9 </span>URLs</h4>
-  <!-- XXXURL -->
+  <h3 id=common2><span class=secno>2.5 </span>Common DOM interfaces</h3>
 
-  <div class=big-issue>
-   <p>This section will do the following:</p>
+  <h4 id=reflecting><span class=secno>2.5.1 </span>Reflecting content
+   attributes in DOM attributes</h4>
 
-   <ul>
-    <li>define URL as IRI and replace all uses of URIs and IRIs in the rest
-     of the spec with URL
+  <p>Some <span title="DOM attribute">DOM attributes</span> are defined to
+   <dfn id=reflect>reflect</dfn> a particular <span>content attribute</span>.
+   This means that on getting, the DOM attribute returns the current value of
+   the content attribute, and on setting, the DOM attribute changes the value
+   of the content attribute to the given value.</p>
+  <!-- XXXURL refer to URLs and use the "resolve to absolute URL"
+  algorithm -->
 
-    <li>define "valid URL" in terms of valid URIs and IRIs and replace that
-     concept through the spec to a pointer here, getting rid of references to
-     <a href="#refsRFC3986">[RFC3986]</a> <a
-     href="#refsRFC3987">[RFC3987]</a> outside this section
+  <p>If a reflecting DOM attribute is a <code>DOMString</code> attribute
+   whose content attribute is defined to contain a URI, then on getting, the
+   DOM attribute must return the value of the content attribute, resolved to
+   an absolute URI, and on setting, must set the content attribute to the
+   specified literal value. If the content attribute is absent, the DOM
+   attribute must return the default value, if the content attribute has one,
+   or else the empty string.</p>
+  <!-- XXXURL refer to URLs and use the "resolve to absolute URL"
+  algorithm -->
 
-    <li>define "valid URL reference" in terms of valid URI references and IRI
-     references and replace that concept through the spec to a pointer here,
-     getting rid of references to <a href="#refsRFC3986">[RFC3986]</a> <a
-     href="#refsRFC3987">[RFC3987]</a> outside this section
+  <p>If a reflecting DOM attribute is a <code>DOMString</code> attribute
+   whose content attribute is defined to contain one or more URIs, then on
+   getting, the DOM attribute must <span title="split the string on
+   spaces">split the content attribute on spaces</span> and return the
+   concatenation of each token URI, resolved to an absolute URI, with a
+   single U+0020 SPACE character between each URI; if the content attribute
+   is absent, the DOM attribute must return the default value, if the content
+   attribute has one, or else the empty string. On setting, the DOM attribute
+   must set the content attribute to the specified literal value.
 
-    <li>define how to parse URLs (maybe by deferring to RFCs)
+  <p>If a reflecting DOM attribute is a <code>DOMString</code> whose content
+   attribute is an <a href="#enumerated">enumerated attribute</a>, and the
+   DOM attribute is <dfn id=limited>limited to only known values</dfn>, then,
+   on getting, the DOM attribute must return the conforming value associated
+   with the state the attribute is in (in its canonical case), or the empty
+   string if the attribute is in a state that has no associated keyword
+   value; and on setting, if the new value case-insensitively matches one of
+   the keywords given for that attribute, then the content attribute must be
+   set to the conforming value associated with the state that the attribute
+   would be in if set to the given new value, otherwise, if the new value is
+   the empty string, then the content attribute must be removed, otherwise,
+   the setter must raise a <code>SYNTAX_ERR</code> exception.
 
-    <li>
-     <p>define how to handle URIs that contain non-ascii characters (and it's
-      not the same as handling as IRIs, especially if the character encoding
-      of the document isn't UTF-8)</p>
+  <p>If a reflecting DOM attribute is a <code>DOMString</code> but doesn't
+   fall into any of the above categories, then the getting and setting must
+   be done in a transparent, case-preserving manner.
 
-     <p>First parse it (we need to define that. For some schemes it's not per
-      spec -- e.g. apparently for ftp: we should split from hosts on ';').
-      Then handle each bit as follows:</p>
+  <p>If a reflecting DOM attribute is a boolean attribute, then on getting
+   the DOM attribute must return true if the attribute is set, and false if
+   it is absent. On setting, the content attribute must be removed if the DOM
+   attribute is set to false, and must be set to have the same value as its
+   name if the DOM attribute is set to true. (This corresponds to the rules
+   for <a href="#boolean0" title="boolean attribute">boolean content
+   attributes</a>.)
 
-     <p>scheme: no further processing (treat %-escaped characters literally,
-      treat unicode characters as unicode characters).</p>
+  <p>If a reflecting DOM attribute is a signed integer type
+   (<code>long</code>) then, on getting, the content attribute must be parsed
+   according to <a href="#rules0" title="rules for parsing integers">the
+   rules for parsing signed integers</a>, and if that is successful, the
+   resulting value must be returned. If, on the other hand, it fails, or if
+   the attribute is absent, then the default value must be returned instead,
+   or 0 if there is no default value. On setting, the given value must be
+   converted to the shortest possible string representing the number as a <a
+   href="#valid0">valid integer</a> in base ten and then that string must be
+   used as the new content attribute value.
 
-     <p>host: expand %-encoded bytes to Unicode as UTF-8, treat unicode
-      characters as per IDN.</p>
+  <p>If a reflecting DOM attribute is an <em>unsigned</em> integer type
+   (<code>unsigned long</code>) then, on getting, the content attribute must
+   be parsed according to <a href="#rules" title="rules for parsing
+   non-negative integers">the rules for parsing unsigned integers</a>, and if
+   that is successful, the resulting value must be returned. If, on the other
+   hand, it fails, or if the attribute is absent, the default value must be
+   returned instead, or 0 if there is no default value. On setting, the given
+   value must be converted to the shortest possible string representing the
+   number as a <a href="#valid">valid non-negative integer</a> in base ten
+   and then that string must be used as the new content attribute value.
 
-     <p>path: don't expand %-encoded bytes. Re-encode unicode to UTF-8 and
-      percent-encode.</p>
+  <p>If a reflecting DOM attribute is an unsigned integer type
+   (<code>unsigned long</code>) that is <dfn id=limited0>limited to only
+   positive non-zero numbers</dfn>, then the behavior is similar to the
+   previous case, but zero is not allowed. On getting, the content attribute
+   must first be parsed according to <a href="#rules" title="rules for
+   parsing non-negative integers">the rules for parsing unsigned
+   integers</a>, and if that is successful, the resulting value must be
+   returned. If, on the other hand, it fails, or if the attribute is absent,
+   the default value must be returned instead, or 1 if there is no default
+   value. On setting, if the value is zero, the user agent must fire an
+   <code>INDEX_SIZE_ERR</code> exception. Otherwise, the given value must be
+   converted to the shortest possible string representing the number as a <a
+   href="#valid">valid non-negative integer</a> in base ten and then that
+   string must be used as the new content attribute value.
 
-     <p>query: don't expand %-encoded bytes. Re-encode unicode to the page's
-      encoding. Do not percent-encode.</p>
+  <p>If a reflecting DOM attribute is a floating point number type
+   (<code>float</code>) and the content attribute is defined to contain a
+   time offset, then, on getting, the content attribute must be parsed
+   according to <a href="#rules4" title="rules for parsing time offsets">the
+   rules for parsing time offsets</a>, and if that is successful, the
+   resulting value, in seconds, must be returned. If that fails, or if the
+   attribute is absent, the default value must be returned, or the
+   not-a-number value (NaN) if there is no default value. On setting, the
+   given value, interpreted as a time offset in seconds, must be converted to
+   a string using the <a href="#time-offset">time offset serialization
+   rules</a>, and that string must be used as the new content attribute
+   value.
 
-    <li>define how to resolve relative URLs in markup attributes (using
-     XMLBase as defined elsewhere right now)
+  <p>If a reflecting DOM attribute is a floating point number type
+   (<code>float</code>) and it doesn't fall into one of the earlier
+   categories, then, on getting, the content attribute must be parsed
+   according to <a href="#rules1" title="rules for parsing floating point
+   number values">the rules for parsing floating point number values</a>, and
+   if that is successful, the resulting value must be returned. If, on the
+   other hand, it fails, or if the attribute is absent, the default value
+   must be returned instead, or 0.0 if there is no default value. On setting,
+   the given value must be converted to the shortest possible string
+   representing the number as a <a href="#valid1">valid floating point
+   number</a> in base ten and then that string must be used as the new
+   content attribute value.
 
-    <li>define how to resolve relative URLs in APIs, using the <dfn
-     id=scripts0>script's base URI</dfn> maybe
+  <p>If a reflecting DOM attribute is of the type <code><a
+   href="#domtokenlist0">DOMTokenList</a></code>, then on getting it must
+   return a <code><a href="#domtokenlist0">DOMTokenList</a></code> object
+   whose underlying string is the element's corresponding content attribute.
+   When the <code><a href="#domtokenlist0">DOMTokenList</a></code> object
+   mutates its underlying string, the content attribute must itself be
+   immediately mutated. When the attribute is absent, then the string
+   represented by the <code><a href="#domtokenlist0">DOMTokenList</a></code>
+   object is the empty string; when the object mutates this empty string, the
+   user agent must first add the corresponding content attribute, and then
+   mutate that attribute instead. <code><a
+   href="#domtokenlist0">DOMTokenList</a></code> attributes are always
+   read-only. The same <code><a href="#domtokenlist0">DOMTokenList</a></code>
+   object must be returned every time for each attribute.
 
-    <li>define what it means to resolve a relative URL when the base URL
-     doesn't have a path hierarchy (e.g. data:, javascript:, about:blank
-     URLs)
+  <p>If a reflecting DOM attribute has the type <code><a
+   href="#htmlelement">HTMLElement</a></code>, or an interface that descends
+   from <code><a href="#htmlelement">HTMLElement</a></code>, then, on
+   getting, it must run the following algorithm (stopping at the first point
+   where a value is returned):
 
-    <li>define "an <dfn id=elements2>element's base URI</dfn>" and make the
-     various places that talk about a base URI in the context of an element
-     use that definition
+  <ol>
+   <li>If the corresponding content attribute is absent, then the DOM
+    attribute must return null.
 
-    <li>make the language used to refer to resolving a base URI consistent
-     throughout, maybe make it hyperlink to a definition each time
+   <li>Let <var title="">candidate</var> be the element that the <code
+    title="">document.getElementById()</code> method would find if it was
+    passed as its argument the current value of the corresponding content
+    attribute.
 
-    <li>define a cheap, interoperable mechanism for URL attributes and
-     anything else that relies on xml:base and the base element to handle
-     dynamic changes to those attributes and elements, possibly by defining
-     some mechanism which causes changes to be ignored in some reliable way.
-     <!--
-On Sat, 1 Mar 2008, Anne van Kesteren wrote:
->
-> Note that the new base URI would only take effect once you actually did
-> something with a potentially affected object. For instance, <img> would
-> not start loading a new image if the base URI changes. <img>.src =
-> <img>.getAttribute("src") could start loading a new resource however if
-> the base URI changed since the initial load.
+   <li>If <var title="">candidate</var> is null, or if it is not
+    type-compatible with the DOM attribute, then the DOM attribute must
+    return null.
 
-On Sat, 1 Mar 2008, Jonas Sicking wrote:
-> 
-> Well, that was my intention with the initial proposal. But Hixie pointed    
-> out that "did something" is a very hard thing to define. For example on 
-> a <a href="...">, does the user hovering the node count? Does resizing
-> the window count? Does removing the node from the DOM and reinserting it
-> count?
+   <li>Otherwise, it must return <var title="">candidate</var>.
+  </ol>
 
-On Sat, 1 Mar 2008, Maciej Stachowiak wrote:
-> 
-> How about requiring that the base used is the one in effect when a given
-> relative URI is resolved, and define that URIs for resource-loading 
-> elements are resolved at the time the relevant attribute is set or
-> parsed (but for hyperlinks, at the time it is dereferenced). That is        
-> easy to implement, interoperable, and reasonably predictable. It makes
-> sense that changing <base> would affect future loads but not trigger
-> reloads of already loaded or already in progress resources.
+  <p>On setting, if the given element has an <code title=attr-id><a
+   href="#id">id</a></code> attribute, then the content attribute must be set
+   to the value of that <code title=attr-id><a href="#id">id</a></code>
+   attribute. Otherwise, the DOM attribute must be set to the empty string.</p>
+  <!-- XXX or raise an exception? -->
 
-possibly "in the event that the xml:base or base href attribute is
-changed, user agents may, whenever convenient, pretend, for the sake
-of url resolution, that it has not changed"
+  <h4 id=collections><span class=secno>2.5.2 </span>Collections</h4>
 
-possibly define "base uri change notification behaviour" for all
-elements with URI attributes, and then define changing base href and
-xml:base to activate that behaviour on all elements in the affected
-subtree. Also make this algorithm get called when a node from another
-document is inserted into an HTML document. (we could define that
-you're allowed to do that, in the absence of a DOM Core update)
+  <p>The <code><a href="#htmlcollection0">HTMLCollection</a></code>, <code><a
+   href="#htmlformcontrolscollection0">HTMLFormControlsCollection</a></code>,
+   and <code><a
+   href="#htmloptionscollection0">HTMLOptionsCollection</a></code> interfaces
+   represent various lists of DOM nodes. Collectively, objects implementing
+   these interfaces are called <dfn id=collections0>collections</dfn>.
+
+  <p>When a <a href="#collections0" title=collections>collection</a> is
+   created, a filter and a root are associated with the collection.
+
+  <p class=example>For example, when the <code><a
+   href="#htmlcollection0">HTMLCollection</a></code> object for the <code
+   title=dom-document-images><a href="#images0">document.images</a></code>
+   attribute is created, it is associated with a filter that selects only
+   <code><a href="#img">img</a></code> elements, and rooted at the root of
+   the document.
+
+  <p>The <a href="#collections0" title=collections>collection</a> then <dfn
+   id=represents title="represented by the collection">represents</dfn> a <a
+   href="#live">live</a> view of the subtree rooted at the collection's root,
+   containing only nodes that match the given filter. The view is linear. In
+   the absence of specific requirements to the contrary, the nodes within the
+   collection must be sorted in <a href="#tree-order">tree order</a>.
+
+  <p class=note>The <code title=dom-table-rows><a
+   href="#rows">rows</a></code> list is not in tree order.
+
+  <p>An attribute that returns a collection must return the same object every
+   time it is retrieved.
+
+  <h5 id=htmlcollection><span class=secno>2.5.2.1. </span>HTMLCollection</h5>
+
+  <p>The <code><a href="#htmlcollection0">HTMLCollection</a></code> interface
+   represents a generic <a href="#collections0"
+   title=collections>collection</a> of elements.
+
+  <pre class=idl>interface <dfn id=htmlcollection0>HTMLCollection</dfn> {
+  readonly attribute unsigned long <a href="#length" title=dom-HTMLCollection-length>length</a>;
+  [IndexGetter] Element <a href="#itemindex" title=dom-HTMLCollection-item>item</a>(in unsigned long index);
+  [NameGetter] Element <a href="#nameditem" title=dom-HTMLCollection-namedItem>namedItem</a>(in DOMString name);
+};</pre>
+
+  <p>The <dfn id=length
+   title=dom-HTMLCollection-length><code>length</code></dfn> attribute must
+   return the number of nodes <a href="#represents">represented by the
+   collection</a>.
+
+  <p>The <dfn id=itemindex title=dom-HTMLCollection-item><code>item(<var
+   title="">index</var>)</code></dfn> method must return the <var
+   title="">index</var>th node in the collection. If there is no <var
+   title="">index</var>th node in the collection, then the method must return
+   null.
+
+  <p>The <dfn id=nameditem
+   title=dom-HTMLCollection-namedItem><code>namedItem(<var
+   title="">key</var>)</code></dfn> method must return the first node in the
+   collection that matches the following requirements:
+
+  <ul>
+   <li>It is an <code><a href="#a">a</a></code>, <code><a
+    href="#applet">applet</a></code>, <code><a href="#area">area</a></code>,
+    <code>form</code>, <code><a href="#img">img</a></code>, or <code><a
+    href="#object">object</a></code> element with a <code
+    title=attr-name>name</code> attribute equal to <var title="">key</var>,
+    or,
+
+   <li>It is an <a href="#html-elements" title="HTML elements">HTML
+    element</a> of any kind with an <code title=attr-id><a
+    href="#id">id</a></code> attribute equal to <var title="">key</var>.
+    (Non-HTML elements, even if they have IDs, are not searched for the
+    purposes of <code title=dom-HTMLCollection-namedItem><a
+    href="#nameditem">namedItem()</a></code>.)
+  </ul>
+
+  <p>If no such elements are found, then the method must return null.
+
+  <h5 id=htmlformcontrolscollection><span class=secno>2.5.2.2.
+   </span>HTMLFormControlsCollection</h5>
+
+  <p>The <code><a
+   href="#htmlformcontrolscollection0">HTMLFormControlsCollection</a></code>
+   interface represents a <a href="#collections0"
+   title=collections>collection</a> of form controls.
+
+  <pre
+   class=idl>interface <dfn id=htmlformcontrolscollection0>HTMLFormControlsCollection</dfn> {
+  readonly attribute unsigned long <a href="#length0" title=dom-HTMLFormControlsCollection-length>length</a>;
+  [IndexGetter] <a href="#htmlelement">HTMLElement</a> <a href="#itemindex0" title=dom-HTMLFormControlsCollection-item>item</a>(in unsigned long index);
+  [NameGetter] Object <a href="#nameditem0" title=dom-HTMLFormControlsCollection-namedItem>namedItem</a>(in DOMString name);
+};</pre>
+
+  <p>The <dfn id=length0
+   title=dom-HTMLFormControlsCollection-length><code>length</code></dfn>
+   attribute must return the number of nodes <a
+   href="#represents">represented by the collection</a>.
+
+  <p>The <dfn id=itemindex0
+   title=dom-HTMLFormControlsCollection-item><code>item(<var
+   title="">index</var>)</code></dfn> method must return the <var
+   title="">index</var>th node in the collection. If there is no <var
+   title="">index</var>th node in the collection, then the method must return
+   null.
+
+  <p>The <dfn id=nameditem0
+   title=dom-HTMLFormControlsCollection-namedItem><code>namedItem(<var
+   title="">key</var>)</code></dfn> method must act according to the
+   following algorithm:
+
+  <ol>
+   <li>If, at the time the method is called, there is exactly one node in the
+    collection that has either an <code title=attr-id><a
+    href="#id">id</a></code> attribute or a <code title=attr-name>name</code>
+    attribute equal to <var title="">key</var>, then return that node and
+    stop the algorithm.
+
+   <li>Otherwise, if there are no nodes in the collection that have either an
+    <code title=attr-id><a href="#id">id</a></code> attribute or a <code
+    title=attr-name>name</code> attribute equal to <var title="">key</var>,
+    then return null and stop the algorithm.
+
+   <li>Otherwise, create a <code>NodeList</code> object representing a live
+    view of the <code><a
+    href="#htmlformcontrolscollection0">HTMLFormControlsCollection</a></code>
+    object, further filtered so that the only nodes in the
+    <code>NodeList</code> object are those that have either an <code
+    title=attr-id><a href="#id">id</a></code> attribute or a <code
+    title=attr-name>name</code> attribute equal to <var title="">key</var>.
+    The nodes in the <code>NodeList</code> object must be sorted in <a
+    href="#tree-order">tree order</a>.
+
+   <li>Return that <code>NodeList</code> object.
+  </ol>
+  <!--
+http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E...%0A%3Cform%20name%3D%22a%22%3E%3Cinput%20id%3D%22x%22%20name%3D%22y%22%3E%3Cinput%20name%3D%22x%22%20id%3D%22y%22%3E%3C/form%3E%0A%3Cscript%3E%0A%20%20var%20x%3B%0A%20%20w%28x%20%3D%20document.forms%5B%27a%27%5D%5B%27x%27%5D%29%3B%0A%20%20w%28x.length%29%3B%0A%20%20x%5B0%5D.parentNode.removeChild%28x%5B0%5D%29%3B%0A%20%20w%28x.length%29%3B%0A%20%20w%28x%20%3D%3D%20document.forms%5B%27a%27%5D%5B%27x%27%5D%29%3B%0A%3C/script%3E%0A
 -->
-     
+
+  <h5 id=htmloptionscollection><span class=secno>2.5.2.3.
+   </span>HTMLOptionsCollection</h5>
+
+  <p>The <code><a
+   href="#htmloptionscollection0">HTMLOptionsCollection</a></code> interface
+   represents a list of <code>option</code> elements.
+
+  <pre
+   class=idl>interface <dfn id=htmloptionscollection0>HTMLOptionsCollection</dfn> {
+           attribute unsigned long <a href="#length1" title=dom-HTMLOptionsCollection-length>length</a>;
+  [IndexGetter] HTMLOptionElement <a href="#itemindex1" title=dom-HTMLOptionsCollection-item>item</a>(in unsigned long index);
+  [NameGetter] Object <a href="#nameditem1" title=dom-HTMLOptionsCollection-namedItem>namedItem</a>(in DOMString name);
+};</pre>
+
+  <p>On getting, the <dfn id=length1
+   title=dom-HTMLOptionsCollection-length><code>length</code></dfn> attribute
+   must return the number of nodes <a href="#represents">represented by the
+   collection</a>.
+
+  <p>On setting, the behavior depends on whether the new value is equal to,
+   greater than, or less than the number of nodes <a
+   href="#represents">represented by the collection</a> at that time. If the
+   number is the same, then setting the attribute must do nothing. If the new
+   value is greater, then <var title="">n</var> new <code>option</code>
+   elements with no attributes and no child nodes must be appended to the
+   <code>select</code> element on which the <code><a
+   href="#htmloptionscollection0">HTMLOptionsCollection</a></code> is rooted,
+   where <var title="">n</var> is the difference between the two numbers (new
+   value minus old value). If the new value is lower, then the last <var
+   title="">n</var> nodes in the collection must be removed from their parent
+   nodes, where <var title="">n</var> is the difference between the two
+   numbers (old value minus new value).
+
+  <p class=note>Setting <code title=dom-HTMLOptionsCollection-length><a
+   href="#length1">length</a></code> never removes or adds any
+   <code>optgroup</code> elements, and never adds new children to existing
+   <code>optgroup</code> elements (though it can remove children from them).
+
+  <p>The <dfn id=itemindex1
+   title=dom-HTMLOptionsCollection-item><code>item(<var
+   title="">index</var>)</code></dfn> method must return the <var
+   title="">index</var>th node in the collection. If there is no <var
+   title="">index</var>th node in the collection, then the method must return
+   null.
+
+  <p>The <dfn id=nameditem1
+   title=dom-HTMLOptionsCollection-namedItem><code>namedItem(<var
+   title="">key</var>)</code></dfn> method must act according to the
+   following algorithm:
+
+  <ol>
+   <li>If, at the time the method is called, there is exactly one node in the
+    collection that has either an <code title=attr-id><a
+    href="#id">id</a></code> attribute or a <code title=attr-name>name</code>
+    attribute equal to <var title="">key</var>, then return that node and
+    stop the algorithm.
+
+   <li>Otherwise, if there are no nodes in the collection that have either an
+    <code title=attr-id><a href="#id">id</a></code> attribute or a <code
+    title=attr-name>name</code> attribute equal to <var title="">key</var>,
+    then return null and stop the algorithm.
+
+   <li>Otherwise, create a <code>NodeList</code> object representing a live
+    view of the <code><a
+    href="#htmloptionscollection0">HTMLOptionsCollection</a></code> object,
+    further filtered so that the only nodes in the <code>NodeList</code>
+    object are those that have either an <code title=attr-id><a
+    href="#id">id</a></code> attribute or a <code
+    title=attr-option-name>name</code> attribute equal to <var
+    title="">key</var>. The nodes in the <code>NodeList</code> object must be
+    sorted in <a href="#tree-order">tree order</a>.
+
+   <li>Return that <code>NodeList</code> object.
+  </ol>
+  <!-- see also http://ln.hixie.ch/?start=1161042744&count=1 -->
+
+  <p class=big-issue>We may want to add <code>add()</code> and
+   <code>remove()</code> methods here too because IE implements
+   HTMLSelectElement and HTMLOptionsCollection on the same object, and so
+   people use them almost interchangeably in the wild.
+
+  <h4 id=domtokenlist><span class=secno>2.5.3 </span>DOMTokenList</h4>
+
+  <p>The <code><a href="#domtokenlist0">DOMTokenList</a></code> interface
+   represents an interface to an underlying string that consists of an <a
+   href="#unordered">unordered set of unique space-separated tokens</a>.
+
+  <p>Which string underlies a particular <code><a
+   href="#domtokenlist0">DOMTokenList</a></code> object is defined when the
+   object is created. It might be a content attribute (e.g. the string that
+   underlies the <code title=dom-classList><a
+   href="#classlist">classList</a></code> object is the <code
+   title=attr-class><a href="#class">class</a></code> attribute), or it might
+   be an anonymous string (e.g. when a <code><a
+   href="#domtokenlist0">DOMTokenList</a></code> object is passed to an
+   author-implemented callback in the <code><a
+   href="#datagrid0">datagrid</a></code> APIs).
+
+  <pre
+   class=idl>[<a href="#stringify" title=dom-tokenlist-toString>Stringifies</a>] interface <dfn id=domtokenlist0>DOMTokenList</dfn> {
+  readonly attribute unsigned long <a href="#length2" title=dom-tokenlist-length>length</a>;
+  [IndexGetter] DOMString <a href="#itemindex2" title=dom-tokenlist-item>item</a>(in unsigned long index);
+  boolean <a href="#hastoken" title=dom-tokenlist-has>has</a>(in DOMString token);
+  void <a href="#addtoken" title=dom-tokenlist-add>add</a>(in DOMString token);
+  void <a href="#remove0" title=dom-tokenlist-remove>remove</a>(in DOMString token);
+  boolean <a href="#toggle" title=dom-tokenlist-toggle>toggle</a>(in DOMString token);
+};</pre>
+
+  <p>The <dfn id=length2 title=dom-tokenlist-length><code>length</code></dfn>
+   attribute must return the number of <em>unique</em> tokens that result
+   from <a href="#split" title="split a string on spaces">splitting the
+   underlying string on spaces</a>.
+
+  <p>The <dfn id=itemindex2 title=dom-tokenlist-item><code>item(<var
+   title="">index</var>)</code></dfn> method must <a href="#split"
+   title="split a string on spaces">split the underlying string on
+   spaces</a>, sort the resulting list of tokens by Unicode
+   codepoint<!-- XXX that's
+  basically nonsense. What sort order do we want here? It should be
+  the cheapest one possible that is well-defined for all Unicode. -->,
+   remove exact duplicates, and then return the <var title="">index</var>th
+   item in this list. If <var title="">index</var> is equal to or greater
+   than the number of tokens, then the method must return null.
+
+  <p>The <dfn id=hastoken title=dom-tokenlist-has><code>has(<var
+   title="">token</var>)</code></dfn> method must run the following
+   algorithm:
+
+  <ol>
+   <li>If the <var title="">token</var> argument contains any <a
+    href="#space" title="space character">space characters</a>, then raise an
+    <code>INVALID_CHARACTER_ERR</code> exception and stop the algorithm.
+
+   <li>Otherwise, <a href="#split" title="split a string on spaces">split the
+    underlying string on spaces</a> to get the list of tokens in the object's
+    underlying string.
+
+   <li>If the token indicated by <var title="">token</var> is one of the
+    tokens in the object's underlying string then return true and stop this
+    algorithm.
+
+   <li>Otherwise, return false.
+  </ol>
+
+  <p>The <dfn id=addtoken title=dom-tokenlist-add><code>add(<var
+   title="">token</var>)</code></dfn> method must run the following
+   algorithm:
+
+  <ol>
+   <li>If the <var title="">token</var> argument contains any <a
+    href="#space" title="space character">space characters</a>, then raise an
+    <code>INVALID_CHARACTER_ERR</code> exception and stop the algorithm.
+
+   <li>Otherwise, <a href="#split" title="split a string on spaces">split the
+    underlying string on spaces</a> to get the list of tokens in the object's
+    underlying string.
+
+   <li>If the given <var title="">token</var> is already one of the tokens in
+    the <code><a href="#domtokenlist0">DOMTokenList</a></code> object's
+    underlying string then stop the algorithm.
+
+   <li>Otherwise, if the <code><a
+    href="#domtokenlist0">DOMTokenList</a></code> object's underlying string
+    is not the empty string and the last character of that string is not a <a
+    href="#space">space character</a>, then append a U+0020 SPACE character
+    to the end of that string.
+
+   <li>Append the value of <var title="">token</var> to the end of the
+    <code><a href="#domtokenlist0">DOMTokenList</a></code> object's
+    underlying string.
+  </ol>
+
+  <p>The <dfn id=remove0 title=dom-tokenlist-remove><code>remove(<var
+   title="">token</var>)</code></dfn> method must run the following
+   algorithm:
+
+  <ol>
+   <li>If the <var title="">token</var> argument contains any <a
+    href="#space" title="space character">space characters</a>, then raise an
+    <code>INVALID_CHARACTER_ERR</code> exception and stop the algorithm.
+
+   <li>Otherwise, <a href="#remove" title="remove a token from a
+    string">remove the given <var title="">token</var> from the underlying
+    string</a>.
+  </ol>
+
+  <p>The <dfn id=toggle title=dom-tokenlist-toggle><code>toggle(<var
+   title="">token</var>)</code></dfn> method must run the following
+   algorithm:
+
+  <ol>
+   <li>If the <var title="">token</var> argument contains any <a
+    href="#space" title="space character">space characters</a>, then raise an
+    <code>INVALID_CHARACTER_ERR</code> exception and stop the algorithm.
+
+   <li>Otherwise, <a href="#split" title="split a string on spaces">split the
+    underlying string on spaces</a> to get the list of tokens in the object's
+    underlying string.
+
+   <li>If the given <var title="">token</var> is already one of the tokens in
+    the <code><a href="#domtokenlist0">DOMTokenList</a></code> object's
+    underlying string then <a href="#remove" title="remove a token from a
+    string">remove the given <var title="">token</var> from the underlying
+    string</a>, and stop the algorithm, returning false.
+
+   <li>Otherwise, if the <code><a
+    href="#domtokenlist0">DOMTokenList</a></code> object's underlying string
+    is not the empty string and the last character of that string is not a <a
+    href="#space">space character</a>, then append a U+0020 SPACE character
+    to the end of that string.
+
+   <li>Append the value of <var title="">token</var> to the end of the
+    <code><a href="#domtokenlist0">DOMTokenList</a></code> object's
+    underlying string.
+
+   <li>Return true.
+  </ol>
+
+  <p>Objects implementing the <code><a
+   href="#domtokenlist0">DOMTokenList</a></code> interface must <dfn
+   id=stringify title=dom-tokenlist-toString>stringify</dfn> to the object's
+   underlying string representation.
+
+  <h4 id=domstringmap><span class=secno>2.5.4 </span>DOMStringMap</h4>
+
+  <p>The <code><a href="#domstringmap0">DOMStringMap</a></code> interface
+   represents a set of name-value pairs. When a <code><a
+   href="#domstringmap0">DOMStringMap</a></code> object is instanced, it is
+   associated with three algorithms, one for getting values from names, one
+   for setting names to certain values, and one for deleting names.
+
+  <p class=big-issue>The names of the methods on this interface are temporary
+   and will be fixed when the Web IDL / "Language Bindings for DOM
+   Specifications" spec is ready to handle this case.
+
+  <pre class=idl>interface <dfn id=domstringmap0>DOMStringMap</dfn> {
+  [NameGetter] DOMString <a href="#xxx1name" title=dom-stringmap-XXX1>XXX1</a>(in DOMString name); <!-- XXX DOMB -->
+  [NameSetter] void <a href="#xxx2name" title=dom-stringmap-XXX2>XXX2</a>(in DOMString name, in DOMString value); <!-- XXX DOMB -->
+  [XXX] boolean <a href="#xxx3name" title=dom-stringmap-XXX3>XXX3</a>(in DOMString name); <!-- XXX DOMB -->
+};</pre>
+
+  <p>The <dfn id=xxx1name title=dom-stringmap-XXX1><code>XXX1(<var
+   title="">name</var>)</code></dfn> method must call the algorithm for
+   getting values from names, passing <var title="">name</var> as the name,
+   and must return the corresponding value, or null if <var
+   title="">name</var> has no corresponding value.
+
+  <p>The <dfn id=xxx2name title=dom-stringmap-XXX2><code>XXX2(<var
+   title="">name</var>, <var title="">value</var>)</code></dfn> method must
+   call the algorithm for setting names to certain values, passing <var
+   title="">name</var> as the name and <var title="">value</var> as the
+   value.
+
+  <p>The <dfn id=xxx3name title=dom-stringmap-XXX3><code>XXX3(<var
+   title="">name</var>)</code></dfn> method must call the algorithm for
+   deleting names, passing <var title="">name</var> as the name, and must
+   return true.
+
+  <h4 id=dom-feature><span class=secno>2.5.5 </span>DOM feature strings</h4>
+
+  <p>DOM3 Core defines mechanisms for checking for interface support, and for
+   obtaining implementations of interfaces, using <a
+   href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMFeatures">feature
+   strings</a>. <a href="#refsDOM3CORE">[DOM3CORE]</a>
+
+  <p>A DOM application can use the <dfn id=hasfeature
+   title=hasFeature><code>hasFeature(<var title="">feature</var>, <var
+   title="">version</var>)</code></dfn> method of the
+   <code>DOMImplementation</code> interface with parameter values "<code
+   title="">HTML</code>" and "<code>5.0</code>" (respectively) to determine
+   whether or not this module is supported by the implementation. In addition
+   to the feature string "<code title="">HTML</code>", the feature string
+   "<code title="">XHTML</code>" (with version string "<code>5.0</code>") can
+   be used to check if the implementation supports XHTML. User agents should
+   respond with a true value when the <code><a
+   href="#hasfeature">hasFeature</a></code> method is queried with these
+   values. Authors are cautioned, however, that UAs returning true might not
+   be perfectly compliant, and that UAs returning false might well have
+   support for features in this specification; in general, therefore, use of
+   this method is discouraged.
+
+  <p>The values "<code title="">HTML</code>" and "<code
+   title="">XHTML</code>" (both with version "<code>5.0</code>") should also
+   be supported in the context of the <code>getFeature()</code> and
+   <code>isSupported()</code> methods, as defined by DOM3 Core.
+
+  <p class=note>The interfaces defined in this specification are not always
+   supersets of the interfaces defined in DOM2 HTML; some features that were
+   formerly deprecated, poorly supported, rarely used or considered
+   unnecessary have been removed. Therefore it is not guaranteed that an
+   implementation that supports "<code title="">HTML</code>"
+   "<code>5.0</code>" also supports "<code title="">HTML</code>"
+   "<code>2.0</code>".
+
+  <h3 id=content-type-sniffing><span class=secno>2.6 </span>Determining the
+   type of a resource</h3>
+
+  <p class=warning>It is imperative that the rules in this section be
+   followed exactly. When a user agent uses different heuristics for content
+   type detection than the server expects, security problems can occur. For
+   example, if a server believes that the client will treat a contributed
+   file as an image (and thus treat it as benign), but a Web browser believes
+   the content to be HTML (and thus execute any scripts contained therein),
+   the end user can be exposed to malicious content, making the user
+   vulnerable to cookie theft attacks and other cross-site scripting attacks.
+
+  <h4 id=content-type><span class=secno>2.6.1 </span>Content-Type metadata</h4>
+
+  <p>What explicit <dfn id=content-type5 title=Content-Type>Content-Type
+   metadata</dfn> is associated with the resource (the resource's type
+   information) depends on the protocol that was used to fetch the resource.
+
+  <p>For HTTP resources, only the first Content-Type HTTP header, if any,
+   contributes any type information; the explicit type of the resource is
+   then the value of that header, interpreted as described by the HTTP
+   specifications. If the Content-Type HTTP header is present but the value
+   of the first such header cannot be interpreted as described by the HTTP
+   specifications (e.g. because its value doesn't contain a U+002F SOLIDUS
+   ('/') character), then the resource has no type information (even if there
+   are multiple Content-Type HTTP headers and one of the other ones is
+   syntactically correct). <a href="#refsHTTP">[HTTP]</a>
+
+  <p>For resources fetched from the file system, user agents should use
+   platform-specific conventions, e.g. operating system extension/type
+   mappings.
+
+  <p>Extensions must not be used for determining resource types for resources
+   fetched over HTTP.
+
+  <p>For resources fetched over most other protocols, e.g. FTP, there is no
+   type information.
+
+  <p>The <dfn id=algorithm>algorithm for extracting an encoding from a
+   Content-Type</dfn>, given a string <var title="">s</var>, is as follows.
+   It either returns an encoding or nothing.
+
+  <ol>
+   <li>
+    <p>Find the first seven characters in <var title="">s</var> that are a
+     case-insensitive<!-- XXX ASCII--> match for the word 'charset'. If no
+     such match is found, return nothing.</p>
+
+   <li>
+    <p>Skip any U+0009, U+000A, U+000C, U+000D, or U+0020 characters that
+     immediately follow the word 'charset' (there might not be any).
+
+   <li>
+    <p>If the next character is not a U+003D EQUALS SIGN ('='), return
+     nothing.
+
+   <li>
+    <p>Skip any U+0009, U+000A, U+000C, U+000D, or U+0020 characters that
+     immediately follow the equals sign (there might not be any).
+
+   <li>
+    <p>Process the next character as follows:</p>
+
+    <dl class=switch>
+     <dt>If it is a U+0022 QUOTATION MARK ('"') and there is a later U+0022
+      QUOTATION MARK ('"') in <var title="">s</var>
+
+     <dt>If it is a U+0027 APOSTROPHE ("'") and there is a later U+0027
+      APOSTROPHE ("'") in <var title="">s</var>
+
+     <dd>
+      <p>Return the string between this character and the next earliest
+       occurrence of this character.
+
+     <dt>If it is an unmatched U+0022 QUOTATION MARK ('"')
+
+     <dt>If it is an unmatched U+0027 APOSTROPHE ("'")
+
+     <dt>If there is no next character
+
+     <dd>
+      <p>Return nothing.
+
+     <dt>Otherwise
+
+     <dd>
+      <p>Return the string from this character to the first U+0009, U+000A,
+       U+000C, U+000D, U+0020, or U+003B character or the end of <var
+       title="">s</var>, whichever comes first.
+    </dl>
+  </ol>
+
+  <p class=note>The above algorithm is a willful violation of the HTTP
+   specification. <a href="#refsRFC2616">[RFC2616]</a>
+
+  <h4 id=content-type0><span class=secno>2.6.2 </span>Content-Type sniffing:
+   Web pages</h4>
+
+  <p>The <dfn id=sniffed title="Content-Type sniffing">sniffed type of a
+   resource</dfn> must be found as follows:
+
+  <ol>
+   <li>
+    <p>Let <var title="">official type</var> be the type given by the <a
+     href="#content-type5" title=Content-Type>Content-Type metadata</a> for
+     the resource (in lowercase<!-- XXX ASCII case folding -->, ignoring any
+     parameters). If there is no such type, jump to the <em
+     title="content-type sniffing: unknown type"><a
+     href="#content-type7">unknown type</a></em> step below.
+
+   <li>
+    <p>If the user agent is configured to strictly obey Content-Type headers
+     for this resource, then jump to the last step in this set of steps.
+
+   <li>
+    <p>If the resource was fetched over an HTTP protocol and there is an HTTP
+     Content-Type header and the value of the first such header has bytes
+     that exactly match one of the following lines:</p>
+
+    <table>
+     <thead>
+      <tr>
+       <th>Bytes in Hexadecimal
+
+       <th>Textual representation
+
+     <tbody>
+      <tr><!-- Very old Apache default -->
+
+       <td>74 65 78 74 2f 70 6c 61 69 6e
+
+       <td><code title="">text/plain</code>
+
+      <tr><!-- Old Apache default -->
+
+       <td>74 65 78 74 2f 70 6c 61 69 6e 3b 20 63 68 61 72 73 65 74 3d 49 53
+        4f 2d 38 38 35 39 2d 31
+
+       <td><code title="">text/plain; charset=ISO-8859-1</code>
+
+      <tr><!-- Debian's arbitrarily different Apache default -->
+
+       <td>74 65 78 74 2f 70 6c 61 69 6e 3b 20 63 68 61 72 73 65 74 3d 69 73
+        6f 2d 38 38 35 39 2d 31
+
+       <td><code title="">text/plain; charset=iso-8859-1</code>
+
+      <tr><!-- Someone else's arbitrarily different Apache default (who?) -->
+
+       <td>74 65 78 74 2f 70 6c 61 69 6e 3b 20 63 68 61 72 73 65 74 3d 55 54
+        46 2d 38
+
+       <td><code title="">text/plain; charset=UTF-8</code>
+    </table>
+
+    <p>...then jump to the <em title="content-type sniffing: text or
+     binary"><a href="#content-type6">text or binary</a></em> section below.</p>
+    <!-- while IE sniffs all text/plain, this will continue to grow as
+    people add new defaults. Hopefully IE will stop the madness in due
+    course and stop sniffing anything but the above... -->
+    
+
+   <li>
+    <p>If <var title="">official type</var> is "unknown/unknown" or
+     "application/unknown", jump to the <em title="content-type sniffing:
+     unknown type"><a href="#content-type7">unknown type</a></em> step below.</p>
+    <!-- In a study looking at many billions of pages whose first five
+   characters were "<HTML", "unknown/unknown" was used to label
+   documents about once for every 5000 pages labeled "text/html", and
+   "application/unknown" was used about once for every 35000 pages
+   labeled "text/html". -->
+
+   <li>
+    <p>If <var title="">official type</var> ends in "+xml", or if it is
+     either "text/xml" or "application/xml", then the sniffed type of the
+     resource is <var title="">official type</var>; return that and abort
+     these steps.
+   </li>
+   <!-- we don't want
+   image/svg+xml going through the next step -->
+
+   <li>
+    <p>If <var title="">official type</var> is an image type supported by the
+     user agent (e.g. "image/png", "image/gif", "image/jpeg", etc), then jump
+     to the <em title="content-type sniffing: image"><a
+     href="#content-type8">images</a></em> section below.
+
+   <li>
+    <p>If <var title="">official type</var> is "text/html", then jump to the
+     <em title="content-type sniffing: feed or html"><a
+     href="#content-type9">feed or HTML</a></em> section below.
+
+   <li>
+    <p>The sniffed type of the resource is <var title="">official type</var>.
+  </ol>
+
+  <h4 id=content-type1><span class=secno>2.6.3 </span><dfn
+   id=content-type6>Content-Type sniffing: text or binary</dfn></h4>
+
+  <ol>
+   <li>
+    <p>The user agent may wait for 512 or more bytes of the resource to be
+     available.
+
+   <li>
+    <p>Let <var title="">n</var> be the smaller of either 512 or the number
+     of bytes already available.
+
+   <li>
+    <p>If <var title="">n</var> is 4 or more, and the first bytes of the file
+     match one of the following byte sets:</p>
+
+    <table>
+     <thead>
+      <tr>
+       <th>Bytes in Hexadecimal
+
+       <th>Description
+
+     <tbody>
+      <tr>
+       <td>FE FF
+
+       <td>UTF-16BE BOM
+        <!-- followed by a character --><!-- nobody uses this: or UTF-32LE BOM -->
+        
+
+      <tr>
+       <td>FF FE
+
+       <td>UTF-16LE BOM <!-- followed by a character -->
+        <!-- nobody uses this
+      <tr>
+       <td>00 00 FE FF
+       <td>UTF-32BE BOM
+-->
+        <!-- this one is redundant with the one above
+      <tr>
+       <td>FF FE 00 00
+       <td>UTF-32LE BOM
+-->
+        
+
+      <tr>
+       <td>EF BB BF
+
+       <td>UTF-8 BOM
+        <!-- followed by a character, or the first byte of a multiple character sequence -->
+        <!-- nobody uses this
+      <tr>
+       <td>DD 73 66 73
+       <td>UTF-EBCDIC BOM
+-->
+        
+    </table>
+
+    <p>...then the sniffed type of the resource is "text/plain".</p>
+
+   <li>
+    <p>Otherwise, if any of the first <var title="">n</var> bytes of the
+     resource are in one of the following byte ranges:</p>
+    <!-- This byte list is based on RFC 2046 Section 4.1.2. Characters
+    in the range 0x00-0x1F, with the exception of 0x09, 0x0A, 0x0C,
+    0x0D (ASCII for TAB, LF, FF, and CR), and character 0x1B
+    (reportedly used by some encodings as a shift escape), are
+    invalid. Thus, if we see them, we assume it's not text. -->
+    
+    <ul class=brief>
+     <li> 0x00 - 0x08
+
+     <li> 0x0B
+
+     <li> 0x0E - 0x1A
+
+     <li> 0x1C - 0x1F
+    </ul>
+
+    <p>...then the sniffed type of the resource is
+     "application/octet-stream".</p>
+
+    <p class=big-issue>maybe we should invoke the "Content-Type sniffing:
+     image" section now, falling back on "application/octet-stream".</p>
+
+   <li>
+    <p>Otherwise, the sniffed type of the resource is "text/plain".
+  </ol>
+
+  <h4 id=content-type2><span class=secno>2.6.4 </span><dfn
+   id=content-type7>Content-Type sniffing: unknown type</dfn></h4>
+
+  <ol>
+   <li>
+    <p>The user agent may wait for 512 or more bytes of the resource to be
+     available.
+
+   <li>
+    <p>Let <var title="">stream length</var> be the smaller of either 512 or
+     the number of bytes already available.
+
+   <li>
+    <p>For each row in the table below:</p>
+
+    <dl class=switch>
+     <dt>If the row has no "<em>WS</em>" bytes:
+
+     <dd>
+      <ol>
+       <li>Let <var title="">pattern length</var> be the length of the
+        pattern (number of bytes described by the cell in the second column
+        of the row).
+
+       <li>If <var title="">pattern length</var> is smaller than <var
+        title="">stream length</var> then skip this row.
+
+       <li>Apply the "and" operator to the first <var title="">pattern
+        length</var> bytes of the resource and the given mask (the bytes in
+        the cell of first column of that row), and let the result be the <var
+        title="">data</var>.
+
+       <li>If the bytes of the <var title="">data</var> matches the given
+        pattern bytes exactly, then the sniffed type of the resource is the
+        type given in the cell of the third column in that row; abort these
+        steps.
+      </ol>
+
+     <dt>If the row has a "<em>WS</em>" byte:
+
+     <dd>
+      <ol>
+       <li>
+        <p>Let <var title="">index<sub>pattern</sub></var> be an index into
+         the mask and pattern byte strings of the row.
+
+       <li>
+        <p>Let <var title="">index<sub>stream</sub></var> be an index into
+         the byte stream being examined.
+
+       <li>
+        <p><em>Loop</em>: If <var title="">index<sub>stream</sub></var>
+         points beyond the end of the byte stream, then this row doesn't
+         match, skip this row.
+
+       <li>
+        <p>Examine the <var title="">index<sub>stream</sub></var>th byte of
+         the byte stream as follows:</p>
+
+        <dl class=switch>
+         <dt>If the <var title="">index<sub>stream</sub></var>th byte of the
+          pattern is a normal hexadecimal byte and not a "<em>WS</em>" byte:
+
+         <dd>
+          <p>If the "and" operator, applied to the <var
+           title="">index<sub>stream</sub></var>th byte of the stream and the
+           <var title="">index<sub>pattern</sub></var>th byte of the mask,
+           yield a value different that the <var
+           title="">index<sub>pattern</sub></var>th byte of the pattern, then
+           skip this row.</p>
+
+          <p>Otherwise, increment <var title="">index<sub>pattern</sub></var>
+           to the next byte in the mask and pattern and <var
+           title="">index<sub>stream</sub></var> to the next byte in the byte
+           stream.</p>
+
+         <dt>Otherwise, if the <var title="">index<sub>stream</sub></var>th
+          byte of the pattern is a "<em>WS</em>" byte:
+
+         <dd>
+          <p>"<em>WS</em>" means "whitespace", and allows insignificant
+           whitespace to be skipped when sniffing for a type signature.</p>
+
+          <p>If the <var title="">index<sub>stream</sub></var>th byte of the
+           stream is one of 0x09 (ASCII TAB), 0x0A (ASCII LF), 0x0C (ASCII
+           FF), 0x0D (ASCII CR), or 0x20 (ASCII space), then increment only
+           the <var title="">index<sub>stream</sub></var> to the next byte in
+           the byte stream.</p>
+
+          <p>Otherwise, increment only the <var
+           title="">index<sub>pattern</sub></var> to the next byte in the
+           mask and pattern.</p>
+        </dl>
+
+       <li>
+        <p>If <var title="">index<sub>pattern</sub></var> does not point
+         beyond the end of the mask and pattern byte strings, then jump back
+         to the <em>loop</em> step in this algorithm.
+
+       <li>
+        <p>Otherwise, the sniffed type of the resource is the type given in
+         the cell of the third column in that row; abort these steps.
+      </ol>
+    </dl>
+
+   <li>
+    <p>As a last-ditch effort, jump to the <a href="#content-type6"
+     title="content-type sniffing: text or binary">text or binary</a>
+     section.
+  </ol>
+
+  <table>
+   <thead>
+    <tr>
+     <th colspan=2>Bytes in Hexadecimal
+
+     <th rowspan=2>Sniffed type
+
+     <th rowspan=2>Comment
+
+    <tr>
+     <th>Mask
+
+     <th>Pattern
+
+   <tbody>
+    <tr>
+     <td>FF FF DF DF DF DF DF DF DF FF DF DF DF DF
+
+     <td>3C 21 44 4F 43 54 59 50 45 20 48 54 4D 4C <!-- "<!DOCTYPE HTML" -->
+      <!-- common in static data -->
+
+     <td>text/html
+
+     <td>The string "<code title=""><!DOCTYPE HTML</code>" in US-ASCII or
+      compatible encodings, case-insensitively.
+
+    <tr>
+     <td>FF FF DF DF DF DF
+
+     <td><em>WS</em> 3C 48 54 4D 4C <!-- "<HTML" -->
+      <!-- common in static data -->
+
+     <td>text/html
+
+     <td>The string "<code title=""><HTML</code>" in US-ASCII or
+      compatible encodings, case-insensitively, possibly with leading spaces.
+      
+
+    <tr>
+     <td>FF FF DF DF DF DF
+
+     <td><em>WS</em> 3C 48 45 41 44 <!-- "<HEAD" -->
+      <!-- common in static data -->
+
+     <td>text/html
+
+     <td>The string "<code title=""><HEAD</code>" in US-ASCII or
+      compatible encodings, case-insensitively, possibly with leading spaces.
+      
+
+    <tr>
+     <td>FF FF DF DF DF DF DF DF
+
+     <td><em>WS</em> 3C 53 43 52 49 50 54 <!-- "<SCRIPT" -->
+      <!-- common in dynamic data -->
+
+     <td>text/html
+
+     <td>The string "<code title=""><SCRIPT</code>" in US-ASCII or
+      compatible encodings, case-insensitively, possibly with leading spaces.
+      
+
+    <tr>
+     <td>FF FF FF FF FF
+
+     <td>25 50 44 46 2D
+      <!-- "%PDF-" (from http://lxr.mozilla.org/seamonkey/source/netwerk/streamconv/converters/nsUnknownDecoder.cpp#321) -->
+      
+
+     <td>application/pdf
+
+     <td>The string "<code title="">%PDF-</code>", the PDF signature.
+
+    <tr>
+     <td>FF FF FF FF FF FF FF FF FF FF FF
+
+     <td>25 21 50 53 2D 41 64 6F 62 65 2D
+      <!-- "%!PS-Adobe-" (from http://lxr.mozilla.org/seamonkey/source/netwerk/streamconv/converters/nsUnknownDecoder.cpp#321) -->
+      
+
+     <td>application/postscript
+
+     <td>The string "<code title="">%!PS-Adobe-</code>", the PostScript
+      signature. <!-- copied from the section below -->
+
+   <tbody>
+    <tr>
+     <td>FF FF FF FF FF FF
+
+     <td>47 49 46 38 37 61 <!-- GIF87a -->
+
+     <td>image/gif
+
+     <td>The string "<code title="">GIF87a</code>", a GIF signature.
+
+    <tr>
+     <td>FF FF FF FF FF FF
+
+     <td>47 49 46 38 39 61 <!-- GIF89a -->
+
+     <td>image/gif
+
+     <td>The string "<code title="">GIF89a</code>", a GIF signature.
+
+    <tr>
+     <td>FF FF FF FF FF FF FF FF
+
+     <td>89 50 4E 47 0D 0A 1A 0A
+      <!-- [TAB]PNG[CR][LF][EOF][LF]; 137 80 78 71 13 10 26 10 -->
+
+     <td>image/png
+
+     <td>The PNG signature.
+
+    <tr>
+     <td>FF FF FF
+
+     <td>FF D8 FF
+      <!-- SOI marker followed by the first byte of another marker -->
+
+     <td>image/jpeg
+
+     <td>A JPEG SOI marker followed by the first byte of another marker.
+
+    <tr>
+     <td>FF FF
+
+     <td>42 4D
+
+     <td>image/bmp
+
+     <td>The string "<code title="">BM</code>", a BMP signature.
+
+    <tr>
+     <td>FF FF FF FF
+
+     <td>00 00 01 00
+
+     <td>image/vnd.microsoft.icon
+
+     <td>A 0 word following by a 1 word, a Windows Icon file format
+      signature.
+  </table>
+
+  <p>User agents may support further types if desired, by implicitly adding
+   to the above table. However, user agents should not use any other patterns
+   for types already mentioned in the table above, as this could then be used
+   for privilege escalation (where, e.g., a server uses the above table to
+   determine that content is not HTML and thus safe from XSS attacks, but
+   then a user agent detects it as HTML anyway and allows script to execute).
+
+  <h4 id=content-type3><span class=secno>2.6.5 </span><dfn
+   id=content-type8>Content-Type sniffing: image</dfn></h4>
+
+  <p>If the first bytes of the file match one of the byte sequences in the
+   first columns of the following table, then the sniffed type of the
+   resource is the type given in the corresponding cell in the second column
+   on the same row:
+
+  <table>
+   <thead>
+    <tr>
+     <th>Bytes in Hexadecimal
+
+     <th>Sniffed type
+
+     <th>Comment <!-- update the table above if you change this! -->
+
+   <tbody>
+    <tr>
+     <td>47 49 46 38 37 61 <!-- GIF87a -->
+
+     <td>image/gif
+
+     <td>The string "<code title="">GIF87a</code>", a GIF signature.
+
+    <tr>
+     <td>47 49 46 38 39 61 <!-- GIF89a -->
+
+     <td>image/gif
+
+     <td>The string "<code title="">GIF89a</code>", a GIF signature.
+
+    <tr>
+     <td>89 50 4E 47 0D 0A 1A 0A
+      <!-- [TAB]PNG[CR][LF][EOF][LF]; 137 80 78 71 13 10 26 10 -->
+
+     <td>image/png
+
+     <td>The PNG signature.
+
+    <tr>
+     <td>FF D8 FF
+      <!-- SOI marker followed by the first byte of another marker -->
+
+     <td>image/jpeg
+
+     <td>A JPEG SOI marker followed by the first byte of another marker.
+
+    <tr>
+     <td>42 4D
+
+     <td>image/bmp
+
+     <td>The string "<code title="">BM</code>", a BMP signature.
+
+    <tr>
+     <td>00 00 01 00
+
+     <td>image/vnd.microsoft.icon
+
+     <td>A 0 word following by a 1 word, a Windows Icon file format
+      signature.
+      <!-- XXX Mozilla also detects ART (AOL proprietary format) and Windows Cursor files -->
+      
+  </table>
+
+  <p>User agents must ignore any rows for image types that they do not
+   support.
+
+  <p>Otherwise, the sniffed type of the resource is the same as its <var
+   title="">official type</var>.
+
+  <h4 id=content-type4><span class=secno>2.6.6 </span><dfn
+   id=content-type9>Content-Type sniffing: feed or HTML</dfn></h4>
+  <!-- mostly based on:
+   http://blogs.msdn.com/rssteam/articles/PublishersGuide.aspx
+   http://lxr.mozilla.org/seamonkey/source/browser/components/feeds/src/nsFeedSniffer.cpp#192
+   http://lxr.mozilla.org/seamonkey/source/browser/components/feeds/src/nsFeedSniffer.cpp#127
+  -->
+
+  <ol>
+   <li>
+    <p>The user agent may wait for 512 or more bytes of the resource to be
+     available.
+
+   <li>
+    <p>Let <var title="">s</var> be the stream of bytes, and let <span><var
+     title="">s</var>[<var title="">i</var>]</span> represent the byte in
+     <var title="">s</var> with position <var title="">i</var>, treating <var
+     title="">s</var> as zero-indexed (so the first byte is at <span><var
+     title="">i</var>=0</span>).
+
+   <li>
+    <p>If at any point this algorithm requires the user agent to determine
+     the value of a byte in <var title="">s</var> which is not yet available,
+     or which is past the first 512 bytes of the resource, or which is beyond
+     the end of the resource, the user agent must stop this algorithm, and
+     assume that the sniffed type of the resource is "text/html".</p>
+
+    <p class=note>User agents are allowed, by the first step of this
+     algorithm, to wait until the first 512 bytes of the resource are
+     available.
+
+   <li>
+    <p>Initialise <var title="">pos</var> to 0.
+
+   <li>
+    <p>If <span><var title="">s</var>[0]</span> is 0xEF, <span><var
+     title="">s</var>[1]</span> is 0xBB, and <span><var
+     title="">s</var>[2]</span> is 0xBF, then set <var title="">pos</var> to
+     3. (This skips over a leading UTF-8 BOM, if any.)
+
+   <li>
+    <p><i>Loop start:</i> Examine <span><var title="">s</var>[<var
+     title="">pos</var>]</span>.</p>
+
+    <dl
+     class=switch><!-- skip whitespace (S token as defined in XML 1.0 section 2.3; production [3] -->
+
+     <dt>If it is 0x09 (ASCII tab), 0x20 (ASCII space), 0x0A (ASCII LF), or
+      0x0D (ASCII CR)
+
+     <dd>Increase <var title="">pos</var> by 1 and repeat this step.
+
+     <dt>If it is 0x3C (ASCII "<code title=""><</code>")
+
+     <dd>Increase <var title="">pos</var> by 1 and go to the next step.
+
+     <dt>If it is anything else
+
+     <dd>The sniffed type of the resource is "text/html". Abort these steps.
+    </dl>
+
+   <li>
+    <p>If the bytes with positions <var title="">pos</var> to <span><var
+     title="">pos</var>+2</span> in <var title="">s</var> are exactly equal
+     to 0x21, 0x2D, 0x2D respectively (ASCII for "<code
+     title="">!--</code>"), then:</p>
+
+    <ol>
+     <li>Increase <var title="">pos</var> by 3.</li>
+     <!-- skips past the " ! - - " -->
+
+     <li>If the bytes with positions <span><var title="">pos</var></span> to
+      <span><var title="">pos</var>+2</span> in <var title="">s</var> are
+      exactly equal to 0x2D, 0x2D, 0x3E respectively (ASCII for "<code
+      title="">--></code>"), then increase <var title="">pos</var> by 3
+      and jump back to the previous step (the step labeled <i>loop start</i>)
+      in the overall algorithm in this section.
+
+     <li>Otherwise, increase <var title="">pos</var> by 1.
+
+     <li>Return to step 2 in these substeps.
+    </ol>
+
+   <li>
+    <p>If <span><var title="">s</var>[<var title="">pos</var>]</span> is 0x21
+     (ASCII "<code title="">!</code>"):</p>
+    <!-- this skips past a DOCTYPE if there is one. It is brain-dead
+    because we don't have to be clever to parse the Atom and RSS x.y
+    DOCTYPEs, as they don't do anything clever like have internal
+    subsets or quoted ">" characters. If this fails, then that's ok,
+    we'll treat it as HTML which is fine since we know it's not a feed
+    in that case. -->
+    
+    <ol>
+     <li>Increase <var title="">pos</var> by 1.
+
+     <li>If <span><var title="">s</var>[<var title="">pos</var>]</span> equal
+      0x3E, then increase <var title="">pos</var> by 1 and jump back to the
+      step labeled <i>loop start</i> in the overall algorithm in this
+      section.
+
+     <li>Otherwise, return to step 1 in these substeps.
+    </ol>
+
+   <li>
+    <p>If <span><var title="">s</var>[<var title="">pos</var>]</span> is 0x3F
+     (ASCII "<code title="">?</code>"):</p>
+
+    <ol>
+     <li>Increase <var title="">pos</var> by 1.
+
+     <li>If <span><var title="">s</var>[<var title="">pos</var>]</span> and
+      <span><var title="">s</var>[<var title="">pos</var>+1]</span> equal
+      0x3F and 0x3E respectively, then increase <var title="">pos</var> by 1
+      and jump back to the step labeled <i>loop start</i> in the overall
+      algorithm in this section.
+
+     <li>Otherwise, return to step 1 in these substeps.
+    </ol>
+
+   <li>
+    <p>Otherwise, if the bytes in <var title="">s</var> starting at <var
+     title="">pos</var> match any of the sequences of bytes in the first
+     column of the following table, then the user agent must follow the steps
+     given in the corresponding cell in the second column of the same row.</p>
+
+    <table>
+     <thead>
+      <tr>
+       <th>Bytes in Hexadecimal
+
+       <th>Requirement
+
+       <th>Comment
+
+     <tbody>
+      <tr>
+       <td>72 73 73
+
+       <td>The sniffed type of the resource is "application/rss+xml"; abort
+        these steps
+
+       <td>The three ASCII characters "<code title="">rss</code>"
+
+      <tr>
+       <td>66 65 65 64
+
+       <td>The sniffed type of the resource is "application/atom+xml"; abort
+        these steps
+
+       <td>The four ASCII characters "<code title="">feed</code>"
+
+      <tr>
+       <td>72 64 66 3A 52 44 46
+
+       <td>Continue to the next step in this algorithm
+
+       <td>The ASCII characters "<code title="">rdf:RDF</code>"
+    </table>
+
+    <p>If none of the byte sequences above match the bytes in <var
+     title="">s</var> starting at <var title="">pos</var>, then the sniffed
+     type of the resource is "text/html". Abort these steps.</p>
+
+   <li>
+    <p class=big-issue>If, before the next ">", you find two xmlns*
+     attributes with http://www.w3.org/1999/02/22-rdf-syntax-ns# and
+     http://purl.org/rss/1.0/ as the namespaces, then the sniffed type of the
+     resource is "application/rss+xml", abort these steps. (maybe we only
+     need to check for http://purl.org/rss/1.0/ actually)
+
+   <li>
+    <p>Otherwise, the sniffed type of the resource is "text/html".
+  </ol>
+
+  <p class=note>For efficiency reasons, implementations may wish to implement
+   this algorithm and the algorithm for detecting the character encoding of
+   HTML documents in parallel.
+
+  <h2 id=dom><span class=secno>3. </span>Semantics and structure of HTML
+   documents</h2>
+
+  <h3 id=semantics-intro><span class=secno>3.1 </span>Introduction</h3>
+
+  <p><em>This section is non-normative.</em>
+
+  <p class=big-issue>An introduction to marking up a document.
+
+  <h3 id=documents><span class=secno>3.2 </span>Documents</h3>
+
+  <p>Every XML and HTML document in an HTML UA is represented by a
+   <code>Document</code> object. <a href="#refsDOM3CORE">[DOM3CORE]</a>
+
+  <h4 id=documents0><span class=secno>3.2.1 </span>Documents in the DOM</h4>
+
+  <p><code>Document</code> objects are assumed to be <dfn
+   id=xml-documents>XML documents</dfn> unless they are flagged as being <dfn
+   id=html->HTML documents</dfn> when they are created. Whether a document is
+   an <a href="#html-" title="HTML documents">HTML document</a> or an <a
+   href="#xml-documents" title="XML documents">XML document</a> affects the
+   behavior of certain APIs, as well as a few CSS rendering rules. <a
+   href="#refsCSS21">[CSS21]</a>
+
+  <p class=note>A <code>Document</code> object created by the <code
+   title="">createDocument()</code> API on the <code>DOMImplementation</code>
+   object is initially an <a href="#xml-documents" title="XML documents">XML
+   document</a>, but can be made into an <a href="#html-" title="HTML
+   documents">HTML document</a> by calling <code title=dom-document-open><a
+   href="#open">document.open()</a></code> on it.
+
+  <p>All <code>Document</code> objects (in user agents implementing this
+   specification) must also implement the <code><a
+   href="#htmldocument">HTMLDocument</a></code> interface, available using
+   binding-specific methods. (This is the case whether or not the document in
+   question is an <a href="#html-" title="HTML documents">HTML document</a>
+   or indeed whether it contains any <a href="#html-elements">HTML
+   elements</a> at all.) <code>Document</code> objects must also implement
+   the document-level interface of any other namespaces found in the document
+   that the UA supports. For example, if an HTML implementation also supports
+   SVG, then the <code>Document</code> object must implement <code><a
+   href="#htmldocument">HTMLDocument</a></code> and <code>SVGDocument</code>.
+
+  <p class=note>Because the <code><a
+   href="#htmldocument">HTMLDocument</a></code> interface is now obtained
+   using binding-specific casting methods instead of simply being the primary
+   interface of the document object, it is no longer defined as inheriting
+   from <code>Document</code>.
+
+  <pre class=idl>interface <dfn id=htmldocument>HTMLDocument</dfn> {
+  // <a href="#resource0">resource metadata management</a>
+  [PutForwards=href] readonly attribute <a href="#location2">Location</a> <a href="#location0" title=dom-document-location>location</a>;
+  readonly attribute DOMString <a href="#url" title=dom-document-URL>URL</a>;
+           attribute DOMString <a href="#domain" title=dom-document-domain>domain</a>;
+  readonly attribute DOMString <a href="#referrer" title=dom-document-referrer>referrer</a>;
+           attribute DOMString <a href="#cookie0" title=dom-document-cookie>cookie</a>;
+  readonly attribute DOMString <a href="#lastmodified" title=dom-document-lastModified>lastModified</a>;
+  readonly attribute DOMString <a href="#compatmode" title=dom-document-compatMode>compatMode</a>;
+           attribute DOMString <a href="#charset0" title=dom-document-charset>charset</a>;
+  readonly attribute DOMString <a href="#characterset" title=dom-document-characterSet>characterSet</a>;
+  readonly attribute DOMString <a href="#defaultcharset" title=dom-document-defaultCharset>defaultCharset</a>;
+  readonly attribute DOMString <a href="#readystate" title=dom-document-readyState>readyState</a>;
+
+  // <a href="#dom-tree0">DOM tree accessors</a>
+           attribute DOMString <a href="#document.title" title=dom-document-title>title</a>;
+           attribute DOMString <a href="#dir1" title=dom-document-dir>dir</a>;
+           attribute <a href="#htmlelement">HTMLElement</a> <a href="#body" title=dom-document-body>body</a>;
+  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#images0" title=dom-document-images>images</a>;
+  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#embeds" title=dom-document-embeds>embeds</a>;
+  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#plugins" title=dom-document-plugins>plugins</a>;
+  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#links0" title=dom-document-links>links</a>;
+  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#forms0" title=dom-document-forms>forms</a>;
+  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#anchors" title=dom-document-anchors>anchors</a>;
+  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#scripts0" title=dom-document-scripts>scripts</a>;
+  NodeList <a href="#getelementsbyname" title=dom-document-getElementsByName>getElementsByName</a>(in DOMString elementName);
+  NodeList <a href="#getelementsbyclassname" title=dom-document-getElementsByClassName>getElementsByClassName</a>(in DOMString classNames);
+
+  // <a href="#dynamic2">dynamic markup insertion</a>
+           attribute DOMString <a href="#innerhtml" title=dom-innerHTML>innerHTML</a>;
+  <a href="#htmldocument">HTMLDocument</a> <a href="#open" title=dom-document-open>open</a>();
+  <a href="#htmldocument">HTMLDocument</a> <a href="#open" title=dom-document-open>open</a>(in DOMString type);
+  <a href="#htmldocument">HTMLDocument</a> <a href="#open" title=dom-document-open>open</a>(in DOMString type, in DOMString replace);
+  <a href="#window">Window</a> <a href="#open" title=dom-document-open>open</a>(in DOMString url, in DOMString name, in DOMString features);
+  <a href="#window">Window</a> <a href="#open" title=dom-document-open>open</a>(in DOMString url, in DOMString name, in DOMString features, in boolean replace);
+  void <a href="#close" title=dom-document-close>close</a>();
+  void <a href="#document.write" title=dom-document-write>write</a>(in DOMString text);
+  void <a href="#document.writeln..." title=dom-document-writeln>writeln</a>(in DOMString text);
+
+  // <a href="#user-interaction">user interaction</a>
+  <a href="#selection1">Selection</a> <a href="#getselection0" title=dom-document-getSelection>getSelection</a>();
+  readonly attribute <span>Element</span> <a href="#activeelement" title=dom-document-activeElement>activeElement</a>;
+  boolean <a href="#hasfocus" title=dom-document-hasFocus>hasFocus</a>();
+           attribute boolean <a href="#designMode" title=dom-document-designMode>designMode</a>;
+  boolean <a href="#execCommand" title=dom-document-execCommand>execCommand</a>(in DOMString commandId);
+  boolean <a href="#execCommand" title=dom-document-execCommand>execCommand</a>(in DOMString commandId, in boolean showUI);
+  boolean <a href="#execCommand" title=dom-document-execCommand>execCommand</a>(in DOMString commandId, in boolean showUI, in DOMString value);
+  boolean <a href="#querycommandenabled" title=dom-document-queryCommandEnabled>queryCommandEnabled</a>(in DOMString commandId);
+  boolean <a href="#querycommandindeterm" title=dom-document-queryCommandIndeterm>queryCommandIndeterm</a>(in DOMString commandId);
+  boolean <a href="#querycommandstate" title=dom-document-queryCommandState>queryCommandState</a>(in DOMString commandId);
+  boolean <a href="#querycommandsupported" title=dom-document-queryCommandSupported>queryCommandSupported</a>(in DOMString commandId);
+  DOMString <a href="#querycommandvalue" title=dom-document-queryCommandValue>queryCommandValue</a>(in DOMString commandId);
+  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#commands0" title=dom-document-commands>commands</a>;
+};</pre>
+
+  <p>Since the <code><a href="#htmldocument">HTMLDocument</a></code>
+   interface holds methods and attributes related to a number of disparate
+   features, the members of this interface are described in various different
+   sections.
+
+  <h4 id=security><span class=secno>3.2.2 </span>Security</h4>
+
+  <p>User agents must raise a <a href="#security9">security exception</a>
+   whenever any of the members of an <code><a
+   href="#htmldocument">HTMLDocument</a></code> object are accessed by
+   scripts whose <a href="#effective3">effective script origin</a> is not the
+   <a href="#same-origin" title="same origin">same</a> as the
+   <code>Document</code>'s <a href="#effective3">effective script origin</a>.
+
+  <h4 id=resource><span class=secno>3.2.3 </span><dfn id=resource0>Resource
+   metadata management</dfn></h4>
+
+  <p>The <dfn id=url title=dom-document-URL><code>URL</code></dfn> attribute
+   must return <span>the document's address</span><!--
+  XXXDOCURL xref -->.
+
+  <p>The <dfn id=referrer
+   title=dom-document-referrer><code>referrer</code></dfn> attribute must
+   return either the <span title="the document's
+   address">address</span><!-- XXXDOXURL xref --> of the <a
+   href="#active">active document</a> of the <a href="#source0">source
+   browsing context</a> at the time the navigation was started (that is, the
+   page which <a href="#navigate" title=navigate>navigated</a> the <a
+   href="#browsing1">browsing context</a> to the current document), or the
+   empty string if there is no such originating page, or if the UA has been
+   configured not to report referrers in this case, or if the navigation was
+   initiated for a <a href="#hyperlinks">hyperlink</a> with a <code
+   title=rel-noreferrer><a href="#noreferrer">noreferrer</a></code> keyword.
+
+  <p class=note>In the case of HTTP, the <code title=dom-document-referrer><a
+   href="#referrer">referrer</a></code> DOM attribute will match the <code
+   title="">Referer</code> (sic) header that was sent when fetching the
+   current page.
+
+  <p class=note>Typically user agents are configured to not report referrers
+   in the case where the referrer uses an encrypted protocol and the current
+   page does not (e.g. when navigating from an <code title="">https:</code>
+   page to an <code title="">http:</code> page).
+
+  <hr>
+
+  <p>The <dfn id=cookie0 title=dom-document-cookie><code>cookie</code></dfn>
+   attribute represents the cookies of the resource.</p>
+  <!-- XXX this needs work; e.g. document.open() should return the
+  cookies of the document that called document.open(), not of
+  about:blank or the document that had .open() called on, as I
+  understand it. -->
+
+  <p id=sandboxCookies>On getting, if the <a href="#sandboxed2">sandboxed
+   origin browsing context flag</a> is set on the <a
+   href="#browsing1">browsing context</a> of the document, the user agent
+   must raise a <a href="#security9">security exception</a>. Otherwise, it
+   must return the same string as the value of the <code
+   title="">Cookie</code> HTTP header it would include if fetching the
+   resource indicated by <span>the document's
+   address</span><!-- XXXDOCURL --> over HTTP, as per RFC 2109 section 4.3.4.
+   <a href="#refsRFC2109">[RFC2109]</a>
+
+  <p>On setting, if the <a href="#sandboxed2">sandboxed origin browsing
+   context flag</a> is set on the <a href="#browsing1">browsing context</a>
+   of the document, the user agent must raise a <a href="#security9">security
+   exception</a>. Otherwise, the user agent must act as it would when
+   processing cookies if it had just attempted to fetch <span>the document's
+   address</span><!-- XXXDOCURL --> over HTTP, and had received a response
+   with a <code>Set-Cookie</code> header whose value was the specified value,
+   as per RFC 2109 sections 4.3.1, 4.3.2, and 4.3.3. <a
+   href="#refsRFC2109">[RFC2109]</a>
+
+  <p class=note>Since the <code title=dom-document-cookie><a
+   href="#cookie0">cookie</a></code> attribute is accessible across frames,
+   the path restrictions on cookies are only a tool to help manage which
+   cookies are sent to which parts of the site, and are not in any way a
+   security feature.
+
+  <hr>
+
+  <p>The <dfn id=lastmodified
+   title=dom-document-lastModified><code>lastModified</code></dfn> attribute,
+   on getting, must return the date and time of the <code>Document</code>'s
+   source file's last modification, in the user's local timezone, in the
+   following format:
+
+  <ol>
+   <li> The month component of the date.
+
+   <li> A U+002F SOLIDUS character ('/').
+
+   <li> The day component of the date.
+
+   <li> A U+002F SOLIDUS character ('/').
+
+   <li> The year component of the date.
+
+   <li> A U+0020 SPACE character.
+
+   <li> The hours component of the time.
+
+   <li> A U+003A COLON character (':').
+
+   <li> The minutes component of the time.
+
+   <li> A U+003A COLON character (':').
+
+   <li> The seconds component of the time.
+  </ol>
+
+  <p>All the numeric components above, other than the year, must be given as
+   two digits in the range U+0030 DIGIT ZERO to U+0039 DIGIT NINE
+   representing the number in base ten, zero-padded if necessary.
+
+  <p>The <code>Document</code>'s source file's last modification date and
+   time must be derived from relevant features of the networking protocols
+   used, e.g. from the value of the HTTP <code title="">Last-Modified</code>
+   header of the document, or from metadata in the file system for local
+   files. If the last modification date and time are not known, the attribute
+   must return the string <code title="">01/01/1970 00:00:00</code>.
+
+  <p>A <code>Document</code> is always set to one of three modes: <dfn
+   id=no-quirks>no quirks mode</dfn>, the default; <dfn id=quirks>quirks
+   mode</dfn>, used typically for legacy documents; and <dfn
+   id=limited1>limited quirks mode</dfn>, also known as "almost standards"
+   mode. The mode is only ever changed from the default by the <a
+   href="#html-0">HTML parser</a>, based on the presence, absence, or value
+   of the DOCTYPE string.
+
+  <p>The <dfn id=compatmode
+   title=dom-document-compatMode><code>compatMode</code></dfn> DOM attribute
+   must return the literal string "<code title="">CSS1Compat</code>" unless
+   the document has been set to <a href="#quirks">quirks mode</a> by the <a
+   href="#html-0">HTML parser</a>, in which case it must instead return the
+   literal string "<code title="">BackCompat</code>".
+
+  <div class=big-issue>
+   <p>As far as parsing goes, the quirks I know of are:</p>
+
+   <ul>
+    <li>Comment parsing is different.
+
+    <li><code><a href="#p">p</a></code> can contain <code><a
+     href="#table">table</a></code>
+
+    <li>Safari and IE have special parsing rules for <% ... %> (even in
+     standards mode, though clearly this should be quirks-only).
    </ul>
   </div>
 
-  <h3 id=documents0><span class=secno>3.3 </span>Documents and document
-   fragments</h3>
+  <p>Documents have an associated <dfn id=character1 title="document's
+   character encoding">character encoding</dfn>. When a <code>Document</code>
+   object is created, the <a href="#character1">document's character
+   encoding</a> must be initialized to UTF-16. Various algorithms during page
+   loading affect this value, as does the <code title=dom-document-charset><a
+   href="#charset0">charset</a></code> setter. <a
+   href="#refsIANACHARSET">[IANACHARSET]</a> <!-- XXX
+  http://www.iana.org/assignments/character-sets -->
 
+  <p>The <dfn id=charset0
+   title=dom-document-charset><code>charset</code></dfn> DOM attribute must,
+   on getting, return the preferred MIME name of the <a
+   href="#character1">document's character encoding</a>. On setting, if the
+   new value is an IANA-registered alias for a character encoding, the <a
+   href="#character1">document's character encoding</a> must be set to that
+   character encoding. (Otherwise, nothing happens.)
+
+  <p>The <dfn id=characterset
+   title=dom-document-characterSet><code>characterSet</code></dfn> DOM
+   attribute must, on getting, return the preferred MIME name of the <a
+   href="#character1">document's character encoding</a>.
+
+  <p>The <dfn id=defaultcharset
+   title=dom-document-defaultCharset><code>defaultCharset</code></dfn> DOM
+   attribute must, on getting, return the preferred MIME name of a character
+   encoding, possibly the user's default encoding, or an encoding associated
+   with the user's current geographical location, or any arbitrary encoding
+   name.
+
+  <p>Each document has a <dfn id=current>current document readiness</dfn>.
+   When a <code>Document</code> object is created, it must have its <a
+   href="#current">current document readiness</a> set to the string
+   "loading". Various algorithms during page loading affect this value. When
+   the value is set, the user agent must <a href="#firing2">fire a simple
+   event</a> called <code
+   title=event-readystatechanged>readystatechanged</code> at the
+   <code>Document</code> object.</p>
+  <!-- XXX define
+  document.onreadystatechange -->
+
+  <p>The <dfn id=readystate
+   title=dom-document-readyState><code>readyState</code></dfn> DOM attribute
+   must, on getting, return the <a href="#current">current document
+   readiness</a>.
+
+  <h4 id=dom-tree><span class=secno>3.2.4 </span><dfn id=dom-tree0>DOM tree
+   accessors</dfn></h4>
+
+  <p><dfn id=the-html0>The <code>html</code> element</dfn> of a document is
+   the document's root element, if there is one and it's an <code><a
+   href="#html">html</a></code> element, or null otherwise.
+
+  <p><dfn id=the-head0>The <code>head</code> element</dfn> of a document is
+   the first <code><a href="#head">head</a></code> element that is a child of
+   <a href="#the-html0">the <code>html</code> element</a>, if there is one,
+   or null otherwise.
+
+  <p><dfn id=the-title1>The <code>title</code> element</dfn> of a document is
+   the first <code><a href="#title1">title</a></code> element in the document
+   (in tree order), if there is one, or null otherwise.
+
+  <p>The <dfn id=document.title
+   title=dom-document-title><code>title</code></dfn> attribute must, on
+   getting, run the following algorithm:
+
+  <ol>
+   <li>
+    <p>If the <a href="#root-element">root element</a> is an <code>svg</code>
+     element in the "<code title="">http://www.w3.org/2000/svg</code>"
+     namespace, and the user agent supports SVG, then the getter must return
+     the value that would have been returned by the DOM attribute of the same
+     name on the <code>SVGDocument</code> interface.
+
+   <li>
+    <p>Otherwise, it must return a concatenation of the data of all the child
+     <a href="#text-node" title="text node">text nodes</a> of <a
+     href="#the-title1">the <code>title</code> element</a>, in tree order, or
+     the empty string if <a href="#the-title1">the <code>title</code>
+     element</a> is null.
+  </ol>
+
+  <p>On setting, the following algorithm must be run:
+
+  <ol>
+   <li>
+    <p>If the <a href="#root-element">root element</a> is an <code>svg</code>
+     element in the "<code title="">http://www.w3.org/2000/svg</code>"
+     namespace, and the user agent supports SVG, then the setter must defer
+     to the setter for the DOM attribute of the same name on the
+     <code>SVGDocument</code> interface. Stop the algorithm here.
+
+   <li>If <a href="#the-title1">the <code>title</code> element</a> is null
+    and <a href="#the-head0">the <code>head</code> element</a> is null, then
+    the attribute must do nothing. Stop the algorithm here.
+
+   <li>If <a href="#the-title1">the <code>title</code> element</a> is null,
+    then a new <code><a href="#title1">title</a></code> element must be
+    created and appended to <a href="#the-head0">the <code>head</code>
+    element</a>.
+
+   <li>The children of <a href="#the-title1">the <code>title</code>
+    element</a> (if any) must all be removed.
+
+   <li>A single <code>Text</code> node whose data is the new value being
+    assigned must be appended to <a href="#the-title1">the <code>title</code>
+    element</a>.
+  </ol>
+
+  <p>The <code title=dom-document-title><a
+   href="#document.title">title</a></code> attribute on the <code><a
+   href="#htmldocument">HTMLDocument</a></code> interface should shadow the
+   attribute of the same name on the <code>SVGDocument</code> interface when
+   the user agent supports both HTML and SVG.
+
+  <p><dfn id=the-body1>The body element</dfn> of a document is the first
+   child of <a href="#the-html0">the <code>html</code> element</a> that is
+   either a <code><a href="#body0">body</a></code> element or a
+   <code>frameset</code> element. If there is no such element, it is null. If
+   the body element is null, then when the specification requires that events
+   be fired at "the body element", they must instead be fired at the
+   <code>Document</code> object.
+
+  <p>The <dfn id=body title=dom-document-body><code>body</code></dfn>
+   attribute, on getting, must return <a href="#the-body1">the body
+   element</a> of the document (either a <code><a
+   href="#body0">body</a></code> element, a <code>frameset</code> element, or
+   null). On setting, the following algorithm must be run:
+
+  <ol>
+   <li>If the new value is not a <code><a href="#body0">body</a></code> or
+    <code>frameset</code> element, then raise a
+    <code>HIERARCHY_REQUEST_ERR</code> exception and abort these steps.
+
+   <li>Otherwise, if the new value is the same as <a href="#the-body1">the
+    body element</a>, do nothing. Abort these steps.
+
+   <li>Otherwise, if <a href="#the-body1">the body element</a> is not null,
+    then replace that element with the new value in the DOM, as if the root
+    element's <code title="">replaceChild()</code> method had been called
+    with the new value and <a href="#the-body1" title="the body element">the
+    incumbent body element</a> as its two arguments respectively, then abort
+    these steps.
+
+   <li>Otherwise, the <a href="#the-body1">the body element</a> is null.
+    Append the new value to the root element.
+  </ol>
+  <!--XXX
+    http://lxr.mozilla.org/seamonkey/source/content/html/document/src/nsHTMLDocument.cpp
+    search for ::GetBody ::SetBody
+    http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/html/HTMLDocument.cpp
+    search for ::setBody
+    http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/dom/Document.cpp
+    search for ::body
+  -->
+
+  <p>The <dfn id=images0 title=dom-document-images><code>images</code></dfn>
+   attribute must return an <code><a
+   href="#htmlcollection0">HTMLCollection</a></code> rooted at the
+   <code>Document</code> node, whose filter matches only <code><a
+   href="#img">img</a></code> elements.
+
+  <p>The <dfn id=embeds title=dom-document-embeds><code>embeds</code></dfn>
+   attribute must return an <code><a
+   href="#htmlcollection0">HTMLCollection</a></code> rooted at the
+   <code>Document</code> node, whose filter matches only <code><a
+   href="#embed">embed</a></code> elements.
+
+  <p>The <dfn id=plugins
+   title=dom-document-plugins><code>plugins</code></dfn> attribute must
+   return the same object as that returned by the <code
+   title=dom-document-embeds><a href="#embeds">embeds</a></code> attribute.
+
+  <p>The <dfn id=links0 title=dom-document-links><code>links</code></dfn>
+   attribute must return an <code><a
+   href="#htmlcollection0">HTMLCollection</a></code> rooted at the
+   <code>Document</code> node, whose filter matches only <code><a
+   href="#a">a</a></code> elements with <code title=attr-hyperlink-href><a
+   href="#href6">href</a></code> attributes and <code><a
+   href="#area">area</a></code> elements with <code
+   title=attr-hyperlink-href><a href="#href6">href</a></code> attributes.
+
+  <p>The <dfn id=forms0 title=dom-document-forms><code>forms</code></dfn>
+   attribute must return an <code><a
+   href="#htmlcollection0">HTMLCollection</a></code> rooted at the
+   <code>Document</code> node, whose filter matches only <code>form</code>
+   elements.
+
+  <p>The <dfn id=anchors
+   title=dom-document-anchors><code>anchors</code></dfn> attribute must
+   return an <code><a href="#htmlcollection0">HTMLCollection</a></code>
+   rooted at the <code>Document</code> node, whose filter matches only
+   <code><a href="#a">a</a></code> elements with <code
+   title=attr-a-name>name</code> attributes.</p>
+  <!-- XXX note that such elements are
+  non-conforming -->
+
+  <p>The <dfn id=scripts0
+   title=dom-document-scripts><code>scripts</code></dfn> attribute must
+   return an <code><a href="#htmlcollection0">HTMLCollection</a></code>
+   rooted at the <code>Document</code> node, whose filter matches only
+   <code><a href="#script1">script</a></code> elements.
+
+  <p>The <dfn id=getelementsbyname
+   title=dom-document-getElementsByName><code>getElementsByName(<var
+   title="">name</var>)</code></dfn> method a string <var
+   title="">name</var>, and must return a live <code>NodeList</code>
+   containing all the <code><a href="#a">a</a></code>, <code><a
+   href="#applet">applet</a></code>, <code>button</code>, <code>form</code>,
+   <!-- frame? frameset?
+  XXX--><code><a href="#iframe">iframe</a></code>,
+   <code><a href="#img">img</a></code>, <code>input</code>, <code><a
+   href="#map">map</a></code>, <code><a href="#meta0">meta</a></code>,
+   <code><a href="#object">object</a></code>,<!-- param?
+  XXX-->
+   <code>select</code>, and <code>textarea</code> elements in that document
+   that have a <code title="">name</code> attribute whose value is
+   equal<!-- XXX case sensitivity --> to the <var title="">name</var>
+   argument.</p>
+  <!-- XXX what about XHTML? -->
+
+  <p>The <dfn id=getelementsbyclassname
+   title=dom-document-getElementsByClassName><code>getElementsByClassName(<var
+   title="">classNames</var>)</code></dfn> method takes a string that
+   contains an <a href="#unordered">unordered set of unique space-separated
+   tokens</a> representing classes. When called, the method must return a
+   live <code>NodeList</code> object containing all the elements in the
+   document that have all the classes specified in that argument, having
+   obtained the classes by <a href="#split" title="split a string on
+   spaces">splitting a string on spaces</a>. If there are no tokens specified
+   in the argument, then the method must return an empty
+   <code>NodeList</code>.
+
+  <p>The <dfn id=getelementsbyclassname0
+   title=dom-getElementsByClassName><code>getElementsByClassName()</code></dfn>
+   method on the <code><a href="#htmlelement">HTMLElement</a></code>
+   interface must return a live <code>NodeList</code> with the nodes that the
+   <code><a href="#htmldocument">HTMLDocument</a></code> <code
+   title=dom-document-getElementsByClassName><a
+   href="#getelementsbyclassname">getElementsByClassName()</a></code> method
+   would return when passed the same argument(s), excluding any elements that
+   are not descendants of the <code><a
+   href="#htmlelement">HTMLElement</a></code> object on which the method was
+   invoked.
+
+  <p>HTML, SVG, and MathML elements define which classes they are in by
+   having an attribute in the per-element partition with the name <code
+   title="">class</code> containing a space-separated list of classes to
+   which the element belongs. Other specifications may also allow elements in
+   their namespaces to be labeled as being in specific classes. UAs must not
+   assume that all attributes of the name <code title="">class</code> for
+   elements in any namespace work in this way, however, and must not assume
+   that such attributes, when used as global attributes, label other elements
+   as being in specific classes.
+
+  <div class=example>
+   <p>Given the following XHTML fragment:</p>
+
+   <pre><div id="example">
+ <p id="p1" class="aaa bbb"/>
+ <p id="p2" class="aaa ccc"/>
+ <p id="p3" class="bbb ccc"/>
+</div></pre>
+
+   <p>A call to
+    <code>document.getElementById('example').getElementsByClassName('aaa')</code>
+    would return a <code>NodeList</code> with the two paragraphs
+    <code>p1</code> and <code>p2</code> in it.</p>
+
+   <p>A call to <code>getElementsByClassName('ccc bbb')</code> would
+    only return one node, however, namely <code>p3</code>. A call to
+    <code>document.getElementById('example').getElementsByClassName('bbb  ccc ')</code>
+    would return the same thing.</p>
+
+   <p>A call to <code>getElementsByClassName('aaa,bbb')</code> would return
+    no nodes; none of the elements above are in the "aaa,bbb" class.</p>
+  </div>
+  <!-- XXX
+>         * xGetParentElementByClassName(rootElement, className, tagName) -
+> Navigates upwards until we hit a parent element with the given class name and
+> optional tag name.
+-->
+
+  <p class=note>The <code title=dom-document-dir><a
+   href="#dir1">dir</a></code> attribute on the <code><a
+   href="#htmldocument">HTMLDocument</a></code> interface is defined along
+   with the <code title=attr-dir><a href="#dir">dir</a></code> content
+   attribute.
+
+  <h3 id=elements><span class=secno>3.3 </span>Elements</h3>
+
   <h4 id=semantics0><span class=secno>3.3.1 </span>Semantics</h4>
 
   <p>Elements, attributes, and attribute values in HTML are defined (by this
    specification) to have certain meanings (semantics). For example, the
    <code><a href="#ol">ol</a></code> element represents an ordered list, and
-   the <code title=lang>lang</code> attribute represents the language of the
-   content.
+   the <code title=attr-lang><a href="#lang">lang</a></code> attribute
+   represents the language of the content.
 
   <p>Authors must not use elements, attributes, and attribute values for
    purposes other than their appropriate intended semantic purpose.
@@ -6396,359 +6736,111 @@
    dynamically updated by a script, the UA would update the rendering to show
    the progress changing.
 
-  <h4 id=structure0><span class=secno>3.3.2 </span>Structure</h4>
+  <h4 id=elements0><span class=secno>3.3.2 </span>Elements in the DOM</h4>
 
-  <p>All the elements in this specification have a defined content model,
-   which describes what nodes are allowed inside the elements, and thus what
-   the structure of an HTML document or fragment must look like.
+  <p>The nodes representing <a href="#html-elements">HTML elements</a> in the
+   DOM must implement, and expose to scripts, the interfaces listed for them
+   in the relevant sections of this specification. This includes <a
+   href="#html-elements">HTML elements</a> in <a href="#xml-documents">XML
+   documents</a>, even when those documents are in another context (e.g.
+   inside an XSLT transform).
 
-  <p class=note>As noted in the conformance and terminology sections, for the
-   purposes of determining if an element matches its content model or not, <a
-   href="#text-node" title="text node"><code>CDATASection</code> nodes in the
-   DOM are treated as equivalent to <code>Text</code> nodes</a>, and <a
-   href="#entity-references">entity reference nodes are treated as if they
-   were expanded in place</a>.
+  <p>Elements in the DOM represent things; that is, they have intrinsic
+   <em>meaning</em>, also known as semantics.
 
-  <p>The <a href="#space" title="space character">space characters</a> are
-   always allowed between elements. User agents represent these characters
-   between elements in the source markup as text nodes in the
-   DOM.<!-- not a conf criteria since the parser now requires this
-  -->
-   Empty <a href="#text-node" title="text node">text nodes</a> and <a
-   href="#text-node" title="text node">text nodes</a> consisting of just
-   sequences of those characters are considered <dfn
-   id=inter-element>inter-element whitespace</dfn>.
+  <p class=example>For example, an <code><a href="#ol">ol</a></code> element
+   represents an ordered list.
 
-  <p><a href="#inter-element">Inter-element whitespace</a>, comment nodes,
-   and processing instruction nodes must be ignored when establishing whether
-   an element matches its content model or not, and must be ignored when
-   following algorithms that define document and element semantics.
+  <p>The basic interface, from which all the <a href="#html-elements">HTML
+   elements</a>' interfaces inherit, and which must be used by elements that
+   have no additional requirements, is the <code><a
+   href="#htmlelement">HTMLElement</a></code> interface.
 
-  <p>An element <var title="">A</var> is said to be <dfn id=preceded>preceded
-   or followed</dfn> by a second element <var title="">B</var> if <var
-   title="">A</var> and <var title="">B</var> have the same parent node and
-   there are no other element nodes or text nodes (other than <a
-   href="#inter-element">inter-element whitespace</a>) between them.
+  <pre
+   class=idl>interface <dfn id=htmlelement>HTMLElement</dfn> : <span>Element</span> {
+  // <a href="#dom-tree0">DOM tree accessors</a>
+  NodeList <a href="#getelementsbyclassname0" title=dom-getElementsByClassName>getElementsByClassName</a>(in DOMString classNames);
 
-  <p>Authors must not use <a href="#elements1">elements in the HTML
-   namespace</a> anywhere except where they are explicitly allowed, as
-   defined for each element, or as explicitly required by other
-   specifications. For XML compound documents, these contexts could be inside
-   elements from other namespaces, if those elements are defined as providing
-   the relevant contexts.
+  // <a href="#dynamic2">dynamic markup insertion</a>
+           attribute DOMString <a href="#innerhtml" title=dom-innerHTML>innerHTML</a>;
 
-  <div class=example>
-   <p>The SVG specification defines the SVG <code>foreignObject</code>
-    element as allowing foreign namespaces to be included, thus allowing
-    compound documents to be created by inserting subdocument content under
-    that element. <em>This</em> specification defines the XHTML <code><a
-    href="#html">html</a></code> element as being allowed where subdocument
-    fragments are allowed in a compound document. Together, these two
-    definitions mean that placing an XHTML <code><a
-    href="#html">html</a></code> element as a child of an SVG
-    <code>foreignObject</code> element is conforming. <a
-    href="#refsSVG">[SVG]</a></p>
-  </div>
+  // <span>metadata attributes</span>
+           attribute DOMString <a href="#id0" title=dom-id>id</a>;
+           attribute DOMString <a href="#title0" title=dom-title>title</a>;
+           attribute DOMString <a href="#lang0" title=dom-lang>lang</a>;
+           attribute DOMString <a href="#dir0" title=dom-dir>dir</a>;
+           attribute <span>DOMString</span> <a href="#classname" title=dom-className>className</a>;
+  readonly attribute <a href="#domtokenlist0">DOMTokenList</a> <a href="#classlist" title=dom-classList>classList</a>;
+  readonly attribute <a href="#domstringmap0">DOMStringMap</a> <a href="#dataset" title=dom-dataset>dataset</a>;
 
-  <div class=example>
-   <p>The Atom specification defines the Atom <code title="">content</code>
-    element, when its <code title="">type</code> attribute has the value
-    <code title="">xhtml</code>, as requiring that it contains a single HTML
-    <code><a href="#div">div</a></code> element. Thus, a <code><a
-    href="#div">div</a></code> element is allowed in that context, even
-    though this is not explicitly normatively stated by this specification.
-    <a href="#refsATOM">[ATOM]</a></p>
-  </div>
+  // <a href="#user-interaction">user interaction</a>
+           attribute boolean <a href="#irrelevant0" title=dom-irrelevant>irrelevant</a>;
+  void <a href="#click1" title=dom-click>click</a>();
+  void <a href="#scrollintoview" title=dom-scrollIntoView>scrollIntoView</a>();
+  void <a href="#scrollintoview" title=dom-scrollIntoView>scrollIntoView</a>(in boolean top);
+           attribute long <a href="#tabindex0" title=dom-tabindex>tabIndex</a>;
+  void <a href="#focus0" title=dom-focus>focus</a>();
+  void <a href="#blur" title=dom-blur>blur</a>();
+           attribute boolean <a href="#draggable0" title=dom-draggable>draggable</a>;
+           attribute DOMString <a href="#contenteditable1" title=dom-contentEditable>contentEditable</a>;
+  readonly attribute DOMString <a href="#iscontenteditable" title=dom-isContentEditable>isContentEditable</a>;
+           attribute <a href="#htmlmenuelement">HTMLMenuElement</a> <a href="#contextmenu0" title=dom-contextMenu>contextMenu</a>;
 
-  <p>In addition, <a href="#elements1">elements in the HTML namespace</a> may
-   be orphan nodes (i.e. without a parent node).
+  // <span>styling</span>
+  readonly attribute <span>CSSStyleDeclaration</span> <a href="#style0" title=dom-style>style</a>;
 
-  <div class=example>
-   <p>For example, creating a <code><a href="#td">td</a></code> element and
-    storing it in a global variable in a script is conforming, even though
-    <code><a href="#td">td</a></code> elements are otherwise only supposed to
-    be used inside <code><a href="#tr">tr</a></code> elements.</p>
+  // <span>data templates</span>
+           attribute DOMString <a href="#template0" title=dom-template>template</a>;
+  readonly attribute HTMLDataTemplateElement <a href="#templateelement" title=dom-templateElement>templateElement</a>;
+           attribute DOMString <a href="#ref0" title=dom-ref>ref</a>;
+  readonly attribute Node <a href="#refnode" title=dom-refNode>refNode</a>;
+           attribute DOMString <a href="#registrationmark0" title=dom-registrationMark>registrationMark</a>;
+  readonly attribute DocumentFragment <a href="#originalcontent" title=dom-originalContent>originalContent</a>;
 
-   <pre>var data = {
-  name: "Banana",
-  cell: document.createElement('td'), 
+  // <a href="#event4">event handler DOM attributes</a>
+           attribute <span>EventListener</span> <a href="#onabort" title=handler-onabort>onabort</a>;
+           attribute <span>EventListener</span> <a href="#onbeforeunload" title=handler-onbeforeunload>onbeforeunload</a>;
+           attribute <span>EventListener</span> <a href="#onblur" title=handler-onblur>onblur</a>;
+           attribute <span>EventListener</span> <a href="#onchange" title=handler-onchange>onchange</a>;
+           attribute <span>EventListener</span> <a href="#onclick" title=handler-onclick>onclick</a>;
+           attribute <span>EventListener</span> <a href="#oncontextmenu" title=handler-oncontextmenu>oncontextmenu</a>;
+           attribute <span>EventListener</span> <a href="#ondblclick" title=handler-ondblclick>ondblclick</a>;
+           attribute <span>EventListener</span> <a href="#ondrag" title=handler-ondrag>ondrag</a>;
+           attribute <span>EventListener</span> <a href="#ondragend" title=handler-ondragend>ondragend</a>;
+           attribute <span>EventListener</span> <a href="#ondragenter" title=handler-ondragenter>ondragenter</a>;
+           attribute <span>EventListener</span> <a href="#ondragleave" title=handler-ondragleave>ondragleave</a>;
+           attribute <span>EventListener</span> <a href="#ondragover" title=handler-ondragover>ondragover</a>;
+           attribute <span>EventListener</span> <a href="#ondragstart" title=handler-ondragstart>ondragstart</a>;
+           attribute <span>EventListener</span> <a href="#ondrop" title=handler-ondrop>ondrop</a>;
+           attribute <span>EventListener</span> <a href="#onerror" title=handler-onerror>onerror</a>;
+           attribute <span>EventListener</span> <a href="#onfocus" title=handler-onfocus>onfocus</a>;
+           attribute <span>EventListener</span> <a href="#onkeydown" title=handler-onkeydown>onkeydown</a>;
+           attribute <span>EventListener</span> <a href="#onkeypress" title=handler-onkeypress>onkeypress</a>;
+           attribute <span>EventListener</span> <a href="#onkeyup" title=handler-onkeyup>onkeyup</a>;
+           attribute <span>EventListener</span> <a href="#onload" title=handler-onload>onload</a>;
+           attribute <span>EventListener</span> <a href="#onmessage" title=handler-onmessage>onmessage</a>;
+           attribute <span>EventListener</span> <a href="#onmousedown" title=handler-onmousedown>onmousedown</a>;
+           attribute <span>EventListener</span> <a href="#onmousemove" title=handler-onmousemove>onmousemove</a>;
+           attribute <span>EventListener</span> <a href="#onmouseout" title=handler-onmouseout>onmouseout</a>;
+           attribute <span>EventListener</span> <a href="#onmouseover" title=handler-onmouseover>onmouseover</a>;
+           attribute <span>EventListener</span> <a href="#onmouseup" title=handler-onmouseup>onmouseup</a>;
+           attribute <span>EventListener</span> <a href="#onmousewheel" title=handler-onmousewheel>onmousewheel</a>;
+           attribute <span>EventListener</span> <a href="#onresize" title=handler-onresize>onresize</a>;
+           attribute <span>EventListener</span> <a href="#onscroll" title=handler-onscroll>onscroll</a>;
+           attribute <span>EventListener</span> <a href="#onselect" title=handler-onselect>onselect</a>;
+           attribute <span>EventListener</span> <a href="#onstorage" title=handler-onstorage>onstorage</a>;
+           attribute <span>EventListener</span> <a href="#onsubmit" title=handler-onsubmit>onsubmit</a>;
+           attribute <span>EventListener</span> <a href="#onunload" title=handler-onunload>onunload</a>;
+
 };</pre>
-  </div>
 
-  <h4 id=kinds><span class=secno>3.3.3 </span>Kinds of content</h4>
+  <p>The <code><a href="#htmlelement">HTMLElement</a></code> interface holds
+   methods and attributes related to a number of disparate features, and the
+   members of this interface are therefore described in various different
+   sections of this specification.
 
-  <p>Each element in HTML falls into zero or more categories that group
-   elements with similar characteristics together. The following categories
-   are used in this specification:
+  <h4 id=global><span class=secno>3.3.3 </span>Global attributes</h4>
 
-  <ul class=brief>
-   <li><a href="#metadata0">Metadata content</a>
-
-   <li><a href="#flow-content0">Flow content</a>
-
-   <li><a href="#sectioning0">Sectioning content</a>
-
-   <li><a href="#heading0">Heading content</a>
-
-   <li><a href="#phrasing0">Phrasing content</a>
-
-   <li><a href="#embedded1">Embedded content</a>
-
-   <li><span>Form control content</span>
-
-   <li><a href="#interactive1">Interactive content</a></li>
-   <!--
-   <li><span>Form content</span></li> XXX "Form control elements"
--->
-  </ul>
-  <!-- XXX xref check that all the above got a section defining them,
-  however briefly -->
-  <!-- XXX check that the element definitions also link to those
-  sections -->
-  <!-- XXX list all the elements for each kind of element in the
-  sections below. -->
-
-  <p>Some elements have unique requirements and do not fit into any
-   particular category.
-
-  <h5 id=metadata><span class=secno>3.3.3.1. </span>Metadata content</h5>
-
-  <p><dfn id=metadata0>Metadata content</dfn> is content that sets up the
-   presentation or behavior of the rest of the content, or that sets up the
-   relationship of the document with other documents, or that conveys other
-   "out of band" information.
-
-  <p>Elements from other namespaces whose semantics are primarily
-   metadata-related (e.g. RDF) are also <a href="#metadata0">metadata
-   content</a>.
-
-  <h5 id=flow-content><span class=secno>3.3.3.2. </span>Flow content</h5>
-
-  <p>Most elements that are used in the body of documents and applications
-   are categorized as <dfn id=flow-content0>flow content</dfn>.
-
-  <p>As a general rule, elements whose content model allows any <a
-   href="#flow-content0">flow content</a> should have either at least one
-   descendant text node that is not <a href="#inter-element">inter-element
-   whitespace</a>, or at least one descendant element node that is <a
-   href="#embedded1">embedded content</a>. For the purposes of this
-   requirement, <code><a href="#del">del</a></code> elements and their
-   descendants must not be counted as contributing to the ancestors of the
-   <code><a href="#del">del</a></code> element.
-
-  <p>This requirement is not a hard requirement, however, as there are many
-   cases where an element can be empty legitimately, for example when it is
-   used as a placeholder which will later be filled in by a script, or when
-   the element is part of a template and would on most pages be filled in but
-   on some pages is not relevant.
-
-  <h5 id=sectioning><span class=secno>3.3.3.3. </span>Sectioning content</h5>
-
-  <p><dfn id=sectioning0>Sectioning content</dfn> is content that defines the
-   scope of <a href="#heading0" title="heading content">headers</a>, <a
-   href="#footer" title=footer>footers</a>, and <a href="#address"
-   title=address>contact information</a>.
-
-  <p>Each <a href="#sectioning0">sectioning content</a> element potentially
-   has a heading. See the section on <a href="#headings0">headings and
-   sections</a> for further details.
-
-  <h5 id=heading><span class=secno>3.3.3.4. </span>Heading content</h5>
-
-  <p><dfn id=heading0>Heading content</dfn> defines the header of a section
-   (whether explicitly marked up using <a href="#sectioning0">sectioning
-   content</a> elements, or implied by the heading content itself).
-
-  <h5 id=phrasing><span class=secno>3.3.3.5. </span>Phrasing content</h5>
-
-  <p><dfn id=phrasing0>Phrasing content</dfn> is the text of the document, as
-   well as elements that mark up that text at the intra-paragraph level. Runs
-   of <a href="#phrasing0">phrasing content</a> form <a href="#paragraph"
-   title=paragraph>paragraphs</a>.
-
-  <p>All <a href="#phrasing0">phrasing content</a> is also <a
-   href="#flow-content0">flow content</a>. Any content model that expects <a
-   href="#flow-content0">flow content</a> also expects <a
-   href="#phrasing0">phrasing content</a>.
-
-  <p>As a general rule, elements whose content model allows any <a
-   href="#phrasing0">phrasing content</a> should have either at least one
-   descendant text node that is not <a href="#inter-element">inter-element
-   whitespace</a>, or at least one descendant element node that is <a
-   href="#embedded1">embedded content</a>. For the purposes of this
-   requirement, nodes that are descendants of <code><a
-   href="#del">del</a></code> elements must not be counted as contributing to
-   the ancestors of the <code><a href="#del">del</a></code> element.
-
-  <p class=note>Most elements that are categorized as phrasing content can
-   only contain elements that are themselves categorized as phrasing content,
-   not any flow content.
-
-  <p>Text nodes that are not <a href="#inter-element">inter-element
-   whitespace</a> are <a href="#phrasing0">phrasing content</a>.
-
-  <h5 id=embedded><span class=secno>3.3.3.6. </span>Embedded content</h5>
-
-  <p><dfn id=embedded1>Embedded content</dfn> is content that imports another
-   resource into the document, or content from another vocabulary that is
-   inserted into the document.
-
-  <p>All <a href="#embedded1">embedded content</a> is also <a
-   href="#phrasing0">phrasing content</a> (and <a href="#flow-content0">flow
-   content</a>). Any content model that expects <a href="#phrasing0">phrasing
-   content</a> (or <a href="#flow-content0">flow content</a>) also expects <a
-   href="#embedded1">embedded content</a>.
-
-  <p>Elements that are from namespaces other than the <a
-   href="#html-namespace0">HTML namespace</a> and that convey content but not
-   metadata, are <a href="#embedded1">embedded content</a> for the purposes
-   of the content models defined in this specification. (For example, MathML,
-   or SVG.)
-
-  <p>Some embedded content elements can have <dfn id=fallback>fallback
-   content</dfn>: content that is to be used when the external resource
-   cannot be used (e.g. because it is of an unsupported format). The element
-   definitions state what the fallback is, if any.
-
-  <h5 id=interactive0><span class=secno>3.3.3.7. </span>Interactive content</h5>
-  <!-- Don't change the above <dfn> or the text below without checking
-  all cross-references. Some of them refer specifically to the
-  activation behavior stuff. -->
-
-  <p class=big-issue>Parts of this section should eventually be moved to DOM3
-   Events.</p>
-  <!-- but see comment above -->
-  <!--
-TESTS:
-http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0A%3Cp%20tabindex%3D1%3Etest%20%3Ca%20href%3D%22%22%3E%20%3Cem%3Etest%3C/em%3E%20%3C/a%3E%0A%3Cscript%3E%0A%20function%20test%20%28e%29%20%7B%20w%28e.type%20+%20%27%20on%20%27%20+%20e.target.tagName%20+%20%27%20through%20%27%20+%20e.currentTarget.tagName%29%3B%20%7D%0A%20document.getElementsByTagName%28%27a%27%29%5B0%5D.addEventListener%28%27click%27%2C%20test%2C%20false%29%3B%0A%20document.getElementsByTagName%28%27a%27%29%5B0%5D.addEventListener%28%27DOMActivate%27%2C%20test%2C%20false%29%3B%0A%20document.getElementsByTagName%28%27p%27%29%5B0%5D.addEventListener%28%27click%27%2C%20test%2C%20false%29%3B%0A%20document.getElementsByTagName%28%27p%27%29%5B0%5D.addEventListener%28%27DOMActivate%27%2C%20test%2C%20false%29%3B%0A%3C/script%3E%0A
-http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0A%3Ca%20href%3Dhttp%3A//google.com/%20target%3Da%3EA%3C/a%3E%3Ca%20href%3Dhttp%3A//yahoo.com/%20target%3Db%3EB%3C/a%3E%3Cbr%3E%0A%3Ciframe%20name%3Da%3E%3C/iframe%3E%3Ciframe%20name%3Db%3E%3C/iframe%3E%0A%3Cscript%3E%0A%20var%20a%20%3D%20document.getElementsByTagName%28%27a%27%29%5B0%5D%3B%0A%20var%20b%20%3D%20document.getElementsByTagName%28%27a%27%29%5B1%5D%3B%0A%20a.appendChild%28b%29%3B%0A%3C/script%3E
-http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0A%3Cform%20action%3D%22http%3A//google.com/%22%20onsubmit%3D%22w%28%27onsubmit%27%29%22%3E%3Cem%3EA%3C/em%3E%3C/form%3E%0A%3Cscript%3E%0Adocument.getElementsByTagName%28%27form%27%29%5B0%5D.attachEvent%28%27onsubmit%27%2C%20function%20%28%29%20%7B%20w%28%27submit%20fired%27%29%20%7D%29%3B%0Adocument.getElementsByTagName%28%27form%27%29%5B0%5D.fireEvent%28%27onsubmit%27%29%3B%0A%3C/script%3E
-http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0A%3Cform%20action%3D%22http%3A//google.com/%22%3EX%3C/form%3E%0A%3Cscript%3E%0Avar%20evt%20%3D%20document.createEvent%28%22Events%22%29%3B%0Aevt.initEvent%28%22submit%22%2C%20true%2C%20true%29%3B%0Adocument.getElementsByTagName%28%27form%27%29%5B0%5D.dispatchEvent%28evt%29%3B%0A%3C/script%3E
--->
-
-  <p><dfn id=interactive1>Interactive content</dfn> is content that is
-   specifically intended for user interaction.
-
-  <p>Certain elements in HTML can be activated, for instance <code><a
-   href="#a">a</a></code> elements, <code>button</code> elements, or
-   <code>input</code> elements when their <code>type</code> attribute is set
-   to <code>radio</code>. Activation of those elements can happen in various
-   (UA-defined) ways, for instance via the mouse or keyboard.
-
-  <p>When activation is performed via some method other than clicking the
-   pointing device, the default action of the event that triggers the
-   activation must, instead of being activating the element directly, be to
-   <a href="#firing">fire a <code title="">click</code> event</a> on the same
-   element.
-
-  <p>The default action of this <code title=event-click>click</code> event,
-   or of the real <code title=event-click>click</code> event if the element
-   was activated by clicking a pointing device, must be to <span title="fire
-   a DOMActivate event">fire a further <code
-   title=event-DOMActivate>DOMActivate</code> event</span> at the same
-   element, whose own default action is to go through all the elements the
-   <code title=event-DOMActivate>DOMActivate</code> event bubbled through
-   (starting at the target node and going towards the <code>Document</code>
-   node), looking for an element with an <a href="#activation0">activation
-   behavior</a>; the first element, in reverse tree order, to have one, must
-   have its activation behavior executed.
-
-  <p class=note>The above doesn't happen for arbitrary synthetic events
-   dispatched by author script. However, the <code title=dom-click><a
-   href="#click1">click()</a></code> method can be used to make it happen
-   programmatically.
-
-  <p>For certain form controls, this process is complicated further by <a
-   href="http://www.whatwg.org/specs/web-forms/current-work/#the-click">changes
-   that must happen around the click event</a>. <a href="#refsWF2">[WF2]</a></p>
-  <!-- XXX WF2: when this is merged into
-  this spec, update xrefs -->
-
-  <p class=note>Most interactive elements have content models that disallow
-   nesting interactive elements.
-
-  <h4 id=transparent><span class=secno>3.3.4 </span>Transparent content
-   models</h4>
-
-  <p>Some elements are described as <dfn id=transparent0>transparent</dfn>;
-   they have "transparent" as their content model. Some elements are
-   described as <dfn id=semi-transparent>semi-transparent</dfn>; this means
-   that part of their content model is "transparent" but that is not the only
-   part of the content model that must be satisfied.
-
-  <p>When a content model includes a part that is "transparent", those parts
-   must not contain content that would not be conformant if all transparent
-   and semi-transparent elements in the tree were replaced, in their parent
-   element, by the children in the "transparent" part of their content model,
-   retaining order.
-
-  <p>When a transparent or semi-transparent element has no parent, then the
-   part of its content model that is "transparent" must instead be treated as
-   accepting any <a href="#flow-content0">flow content</a>.
-
-  <h4 id=paragraphs><span class=secno>3.3.5 </span>Paragraphs</h4>
-
-  <p>A <dfn id=paragraph>paragraph</dfn> is typically a block of text with
-   one or more sentences that discuss a particular topic, as in typography,
-   but can also be used for more general thematic grouping. For instance, an
-   address is also a paragraph, as is a part of a form, a byline, or a stanza
-   in a poem.
-
-  <p>Paragraphs in <a href="#flow-content0">flow content</a> are defined
-   relative to what the document looks like without the <code><a
-   href="#ins">ins</a></code> and <code><a href="#del">del</a></code>
-   elements complicating matters. Let <var title="">view</var> be a view of
-   the DOM that replaces all <code><a href="#ins">ins</a></code> and <code><a
-   href="#del">del</a></code> elements in the document with their contents.
-   Then, in <var title="">view</var>, for each run of <a
-   href="#phrasing0">phrasing content</a> uninterrupted by other types of
-   content, in an element that accepts content other than <a
-   href="#phrasing0">phrasing content</a>, let <var title="">first</var> be
-   the first node of the run, and let <var title="">last</var> be the last
-   node of the run. For each run, a paragraph exists in the original DOM from
-   immediately before <var title="">first</var> to immediately after <var
-   title="">last</var>. (Paragraphs can thus span across <code><a
-   href="#ins">ins</a></code> and <code><a href="#del">del</a></code>
-   elements.)
-
-  <p>A <a href="#paragraph">paragraph</a> is also formed by <code><a
-   href="#p">p</a></code> elements.
-
-  <p class=note>The <code><a href="#p">p</a></code> element can be used to
-   wrap individual paragraphs when there would otherwise not be any content
-   other than phrasing content to separate the paragraphs from each other.
-
-  <div class=example>
-   <p>In the following example, there are two paragraphs in a section. There
-    is also a header, which contains phrasing content that is not a
-    paragraph. Note how the comments and <span>intra-element
-    whitespace</span> do not form paragraphs.</p>
-
-   <pre><section>
-  <h1>Example of paragraphs</h1>
-  This is the <em>first</em> paragraph in this example.
-  <p>This is the second.</p>
-  <!-- This is not a paragraph. -->
-</section></pre>
-
-   <p>The following example takes that markup and puts <code><a
-    href="#ins">ins</a></code> and <code><a href="#del">del</a></code>
-    elements around some of the markup to show that the text was changed
-    (though in this case, the changes don't really make much sense,
-    admittedly). Notice how this example has exactly the same paragraphs as
-    the previous one, despite the <code><a href="#ins">ins</a></code> and
-    <code><a href="#del">del</a></code> elements.</p>
-
-   <pre><section>
-  <ins><h1>Example of paragraphs</h1>
-  This is the <em>first</em> paragraph in</ins> this example<del>.
-  <p>This is the second.</p></del>
-  <!-- This is not a paragraph. -->
-</section></pre>
-  </div>
-
-  <h3 id=global><span class=secno>3.4 </span>Global attributes</h3>
-
   <p>The following attributes are common to and may be specified on all <a
    href="#html-elements">HTML elements</a> (even those not defined in this
    specification):
@@ -6904,8 +6996,8 @@
    the namespace declaration mechanism, and an element cannot actually have
    an <code title="">xmlns</code> attribute in no namespace specified.
 
-  <h4 id=the-id><span class=secno>3.4.1 </span>The <dfn id=id
-   title=attr-id><code>id</code></dfn> attribute</h4>
+  <h5 id=the-id><span class=secno>3.3.3.1. </span>The <dfn id=id
+   title=attr-id><code>id</code></dfn> attribute</h5>
 
   <p>The <code title=attr-id><a href="#id">id</a></code> attribute represents
    its element's unique identifier. The value must be unique in the subtree
@@ -6934,8 +7026,8 @@
    href="#reflect">reflect</a> the <code title=attr-id><a
    href="#id">id</a></code> content attribute.
 
-  <h4 id=the-title><span class=secno>3.4.2 </span>The <dfn id=title
-   title=attr-title><code>title</code></dfn> attribute</h4>
+  <h5 id=the-title><span class=secno>3.3.3.2. </span>The <dfn id=title
+   title=attr-title><code>title</code></dfn> attribute</h5>
 
   <p>The <code title=attr-title><a href="#title">title</a></code> attribute
    represents advisory information for the element, such as would be
@@ -6969,9 +7061,9 @@
    attribute must <a href="#reflect">reflect</a> the <code
    title=attr-title><a href="#title">title</a></code> content attribute.
 
-  <h4 id=the-lang><span class=secno>3.4.3 </span>The <dfn id=lang
+  <h5 id=the-lang><span class=secno>3.3.3.3. </span>The <dfn id=lang
    title=attr-lang><code>lang</code></dfn> (HTML only) and <dfn id=xmllang
-   title=attr-xml-lang><code>xml:lang</code></dfn> (XML only) attributes</h4>
+   title=attr-xml-lang><code>xml:lang</code></dfn> (XML only) attributes</h5>
 
   <p>The <code title=attr-lang><a href="#lang">lang</a></code> attribute
    specifies the primary <dfn id=language>language</dfn> for the element's
@@ -7034,8 +7126,8 @@
    must <a href="#reflect">reflect</a> the <code title=attr-lang><a
    href="#lang">lang</a></code> content attribute.
 
-  <h4 id=the-xmlbase><span class=secno>3.4.4 </span>The <dfn id=xmlbase
-   title=attr-xml-base><code>xml:base</code></dfn> attribute (XML only)</h4>
+  <h5 id=the-xmlbase><span class=secno>3.3.3.4. </span>The <dfn id=xmlbase
+   title=attr-xml-base><code>xml:base</code></dfn> attribute (XML only)</h5>
 
   <p>The <code title=attr-xml-base><a href="#xmlbase">xml:base</a></code>
    attribute is defined in XML Base. <a href="#refsXMLBASE">[XMLBASE]</a>
@@ -7046,8 +7138,8 @@
    href="#xmlbase">xml:base</a></code> attribute in <a href="#html-">HTML
    documents</a>.
 
-  <h4 id=the-dir><span class=secno>3.4.5 </span>The <dfn id=dir
-   title=attr-dir><code>dir</code></dfn> attribute</h4>
+  <h5 id=the-dir><span class=secno>3.3.3.5. </span>The <dfn id=dir
+   title=attr-dir><code>dir</code></dfn> attribute</h5>
 
   <p>The <code title=attr-dir><a href="#dir">dir</a></code> attribute
    specifies the element's text directionality. The attribute is an <a
@@ -7071,18 +7163,18 @@
   <p>The <dfn id=dir0 title=dom-dir><code>dir</code></dfn> DOM attribute on
    an element must <a href="#reflect">reflect</a> the <code title=attr-dir><a
    href="#dir">dir</a></code> content attribute of that element, <a
-   href="#limited0">limited to only known values</a>.
+   href="#limited">limited to only known values</a>.
 
   <p>The <dfn id=dir1 title=dom-document-dir><code>dir</code></dfn> DOM
    attribute on <code><a href="#htmldocument">HTMLDocument</a></code> objects
    must <a href="#reflect">reflect</a> the <code title=attr-dir><a
    href="#dir">dir</a></code> content attribute of <a href="#the-html0">the
-   <code>html</code> element</a>, if any, <a href="#limited0">limited to only
+   <code>html</code> element</a>, if any, <a href="#limited">limited to only
    known values</a>. If there is no such element, then the attribute must
    return the empty string and do nothing on setting.
 
-  <h4 id=classes><span class=secno>3.4.6 </span>The <dfn id=class
-   title=attr-class><code>class</code></dfn> attribute</h4>
+  <h5 id=classes><span class=secno>3.3.3.6. </span>The <dfn id=class
+   title=attr-class><code>class</code></dfn> attribute</h5>
 
   <p>Every <a href="#html-elements" title="HTML elements">HTML element</a>
    may have a <code title=attr-class><a href="#class">class</a></code>
@@ -7113,8 +7205,8 @@
    attributes must both <a href="#reflect">reflect</a> the <code
    title=attr-class><a href="#class">class</a></code> content attribute.
 
-  <h4 id=the-style><span class=secno>3.4.7 </span>The <dfn id=style
-   title=attr-style><code>style</code></dfn> attribute</h4>
+  <h5 id=the-style><span class=secno>3.3.3.7. </span>The <dfn id=style
+   title=attr-style><code>style</code></dfn> attribute</h5>
 
   <p>All elements may have the <code title=attr-style><a
    href="#style">style</a></code> content attribute set. If specified, the
@@ -7156,8 +7248,8 @@
 background: transparent">blue</span>.</p></pre>
   </div>
 
-  <h4 id=embedding><span class=secno>3.4.8 </span><dfn
-   id=embedding0>Embedding custom non-visible data</dfn></h4>
+  <h5 id=embedding><span class=secno>3.3.3.8. </span><dfn
+   id=embedding0>Embedding custom non-visible data</dfn></h5>
 
   <p>A <dfn id=custom>custom data attribute</dfn> is an attribute whose name
    starts with the string "<dfn id=data-
@@ -7252,9 +7344,954 @@
    attributes or values. Specifications intended for user agents must not
    define these attributes to have any meaningful values.
 
-  <h3 id=the-root><span class=secno>3.5 </span>The root element</h3>
+  <h3 id=content><span class=secno>3.4 </span>Content models</h3>
 
-  <h4 id=the-html><span class=secno>3.5.1 </span>The <dfn
+  <p>All the elements in this specification have a defined content model,
+   which describes what nodes are allowed inside the elements, and thus what
+   the structure of an HTML document or fragment must look like.
+
+  <p class=note>As noted in the conformance and terminology sections, for the
+   purposes of determining if an element matches its content model or not, <a
+   href="#text-node" title="text node"><code>CDATASection</code> nodes in the
+   DOM are treated as equivalent to <code>Text</code> nodes</a>, and <a
+   href="#entity-references">entity reference nodes are treated as if they
+   were expanded in place</a>.
+
+  <p>The <a href="#space" title="space character">space characters</a> are
+   always allowed between elements. User agents represent these characters
+   between elements in the source markup as text nodes in the
+   DOM.<!-- not a conf criteria since the parser now requires this
+  -->
+   Empty <a href="#text-node" title="text node">text nodes</a> and <a
+   href="#text-node" title="text node">text nodes</a> consisting of just
+   sequences of those characters are considered <dfn
+   id=inter-element>inter-element whitespace</dfn>.
+
+  <p><a href="#inter-element">Inter-element whitespace</a>, comment nodes,
+   and processing instruction nodes must be ignored when establishing whether
+   an element matches its content model or not, and must be ignored when
+   following algorithms that define document and element semantics.
+
+  <p>An element <var title="">A</var> is said to be <dfn id=preceded>preceded
+   or followed</dfn> by a second element <var title="">B</var> if <var
+   title="">A</var> and <var title="">B</var> have the same parent node and
+   there are no other element nodes or text nodes (other than <a
+   href="#inter-element">inter-element whitespace</a>) between them.
+
+  <p>Authors must not use <a href="#elements2">elements in the HTML
+   namespace</a> anywhere except where they are explicitly allowed, as
+   defined for each element, or as explicitly required by other
+   specifications. For XML compound documents, these contexts could be inside
+   elements from other namespaces, if those elements are defined as providing
+   the relevant contexts.
+
+  <div class=example>
+   <p>The SVG specification defines the SVG <code>foreignObject</code>
+    element as allowing foreign namespaces to be included, thus allowing
+    compound documents to be created by inserting subdocument content under
+    that element. <em>This</em> specification defines the XHTML <code><a
+    href="#html">html</a></code> element as being allowed where subdocument
+    fragments are allowed in a compound document. Together, these two
+    definitions mean that placing an XHTML <code><a
+    href="#html">html</a></code> element as a child of an SVG
+    <code>foreignObject</code> element is conforming. <a
+    href="#refsSVG">[SVG]</a></p>
+  </div>
+
+  <div class=example>
+   <p>The Atom specification defines the Atom <code title="">content</code>
+    element, when its <code title="">type</code> attribute has the value
+    <code title="">xhtml</code>, as requiring that it contains a single HTML
+    <code><a href="#div">div</a></code> element. Thus, a <code><a
+    href="#div">div</a></code> element is allowed in that context, even
+    though this is not explicitly normatively stated by this specification.
+    <a href="#refsATOM">[ATOM]</a></p>
+  </div>
+
+  <p>In addition, <a href="#elements2">elements in the HTML namespace</a> may
+   be orphan nodes (i.e. without a parent node).
+
+  <div class=example>
+   <p>For example, creating a <code><a href="#td">td</a></code> element and
+    storing it in a global variable in a script is conforming, even though
+    <code><a href="#td">td</a></code> elements are otherwise only supposed to
+    be used inside <code><a href="#tr">tr</a></code> elements.</p>
+
+   <pre>var data = {
+  name: "Banana",
+  cell: document.createElement('td'), 
+};</pre>
+  </div>
+
+  <h4 id=kinds><span class=secno>3.4.1 </span>Kinds of content</h4>
+
+  <p>Each element in HTML falls into zero or more categories that group
+   elements with similar characteristics together. The following categories
+   are used in this specification:
+
+  <ul class=brief>
+   <li><a href="#metadata0">Metadata content</a>
+
+   <li><a href="#flow-content0">Flow content</a>
+
+   <li><a href="#sectioning0">Sectioning content</a>
+
+   <li><a href="#heading0">Heading content</a>
+
+   <li><a href="#phrasing0">Phrasing content</a>
+
+   <li><a href="#embedded1">Embedded content</a>
+
+   <li><span>Form control content</span>
+
+   <li><a href="#interactive1">Interactive content</a></li>
+   <!--
+   <li><span>Form content</span></li> XXX "Form control elements"
+-->
+  </ul>
+  <!-- XXX xref check that all the above got a section defining them,
+  however briefly -->
+  <!-- XXX check that the element definitions also link to those
+  sections -->
+  <!-- XXX list all the elements for each kind of element in the
+  sections below. -->
+
+  <p>Some elements have unique requirements and do not fit into any
+   particular category.
+
+  <h5 id=metadata><span class=secno>3.4.1.1. </span>Metadata content</h5>
+
+  <p><dfn id=metadata0>Metadata content</dfn> is content that sets up the
+   presentation or behavior of the rest of the content, or that sets up the
+   relationship of the document with other documents, or that conveys other
+   "out of band" information.
+
+  <p>Elements from other namespaces whose semantics are primarily
+   metadata-related (e.g. RDF) are also <a href="#metadata0">metadata
+   content</a>.
+
+  <h5 id=flow-content><span class=secno>3.4.1.2. </span>Flow content</h5>
+
+  <p>Most elements that are used in the body of documents and applications
+   are categorized as <dfn id=flow-content0>flow content</dfn>.
+
+  <p>As a general rule, elements whose content model allows any <a
+   href="#flow-content0">flow content</a> should have either at least one
+   descendant text node that is not <a href="#inter-element">inter-element
+   whitespace</a>, or at least one descendant element node that is <a
+   href="#embedded1">embedded content</a>. For the purposes of this
+   requirement, <code><a href="#del">del</a></code> elements and their
+   descendants must not be counted as contributing to the ancestors of the
+   <code><a href="#del">del</a></code> element.
+
+  <p>This requirement is not a hard requirement, however, as there are many
+   cases where an element can be empty legitimately, for example when it is
+   used as a placeholder which will later be filled in by a script, or when
+   the element is part of a template and would on most pages be filled in but
+   on some pages is not relevant.
+
+  <h5 id=sectioning><span class=secno>3.4.1.3. </span>Sectioning content</h5>
+
+  <p><dfn id=sectioning0>Sectioning content</dfn> is content that defines the
+   scope of <a href="#heading0" title="heading content">headers</a>, <a
+   href="#footer" title=footer>footers</a>, and <a href="#address"
+   title=address>contact information</a>.
+
+  <p>Each <a href="#sectioning0">sectioning content</a> element potentially
+   has a heading. See the section on <a href="#headings0">headings and
+   sections</a> for further details.
+
+  <h5 id=heading><span class=secno>3.4.1.4. </span>Heading content</h5>
+
+  <p><dfn id=heading0>Heading content</dfn> defines the header of a section
+   (whether explicitly marked up using <a href="#sectioning0">sectioning
+   content</a> elements, or implied by the heading content itself).
+
+  <h5 id=phrasing><span class=secno>3.4.1.5. </span>Phrasing content</h5>
+
+  <p><dfn id=phrasing0>Phrasing content</dfn> is the text of the document, as
+   well as elements that mark up that text at the intra-paragraph level. Runs
+   of <a href="#phrasing0">phrasing content</a> form <a href="#paragraph"
+   title=paragraph>paragraphs</a>.
+
+  <p>All <a href="#phrasing0">phrasing content</a> is also <a
+   href="#flow-content0">flow content</a>. Any content model that expects <a
+   href="#flow-content0">flow content</a> also expects <a
+   href="#phrasing0">phrasing content</a>.
+
+  <p>As a general rule, elements whose content model allows any <a
+   href="#phrasing0">phrasing content</a> should have either at least one
+   descendant text node that is not <a href="#inter-element">inter-element
+   whitespace</a>, or at least one descendant element node that is <a
+   href="#embedded1">embedded content</a>. For the purposes of this
+   requirement, nodes that are descendants of <code><a
+   href="#del">del</a></code> elements must not be counted as contributing to
+   the ancestors of the <code><a href="#del">del</a></code> element.
+
+  <p class=note>Most elements that are categorized as phrasing content can
+   only contain elements that are themselves categorized as phrasing content,
+   not any flow content.
+
+  <p>Text nodes that are not <a href="#inter-element">inter-element
+   whitespace</a> are <a href="#phrasing0">phrasing content</a>.
+
+  <h5 id=embedded><span class=secno>3.4.1.6. </span>Embedded content</h5>
+
+  <p><dfn id=embedded1>Embedded content</dfn> is content that imports another
+   resource into the document, or content from another vocabulary that is
+   inserted into the document.
+
+  <p>All <a href="#embedded1">embedded content</a> is also <a
+   href="#phrasing0">phrasing content</a> (and <a href="#flow-content0">flow
+   content</a>). Any content model that expects <a href="#phrasing0">phrasing
+   content</a> (or <a href="#flow-content0">flow content</a>) also expects <a
+   href="#embedded1">embedded content</a>.
+
+  <p>Elements that are from namespaces other than the <a
+   href="#html-namespace0">HTML namespace</a> and that convey content but not
+   metadata, are <a href="#embedded1">embedded content</a> for the purposes
+   of the content models defined in this specification. (For example, MathML,
+   or SVG.)
+
+  <p>Some embedded content elements can have <dfn id=fallback>fallback
+   content</dfn>: content that is to be used when the external resource
+   cannot be used (e.g. because it is of an unsupported format). The element
+   definitions state what the fallback is, if any.
+
+  <h5 id=interactive0><span class=secno>3.4.1.7. </span>Interactive content</h5>
+  <!-- Don't change the above <dfn> or the text below without checking
+  all cross-references. Some of them refer specifically to the
+  activation behavior stuff. -->
+
+  <p class=big-issue>Parts of this section should eventually be moved to DOM3
+   Events.</p>
+  <!-- but see comment above -->
+  <!--
+TESTS:
+http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0A%3Cp%20tabindex%3D1%3Etest%20%3Ca%20href%3D%22%22%3E%20%3Cem%3Etest%3C/em%3E%20%3C/a%3E%0A%3Cscript%3E%0A%20function%20test%20%28e%29%20%7B%20w%28e.type%20+%20%27%20on%20%27%20+%20e.target.tagName%20+%20%27%20through%20%27%20+%20e.currentTarget.tagName%29%3B%20%7D%0A%20document.getElementsByTagName%28%27a%27%29%5B0%5D.addEventListener%28%27click%27%2C%20test%2C%20false%29%3B%0A%20document.getElementsByTagName%28%27a%27%29%5B0%5D.addEventListener%28%27DOMActivate%27%2C%20test%2C%20false%29%3B%0A%20document.getElementsByTagName%28%27p%27%29%5B0%5D.addEventListener%28%27click%27%2C%20test%2C%20false%29%3B%0A%20document.getElementsByTagName%28%27p%27%29%5B0%5D.addEventListener%28%27DOMActivate%27%2C%20test%2C%20false%29%3B%0A%3C/script%3E%0A
+http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0A%3Ca%20href%3Dhttp%3A//google.com/%20target%3Da%3EA%3C/a%3E%3Ca%20href%3Dhttp%3A//yahoo.com/%20target%3Db%3EB%3C/a%3E%3Cbr%3E%0A%3Ciframe%20name%3Da%3E%3C/iframe%3E%3Ciframe%20name%3Db%3E%3C/iframe%3E%0A%3Cscript%3E%0A%20var%20a%20%3D%20document.getElementsByTagName%28%27a%27%29%5B0%5D%3B%0A%20var%20b%20%3D%20document.getElementsByTagName%28%27a%27%29%5B1%5D%3B%0A%20a.appendChild%28b%29%3B%0A%3C/script%3E
+http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0A%3Cform%20action%3D%22http%3A//google.com/%22%20onsubmit%3D%22w%28%27onsubmit%27%29%22%3E%3Cem%3EA%3C/em%3E%3C/form%3E%0A%3Cscript%3E%0Adocument.getElementsByTagName%28%27form%27%29%5B0%5D.attachEvent%28%27onsubmit%27%2C%20function%20%28%29%20%7B%20w%28%27submit%20fired%27%29%20%7D%29%3B%0Adocument.getElementsByTagName%28%27form%27%29%5B0%5D.fireEvent%28%27onsubmit%27%29%3B%0A%3C/script%3E
+http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0A%3Cform%20action%3D%22http%3A//google.com/%22%3EX%3C/form%3E%0A%3Cscript%3E%0Avar%20evt%20%3D%20document.createEvent%28%22Events%22%29%3B%0Aevt.initEvent%28%22submit%22%2C%20true%2C%20true%29%3B%0Adocument.getElementsByTagName%28%27form%27%29%5B0%5D.dispatchEvent%28evt%29%3B%0A%3C/script%3E
+-->
+
+  <p><dfn id=interactive1>Interactive content</dfn> is content that is
+   specifically intended for user interaction.
+
+  <p>Certain elements in HTML can be activated, for instance <code><a
+   href="#a">a</a></code> elements, <code>button</code> elements, or
+   <code>input</code> elements when their <code>type</code> attribute is set
+   to <code>radio</code>. Activation of those elements can happen in various
+   (UA-defined) ways, for instance via the mouse or keyboard.
+
+  <p>When activation is performed via some method other than clicking the
+   pointing device, the default action of the event that triggers the
+   activation must, instead of being activating the element directly, be to
+   <a href="#firing">fire a <code title="">click</code> event</a> on the same
+   element.
+
+  <p>The default action of this <code title=event-click>click</code> event,
+   or of the real <code title=event-click>click</code> event if the element
+   was activated by clicking a pointing device, must be to <span title="fire
+   a DOMActivate event">fire a further <code
+   title=event-DOMActivate>DOMActivate</code> event</span> at the same
+   element, whose own default action is to go through all the elements the
+   <code title=event-DOMActivate>DOMActivate</code> event bubbled through
+   (starting at the target node and going towards the <code>Document</code>
+   node), looking for an element with an <a href="#activation0">activation
+   behavior</a>; the first element, in reverse tree order, to have one, must
+   have its activation behavior executed.
+
+  <p class=note>The above doesn't happen for arbitrary synthetic events
+   dispatched by author script. However, the <code title=dom-click><a
+   href="#click1">click()</a></code> method can be used to make it happen
+   programmatically.
+
+  <p>For certain form controls, this process is complicated further by <a
+   href="http://www.whatwg.org/specs/web-forms/current-work/#the-click">changes
+   that must happen around the click event</a>. <a href="#refsWF2">[WF2]</a></p>
+  <!-- XXX WF2: when this is merged into
+  this spec, update xrefs -->
+
+  <p class=note>Most interactive elements have content models that disallow
+   nesting interactive elements.
+
+  <h4 id=transparent><span class=secno>3.4.2 </span>Transparent content
+   models</h4>
+
+  <p>Some elements are described as <dfn id=transparent0>transparent</dfn>;
+   they have "transparent" as their content model. Some elements are
+   described as <dfn id=semi-transparent>semi-transparent</dfn>; this means
+   that part of their content model is "transparent" but that is not the only
+   part of the content model that must be satisfied.
+
+  <p>When a content model includes a part that is "transparent", those parts
+   must not contain content that would not be conformant if all transparent
+   and semi-transparent elements in the tree were replaced, in their parent
+   element, by the children in the "transparent" part of their content model,
+   retaining order.
+
+  <p>When a transparent or semi-transparent element has no parent, then the
+   part of its content model that is "transparent" must instead be treated as
+   accepting any <a href="#flow-content0">flow content</a>.
+
+  <h3 id=paragraphs><span class=secno>3.5 </span>Paragraphs</h3>
+
+  <p>A <dfn id=paragraph>paragraph</dfn> is typically a block of text with
+   one or more sentences that discuss a particular topic, as in typography,
+   but can also be used for more general thematic grouping. For instance, an
+   address is also a paragraph, as is a part of a form, a byline, or a stanza
+   in a poem.
+
+  <p>Paragraphs in <a href="#flow-content0">flow content</a> are defined
+   relative to what the document looks like without the <code><a
+   href="#ins">ins</a></code> and <code><a href="#del">del</a></code>
+   elements complicating matters. Let <var title="">view</var> be a view of
+   the DOM that replaces all <code><a href="#ins">ins</a></code> and <code><a
+   href="#del">del</a></code> elements in the document with their contents.
+   Then, in <var title="">view</var>, for each run of <a
+   href="#phrasing0">phrasing content</a> uninterrupted by other types of
+   content, in an element that accepts content other than <a
+   href="#phrasing0">phrasing content</a>, let <var title="">first</var> be
+   the first node of the run, and let <var title="">last</var> be the last
+   node of the run. For each run, a paragraph exists in the original DOM from
+   immediately before <var title="">first</var> to immediately after <var
+   title="">last</var>. (Paragraphs can thus span across <code><a
+   href="#ins">ins</a></code> and <code><a href="#del">del</a></code>
+   elements.)
+
+  <p>A <a href="#paragraph">paragraph</a> is also formed by <code><a
+   href="#p">p</a></code> elements.
+
+  <p class=note>The <code><a href="#p">p</a></code> element can be used to
+   wrap individual paragraphs when there would otherwise not be any content
+   other than phrasing content to separate the paragraphs from each other.
+
+  <div class=example>
+   <p>In the following example, there are two paragraphs in a section. There
+    is also a header, which contains phrasing content that is not a
+    paragraph. Note how the comments and <span>intra-element
+    whitespace</span> do not form paragraphs.</p>
+
+   <pre><section>
+  <h1>Example of paragraphs</h1>
+  This is the <em>first</em> paragraph in this example.
+  <p>This is the second.</p>
+  <!-- This is not a paragraph. -->
+</section></pre>
+
+   <p>The following example takes that markup and puts <code><a
+    href="#ins">ins</a></code> and <code><a href="#del">del</a></code>
+    elements around some of the markup to show that the text was changed
+    (though in this case, the changes don't really make much sense,
+    admittedly). Notice how this example has exactly the same paragraphs as
+    the previous one, despite the <code><a href="#ins">ins</a></code> and
+    <code><a href="#del">del</a></code> elements.</p>
+
+   <pre><section>
+  <ins><h1>Example of paragraphs</h1>
+  This is the <em>first</em> paragraph in</ins> this example<del>.
+  <p>This is the second.</p></del>
+  <!-- This is not a paragraph. -->
+</section></pre>
+  </div>
+
+  <h3 id=apis-in><span class=secno>3.6 </span>APIs in HTML documents</h3>
+  <!-- XXX case-sensitivity training required here. -->
+
+  <p>For <a href="#html-">HTML documents</a>, and for <a
+   href="#html-elements">HTML elements</a> in <a href="#html-">HTML
+   documents</a>, certain APIs defined in DOM3 Core become case-insensitive
+   or case-changing, as sometimes defined in DOM3 Core, and as summarized or
+   required below. <a href="#refsDOM3CORE">[DOM3CORE]</a>.
+
+  <p>This does not apply to <a href="#xml-documents">XML documents</a> or to
+   elements that are not in the <a href="#html-namespace0">HTML namespace</a>
+   despite being in <a href="#html-">HTML documents</a>.
+
+  <dl>
+   <dt><code title="">Element.tagName</code>, <code
+    title="">Node.nodeName</code>, and <code title="">Node.localName</code>
+
+   <dd>
+    <p>These attributes return tag names in all uppercase<!-- XXX
+    xref-->
+     and attribute names in all lowercase<!-- XXX xref -->, regardless of the
+     case with which they were created.</p>
+
+   <dt><code title="">Document.createElement()</code>
+
+   <dd>
+    <p>The canonical form of HTML markup is all-lowercase; thus, this method
+     will lowercase<!-- XXX xref --> the argument before creating the
+     requisite element. Also, the element created must be in the <a
+     href="#html-namespace0">HTML namespace</a>.</p>
+
+    <p class=note>This doesn't apply to <code
+     title="">Document.createElementNS()</code>. Thus, it is possible, by
+     passing this last method a tag name in the wrong case, to create an
+     element that claims to have the tag name of an element defined in this
+     specification, but doesn't support its interfaces, because it really has
+     another tag name not accessible from the DOM APIs.</p>
+
+   <dt><code title="">Element.setAttributeNode()</code>
+
+   <dd>
+    <p>When an <code>Attr</code> node is set on an <a href="#html-elements"
+     title="HTML elements">HTML element</a>, it must have its name
+     lowercased<!-- XXX xref --> before the element is affected.</p>
+
+    <p class=note>This doesn't apply to <code
+     title="">Document.setAttributeNodeNS()</code>.</p>
+
+   <dt><code title="">Element.setAttribute()</code>
+
+   <dd>
+    <p>When an attribute is set on an <a href="#html-elements" title="HTML
+     elements">HTML element</a>, the name argument must be
+     lowercased<!-- XXX xref
+    --> before the element is affected.</p>
+
+    <p class=note>This doesn't apply to <code
+     title="">Document.setAttributeNS()</code>.</p>
+
+   <dt><code title="">Document.getElementsByTagName()</code> and <code
+    title="">Element.getElementsByTagName()</code>
+
+   <dd>
+    <p>These methods (but not their namespaced counterparts) must compare the
+     given argument case-insensitively<!-- XXX xref --> when looking at <a
+     href="#html-elements" title="HTML elements">HTML elements</a>, and
+     case-sensitively otherwise.</p>
+
+    <p class=note>Thus, in an <a href="#html-" title="HTML documents">HTML
+     document</a> with nodes in multiple namespaces, these methods will be
+     both case-sensitive and case-insensitive at the same time.</p>
+
+   <dt><code title="">Document.renameNode()</code>
+
+   <dd>
+    <p>If the new namespace is the <a href="#html-namespace0">HTML
+     namespace</a>, then the new qualified name must be lowercased before the
+     rename takes place.<!-- XXX xref --></p>
+  </dl>
+
+  <h3 id=dynamic><span class=secno>3.7 </span><dfn id=dynamic2>Dynamic markup
+   insertion</dfn></h3>
+
+  <p>The <code title=dom-document-write><a
+   href="#document.write">document.write()</a></code> family of methods and
+   the <code title=dom-innerHTML><a href="#innerhtml">innerHTML</a></code>
+   family of DOM attributes enable script authors to dynamically insert
+   markup into the document.
+
+  <p class=issue>bz argues that innerHTML should be called something else on
+   XML documents and XML elements. Is the sanity worth the migration pain?
+
+  <p>Because these APIs interact with the parser, their behavior varies
+   depending on whether they are used with <a href="#html-">HTML
+   documents</a> (and the <a href="#html-0">HTML parser</a>) or XHTML in <a
+   href="#xml-documents">XML documents</a> (and the <span>XML parser</span>).
+   The following table cross-references the various versions of these APIs.
+
+  <table>
+   <thead>
+    <tr>
+     <td>
+
+     <th><dfn id=document.write
+      title=dom-document-write><code>document.write()</code></dfn>
+
+     <th><dfn id=innerhtml title=dom-innerHTML><code>innerHTML</code></dfn>
+
+   <tbody>
+    <tr>
+     <th>For documents that are <a href="#html-">HTML documents</a>
+
+     <td><a href="#document.write..."
+      title=dom-document-write-HTML><code>document.write()</code> in HTML</a>
+
+     <td><a href="#innerhtml0"
+      title=dom-innerHTML-HTML><code>innerHTML</code> in HTML</a>
+
+    <tr>
+     <th>For documents that are <a href="#xml-documents">XML documents</a>
+
+     <td><a href="#document.write0"
+      title=dom-document-write-XML><code>document.write()</code> in XML</a>
+
+     <td><a href="#innerhtml1" title=dom-innerHTML-XML><code>innerHTML</code>
+      in XML</a>
+  </table>
+
+  <p>Regardless of the parsing mode, the <dfn id=document.writeln...
+   title=dom-document-writeln><code>document.writeln(...)</code></dfn> method
+   must call the <code title=dom-document-write><a
+   href="#document.write">document.write()</a></code> method with the same
+   argument(s), and then call the <code title=dom-document-write><a
+   href="#document.write">document.write()</a></code> method with, as its
+   argument, a string consisting of a single line feed character (U+000A).
+
+  <h4 id=controlling><span class=secno>3.7.1 </span>Controlling the input
+   stream</h4>
+
+  <p>The <dfn id=open title=dom-document-open><code>open()</code></dfn>
+   method comes in several variants with different numbers of arguments.
+
+  <p>When called with two or fewer arguments, the method must act as follows:
+
+  <ol>
+   <li>
+    <p>Let <var title="">type</var> be the value of the first argument, if
+     there is one, or "<code>text/html</code>" otherwise.
+
+   <li>
+    <p>Let <var title="">replace</var> be true if there is a second argument
+     and it has the value "replace"<!-- case-insensitive. XXX
+   -->, and
+     false otherwise.
+
+   <li>
+    <p>If the document has an <span>active parser</span><!-- XXX xref
+    -->
+     that isn't a <a href="#script-created">script-created parser</a>, and
+     the <a href="#insertion">insertion point</a> associated with that
+     parser's <a href="#input0">input stream</a> is not undefined (that is,
+     it <em>does</em> point to somewhere in the input stream), then the
+     method does nothing. Abort these steps and return the
+     <code>Document</code> object on which the method was invoked.</p>
+
+    <p class=note>This basically causes <code title=dom-document-open><a
+     href="#open">document.open()</a></code> to be ignored when it's called
+     in an inline script found during the parsing of data sent over the
+     network, while still letting it have an effect when called
+     asynchronously or on a document that is itself being spoon-fed using
+     these APIs.</p>
+
+   <li>
+    <p class=big-issue>onbeforeunload, onunload, reset timers, empty event
+     queue, kill any pending transactions, XMLHttpRequests, etc
+   </li>
+   <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E...%3Ciframe%20src%3D%22document%22%3E%3C%2Fiframe%3E%0A%3Cscript%3Eonload%20%3D%20function%20()%20{%20f%20%3D%20document.getElementsByTagName(%27iframe%27)[0]%3B%20d%20%3D%20f.contentDocument%3B%20}%3C%2Fscript%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22w(d.documentElement.innerHTML)%22%20value%3D%22dump%22%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22d.body.bgColor%3D%27red%27%22%20value%3D%22color%22%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22f.style.border%3D%27lime%20solid%27%22%20value%3D%22color%20frame%22%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22d.open()%3B%20d.write(%27%3Cp%3Etest%3C%2Fp%3E%27)%3B%20d.close()%22%20value%3D%22replace%22%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22d.open()%3B%20d.write(%27%3Cp%3E%3Cscript%3Ei%20%3D%200%3B%20setInterval(%26quot%3Bparent.w(i%2B%2B)%26quot%3B%2C%20500)%3C%2Fscript%3E%3C%2Fp%3E%27)%3B%20d.close()%22%20value%3D%22replace%20with%20timer%22%3E%0A -->
+
+   <li>
+    <p>If the document has an <span>active parser</span><!--XXX
+   xref-->,
+     then stop that parser, and throw away any pending content in the input
+     stream. <span class=big-issue>what about if it doesn't, because it's
+     either like a text/plain, or Atom, or PDF, or XHTML, or image document,
+     or something?</span>
+   </li>
+   <!-- XXX see
+   also innerHTML in HTML -->
+
+   <li>
+    <p>Remove all child nodes of the document.
+
+   <li>
+    <p>Change the <a href="#character1">document's character encoding</a> to
+     UTF-16.
+
+   <li>
+    <p>Create a new <a href="#html-0">HTML parser</a> and associate it with
+     the document. This is a <dfn id=script-created>script-created
+     parser</dfn> (meaning that it can be closed by the <code
+     title=dom-document-open><a href="#open">document.open()</a></code> and
+     <code title=dom-document-close><a
+     href="#close">document.close()</a></code> methods, and that the
+     tokeniser will wait for an explicit call to <code
+     title=dom-document-close><a href="#close">document.close()</a></code>
+     before emitting an end-of-file token).
+
+   <li>Mark the document as being an <a href="#html-" title="HTML
+    documents">HTML document</a> (it might already be so-marked).</li>
+   <!-- text/plain handling -->
+
+   <li>
+    <p>If <var title="">type</var> does not have the value
+     "<code>text/html</code>"<!-- XXX matched how?
+   -->, then act as if the
+     tokeniser had emitted a <code><a href="#pre">pre</a></code> element
+     start tag, then set the <a href="#html-0">HTML parser</a>'s <a
+     href="#tokenisation0">tokenisation</a> stage's <a
+     href="#content3">content model flag</a> to <em>PLAINTEXT</em>.
+
+   <li>
+    <p>If <var title="">replace</var> is false, then:
+
+    <ol>
+     <li>Remove all the entries in the <a href="#browsing1">browsing
+      context</a>'s <a href="#session">session history</a> after the <a
+      href="#current1">current entry</a> in its <code>Document</code>'s
+      <code><a href="#history2">History</a></code> object
+
+     <li>Remove any earlier entries that share the same <code>Document</code>
+
+     <li>Add a new entry just before the last entry that is associated with
+      the text that was parsed by the previous parser associated with the
+      <code>Document</code> object, as well as the state of the document at
+      the start of these steps. (This allows the user to step backwards in
+      the session history to see the page before it was blown away by the
+      <code title=dom-document-open><a
+      href="#open">document.open()</a></code> call.)
+    </ol>
+
+   <li>
+    <p>Finally, set the <a href="#insertion">insertion point</a> to point at
+     just before the end of the <a href="#input0">input stream</a> (which at
+     this point will be empty).
+
+   <li>
+    <p>Return the <code>Document</code> on which the method was invoked.
+  </ol>
+
+  <p class=big-issue>We shouldn't hard-code <code>text/plain</code> there. We
+   should do it some other way, e.g. hand off to the section on
+   content-sniffing and handling of incoming data streams, the part that
+   defines how this all works when stuff comes over the network.</p>
+  <!-- XXX Should we support XML/XHTML as a type to that method? -->
+
+  <p>When called with three or more arguments, the <code
+   title=dom-document-open><a href="#open">open()</a></code> method on the
+   <code><a href="#htmldocument">HTMLDocument</a></code> object must call the
+   <code title=dom-open><a href="#open2">open()</a></code> method on the
+   <code><a href="#window">Window</a></code> interface of the object returned
+   by the <code title=dom-document-defaultView>defaultView</code> attribute
+   of the <code>DocumentView</code> interface of the <code><a
+   href="#htmldocument">HTMLDocument</a></code> object, with the same
+   arguments as the original call to the <code title=dom-document-open><a
+   href="#open">open()</a></code> method, and return whatever that method
+   returned. If the <code title=dom-document-defaultView>defaultView</code>
+   attribute of the <code>DocumentView</code> interface of the <code><a
+   href="#htmldocument">HTMLDocument</a></code> object is null, then the
+   method must raise an <code>INVALID_ACCESS_ERR</code> exception.
+
+  <p>The <dfn id=close title=dom-document-close><code>close()</code></dfn>
+   method must do nothing if there is no <a
+   href="#script-created">script-created parser</a> associated with the
+   document. If there is such a parser, then, when the method is called, the
+   user agent must insert an <a href="#explicit0">explicit "EOF"
+   character</a> at the <a href="#insertion">insertion point</a> of the
+   parser's <a href="#input0">input stream</a>.
+
+  <h4 id=dynamic0><span class=secno>3.7.2 </span>Dynamic markup insertion in
+   HTML</h4>
+
+  <p>In HTML, the <dfn id=document.write...
+   title=dom-document-write-HTML><code>document.write(...)</code></dfn>
+   method must act as follows:
+
+  <ol>
+   <li>
+    <p>If the <a href="#insertion">insertion point</a> is undefined, the
+     <code title=dom-document-open><a href="#open">open()</a></code> method
+     must be called (with no arguments) on the <code
+     title=Document>document</code> object. The <a
+     href="#insertion">insertion point</a> will point at just before the end
+     of the (empty) <a href="#input0">input stream</a>.</p>
+
+   <li>
+    <p>The string consisting of the concatenation of all the arguments to the
+     method must be inserted into the <a href="#input0">input
+     stream</a><!-- XXX xref --> just before the <a
+     href="#insertion">insertion point</a>.</p>
+
+   <li>
+    <p>If there is <a href="#the-script" title="the script that will execute
+     as soon as the parser resumes">a script that will execute as soon as the
+     parser resumes</a>, then the method must now return without further
+     processing of the <a href="#input0">input stream</a>.</p>
+
+   <li>
+    <p>Otherwise, the tokeniser must process the characters that were
+     inserted, one at a time, processing resulting tokens as they are
+     emitted, and stopping when the tokeniser reaches the insertion point or
+     when the processing of the tokeniser is aborted by the tree construction
+     stage (this can happen if a <code><a href="#script1">script</a></code>
+     start tag token is emitted by the tokeniser).
+
+    <p class=note>If the <code title=dom-document-write-HTML><a
+     href="#document.write...">document.write()</a></code> method was called
+     from script executing inline (i.e. executing because the parser parsed a
+     set of <code><a href="#script1">script</a></code> tags), then this is a
+     <a href="#nestedParsing">reentrant invocation of the parser</a>.</p>
+
+   <li>
+    <p>Finally, the method must return.</p>
+  </ol>
+
+  <p>In HTML, the <dfn id=innerhtml0
+   title=dom-innerHTML-HTML><code>innerHTML</code></dfn> DOM attribute of all
+   <code><a href="#htmlelement">HTMLElement</a></code> and <code><a
+   href="#htmldocument">HTMLDocument</a></code> nodes returns a serialization
+   of the node's children using the <span>HTML syntax</span><!-- XXX xref
+  -->.
+   On setting, it replaces the node's children with new nodes that result
+   from parsing the given value. The formal definitions follow.
+
+  <p>On getting, the <code title=dom-innerHTML-HTML><a
+   href="#innerhtml0">innerHTML</a></code> DOM attribute must return the
+   result of running the <a href="#html-fragment">HTML fragment serialization
+   algorithm</a> on the node.
+
+  <p>On setting, if the node is a document, the <code
+   title=dom-innerHTML-HTML><a href="#innerhtml0">innerHTML</a></code> DOM
+   attribute must run the following algorithm:
+
+  <ol>
+   <li>
+    <p>If the document has an <span>active parser</span><!--XXX
+    xref-->,
+     then stop that parser, and throw away any pending content in the input
+     stream. <span class=big-issue>what about if it doesn't, because it's
+     either like a text/plain, or Atom, or PDF, or XHTML, or image document,
+     or something?</span></p>
+    <!-- XXX see
+    also document.open() -->
+
+   <li>
+    <p>Remove the children nodes of the <code>Document</code> whose <code
+     title=dom-innerHTML-HTML><a href="#innerhtml0">innerHTML</a></code>
+     attribute is being set.</p>
+
+   <li>
+    <p>Create a new <a href="#html-0">HTML parser</a>, in its initial state,
+     and associate it with the <code>Document</code> node.</p>
+   </li>
+   <!-- redundant, the document is forcibly already so labeled if we get here
+   <li>
+
+    <p>Mark the <code>Document</code> object as being an <span
+    title="HTML documents">HTML document</span>.</p>
+
+   </li>
+-->
+
+   <li>
+    <p>Place into the <a href="#input0">input stream</a> for the <a
+     href="#html-0">HTML parser</a> just created the string being assigned
+     into the <code title=dom-innerHTML-HTML><a
+     href="#innerhtml0">innerHTML</a></code> attribute.</p>
+
+   <li>
+    <p>Start the parser and let it run until it has consumed all the
+     characters just inserted into the input stream. (The
+     <code>Document</code> node will have been populated with elements and a
+     <code title=event-load><a href="#load0">load</a></code> event will have
+     fired on <a href="#the-body1" title="the body element">its body
+     element</a>.)</p>
+  </ol>
+
+  <p>Otherwise, if the node is an element, then setting the <code
+   title=dom-innerHTML-HTML><a href="#innerhtml0">innerHTML</a></code> DOM
+   attribute must cause the following algorithm to run instead:
+
+  <ol>
+   <li>
+    <p>Invoke the <a href="#html-fragment0">HTML fragment parsing
+     algorithm</a>, with the element whose <code title=dom-innerHTML-HTML><a
+     href="#innerhtml0">innerHTML</a></code> attribute is being set as the
+     <var title="">context</var> element, and the string being assigned into
+     the <code title=dom-innerHTML-HTML><a
+     href="#innerhtml0">innerHTML</a></code> attribute as the <var
+     title="">input</var>. Let <var title="">new children</var> be the result
+     of this algorithm.</p>
+
+   <li>
+    <p>Remove the children of the element whose <code
+     title=dom-innerHTML-HTML><a href="#innerhtml0">innerHTML</a></code>
+     attribute is being set.</p>
+
+   <li>
+    <p>Let <var title="">target document</var> be the <code
+     title="">ownerDocument</code> of the <code>Element</code> node whose
+     <code title=dom-innerHTML-HTML><a
+     href="#innerhtml0">innerHTML</a></code> attribute is being set.</p>
+
+   <li>
+    <p>Set the <code title="">ownerDocument</code> of all the nodes in <var
+     title="">new children</var> to the <var title="">target document</var>.</p>
+
+   <li>
+    <p>Append all the <var title="">new children</var> nodes to the node
+     whose <code title=dom-innerHTML-HTML><a
+     href="#innerhtml0">innerHTML</a></code> attribute is being set,
+     preserving their order.</p>
+  </ol>
+
+  <p class=note><code><a href="#script1">script</a></code> elements inserted
+   using <code title=dom-innerHTML-HTML><a
+   href="#innerhtml0">innerHTML</a></code> do not execute when they are
+   inserted.</p>
+  <!-- XXX must make sure we spec that innerHTML causes mutation
+  events to fire, but document.write() doesn't. (the latter is already
+  req-stated in the parser section, btw) -->
+  <!-- http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/innerhtml.asp -->
+  <!-- http://lxr.mozilla.org/seamonkey/source/content/html/content/src/nsGenericHTMLElement.cpp#879
+       note script execution disabled
+       http://lxr.mozilla.org/seamonkey/source/content/base/src/nsContentUtils.cpp#3308
+       http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/html/HTMLElement.cpp#L295
+       http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/html/HTMLElement.cpp#L242
+       http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/html/HTMLTokenizer.cpp#L1742
+   -->
+
+  <h4 id=dynamic1><span class=secno>3.7.3 </span>Dynamic markup insertion in
+   XML</h4>
+
+  <p>In an XML context, the <dfn id=document.write0
+   title=dom-document-write-XML><code>document.write()</code></dfn> method
+   must raise an <code>INVALID_ACCESS_ERR</code> exception.</p>
+  <!--
+  For XHTML: content must be well-formed. Where does
+  it insert? Immediately after the script that called document.write()?</p>
+  how do we handle async scripts vs sync scripts?
+
+Consider:
+data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ document.write('<foo>Test</foo>'); ]]></script>
+data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ alert('test'); alert(document.write); try { document.write('<foo>Test</foo>'); alert(document.childNodes.length); } catch (e) { alert(e); } ]]></script>
+
+-->
+
+  <p>On the other hand, however, the <dfn id=innerhtml1
+   title=dom-innerHTML-XML><code>innerHTML</code></dfn> attribute is indeed
+   usable in an XML context.
+
+  <p>In an XML context, the <code title=dom-innerHTML-XML><a
+   href="#innerhtml1">innerHTML</a></code> DOM attribute on <code><a
+   href="#htmlelement">HTMLElement</a></code>s must return a string in the
+   form of an <a href="http://www.w3.org/TR/xml/#wf-entities">internal
+   general parsed entity</a>, and on <code><a
+   href="#htmldocument">HTMLDocument</a></code>s must return a string in the
+   form of a <a href="http://www.w3.org/TR/xml/#sec-well-formed">document
+   entity</a>. The string returned must be XML namespace-well-formed and must
+   be an isomorphic serialization of all of that node's child nodes, in
+   document order. User agents may adjust prefixes and namespace declarations
+   in the serialization (and indeed might be forced to do so in some cases to
+   obtain namespace-well-formed XML). For the <code
+   title=dom-innerHTML-XML><a href="#innerhtml1">innerHTML</a></code>
+   attribute on <code><a href="#htmlelement">HTMLElement</a></code> objects,
+   if any of the elements in the serialization are in no namespace, the
+   default namespace in scope for those elements must be explicitly declared
+   as the empty string.<!-- because otherwise round-tripping might break
+  since it'll pick up the surrounding default ns when setting -->
+   (This doesn't apply to the <code title=dom-innerHTML-XML><a
+   href="#innerhtml1">innerHTML</a></code> attribute on <code><a
+   href="#htmldocument">HTMLDocument</a></code> objects.) <a
+   href="#refsXML">[XML]</a> <a href="#refsXMLNS">[XMLNS]</a>
+
+  <p>If any of the following cases are found in the DOM being serialized, the
+   user agent must raise an <code>INVALID_STATE_ERR</code> exception:
+
+  <ul>
+   <li>A <code>Document</code> node with no child element nodes.
+
+   <li>A <code>DocumentType</code> node that has an external subset public
+    identifier or an external subset system identifier that contains both a
+    U+0022 QUOTATION MARK ('"') and a U+0027 APOSTROPHE ("'").
+
+   <li>A node with a prefix or local name containing a U+003A COLON (":").
+
+   <li>An <code>Attr</code> node, <code>Text</code> node,
+    <code>CDATASection</code> node, <code>Comment</code> node, or
+    <code>ProcessingInstruction</code> node whose data contains characters
+    that are not matched by the XML <code title="">Char</code> production. <a
+    href="#refsXML">[XML]</a>
+
+   <li>A <code>CDATASection</code> node whose data contains the string "<code
+    title="">]]></code>".
+
+   <li>A <code>Comment</code> node whose data contains two adjacent U+002D
+    HYPHEN-MINUS (-) characters or ends with such a character.
+
+   <li>A <code>ProcessingInstruction</code> node whose target name is the
+    string "<code title="">xml</code>" (case insensitively)<!--
+   ASCII -->.
+
+   <li>A <code>ProcessingInstruction</code> node whose target name contains a
+    U+003A COLON (":").
+
+   <li>A <code>ProcessingInstruction</code> node whose data contains the
+    string "<code title="">?></code>".
+  </ul>
+
+  <p class=note>These are the only ways to make a DOM unserializable. The DOM
+   enforces all the other XML constraints; for example, trying to set an
+   attribute with a name that contains an equals sign (=) will raised an
+   <code>INVALID_CHARACTER_ERR</code> exception.
+
+  <p>On setting, in an XML context, the <code title=dom-innerHTML-XML><a
+   href="#innerhtml1">innerHTML</a></code> DOM attribute on <code><a
+   href="#htmlelement">HTMLElement</a></code>s and <code><a
+   href="#htmldocument">HTMLDocument</a></code>s must run the following
+   algorithm:
+
+  <ol>
+   <li>
+    <p>The user agent must create a new <span>XML parser</span>.</p>
+
+   <li>
+    <p>If the <code title=dom-innerHTML-XML><a
+     href="#innerhtml1">innerHTML</a></code> attribute is being set on an
+     element, the user agent must <span>feed the parser</span> just created
+     the string corresponding to the start tag of that element, declaring all
+     the namespace prefixes that are in scope on that element in the DOM, as
+     well as declaring the default namespace (if any) that is in scope on
+     that element in the DOM.</p>
+
+   <li>
+    <p>The user agent must <span>feed the parser</span> just created the
+     string being assigned into the <code title=dom-innerHTML-XML><a
+     href="#innerhtml1">innerHTML</a></code> attribute.</p>
+
+   <li>
+    <p>If the <code title=dom-innerHTML-XML><a
+     href="#innerhtml1">innerHTML</a></code> attribute is being set on an
+     element, the user agent must <span>feed the parser</span> the string
+     corresponding to the end tag of that element.</p>
+
+   <li>
+    <p>If the parser found a well-formedness error, the attribute's setter
+     must raise a <code>SYNTAX_ERR</code> exception and abort these steps.</p>
+
+   <li>
+    <p>The user agent must remove the children nodes of the node whose <code
+     title=dom-innerHTML-XML><a href="#innerhtml1">innerHTML</a></code>
+     attribute is being set.</p>
+
+   <li>
+    <p>If the attribute is being set on a <code>Document</code> node, let
+     <var title="">new children</var> be the children of the document,
+     preserving their order. Otherwise, the attribute is being set on an
+     <code>Element</code> node; let <var title="">new children</var> be the
+     children of the document's root element, preserving their order.</p>
+
+   <li>
+    <p>If the attribute is being set on a <code>Document</code> node, let
+     <var title="">target document</var> be that <code>Document</code> node.
+     Otherwise, the attribute is being set on an <code>Element</code> node;
+     let <var title="">target document</var> be the <code
+     title="">ownerDocument</code> of that <code>Element</code>.</p>
+
+   <li>
+    <p>Set the <code title="">ownerDocument</code> of all the nodes in <var
+     title="">new children</var> to the <var title="">target document</var>.</p>
+
+   <li>
+    <p>Append all the <var title="">new children</var> nodes to the node
+     whose <code title=dom-innerHTML-XML><a
+     href="#innerhtml1">innerHTML</a></code> attribute is being set,
+     preserving their order.</p>
+  </ol>
+
+  <p class=note><code><a href="#script1">script</a></code> elements inserted
+   using <code title=dom-innerHTML-XML><a
+   href="#innerhtml1">innerHTML</a></code> do not execute when they are
+   inserted.
+
+  <h2 id=semantics><span class=secno>4. </span>The elements of HTML</h2>
+
+  <h3 id=the-root><span class=secno>4.1 </span>The root element</h3>
+
+  <h4 id=the-html><span class=secno>4.1.1 </span>The <dfn
    id=html><code>html</code></dfn> element</h4>
 
   <dl class=element>
@@ -7311,9 +8348,9 @@
    href="#manifest">manifest</a></code> attributes, as the attributes are
    processed before those elements are seen.
 
-  <h3 id=document><span class=secno>3.6 </span>Document metadata</h3>
+  <h3 id=document><span class=secno>4.2 </span>Document metadata</h3>
 
-  <h4 id=the-head><span class=secno>3.6.1 </span>The <dfn
+  <h4 id=the-head><span class=secno>4.2.1 </span>The <dfn
    id=head><code>head</code></dfn> element</h4>
 
   <dl class=element>
@@ -7343,7 +8380,7 @@
   <p>The <code><a href="#head">head</a></code> element collects the
    document's metadata.
 
-  <h4 id=the-title0><span class=secno>3.6.2 </span>The <dfn
+  <h4 id=the-title0><span class=secno>4.2.2 </span>The <dfn
    id=title1><code>title</code></dfn> element</h4>
 
   <dl class=element>
@@ -7409,7 +8446,7 @@
    agents should use the document's title when referring to the document in
    their user interface.
 
-  <h4 id=the-base><span class=secno>3.6.3 </span>The <dfn
+  <h4 id=the-base><span class=secno>4.2.3 </span>The <dfn
    id=base><code>base</code></dfn> element</h4>
 
   <dl class=element>
@@ -7509,7 +8546,7 @@
    must <a href="#reflect">reflect</a> the content attributes of the same
    name.
 
-  <h4 id=the-link><span class=secno>3.6.4 </span>The <dfn
+  <h4 id=the-link><span class=secno>4.2.4 </span>The <dfn
    id=link><code>link</code></dfn> element</h4>
 
   <dl class=element>
@@ -7710,14 +8747,14 @@
    type.
 
   <p id=concept-link-type-sniffing>If the resource is expected to be an
-   image, user agents may apply the <a href="#content-type6"
+   image, user agents may apply the <a href="#content-type8"
    title="Content-Type sniffing: image">image sniffing rules</a>, with the
    <var title="">official type</var> being the type determined from the
-   resource's <a href="#content-type8" title=Content-Type>Content-Type
+   resource's <a href="#content-type5" title=Content-Type>Content-Type
    metadata</a>, and use the resulting sniffed type of the resource as if it
    was the actual type. Otherwise, if the resource is not expected to be an
    image, or if the user agent opts not to apply those rules, then the user
-   agent must use the resource's <a href="#content-type8"
+   agent must use the resource's <a href="#content-type5"
    title=Content-Type>Content-Type metadata</a> to determine the type of the
    resource. If there is no type metadata, but the external resource link
    type has a default type defined, then the user agent must assume that the
@@ -7744,7 +8781,7 @@
     other type, it would not.</p>
 
    <p>If one the two files was returned without a <a
-    href="#content-type8">Content-Type</a> metadata, or with a syntactically
+    href="#content-type5">Content-Type</a> metadata, or with a syntactically
     incorrect type like <code title="">Content-Type: "null"</code>, then
     the default type for <code title=rel-stylesheet><a
     href="#stylesheet">stylesheet</a></code> links would kick in. Since that
@@ -7814,7 +8851,7 @@
   <!-- that is
   normatively required in the definition of dom-linkstyle-disabled -->
 
-  <h4 id=meta><span class=secno>3.6.5 </span>The <dfn
+  <h4 id=meta><span class=secno>4.2.5 </span>The <dfn
    id=meta0><code>meta</code></dfn> element</h4>
 
   <dl class=element>
@@ -7858,7 +8895,7 @@
    <dd><code title=attr-meta-http-equiv><a
     href="#http-equiv0">http-equiv</a></code>
 
-   <dd><code title=attr-meta-content><a href="#content0">content</a></code>
+   <dd><code title=attr-meta-content><a href="#content1">content</a></code>
 
    <dd><code title=attr-meta-charset><a href="#charset1">charset</a></code>
     (<a href="#html-" title="HTML documents">HTML</a> only)
@@ -7868,7 +8905,7 @@
    <dd>
     <pre
      class=idl>interface <dfn id=htmlmetaelement>HTMLMetaElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
-           attribute DOMString <a href="#content1" title=dom-meta-content>content</a>;
+           attribute DOMString <a href="#content2" title=dom-meta-content>content</a>;
            attribute DOMString <a href="#name0" title=dom-meta-name>name</a>;
            attribute DOMString <a href="#httpequiv" title=dom-meta-httpEquiv>httpEquiv</a>;
 };</pre>
@@ -7899,7 +8936,7 @@
   <p>If either <code title=attr-meta-name><a href="#name">name</a></code> or
    <code title=attr-meta-http-equiv><a
    href="#http-equiv0">http-equiv</a></code> is specified, then the <code
-   title=attr-meta-content><a href="#content0">content</a></code> attribute
+   title=attr-meta-content><a href="#content1">content</a></code> attribute
    must also be specified. Otherwise, it must be omitted.
 
   <p>The <dfn id=charset1 title=attr-meta-charset><code>charset</code></dfn>
@@ -7914,7 +8951,7 @@
    must be the first element in <a href="#the-head0">the <code>head</code>
    element</a> of the file.
 
-  <p>The <dfn id=content0 title=attr-meta-content><code>content</code></dfn>
+  <p>The <dfn id=content1 title=attr-meta-content><code>content</code></dfn>
    attribute gives the value of the document metadata or pragma directive
    when the element is used for those purposes. The allowed values depend on
    the exact context, as described in subsequent sections of this
@@ -7925,12 +8962,12 @@
    metadata. Document metadata is expressed in terms of name/value pairs, the
    <code title=attr-meta-name><a href="#name">name</a></code> attribute on
    the <code><a href="#meta0">meta</a></code> element giving the name, and
-   the <code title=attr-meta-content><a href="#content0">content</a></code>
+   the <code title=attr-meta-content><a href="#content1">content</a></code>
    attribute on the same element giving the value. The name specifies what
    aspect of metadata is being set; valid names and the meaning of their
    values are described in the following sections. If a <code><a
    href="#meta0">meta</a></code> element has no <code
-   title=attr-meta-content><a href="#content0">content</a></code> attribute,
+   title=attr-meta-content><a href="#content1">content</a></code> attribute,
    then the value part of the metadata name/value pair is the empty string.
 
   <p>If a <code><a href="#meta0">meta</a></code> element has the <code
@@ -7945,7 +8982,7 @@
    element.
 
   <p>The DOM attributes <dfn id=name0
-   title=dom-meta-name><code>name</code></dfn> and <dfn id=content1
+   title=dom-meta-name><code>name</code></dfn> and <dfn id=content2
    title=dom-meta-content><code>content</code></dfn> must <a
    href="#reflect">reflect</a> the respective content attributes of the same
    name. The DOM attribute <dfn id=httpequiv
@@ -7953,7 +8990,7 @@
    href="#reflect">reflect</a> the content attribute <code
    title=attr-meta-http-equiv><a href="#http-equiv0">http-equiv</a></code>.
 
-  <h5 id=standard><span class=secno>3.6.5.1. </span>Standard metadata names</h5>
+  <h5 id=standard><span class=secno>4.2.5.1. </span>Standard metadata names</h5>
 
   <p>This specification defines a few names for the <code
    title=attr-meta-name><a href="#name">name</a></code> attribute of the
@@ -7989,7 +9026,7 @@
      pages.
   </dl>
 
-  <h5 id=other><span class=secno>3.6.5.2. </span>Other metadata names</h5>
+  <h5 id=other><span class=secno>4.2.5.2. </span>Other metadata names</h5>
 
   <p><dfn id=extensions title=concept-meta-extensions>Extensions to the
    predefined set of metadata names</dfn> may be registered in the <a
@@ -8073,7 +9110,7 @@
    href="#link">link</a></code> element, not the <code><a
    href="#meta0">meta</a></code> element.
 
-  <h5 id=pragma><span class=secno>3.6.5.3. </span>Pragma directives</h5>
+  <h5 id=pragma><span class=secno>4.2.5.3. </span>Pragma directives</h5>
 
   <p>When the <dfn id=http-equiv
    title=attr-meta-http-equiv><code>http-equiv</code></dfn> attribute is
@@ -8191,7 +9228,7 @@
     <p>For <code><a href="#meta0">meta</a></code> elements in the <a
      href="#encoding" title=attr-meta-http-equiv-content-type>Encoding
      declaration state</a>, the <code title=attr-meta-content><a
-     href="#content0">content</a></code> attribute must have a value that is
+     href="#content1">content</a></code> attribute must have a value that is
      a case-insensitive<!-- ASCII
     XXX--> match of a string that consists
      of the literal string "<code title="">text/html;</code>", optionally
@@ -8238,13 +9275,13 @@
 
      <li>
       <p>If the <code><a href="#meta0">meta</a></code> element has no <code
-       title=attr-meta-content><a href="#content0">content</a></code>
+       title=attr-meta-content><a href="#content1">content</a></code>
        attribute, or if that attribute's value is the empty string, then
        abort these steps.
 
      <li>
       <p>Let <var title="">input</var> be the value of the element's <code
-       title=attr-meta-content><a href="#content0">content</a></code>
+       title=attr-meta-content><a href="#content1">content</a></code>
        attribute.
 
      <li>
@@ -8331,7 +9368,7 @@
 
      <li>
       <p>Resolve the <var title="">url</var> value to an absolute URI using
-       <a href="#elements2" title="element's base URI">the base URI</a> of
+       <a href="#elements3" title="element's base URI">the base URI</a> of
        the <code><a href="#meta0">meta</a></code> element.
 
      <li>
@@ -8364,7 +9401,7 @@
 
     <p>For <code><a href="#meta0">meta</a></code> elements in the <a
      href="#refresh" title=attr-meta-http-equiv-refresh>Refresh state</a>,
-     the <code title=attr-meta-content><a href="#content0">content</a></code>
+     the <code title=attr-meta-content><a href="#content1">content</a></code>
      attribute must have a value consisting either of:
 
     <ul>
@@ -8390,7 +9427,7 @@
   <p>There must not be more than one <code><a href="#meta0">meta</a></code>
    element with any particular state in the document at a time.
 
-  <h5 id=charset><span class=secno>3.6.5.4. </span>Specifying the document's
+  <h5 id=charset><span class=secno>4.2.5.4. </span>Specifying the document's
    character encoding</h5>
   <!-- XXX maybe the rest should move to "writing html" section,
   though if we do then we have to duplicate the requirements in the
@@ -8417,7 +9454,7 @@
   </ul>
 
   <p>If the document does not start with a BOM, and if its encoding is not
-   explicitly given by <a href="#content-type8"
+   explicitly given by <a href="#content-type5"
    title=Content-Type>Content-Type metadata</a>, then the character encoding
    used must be an <a href="#ascii-compatible">ASCII-compatible character
    encoding</a>, and, in addition, if that encoding isn't US-ASCII itself,
@@ -8457,7 +9494,7 @@
   <p>In XHTML, the XML declaration should be used for inline character
    encoding information, if necessary.
 
-  <h4 id=the-style0><span class=secno>3.6.6 </span>The <dfn
+  <h4 id=the-style0><span class=secno>4.2.6 </span>The <dfn
    id=style1><code>style</code></dfn> element</h4>
 
   <dl class=element>
@@ -8603,7 +9640,7 @@
    defined <a href="#disabled1" title=dom-linkstyle-disabled>for the
    alternative style sheets DOM</a>.
 
-  <h4 id=styling><span class=secno>3.6.7 </span><dfn id=styling0
+  <h4 id=styling><span class=secno>4.2.7 </span><dfn id=styling0
    title="styling processing model">Styling</dfn></h4>
 
   <p>The <code><a href="#link">link</a></code> and <code><a
@@ -8645,7 +9682,7 @@
      the <code title=attr-style-type><a href="#type1">type</a></code> content
      attribute's value, or <code title="">text/css</code> if that is omitted.
      For <code><a href="#link">link</a></code> elements, this is the <a
-     href="#content-type8" title=Content-Type>Content-Type metadata of the
+     href="#content-type5" title=Content-Type>Content-Type metadata of the
      specified resource</a>.
 
    <dt>The location (<code title=dom-stylesheet-href>href</code> DOM
@@ -8690,7 +9727,7 @@
   .styleSheets, HTTP Link: headers, and the stuff about the alternative
   stylesheet API.</p> XXX that will all be covered by Anne's spec -->
 
-  <h3 id=sections><span class=secno>3.7 </span>Sections</h3>
+  <h3 id=sections><span class=secno>4.3 </span>Sections</h3>
 
   <p id=applyToSection>Some elements, for example <code><a
    href="#address">address</a></code> elements, are scoped to their nearest
@@ -8701,7 +9738,7 @@
    href="#sectioning0">sectioning content</a> ancestor is <var
    title="">e</var>.
 
-  <h4 id=the-body><span class=secno>3.7.1 </span>The <dfn
+  <h4 id=the-body><span class=secno>4.3.1 </span>The <dfn
    id=body0><code>body</code></dfn> element</h4>
 
   <dl class=element>
@@ -8744,7 +9781,7 @@
    element in the DOM, as per the definition of the term, and not any
    arbitrary <code><a href="#body0">body</a></code> element.
 
-  <h4 id=the-section><span class=secno>3.7.2 </span>The <dfn
+  <h4 id=the-section><span class=secno>4.3.2 </span>The <dfn
    id=section><code>section</code></dfn> element</h4>
 
   <dl class=element>
@@ -8781,7 +9818,7 @@
    site's home page could be split into sections for an introduction, news
    items, contact information.
 
-  <h4 id=the-nav><span class=secno>3.7.3 </span>The <dfn
+  <h4 id=the-nav><span class=secno>4.3.3 </span>The <dfn
    id=nav><code>nav</code></dfn> element</h4>
 
   <dl class=element>
@@ -8849,7 +9886,7 @@
 </body></pre>
   </div>
 
-  <h4 id=the-article><span class=secno>3.7.4 </span>The <dfn
+  <h4 id=the-article><span class=secno>4.3.4 </span>The <dfn
    id=article><code>article</code></dfn> element</h4>
 
   <dl class=element>
@@ -8909,7 +9946,7 @@
    href="#address">address</a></code> element) does not apply to nested
    <code><a href="#article">article</a></code> elements.
 
-  <h4 id=the-aside><span class=secno>3.7.5 </span>The <dfn
+  <h4 id=the-aside><span class=secno>4.3.5 </span>The <dfn
    id=aside><code>aside</code></dfn> element</h4>
 
   <dl class=element>
@@ -8979,7 +10016,7 @@
 ...</pre>
   </div>
 
-  <h4 id=the-h1><span class=secno>3.7.6 </span>The <dfn
+  <h4 id=the-h1><span class=secno>4.3.6 </span>The <dfn
    id=h1><code>h1</code></dfn>, <dfn id=h2><code>h2</code></dfn>, <dfn
    id=h3><code>h3</code></dfn>, <dfn id=h4><code>h4</code></dfn>, <dfn
    id=h5><code>h5</code></dfn>, and <dfn id=h6><code>h6</code></dfn> elements</h4>
@@ -9018,7 +10055,7 @@
    the highest rank, the <code><a href="#h6">h6</a></code> element has the
    lowest rank, and two elements with the same name have equal rank.
 
-  <h4 id=the-header><span class=secno>3.7.7 </span>The <dfn
+  <h4 id=the-header><span class=secno>4.3.7 </span>The <dfn
    id=header><code>header</code></dfn> element</h4>
 
   <dl class=element>
@@ -9117,7 +10154,7 @@
 </header></pre>
   </div>
 
-  <h4 id=the-footer><span class=secno>3.7.8 </span>The <dfn
+  <h4 id=the-footer><span class=secno>4.3.8 </span>The <dfn
    id=footer><code>footer</code></dfn> element</h4>
 
   <dl class=element>
@@ -9175,7 +10212,7 @@
 </body></pre>
   </div>
 
-  <h4 id=the-address><span class=secno>3.7.9 </span>The <dfn
+  <h4 id=the-address><span class=secno>4.3.9 </span>The <dfn
    id=address><code>address</code></dfn> element</h4>
 
   <dl class=element>
@@ -9258,7 +10295,7 @@
    element, does not apply to its ancestor elements, e.g. the page's <code><a
    href="#body0">body</a></code>.
 
-  <h4 id=headings><span class=secno>3.7.10 </span><dfn id=headings0>Headings
+  <h4 id=headings><span class=secno>4.3.10 </span><dfn id=headings0>Headings
    and sections</dfn></h4>
 
   <p>The <code><a href="#h1">h1</a></code>–<code><a
@@ -9370,7 +10407,7 @@
     produce the same outline in compliant user agents.</p>
   </div>
 
-  <h5 id=outlines><span class=secno>3.7.10.1. </span>Creating an outline</h5>
+  <h5 id=outlines><span class=secno>4.3.10.1. </span>Creating an outline</h5>
 
   <p>This section defines an algorithm for creating an outline for a <a
    href="#sectioning0">sectioning content</a> element or a <a
@@ -9705,7 +10742,7 @@
 }</pre>
   </div>
 
-  <h5 id=distinguishing><span class=secno>3.7.10.2. </span>Distinguishing
+  <h5 id=distinguishing><span class=secno>4.3.10.2. </span>Distinguishing
    site-wide headings from page headings</h5>
 
   <p>Given the <a href="#outline">outline</a> of a document, but ignoring any
@@ -9748,10 +10785,10 @@
    original single page becomes the heading of the site, repeated on every
    page.
 
-  <h3 id=grouping><span class=secno>3.8 </span>Grouping content</h3>
+  <h3 id=grouping><span class=secno>4.4 </span>Grouping content</h3>
   <!-- XXX ew, find a better section name -->
 
-  <h4 id=the-p><span class=secno>3.8.1 </span>The <dfn
+  <h4 id=the-p><span class=secno>4.4.1 </span>The <dfn
    id=p><code>p</code></dfn> element</h4>
 
   <dl class=element>
@@ -9833,7 +10870,7 @@
 </section></pre>
   </div>
 
-  <h4 id=the-hr><span class=secno>3.8.2 </span>The <dfn
+  <h4 id=the-hr><span class=secno>4.4.2 </span>The <dfn
    id=hr><code>hr</code></dfn> element</h4>
 
   <dl class=element>
@@ -9863,7 +10900,7 @@
    in a story, or a transition to another topic within a section of a
    reference book.
 
-  <h4 id=the-br><span class=secno>3.8.3 </span>The <dfn
+  <h4 id=the-br><span class=secno>4.4.3 </span>The <dfn
    id=br><code>br</code></dfn> element</h4>
 
   <dl class=element>
@@ -9938,7 +10975,7 @@
   content shouldn't go over the wire, though. We need to make it
   illegal while still defining what it means. Maybe. -->
 
-  <h4 id=the-pre><span class=secno>3.8.4 </span>The <dfn
+  <h4 id=the-pre><span class=secno>4.4.4 </span>The <dfn
    id=pre><code>pre</code></dfn> element</h4>
 
   <dl class=element>
@@ -10044,7 +11081,7 @@
 ~cdr 11dec07</pre></pre>
   </div>
 
-  <h4 id=the-dialog><span class=secno>3.8.5 </span>The <dfn
+  <h4 id=the-dialog><span class=secno>4.4.5 </span>The <dfn
    id=dialog><code>dialog</code></dfn> element</h4>
 
   <dl class=element>
@@ -10111,7 +11148,7 @@
    and <code><a href="#blockquote">blockquote</a></code> elements for other
    ways to cite or quote.
 
-  <h4 id=the-blockquote><span class=secno>3.8.6 </span>The <dfn
+  <h4 id=the-blockquote><span class=secno>4.4.6 </span>The <dfn
    id=blockquote><code>blockquote</code></dfn> element</h4>
 
   <dl class=element>
@@ -10179,7 +11216,7 @@
    href="#blockquote">blockquote</a></code> elements, but with the <code><a
    href="#dialog">dialog</a></code> element.
 
-  <h4 id=the-ol><span class=secno>3.8.7 </span>The <dfn
+  <h4 id=the-ol><span class=secno>4.4.7 </span>The <dfn
    id=ol><code>ol</code></dfn> element</h4>
 
   <dl class=element>
@@ -10295,7 +11332,7 @@
 </ol></pre>
   </div>
 
-  <h4 id=the-ul><span class=secno>3.8.8 </span>The <dfn
+  <h4 id=the-ul><span class=secno>4.4.8 </span>The <dfn
    id=ul><code>ul</code></dfn> element</h4>
 
   <dl class=element>
@@ -10361,7 +11398,7 @@
 </ul></pre>
   </div>
 
-  <h4 id=the-li><span class=secno>3.8.9 </span>The <dfn
+  <h4 id=the-li><span class=secno>4.4.9 </span>The <dfn
    id=li><code>li</code></dfn> element</h4>
 
   <dl class=element>
@@ -10475,7 +11512,7 @@
 </figure></pre>
   </div>
 
-  <h4 id=the-dl><span class=secno>3.8.10 </span>The <dfn
+  <h4 id=the-dl><span class=secno>4.4.10 </span>The <dfn
    id=dl><code>dl</code></dfn> element</h4>
 
   <dl class=element>
@@ -10636,7 +11673,7 @@
    speaker/line pair comes after the next). For an example of how to mark up
    dialogue, see the <code><a href="#dialog">dialog</a></code> element.
 
-  <h4 id=the-dt><span class=secno>3.8.11 </span>The <dfn
+  <h4 id=the-dt><span class=secno>4.4.11 </span>The <dfn
    id=dt><code>dt</code></dfn> element</h4>
 
   <dl class=element>
@@ -10700,7 +11737,7 @@
 </dialog></pre>
    <!-- with thanks to http://bash.org/?854262 --></div>
 
-  <h4 id=the-dd><span class=secno>3.8.12 </span>The <dfn
+  <h4 id=the-dd><span class=secno>4.4.12 </span>The <dfn
    id=dd><code>dd</code></dfn> element</h4>
 
   <dl class=element>
@@ -10736,10 +11773,10 @@
    discourse, or quote, part in a conversation (<code><a
    href="#dialog">dialog</a></code> element).
 
-  <h3 id=text-level><span class=secno>3.9 </span>Text-level semantics</h3>
+  <h3 id=text-level><span class=secno>4.5 </span>Text-level semantics</h3>
   <!-- XXX ew, find a better section name -->
 
-  <h4 id=the-a><span class=secno>3.9.1 </span>The <dfn
+  <h4 id=the-a><span class=secno>4.5.1 </span>The <dfn
    id=a><code>a</code></dfn> element</h4>
 
   <dl class=element>
@@ -10912,7 +11949,7 @@
    href="#reflect">reflect</a> the <code title=attr-hyperlink-rel><a
    href="#rel3">rel</a></code> content attribute.
 
-  <h4 id=the-q><span class=secno>3.9.2 </span>The <dfn
+  <h4 id=the-q><span class=secno>4.5.2 </span>The <dfn
    id=q><code>q</code></dfn> element</h4>
 
   <dl class=element>
@@ -10995,7 +12032,7 @@
    <pre><p>His best argument: <q>I disagree!</q></p></pre>
   </div>
 
-  <h4 id=the-cite><span class=secno>3.9.3 </span>The <dfn
+  <h4 id=the-cite><span class=secno>4.5.3 </span>The <dfn
    id=cite2><code>cite</code></dfn> element</h4>
 
   <dl class=element>
@@ -11121,7 +12158,7 @@
   ...</pre>
   </div>
 
-  <h4 id=the-em><span class=secno>3.9.4 </span>The <dfn
+  <h4 id=the-em><span class=secno>4.5.4 </span>The <dfn
    id=em><code>em</code></dfn> element</h4>
 
   <dl class=element>
@@ -11200,7 +12237,7 @@
 
   -->
 
-  <h4 id=the-strong><span class=secno>3.9.5 </span>The <dfn
+  <h4 id=the-strong><span class=secno>4.5.5 </span>The <dfn
    id=strong><code>strong</code></dfn> element</h4>
 
   <dl class=element>
@@ -11248,7 +12285,7 @@
 ten meters.</strong></strong> You have been warned.</p></pre>
   </div>
 
-  <h4 id=the-small><span class=secno>3.9.6 </span>The <dfn
+  <h4 id=the-small><span class=secno>4.5.6 </span>The <dfn
    id=small><code>small</code></dfn> element</h4>
 
   <dl class=element>
@@ -11308,7 +12345,7 @@
    <pre><p><strong><small>Continued use of this service will result in a kiss.</small></strong></p></pre>
   </div>
 
-  <h4 id=the-mark><span class=secno>3.9.7 </span>The <dfn
+  <h4 id=the-mark><span class=secno>4.5.7 </span>The <dfn
    id=mark><code>mark</code></dfn> element</h4>
 
   <dl class=element>
@@ -11455,7 +12492,7 @@
 wormhole connection.</mark></p></pre>
   </div>
 
-  <h4 id=the-dfn><span class=secno>3.9.8 </span>The <dfn
+  <h4 id=the-dfn><span class=secno>4.5.8 </span>The <dfn
    id=dfn><code>dfn</code></dfn> element</h4>
 
   <dl class=element>
@@ -11552,7 +12589,7 @@
 - mpt
 -->
 
-  <h4 id=the-abbr><span class=secno>3.9.9 </span>The <dfn
+  <h4 id=the-abbr><span class=secno>4.5.9 </span>The <dfn
    id=abbr><code>abbr</code></dfn> element</h4>
 
   <dl class=element>
@@ -11644,7 +12681,7 @@
 <abbr>HTMLWG</abbr>.</p></pre>
   </div>
 
-  <h4 id=the-time><span class=secno>3.9.10 </span>The <dfn
+  <h4 id=the-time><span class=secno>4.5.10 </span>The <dfn
    id=time><code>time</code></dfn> element</h4>
 
   <dl class=element>
@@ -11794,7 +12831,7 @@
    for marking event dates in hCalendar markup. Thus the DOM APIs are likely
    to be used as ways to generate interactive calendar widgets or some such.
 
-  <h4 id=the-progress><span class=secno>3.9.11 </span>The <dfn
+  <h4 id=the-progress><span class=secno>4.5.11 </span>The <dfn
    id=progress><code>progress</code></dfn> element</h4>
 
   <dl class=element>
@@ -11986,7 +13023,7 @@
    attribute must return &#x2212;1. Otherwise, it must return the result of
    dividing the current value by the maximum value.
 
-  <h4 id=the-meter><span class=secno>3.9.12 </span>The <dfn
+  <h4 id=the-meter><span class=secno>4.5.12 </span>The <dfn
    id=meter><code>meter</code></dfn> element</h4>
   <!-- Keep this after <progress> and NOT close to <time> -->
 
@@ -12383,7 +13420,7 @@
 should we make the contents accessible in some way, e.g. as a tooltip?
 -->
 
-  <h4 id=the-code><span class=secno>3.9.13 </span>The <dfn
+  <h4 id=the-code><span class=secno>4.5.13 </span>The <dfn
    id=code><code>code</code></dfn> element</h4>
 
   <dl class=element>
@@ -12450,7 +13487,7 @@
   <p class=note>See the <code><a href="#pre">pre</a></code> element for more
    details.
 
-  <h4 id=the-var><span class=secno>3.9.14 </span>The <dfn
+  <h4 id=the-var><span class=secno>4.5.14 </span>The <dfn
    id=var><code>var</code></dfn> element</h4>
 
   <dl class=element>
@@ -12489,7 +13526,7 @@
 flavours of ice cream to be available for purchase!</p></pre>
   </div>
 
-  <h4 id=the-samp><span class=secno>3.9.15 </span>The <dfn
+  <h4 id=the-samp><span class=secno>4.5.15 </span>The <dfn
    id=samp><code>samp</code></dfn> element</h4>
 
   <dl class=element>
@@ -12539,7 +13576,7 @@
 <samp class="prompt">jdoe at demo:~$</samp> <samp class="cursor">_</samp></samp></pre></pre>
   </div>
 
-  <h4 id=the-kbd><span class=secno>3.9.16 </span>The <dfn
+  <h4 id=the-kbd><span class=secno>4.5.16 </span>The <dfn
    id=kbd><code>kbd</code></dfn> element</h4>
 
   <dl class=element>
@@ -12600,7 +13637,7 @@
 </p></pre>
   </div>
 
-  <h4 id=the-sub><span class=secno>3.9.17 </span>The <dfn
+  <h4 id=the-sub><span class=secno>4.5.17 </span>The <dfn
    id=sub><code>sub</code></dfn> and <dfn id=sup><code>sup</code></dfn>
    elements</h4>
 
@@ -12671,7 +13708,7 @@
    <pre>f(<var>x</var>, <var>n</var>) = log<sub>4</sub><var>x</var><sup><var>n</var></sup></pre>
   </div>
 
-  <h4 id=the-span><span class=secno>3.9.18 </span>The <dfn
+  <h4 id=the-span><span class=secno>4.5.18 </span>The <dfn
    id=span><code>span</code></dfn> element</h4>
 
   <dl class=element>
@@ -12716,7 +13753,7 @@
   </div>
 -->
 
-  <h4 id=the-i><span class=secno>3.9.19 </span>The <dfn
+  <h4 id=the-i><span class=secno>4.5.19 </span>The <dfn
    id=i><code>i</code></dfn> element</h4>
 
   <dl class=element>
@@ -12795,7 +13832,7 @@
    restyled. Thus, it is not the case that content in <code><a
    href="#i">i</a></code> elements will necessarily be italicized.
 
-  <h4 id=the-b><span class=secno>3.9.20 </span>The <dfn
+  <h4 id=the-b><span class=secno>4.5.20 </span>The <dfn
    id=b><code>b</code></dfn> element</h4>
 
   <dl class=element>
@@ -12882,7 +13919,7 @@
    restyled. Thus, it is not the case that content in <code><a
    href="#b">b</a></code> elements will necessarily be boldened.
 
-  <h4 id=the-bdo><span class=secno>3.9.21 </span>The <dfn
+  <h4 id=the-bdo><span class=secno>4.5.21 </span>The <dfn
    id=bdo><code>bdo</code></dfn> element</h4>
 
   <dl class=element>
@@ -12938,7 +13975,7 @@
    <a href="#refsCSS21">[CSS21]</a></p>
   <!-- XXX need examples -->
 
-  <h4 id=the-ruby><span class=secno>3.9.22 </span>The <dfn
+  <h4 id=the-ruby><span class=secno>4.5.22 </span>The <dfn
    id=ruby><code>ruby</code></dfn> element</h4>
 
   <dl class=element>
@@ -12994,7 +14031,7 @@
     rendered in a smaller font above it." src="images/sample-ruby.png"></p>
   </div>
 
-  <h4 id=the-rt><span class=secno>3.9.23 </span>The <dfn
+  <h4 id=the-rt><span class=secno>4.5.23 </span>The <dfn
    id=rt><code>rt</code></dfn> element</h4>
 
   <dl class=element>
@@ -13032,7 +14069,7 @@
    <code><a href="#ruby">ruby</a></code> element represents the same thing as
    its children.
 
-  <h4 id=the-rp><span class=secno>3.9.24 </span>The <dfn
+  <h4 id=the-rp><span class=secno>4.5.24 </span>The <dfn
    id=rp><code>rp</code></dfn> element</h4>
 
   <dl class=element>
@@ -13095,14 +14132,14 @@
     lang=ja>... &#x658e; (&#x3055;&#x3044;) &#x85e4; (&#x3068;&#x3046;) &#x4fe1; (&#x306e;&#x3076;) &#x7537; (&#x304a;) ...</pre>
   </div>
 
-  <h4 id=usage><span class=secno>3.9.25 </span>Usage summary</h4>
+  <h4 id=usage><span class=secno>4.5.25 </span>Usage summary</h4>
 
   <p class=big-issue>We need to summarize the various elements, in particular
    to distinguish b/i/em/strong/var/q/mark/cite.</p>
   <!-- XXX when you do this, also reorder the elements in this section
   to bring the related ones closer together. -->
 
-  <h4 id=footnotes><span class=secno>3.9.26 </span>Footnotes</h4>
+  <h4 id=footnotes><span class=secno>4.5.26 </span>Footnotes</h4>
 
   <p>HTML does not have a dedicated mechanism for marking up footnotes. Here
    are the recommended alternatives.
@@ -13183,12 +14220,12 @@
 </aside></pre>
   </div>
 
-  <h3 id=edits><span class=secno>3.10 </span>Edits</h3>
+  <h3 id=edits><span class=secno>4.6 </span>Edits</h3>
 
   <p>The <code><a href="#ins">ins</a></code> and <code><a
    href="#del">del</a></code> elements represent edits to the document.
 
-  <h4 id=the-ins><span class=secno>3.10.1 </span>The <dfn
+  <h4 id=the-ins><span class=secno>4.6.1 </span>The <dfn
    id=ins><code>ins</code></dfn> element</h4>
 
   <dl class=element>
@@ -13287,7 +14324,7 @@
    something. Can you guess what? -->
    </div>
 
-  <h4 id=the-del><span class=secno>3.10.2 </span>The <dfn
+  <h4 id=the-del><span class=secno>4.6.2 </span>The <dfn
    id=del><code>del</code></dfn> element</h4>
 
   <dl class=element>
@@ -13328,7 +14365,7 @@
   <p><code><a href="#del">del</a></code> elements should not cross <a
    href="#paragraph" title=paragraph>implied paragraph</a> boundaries.
 
-  <h4 id=attributes><span class=secno>3.10.3 </span>Attributes common to
+  <h4 id=attributes><span class=secno>4.6.3 </span>Attributes common to
    <code><a href="#ins">ins</a></code> and <code><a
    href="#del">del</a></code> elements</h4>
 
@@ -13377,7 +14414,7 @@
    DOM attribute must <a href="#reflect">reflect</a> the element's <code
    title="">datetime</code> content attribute.
 
-  <h4 id=edits0><span class=secno>3.10.4 </span>Edits and paragraphs</h4>
+  <h4 id=edits0><span class=secno>4.6.4 </span>Edits and paragraphs</h4>
 
   <p>Since the <code><a href="#ins">ins</a></code> and <code><a
    href="#del">del</a></code> elements do not affect <a href="#paragraph"
@@ -13440,7 +14477,7 @@
    that cross across any <a href="#paragraph" title=paragraph>implied
    paragraphs</a>.
 
-  <h4 id=edits1><span class=secno>3.10.5 </span>Edits and lists</h4>
+  <h4 id=edits1><span class=secno>4.6.5 </span>Edits and lists</h4>
 
   <p>The content models of the <code><a href="#ol">ol</a></code> and <code><a
    href="#ul">ul</a></code> elements do not allow <code><a
@@ -13493,9 +14530,9 @@
 </ul></pre>
   </div>
 
-  <h3 id=embedded0><span class=secno>3.11 </span>Embedded content</h3>
+  <h3 id=embedded0><span class=secno>4.7 </span>Embedded content</h3>
 
-  <h4 id=the-figure><span class=secno>3.11.1 </span>The <dfn
+  <h4 id=the-figure><span class=secno>4.7.1 </span>The <dfn
    id=figure><code>figure</code></dfn> element</h4>
 
   <dl class=element>
@@ -13633,7 +14670,7 @@
 </figure></pre>
   </div>
 
-  <h4 id=the-img><span class=secno>3.11.2 </span>The <dfn
+  <h4 id=the-img><span class=secno>4.7.2 </span>The <dfn
    id=img><code>img</code></dfn> element</h4>
 
   <dl class=element>
@@ -14137,7 +15174,7 @@
    the <code><a href="#img">img</a></code> element.
 
   <p>The remote server's response metadata (e.g. an HTTP 404 status code, or
-   <a href="#content-type8" title=Content-Type>associated Content-Type
+   <a href="#content-type5" title=Content-Type>associated Content-Type
    headers</a>) must be ignored when determining whether the resource
    obtained is a valid image or not.
 
@@ -14281,7 +15318,7 @@
 </article></pre>
   </div>
 
-  <h4 id=the-iframe><span class=secno>3.11.3 </span>The <dfn
+  <h4 id=the-iframe><span class=secno>4.7.3 </span>The <dfn
    id=iframe><code>iframe</code></dfn> element</h4>
 
   <dl class=element>
@@ -14710,7 +15747,7 @@
    title=dom-iframe-seamless><code>seamless</code></dfn> must <a
    href="#reflect">reflect</a> the content attributes of the same name.
 
-  <h4 id=the-embed><span class=secno>3.11.4 </span>The <dfn
+  <h4 id=the-embed><span class=secno>4.7.4 </span>The <dfn
    id=embed><code>embed</code></dfn> element</h4>
 
   <dl class=element>
@@ -14825,7 +15862,7 @@
     title=attr-embed-type><a href="#type4">type</a></code> attribute is the
     <span>content's type</span>.
 
-   <li>Otherwise, if the specified resource has <a href="#content-type8"
+   <li>Otherwise, if the specified resource has <a href="#content-type5"
     title=Content-Type>explicit Content-Type metadata</a>, then that is the
     <span>content's type</span>.
 
@@ -14851,7 +15888,7 @@
    href="#reflect">reflect</a> the respective content attributes of the same
    name.
 
-  <h4 id=the-object><span class=secno>3.11.5 </span>The <dfn
+  <h4 id=the-object><span class=secno>4.7.5 </span>The <dfn
    id=object><code>object</code></dfn> element</h4>
 
   <dl class=element>
@@ -15012,10 +16049,10 @@
         <p>Let the <var title="">resource type</var> be unknown.</p>
 
        <li>
-        <p>If the resource has <a href="#content-type8"
+        <p>If the resource has <a href="#content-type5"
          title=Content-Type>associated Content-Type metadata</a>, then let
          the <var title="">resource type</var> be the type specified in <a
-         href="#content-type8" title=Content-Type>the resource's Content-Type
+         href="#content-type5" title=Content-Type>the resource's Content-Type
          metadata</a>.</p>
 
        <li>
@@ -15087,7 +16124,7 @@
         "<code>image/</code>", and support for images has not been disabled
 
        <dd>
-        <p>Apply the <a href="#content-type6" title="content-type sniffing:
+        <p>Apply the <a href="#content-type8" title="content-type sniffing:
          image">image sniffing</a> rules to determine the type of the image.</p>
 
         <p>The <code><a href="#object">object</a></code> element represents
@@ -15219,7 +16256,7 @@
 </figure></pre>
   </div>
 
-  <h4 id=the-param><span class=secno>3.11.6 </span>The <dfn
+  <h4 id=the-param><span class=secno>4.7.6 </span>The <dfn
    id=param><code>param</code></dfn> element</h4>
 
   <dl class=element>
@@ -15275,7 +16312,7 @@
    href="#reflect">reflect</a> the respective content attributes of the same
    name.
 
-  <h4 id=video><span class=secno>3.11.7 </span>The <dfn
+  <h4 id=video><span class=secno>4.7.7 </span>The <dfn
    id=video1><code>video</code></dfn> element</h4>
 
   <dl class=element>
@@ -15554,7 +16591,7 @@
    experience. So far, browsers seem to be making the controls overlay-only,
    thus somewhat sidestepping the issue.
 
-  <h5 id=video0><span class=secno>3.11.7.1. </span>Video and audio codecs for
+  <h5 id=video0><span class=secno>4.7.7.1. </span>Video and audio codecs for
    <code><a href="#video1">video</a></code> elements</h5>
 
   <p>User agents may support any video and audio codecs and container
@@ -15574,7 +16611,7 @@
   <p class=note>Certain user agents might support no codecs at all, e.g. text
    browsers running over SSH connections.
 
-  <h4 id=audio><span class=secno>3.11.8 </span>The <dfn
+  <h4 id=audio><span class=secno>4.7.8 </span>The <dfn
    id=audio1><code>audio</code></dfn> element</h4>
 
   <dl class=element>
@@ -15670,7 +16707,7 @@
    href="#actively">actively playing</a>, audio must not play for the
    element.
 
-  <h5 id=audio0><span class=secno>3.11.8.1. </span>Audio codecs for <code><a
+  <h5 id=audio0><span class=secno>4.7.8.1. </span>Audio codecs for <code><a
    href="#audio1">audio</a></code> elements</h5>
 
   <p>User agents may support any audio codecs and container formats.
@@ -15680,7 +16717,7 @@
   <!-- XXX mention that this spec doesn't require native support or
   plugin support, either is fine -->
 
-  <h4 id=the-source><span class=secno>3.11.9 </span>The <dfn
+  <h4 id=the-source><span class=secno>4.7.9 </span>The <dfn
    id=source><code>source</code></dfn> element</h4>
 
   <dl class=element>
@@ -15909,7 +16946,7 @@
    href="#reflect">reflect</a> the <code title=attr-source-pixelratio><a
    href="#pixelratio">pixelratio</a></code> content attribute.
 
-  <h4 id=media><span class=secno>3.11.10 </span>Media elements</h4>
+  <h4 id=media><span class=secno>4.7.10 </span>Media elements</h4>
 
   <p><dfn id=media7 title="media element">Media elements</dfn> implement the
    following interface:
@@ -16026,7 +17063,7 @@
    resource</dfn> is used to refer to the complete set of media data, e.g.
    the complete video file, or complete audio file.
 
-  <h5 id=error><span class=secno>3.11.10.1. </span>Error codes</h5>
+  <h5 id=error><span class=secno>4.7.10.1. </span>Error codes</h5>
 
   <p>All <a href="#media7" title="media element">media elements</a> have an
    associated error status, which records the last error the element
@@ -16070,7 +17107,7 @@
     href="#media10">media resource</a>.
   </dl>
 
-  <h5 id=location><span class=secno>3.11.10.2. </span>Location of the media
+  <h5 id=location><span class=secno>4.7.10.2. </span>Location of the media
    resource</h5>
 
   <p>The <dfn id=src7 title=attr-media-src><code>src</code></dfn> content
@@ -16196,7 +17233,7 @@
    href="#empty" title=dom-media-EMPTY>EMPTY</a>, and the address of the <a
    href="#chosen">chosen media resource</a> otherwise.
 
-  <h5 id=network0><span class=secno>3.11.10.3. </span>Network states</h5>
+  <h5 id=network0><span class=secno>4.7.10.3. </span>Network states</h5>
 
   <p>As <a href="#media7" title="media element">media elements</a> interact
    with the network, they go through several states. The <dfn id=networkstate
@@ -16250,7 +17287,7 @@
    the <code title=dom-media-networkState><a
    href="#networkstate">networkState</a></code> attribute changes value.
 
-  <h5 id=loading><span class=secno>3.11.10.4. </span>Loading the media
+  <h5 id=loading><span class=secno>4.7.10.4. </span>Loading the media
    resource</h5>
 
   <p>All <a href="#media7" title="media element">media elements</a> have a
@@ -16692,7 +17729,7 @@
    end up being not included in the range(s) of objects returned by the same
    attributes at a later time.
 
-  <h5 id=offsets><span class=secno>3.11.10.5. </span>Offsets into the media
+  <h5 id=offsets><span class=secno>4.7.10.5. </span>Offsets into the media
    resource</h5>
 
   <p>The <dfn id=duration
@@ -16812,7 +17849,7 @@
    <a href="#reflect">reflect</a> the <code title=attr-media-playcount><a
    href="#playcount">playcount</a></code> content attribute on the <a
    href="#media7">media element</a>. The value must be <a
-   href="#limited1">limited to only positive non-zero numbers</a>.
+   href="#limited0">limited to only positive non-zero numbers</a>.
 
   <p>The <dfn id=currentloop
    title=dom-media-currentLoop><code>currentLoop</code></dfn> attribute must
@@ -16891,7 +17928,7 @@
      end.
   </ol>
 
-  <h5 id=the-ready><span class=secno>3.11.10.6. </span>The ready states</h5>
+  <h5 id=the-ready><span class=secno>4.7.10.6. </span>The ready states</h5>
 
   <p><a href="#media7" title="media element">Media elements</a> have a
    <em>ready state</em>, which describes to what degree they are ready to be
@@ -17054,7 +18091,7 @@
    title=dom-media-autoplay><code>autoplay</code></dfn> DOM attribute must <a
    href="#reflect">reflect</a> the content attribute of the same name.
 
-  <h5 id=playing><span class=secno>3.11.10.7. </span>Playing the media
+  <h5 id=playing><span class=secno>4.7.10.7. </span>Playing the media
    resource</h5>
 
   <p>The <dfn id=paused title=dom-media-paused><code>paused</code></dfn>
@@ -17369,7 +18406,7 @@
    href="#media10">media resource</a>, if any, that the user agent has so far
    rendered, at the time the attribute is evaluated.
 
-  <h5 id=seeking><span class=secno>3.11.10.8. </span>Seeking</h5>
+  <h5 id=seeking><span class=secno>4.7.10.8. </span>Seeking</h5>
 
   <p>The <dfn id=seeking0 title=dom-media-seeking><code>seeking</code></dfn>
    attribute must initially have the value false.
@@ -17497,7 +18534,7 @@
    href="#duration">duration</a></code> attribute's value (which would equal
    the time of the last frame).
 
-  <h5 id=cue-ranges><span class=secno>3.11.10.9. </span>Cue ranges</h5>
+  <h5 id=cue-ranges><span class=secno>4.7.10.9. </span>Cue ranges</h5>
 
   <p><a href="#media7" title="media element">Media elements</a> have a set of
    <dfn id=cue-ranges0 title="cue range">cue ranges</dfn>. Each cue range is
@@ -17655,7 +18692,7 @@
    href="#voidcallback">VoidCallback</a></code> interface is the entry point
    for the callback represented by the object.
 
-  <h5 id=user-interface><span class=secno>3.11.10.10. </span>User interface</h5>
+  <h5 id=user-interface><span class=secno>4.7.10.10. </span>User interface</h5>
 
   <p>The <dfn id=controls
    title=attr-media-controls><code>controls</code></dfn> attribute is a <a
@@ -17721,7 +18758,7 @@
    title=event-volumechange><a href="#volumechange">volumechange</a></code>
    at the <a href="#media7">media element</a>.
 
-  <h5 id=time-ranges><span class=secno>3.11.10.11. </span>Time ranges</h5>
+  <h5 id=time-ranges><span class=secno>4.7.10.11. </span>Time ranges</h5>
 
   <p>Objects implementing the <code><a
    href="#timeranges">TimeRanges</a></code> interface represent a list of
@@ -17773,7 +18810,7 @@
    of <a href="#media7" title="media element">media elements</a> must be the
    same as that element's <a href="#media10">media resource</a>'s timeline.
 
-  <h5 id=byte-ranges><span class=secno>3.11.10.12. </span>Byte ranges</h5>
+  <h5 id=byte-ranges><span class=secno>4.7.10.12. </span>Byte ranges</h5>
 
   <p>Objects implementing the <code><a
    href="#byteranges">ByteRanges</a></code> interface represent a list of
@@ -17822,7 +18859,7 @@
    aren't empty, and don't touch (adjacent ranges are folded into one bigger
    range).
 
-  <h5 id=mediaevents><span class=secno>3.11.10.13. </span>Event summary</h5>
+  <h5 id=mediaevents><span class=secno>4.7.10.13. </span>Event summary</h5>
 
   <p>The following events fire on <a href="#media7" title="media
    element">media elements</a> as part of the processing model described
@@ -18168,7 +19205,7 @@
      <td>
   </table>
 
-  <h5 id=security0><span class=secno>3.11.10.14. </span>Security and privacy
+  <h5 id=security0><span class=secno>4.7.10.14. </span>Security and privacy
    considerations</h5>
 
   <p class=big-issue>Talk about making sure interactive media files (e.g.
@@ -18176,7 +19213,7 @@
    not exposing any sensitive data like metadata from tracks in the media
    files (intranet snooping risk)
 
-  <h4 id=the-canvas><span class=secno>3.11.11 </span>The <dfn
+  <h4 id=the-canvas><span class=secno>4.7.11 </span>The <dfn
    id=canvas><code>canvas</code></dfn> element</h4>
 
   <dl class=element>
@@ -18412,7 +19449,7 @@
    allow authors to more carefully control compression settings, image
    metadata, etc.
 
-  <h5 id=the-2d><span class=secno>3.11.11.1. </span>The 2D context</h5>
+  <h5 id=the-2d><span class=secno>4.7.11.1. </span>The 2D context</h5>
 
   <p>When the <code title=dom-canvas-getContext><a
    href="#getcontext">getContext()</a></code> method of a <code><a
@@ -18585,7 +19622,7 @@
    value of the <code title="">currentColor</code> keyword is fully opaque
    black. <a href="#refsCSS3COLOR">[CSS3COLOR]</a>
 
-  <h6 id=the-canvas0><span class=secno>3.11.11.1.1. </span>The canvas state</h6>
+  <h6 id=the-canvas0><span class=secno>4.7.11.1.1. </span>The canvas state</h6>
 
   <p>Each context maintains a stack of drawing states. <dfn id=drawing0
    title="drawing state">Drawing states</dfn> consist of:
@@ -18657,7 +19694,7 @@
 > But how would it interact with normal calls to ctx.restore()?
   -->
 
-  <h6 id=transformations><span class=secno>3.11.11.1.2. </span><dfn
+  <h6 id=transformations><span class=secno>4.7.11.1.2. </span><dfn
    id=transformations0
    title=dom-context-2d-transformation>Transformations</dfn></h6>
 
@@ -18740,7 +19777,7 @@
    title="">dx</var>, <var title="">dy</var>)</code> method with the same
    arguments.
 
-  <h6 id=compositing><span class=secno>3.11.11.1.3. </span>Compositing</h6>
+  <h6 id=compositing><span class=secno>4.7.11.1.3. </span>Compositing</h6>
 
   <p>All drawing operations are affected by the global compositing
    attributes, <code title=dom-context-2d-globalAlpha><a
@@ -18880,7 +19917,7 @@
    href="#globalcompositeoperation">globalCompositeOperation</a></code>
    attribute must initially have the value <code>source-over</code>.
 
-  <h6 id=colors><span class=secno>3.11.11.1.4. </span>Colors and styles</h6>
+  <h6 id=colors><span class=secno>4.7.11.1.4. </span>Colors and styles</h6>
 
   <p>The <dfn id=strokestyle
    title=dom-context-2d-strokeStyle><code>strokeStyle</code></dfn> attribute
@@ -19160,7 +20197,7 @@
       canvas then using that canvas as the pattern.
   -->
 
-  <h6 id=line-styles><span class=secno>3.11.11.1.5. </span>Line styles</h6>
+  <h6 id=line-styles><span class=secno>4.7.11.1.5. </span>Line styles</h6>
 
   <p>The <dfn id=linewidth
    title=dom-context-2d-lineWidth><code>lineWidth</code></dfn> attribute
@@ -19277,7 +20314,7 @@
 > allowing whatever behavior the graphics library has.)
   -->
 
-  <h6 id=shadows><span class=secno>3.11.11.1.6. </span><dfn
+  <h6 id=shadows><span class=secno>4.7.11.1.6. </span><dfn
    id=shadows0>Shadows</dfn></h6>
 
   <p>All drawing operations are affected by the four global shadow
@@ -19395,7 +20432,7 @@
      part of the drawing model described below.</p>
   </ol>
 
-  <h6 id=simple><span class=secno>3.11.11.1.7. </span>Simple shapes
+  <h6 id=simple><span class=secno>4.7.11.1.7. </span>Simple shapes
    (rectangles)</h6>
 
   <p>There are three methods that immediately draw rectangles to the bitmap.
@@ -19456,7 +20493,7 @@
    will draw a line instead (the path for the outline is just a straight line
    along the non-zero dimension).
 
-  <h6 id=complex><span class=secno>3.11.11.1.8. </span>Complex shapes (paths)</h6>
+  <h6 id=complex><span class=secno>4.7.11.1.8. </span>Complex shapes (paths)</h6>
 
   <p>The context always has a current path. There is only one current path,
    it is not part of the <span title=dom-context-2d->drawing state</span>.
@@ -19721,7 +20758,7 @@
    If either of the arguments is infinite or NaN, then the method must return
    false.
 
-  <h6 id=text><span class=secno>3.11.11.1.9. </span>Text</h6>
+  <h6 id=text><span class=secno>4.7.11.1.9. </span>Text</h6>
   <!-- a v3 feature -->
 
   <p>The <dfn id=font title=dom-context-2d-font><code>font</code></dfn> DOM
@@ -20222,7 +21259,7 @@
    This would be provided in preference to a dedicated way of doing multiline
    layout.
 
-  <h6 id=images><span class=secno>3.11.11.1.10. </span>Images</h6>
+  <h6 id=images><span class=secno>4.7.11.1.10. </span>Images</h6>
 
   <p>To draw images onto the canvas, the <dfn id=drawimage
    title=dom-context-2d-drawImage><code>drawImage</code></dfn> method can be
@@ -20325,7 +21362,7 @@
   of the target element, not the rendered image (e.g. height/width
   attributes don't affect it -->
 
-  <h6 id=pixel><span class=secno>3.11.11.1.11. </span><dfn id=pixel1>Pixel
+  <h6 id=pixel><span class=secno>4.7.11.1.11. </span><dfn id=pixel1>Pixel
    manipulation</dfn></h6>
 
   <p>The <dfn id=createimagedata
@@ -20647,7 +21684,7 @@
 </html></pre>
   </div>
 
-  <h6 id=drawing><span class=secno>3.11.11.1.12. </span>Drawing model</h6>
+  <h6 id=drawing><span class=secno>4.7.11.1.12. </span>Drawing model</h6>
 
   <p>When a shape or image is painted, user agents must follow these steps,
    in the order given (or act as if they do):
@@ -20688,7 +21725,7 @@
   <p class="big-issue">Well, one day.</p>
 -->
 
-  <h5 id=color><span class=secno>3.11.11.2. </span>Color spaces and color
+  <h5 id=color><span class=secno>4.7.11.2. </span>Color spaces and color
    correction</h5>
 
   <p>The <code><a href="#canvas">canvas</a></code> APIs must perform color
@@ -20733,7 +21770,7 @@
    href="#todataurl">toDataURL()</a></code> method to the canvas, given the
    appropriate dimensions, has no visible effect.
 
-  <h5 id=security1><span class=secno>3.11.11.3. </span>Security with <code><a
+  <h5 id=security1><span class=secno>4.7.11.3. </span>Security with <code><a
    href="#canvas">canvas</a></code> elements</h5>
 
   <p><strong>Information leakage</strong> can occur if scripts from one <a
@@ -20817,7 +21854,7 @@
    title=attr-canvas-height><a href="#height0">height</a></code> attributes
    doesn't reset the <i>origin-clean</i> flag.
 
-  <h4 id=the-map><span class=secno>3.11.12 </span>The <dfn
+  <h4 id=the-map><span class=secno>4.7.12 </span>The <dfn
    id=map><code>map</code></dfn> element</h4>
 
   <dl class=element>
@@ -20875,7 +21912,7 @@
    title=dom-map-name><code>name</code></dfn> must <a
    href="#reflect">reflect</a> the content attribute of the same name.
 
-  <h4 id=the-area><span class=secno>3.11.13 </span>The <dfn
+  <h4 id=the-area><span class=secno>4.7.13 </span>The <dfn
    id=area><code>area</code></dfn> element</h4>
 
   <dl class=element>
@@ -21127,14 +22164,14 @@
    title=dom-area-shape><code>shape</code></dfn> must <a
    href="#reflect">reflect</a> the <code title=attr-area-shape><a
    href="#shape">shape</a></code> content attribute, <a
-   href="#limited0">limited to only known values</a>.
+   href="#limited">limited to only known values</a>.
 
   <p>The DOM attribute <dfn id=rellist1
    title=dom-area-rellist><code>relList</code></dfn> must <a
    href="#reflect">reflect</a> the <code title=attr-hyperlink-rel><a
    href="#rel3">rel</a></code> content attribute.
 
-  <h4 id=image-maps><span class=secno>3.11.14 </span>Image maps</h4>
+  <h4 id=image-maps><span class=secno>4.7.14 </span>Image maps</h4>
   <!-- TESTS
   http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0A%3Cimg%20src%3D%22http%3A//hixie.ch/resources/images/smallcats%22%20usemap%3D%23a%20onclick%3Dw%28%27img%27%29%3E%0A%3Cmap%20name%3Da%3E%0A%20%3Carea%20onclick%3Dw%28%271%27%29%20coords%3D%270%25%200%25%20100%25%20100%25%27%20href%3Djavascript%3A%3E%0A%3C/map%3E
   http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0A%3Cbody%20onfocus%3D%22w%28document.activeElement.tagName%29%22%3E%0A%3Cimg%20src%3D%22http%3A//hixie.ch/resources/images/smallcats%22%20usemap%3D%23a%20onclick%3Dw%28%27img%27%29%20onfocus%3D%22w%28document.activeElement.tagName%29%22%3E%0A%3Cimg%20src%3D%22http%3A//hixie.ch/resources/images/sample%22%20usemap%3D%23a%20onclick%3Dw%28%27img%27%29%20onfocus%3D%22w%28document.activeElement.tagName%29%22%3E%0A%3Cmap%20name%3Da%20onfocus%3D%22w%28document.activeElement.tagName%29%22%3E%0A%20%3Carea%20onclick%3Dw%28%271%27%29%20coords%3D%270%200%2050%2050%27%20href%3Djavascript%3A%20onfocus%3D%22w%28document.activeElement.tagName%29%22%3E%0A%3C/map%3E%0A%3Cscript%3E%0A%20var%20x%20%3D%20document.getElementsByTagName%28%27img%27%29%5B0%5D%3B%0A%20x.parentNode.appendChild%28x%29%3B%0A%20document.getElementsByTagName%28%27area%27%29%5B0%5D.focus%28%29%3B%0A%3C/script%3E
@@ -21429,7 +22466,7 @@
    then the user agent must act as if it had rerun the algorithms for image
    maps.
 
-  <h4 id=mathml><span class=secno>3.11.15 </span>MathML</h4>
+  <h4 id=mathml><span class=secno>4.7.15 </span>MathML</h4>
 
   <p>The <code>math</code> element from the <a href="#mathml0">MathML
    namespace</a> falls into the <a href="#embedded1">embedded content</a>
@@ -21454,7 +22491,7 @@
    form, interactive HTML user agents are encouraged to provide a way to
    export any MathML fragment as a namespace-well-formed XML fragment.
 
-  <h4 id=svg><span class=secno>3.11.16 </span>SVG</h4>
+  <h4 id=svg><span class=secno>4.7.16 </span>SVG</h4>
 
   <p>The <code>svg</code> element from the <a href="#svg-namespace">SVG
    namespace</a> falls into the <a href="#embedded1">embedded content</a>
@@ -21464,7 +22501,7 @@
    interactive HTML user agents are encouraged to provide a way to export any
    SVG fragment as a namespace-well-formed XML fragment.
 
-  <h4 id=dimension><span class=secno>3.11.17 </span><dfn
+  <h4 id=dimension><span class=secno>4.7.17 </span><dfn
    id=dimension0>Dimension attributes</dfn></h4>
 
   <p>The <dfn id=width4 title=attr-dim-width><code>width</code></dfn> and
@@ -21503,16 +22540,16 @@
    href="#video1">video</a></code> elements must <a
    href="#reflect">reflect</a> the content attributes of the same name.
 
-  <h3 id=tabular><span class=secno>3.12 </span>Tabular data</h3>
+  <h3 id=tabular><span class=secno>4.8 </span>Tabular data</h3>
 
-  <h4 id=table-intro><span class=secno>3.12.1 </span>Introduction</h4>
+  <h4 id=table-intro><span class=secno>4.8.1 </span>Introduction</h4>
 
   <p><em>This section is non-normative.</em>
 
   <p class=big-issue>...examples, how to write tables accessibly, a brief
    mention of the table model, etc...
 
-  <h4 id=the-table><span class=secno>3.12.2 </span>The <dfn
+  <h4 id=the-table><span class=secno>4.8.2 </span>The <dfn
    id=table><code>table</code></dfn> element</h4>
 
   <dl class=element>
@@ -21812,7 +22849,7 @@
      href="#rows">rows</a></code> collection from its parent.</p>
   </ol>
 
-  <h4 id=the-caption><span class=secno>3.12.3 </span>The <dfn
+  <h4 id=the-caption><span class=secno>4.8.3 </span>The <dfn
    id=caption0><code>caption</code></dfn> element</h4>
 
   <dl class=element>
@@ -21846,7 +22883,7 @@
   <p>The <code><a href="#caption0">caption</a></code> element takes part in
    the <a href="#table0">table model</a>.
 
-  <h4 id=the-colgroup><span class=secno>3.12.4 </span>The <dfn
+  <h4 id=the-colgroup><span class=secno>4.8.4 </span>The <dfn
    id=colgroup><code>colgroup</code></dfn> element</h4>
 
   <dl class=element>
@@ -21897,10 +22934,10 @@
 
   <p>The <dfn id=span1 title=dom-colgroup-span><code>span</code></dfn> DOM
    attribute must <a href="#reflect">reflect</a> the content attribute of the
-   same name. The value must be <a href="#limited1">limited to only positive
+   same name. The value must be <a href="#limited0">limited to only positive
    non-zero numbers</a>.
 
-  <h4 id=the-col><span class=secno>3.12.5 </span>The <dfn
+  <h4 id=the-col><span class=secno>4.8.5 </span>The <dfn
    id=col><code>col</code></dfn> element</h4>
 
   <dl class=element>
@@ -21951,10 +22988,10 @@
 
   <p>The <dfn id=span3 title=dom-col-span><code>span</code></dfn> DOM
    attribute must <a href="#reflect">reflect</a> the content attribute of the
-   same name. The value must be <a href="#limited1">limited to only positive
+   same name. The value must be <a href="#limited0">limited to only positive
    non-zero numbers</a>.
 
-  <h4 id=the-tbody><span class=secno>3.12.6 </span>The <dfn
+  <h4 id=the-tbody><span class=secno>4.8.6 </span>The <dfn
    id=tbody><code>tbody</code></dfn> element</h4>
 
   <dl class=element>
@@ -22042,7 +23079,7 @@
    href="#rows0">rows</a></code> collection, the method must instead raise an
    <code>INDEX_SIZE_ERR</code> exception.
 
-  <h4 id=the-thead><span class=secno>3.12.7 </span>The <dfn
+  <h4 id=the-thead><span class=secno>4.8.7 </span>The <dfn
    id=thead0><code>thead</code></dfn> element</h4>
 
   <dl class=element>
@@ -22085,7 +23122,7 @@
   <p>The <code><a href="#thead0">thead</a></code> element takes part in the
    <a href="#table0">table model</a>.
 
-  <h4 id=the-tfoot><span class=secno>3.12.8 </span>The <dfn
+  <h4 id=the-tfoot><span class=secno>4.8.8 </span>The <dfn
    id=tfoot0><code>tfoot</code></dfn> element</h4>
 
   <dl class=element>
@@ -22137,7 +23174,7 @@
   <p>The <code><a href="#tfoot0">tfoot</a></code> element takes part in the
    <a href="#table0">table model</a>.
 
-  <h4 id=the-tr><span class=secno>3.12.9 </span>The <dfn
+  <h4 id=the-tr><span class=secno>4.8.9 </span>The <dfn
    id=tr><code>tr</code></dfn> element</h4>
 
   <dl class=element>
@@ -22254,7 +23291,7 @@
    href="#cells">cells</a></code> collection, the method must instead raise
    an <code>INDEX_SIZE_ERR</code> exception.
 
-  <h4 id=the-td><span class=secno>3.12.10 </span>The <dfn
+  <h4 id=the-td><span class=secno>4.8.10 </span>The <dfn
    id=td><code>td</code></dfn> element</h4>
 
   <dl class=element>
@@ -22303,7 +23340,7 @@
    href="#table0">table model</a>).
 
   <p>The exact effect of the attribute is described in detail in the <a
-   href="#algorithm3">algorithm for assigning header cells to data cells</a>,
+   href="#algorithm4">algorithm for assigning header cells to data cells</a>,
    which user agents must apply to determine the relationships between data
    cells and header cells.
 
@@ -22316,7 +23353,7 @@
    attribute must <a href="#reflect">reflect</a> the content attribute of the
    same name.
 
-  <h4 id=the-th><span class=secno>3.12.11 </span>The <dfn
+  <h4 id=the-th><span class=secno>4.8.11 </span>The <dfn
    id=th><code>th</code></dfn> element</h4>
 
   <dl class=element>
@@ -22395,7 +23432,7 @@
    attribute's <em>missing value default</em> is the <em>auto</em> state.
 
   <p>The exact effect of these values is described in detail in the <a
-   href="#algorithm3">algorithm for assigning header cells to data cells</a>,
+   href="#algorithm4">algorithm for assigning header cells to data cells</a>,
    which user agents must apply to determine the relationships between data
    cells and header cells.
 
@@ -22408,7 +23445,7 @@
    attribute must <a href="#reflect">reflect</a> the content attribute of the
    same name.
 
-  <h4 id=attributes0><span class=secno>3.12.12 </span>Attributes common to
+  <h4 id=attributes0><span class=secno>4.8.12 </span>Attributes common to
    <code><a href="#td">td</a></code> and <code><a href="#th">th</a></code>
    elements</h4>
 
@@ -22438,7 +23475,7 @@
 
   <p>The <dfn id=colspan0 title=dom-tdth-colSpan><code>colSpan</code></dfn>
    DOM attribute must <a href="#reflect">reflect</a> the content attribute of
-   the same name. The value must be <a href="#limited1">limited to only
+   the same name. The value must be <a href="#limited0">limited to only
    positive non-zero numbers</a>.
 
   <p>The <dfn id=rowspan0 title=dom-tdth-rowSpan><code>rowSpan</code></dfn>
@@ -22454,7 +23491,7 @@
    title=dom-tr-cells><a href="#cells">cells</a></code> collection. If there
    is no such parent element, then the attribute must return 0.
 
-  <h4 id=processing><span class=secno>3.12.13 </span>Processing model</h4>
+  <h4 id=processing><span class=secno>4.8.13 </span>Processing model</h4>
 
   <p>The various table elements and their content attributes together define
    the <dfn id=table0>table model</dfn>.
@@ -22558,7 +23595,7 @@
    represented by <code><a href="#table">table</a></code> elements and their
    descendants. Documents must not have table model errors.
 
-  <h5 id=forming><span class=secno>3.12.13.1. </span>Forming a table</h5>
+  <h5 id=forming><span class=secno>4.8.13.1. </span>Forming a table</h5>
 
   <p>To determine which elements correspond to which slots in a <a
    href="#table1" title=concept-table>table</a> associated with a <code><a
@@ -22800,7 +23837,7 @@
 
    <li>
     <p>If the <var title="">current element</var> is a <code><a
-     href="#tr">tr</a></code>, then run the <a href="#algorithm1">algorithm
+     href="#tr">tr</a></code>, then run the <a href="#algorithm2">algorithm
      for processing rows</a>, <a href="#advanced"
      title=concept-table-advance>advance</a> the <var title="">current
      element</var> to the next child of the <code><a
@@ -22808,7 +23845,7 @@
      <i>rows</i>.</p>
 
    <li>
-    <p>Run the <a href="#algorithm0">algorithm for ending a row group</a>.</p>
+    <p>Run the <a href="#algorithm1">algorithm for ending a row group</a>.</p>
 
    <li>
     <p>If the <var title="">current element</var> is a <code><a
@@ -22825,7 +23862,7 @@
      href="#thead0">thead</a></code> or a <code><a
      href="#tbody">tbody</a></code>.</p>
 
-    <p>Run the <a href="#algorithm">algorithm for processing row groups</a>.</p>
+    <p>Run the <a href="#algorithm0">algorithm for processing row groups</a>.</p>
 
    <li>
     <p><a href="#advanced" title=concept-table-advance>Advance</a> the <var
@@ -22839,7 +23876,7 @@
     <p><i>End</i>: For each <code><a href="#tfoot0">tfoot</a></code> element
      in the list of <var title="">pending <code><a
      href="#tfoot0">tfoot</a></code> elements</var>, in tree order, run the
-     <a href="#algorithm">algorithm for processing row groups</a>.</p>
+     <a href="#algorithm0">algorithm for processing row groups</a>.</p>
 
    <li>
     <p>If there exists a <a href="#row0" title=concept-row>row</a> or <a
@@ -22853,7 +23890,7 @@
     <p>Return <var title="">the table</var>.</p>
   </ol>
 
-  <p>The <dfn id=algorithm>algorithm for processing row groups</dfn>, which
+  <p>The <dfn id=algorithm0>algorithm for processing row groups</dfn>, which
    is invoked by the set of steps above for processing <code><a
    href="#thead0">thead</a></code>, <code><a href="#tbody">tbody</a></code>,
    and <code><a href="#tfoot0">tfoot</a></code> elements, is:
@@ -22866,7 +23903,7 @@
    <li>
     <p>For each <code><a href="#tr">tr</a></code> element that is a child of
      the element being processed, in tree order, run the <a
-     href="#algorithm1">algorithm for processing rows</a>.</p>
+     href="#algorithm2">algorithm for processing rows</a>.</p>
 
    <li> <!-- if we added any rows, make them part of a row group -->
     <p>If <span><var title="">y<sub
@@ -22883,10 +23920,10 @@
      title="">current element</var>.</p>
 
    <li>
-    <p>Run the <a href="#algorithm0">algorithm for ending a row group</a>.</p>
+    <p>Run the <a href="#algorithm1">algorithm for ending a row group</a>.</p>
   </ol>
 
-  <p>The <dfn id=algorithm0>algorithm for ending a row group</dfn>, which is
+  <p>The <dfn id=algorithm1>algorithm for ending a row group</dfn>, which is
    invoked by the set of steps above when starting and ending a block of
    rows, is:
 
@@ -22897,7 +23934,7 @@
 
     <ol>
      <li>
-      <p>Run the <a href="#algorithm2">algorithm for growing downward-growing
+      <p>Run the <a href="#algorithm3">algorithm for growing downward-growing
        cells</a>.</p>
 
      <li>
@@ -22908,7 +23945,7 @@
     <p>Empty the <var title="">list of downward-growing cells</var>.</p>
   </ol>
 
-  <p>The <dfn id=algorithm1>algorithm for processing rows</dfn>, which is
+  <p>The <dfn id=algorithm2>algorithm for processing rows</dfn>, which is
    invoked by the set of steps above for processing <code><a
    href="#tr">tr</a></code> elements, is:
 
@@ -22929,7 +23966,7 @@
      the <code><a href="#tr">tr</a></code> element being processed.</p>
 
    <li>
-    <p>Run the <a href="#algorithm2">algorithm for growing downward-growing
+    <p>Run the <a href="#algorithm3">algorithm for growing downward-growing
      cells</a>.</p>
 
    <li>
@@ -23008,7 +24045,7 @@
      href="#th">th</a></code> element, let this new cell <var
      title="">c</var> be a header cell; otherwise, let it be a data cell. To
      establish what header cells apply to a data cell, use the <a
-     href="#algorithm3">algorithm for assigning header cells to data
+     href="#algorithm4">algorithm for assigning header cells to data
      cells</a> described in the next section.</p>
 
     <p>If any of the slots involved already had a <a href="#cell"
@@ -23043,7 +24080,7 @@
   </ol>
 
   <p>When the algorithms above require the user agent to run the <dfn
-   id=algorithm2>algorithm for growing downward-growing cells</dfn>, the user
+   id=algorithm3>algorithm for growing downward-growing cells</dfn>, the user
    agent must, for each {<var title="">cell</var>, <var title="">cell<sub
    title="">x</sub></var>, <var title="">width</var>} tuple in the <var
    title="">list of downward-growing cells</var>, if any, extend the <a
@@ -23054,11 +24091,11 @@
    title="">x</var> < <var title="">cell<sub
    title="">x</sub></var>+<var title="">width</var></span>.
 
-  <h5 id=header-and-data-cell-semantics><span class=secno>3.12.13.2.
+  <h5 id=header-and-data-cell-semantics><span class=secno>4.8.13.2.
    </span>Forming relationships between data cells and header cells</h5>
 
   <p>Each data cell can be assigned zero or more header cells. The <dfn
-   id=algorithm3>algorithm for assigning header cells to data cells</dfn> is
+   id=algorithm4>algorithm for assigning header cells to data cells</dfn> is
    as follows.
 
   <ol>
@@ -23341,7 +24378,7 @@
    data cells</a> when analyzing data in a <a href="#table1"
    title=concept-table>table</a>.
 
-  <h3 id=forms><span class=secno>3.13 </span>Forms</h3>
+  <h3 id=forms><span class=secno>4.9 </span>Forms</h3>
   <!-- XXX everything in WF2 -->
 
   <p class=big-issue>This section will contain definitions of the
@@ -23352,46 +24389,46 @@
   <!-- From HTML4: BUTTON FIELDSET FORM INPUT LABEL OPTGROUP OPTION
   SELECT TEXTAREA -->
 
-  <h4 id=the-form><span class=secno>3.13.1 </span>The <code>form</code>
+  <h4 id=the-form><span class=secno>4.9.1 </span>The <code>form</code>
    element</h4>
 
-  <h4 id=the-fieldset><span class=secno>3.13.2 </span>The
+  <h4 id=the-fieldset><span class=secno>4.9.2 </span>The
    <code>fieldset</code> element</h4>
 
-  <h4 id=the-input><span class=secno>3.13.3 </span>The <code>input</code>
+  <h4 id=the-input><span class=secno>4.9.3 </span>The <code>input</code>
    element</h4>
 
-  <h4 id=the-button><span class=secno>3.13.4 </span>The <code>button</code>
+  <h4 id=the-button><span class=secno>4.9.4 </span>The <code>button</code>
    element</h4>
 
-  <h4 id=the-label><span class=secno>3.13.5 </span>The <code>label</code>
+  <h4 id=the-label><span class=secno>4.9.5 </span>The <code>label</code>
    element</h4>
 
-  <h4 id=the-select><span class=secno>3.13.6 </span>The <code>select</code>
+  <h4 id=the-select><span class=secno>4.9.6 </span>The <code>select</code>
    element</h4>
 
-  <h4 id=the-datalist><span class=secno>3.13.7 </span>The
+  <h4 id=the-datalist><span class=secno>4.9.7 </span>The
    <code>datalist</code> element</h4>
 
-  <h4 id=the-optgroup><span class=secno>3.13.8 </span>The
+  <h4 id=the-optgroup><span class=secno>4.9.8 </span>The
    <code>optgroup</code> element</h4>
 
-  <h4 id=the-option><span class=secno>3.13.9 </span>The <code>option</code>
+  <h4 id=the-option><span class=secno>4.9.9 </span>The <code>option</code>
    element</h4>
 
-  <h4 id=the-textarea><span class=secno>3.13.10 </span>The
+  <h4 id=the-textarea><span class=secno>4.9.10 </span>The
    <code>textarea</code> element</h4>
 
-  <h4 id=the-output><span class=secno>3.13.11 </span>The <code>output</code>
+  <h4 id=the-output><span class=secno>4.9.11 </span>The <code>output</code>
    element</h4>
 
-  <h4 id=processing0><span class=secno>3.13.12 </span>Processing model</h4>
+  <h4 id=processing0><span class=secno>4.9.12 </span>Processing model</h4>
 
   <p class=big-issue>See <a
    href="http://www.whatwg.org/specs/web-forms/current-work/#extend-form-controls">WF2</a>
    for now
 
-  <h5 id=form-submission><span class=secno>3.13.12.1. </span>Form submission</h5>
+  <h5 id=form-submission><span class=secno>4.9.12.1. </span>Form submission</h5>
 
   <p class=big-issue>See <a
    href="http://www.whatwg.org/specs/web-forms/current-work/#form-submission">WF2</a>
@@ -23401,7 +24438,7 @@
    context whose <a href="#sandboxed3">sandboxed forms browsing context
    flag</a> is set, it must not be submitted.
 
-  <h3 id=scripting0><span class=secno>3.14 </span>Scripting</h3>
+  <h3 id=scripting0><span class=secno>4.10 </span>Scripting</h3>
 
   <p>Scripts allow authors to add interactivity to their documents.
 
@@ -23424,7 +24461,7 @@
     without scripts by requesting the sorted table from the server.</p>
   </div>
 
-  <h4 id=script><span class=secno>3.14.1 </span>The <dfn
+  <h4 id=script><span class=secno>4.10.1 </span>The <dfn
    id=script1><code>script</code></dfn> element</h4>
 
   <dl class=element>
@@ -23842,7 +24879,7 @@
         <p>The file must be interpreted using the character encoding given by
          <var><a href="#the-scripts0">the script's character
          encoding</a></var>, regardless of any metadata given by the file's
-         <a href="#content-type8" title=Content-Type>Content-Type
+         <a href="#content-type5" title=Content-Type>Content-Type
          metadata</a>.</p>
 
         <p class=big-issue>This means that a UTF-16 document will always
@@ -23905,7 +24942,7 @@
    way as the <code><a href="#textcontent">textContent</a></code> DOM
    attribute.
 
-  <h5 id=scriptingLanguages><span class=secno>3.14.1.1. </span>Scripting
+  <h5 id=scriptingLanguages><span class=secno>4.10.1.1. </span>Scripting
    languages</h5>
 
   <p>A user agent is said to <dfn id=support>support the scripting
@@ -23936,7 +24973,7 @@
    XXX we should reference #refsRFC4329 http://www.ietf.org/rfc/rfc4329
   -->
 
-  <h4 id=the-noscript><span class=secno>3.14.2 </span>The <dfn
+  <h4 id=the-noscript><span class=secno>4.10.2 </span>The <dfn
    id=noscript><code>noscript</code></dfn> element</h4>
 
   <dl class=element>
@@ -24097,7 +25134,7 @@
    that will have <code title=dom-document-designMode><a
    href="#designMode">designMode</a></code> enabled.
 
-  <h4 id=the-event-source><span class=secno>3.14.3 </span>The <dfn
+  <h4 id=the-event-source><span class=secno>4.10.3 </span>The <dfn
    id=event-source><code>event-source</code></dfn> element</h4>
 
   <dl class=element>
@@ -24187,10 +25224,10 @@
    attribute must <a href="#reflect">reflect</a> the content attribute of the
    same name.
 
-  <h3 id=interactive-elements><span class=secno>3.15 </span>Interactive
+  <h3 id=interactive-elements><span class=secno>4.11 </span>Interactive
    elements</h3>
 
-  <h4 id=the-details><span class=secno>3.15.1 </span>The <dfn
+  <h4 id=the-details><span class=secno>4.11.1 </span>The <dfn
    id=details><code>details</code></dfn> element</h4>
 
   <dl class=element>
@@ -24267,7 +25304,7 @@
    reflecting state has been a pain in the neck before. But is it
    semantically ok?
 
-  <h4 id=datagrid><span class=secno>3.15.2 </span>The <dfn
+  <h4 id=datagrid><span class=secno>4.11.2 </span>The <dfn
    id=datagrid0><code>datagrid</code></dfn> element</h4>
 
   <dl class=element>
@@ -24360,7 +25397,7 @@
    <code title=attr-datagrid-disabled><a
    href="#disabled3">disabled</a></code> content attributes respectively.
 
-  <h5 id=the-datagrid><span class=secno>3.15.2.1. </span>The <code><a
+  <h5 id=the-datagrid><span class=secno>4.11.2.1. </span>The <code><a
    href="#datagrid0">datagrid</a></code> data model</h5>
 
   <p><em>This section is non-normative.</em>
@@ -24407,7 +25444,7 @@
    scripted data providers.</p>
   <!-- XXX check xrefs -->
 
-  <h5 id=how-rows><span class=secno>3.15.2.2. </span>How rows are identified</h5>
+  <h5 id=how-rows><span class=secno>4.11.2.2. </span>How rows are identified</h5>
 
   <p>The chains of numbers that give a row's path, or identifier, are
    represented by objects that implement the <a
@@ -24439,7 +25476,7 @@
    href="#getchildatposition">GetChildAtPosition()</a></code> methods ever
    get called with the empty path.
 
-  <h5 id=the-data><span class=secno>3.15.2.3. </span>The data provider
+  <h5 id=the-data><span class=secno>4.11.2.3. </span>The data provider
    interface</h5>
 
   <p><em>The conformance criteria in this section apply to any implementation
@@ -24907,7 +25944,7 @@
 -->
   </table>
 
-  <h5 id=the-default><span class=secno>3.15.2.4. </span>The default data
+  <h5 id=the-default><span class=secno>4.11.2.4. </span>The default data
    provider</h5>
 
   <p>The user agent must supply a default data provider for the case where
@@ -25411,7 +26448,7 @@
      <code><a href="#datagrid0">datagrid</a></code>.</p>
   </dl>
 
-  <h6 id=commonDefaultDataGridMethodDefinitions><span class=secno>3.15.2.4.1.
+  <h6 id=commonDefaultDataGridMethodDefinitions><span class=secno>4.11.2.4.1.
    </span>Common default data provider method definitions for cells</h6>
 
   <p>These definitions are used for the cell-specific methods of the default
@@ -25552,7 +26589,7 @@
   </dl>
   <!-- XXX Calculated cells, like in spreadsheets? -->
 
-  <h5 id=populating><span class=secno>3.15.2.5. </span>Populating the
+  <h5 id=populating><span class=secno>4.11.2.5. </span>Populating the
    <code><a href="#datagrid0">datagrid</a></code> element</h5>
 
   <p>A <code><a href="#datagrid0">datagrid</a></code> must be disabled until
@@ -25837,7 +26874,7 @@
     href="#rowspecification">RowSpecification</a></code> object representing
     the row in question. The return value is a string representing a valid
     URI (or IRI) to an image. Relative URIs must be interpreted relative to
-    the <code><a href="#datagrid0">datagrid</a></code>'s <a href="#elements2"
+    the <code><a href="#datagrid0">datagrid</a></code>'s <a href="#elements3"
     title="element's base URI">base URI</a>. If the method returns the empty
     string, null, or if the method is not defined, then the row has no
     associated image.
@@ -26000,7 +27037,7 @@
   <!-- XXX speaking of which, do we actually want that
   limitation? -->
 
-  <h5 id=updating><span class=secno>3.15.2.6. </span>Updating the <code><a
+  <h5 id=updating><span class=secno>4.11.2.6. </span>Updating the <code><a
    href="#datagrid0">datagrid</a></code></h5>
 
   <p>Whenever the <code title=dom-datagrid-data><a
@@ -26080,7 +27117,7 @@
    href="#inconsistentDataProvider">likely to result in inconsistent
    renderings</a>, and the user agent is likely to disable the data grid.
 
-  <h5 id=requirements><span class=secno>3.15.2.7. </span>Requirements for
+  <h5 id=requirements><span class=secno>4.11.2.7. </span>Requirements for
    interactive user agents</h5>
 
   <p><em>This section only applies to interactive user agents.</em>
@@ -26149,7 +27186,7 @@
    provider's method was invoked.</p>
   <!-- XXXPA <p class="big-issue">define actions (performAction(), etc)</p> -->
 
-  <h5 id=the-selection><span class=secno>3.15.2.8. </span>The selection</h5>
+  <h5 id=the-selection><span class=secno>4.11.2.8. </span>The selection</h5>
 
   <p><em>This section only applies to interactive user agents. For other user
    agents, the <code title=dom-datagrid-selection><a
@@ -26275,7 +27312,7 @@
    relation to the <code><a href="#selection1">Selection</a></code>
    interface.
 
-  <h5 id=columns><span class=secno>3.15.2.9. </span>Columns and captions</h5>
+  <h5 id=columns><span class=secno>4.11.2.9. </span>Columns and captions</h5>
 
   <p><em>This section only applies to interactive user agents.</em>
 
@@ -26327,7 +27364,7 @@
   <p class="big-issue">define drag and drop in datagrids; selectiondraggable, etc.</p>
 -->
 
-  <h4 id=the-command><span class=secno>3.15.3 </span>The <dfn
+  <h4 id=the-command><span class=secno>4.11.3 </span>The <dfn
    id=command0><code>command</code></dfn> element</h4>
 
   <dl class=element>
@@ -26540,7 +27577,7 @@
   <p class=note><code><a href="#command0">command</a></code> elements are not
    rendered unless they <a href="#menu" title=menu>form part of a menu</a>.
 
-  <h4 id=menus><span class=secno>3.15.4 </span>The <dfn
+  <h4 id=menus><span class=secno>4.11.4 </span>The <dfn
    id=menu><code>menu</code></dfn> element</h4>
 
   <dl class=element>
@@ -26649,7 +27686,7 @@
    the UA must invoke the <code title=dom-form-submit>submit()</code> method
    of the <code>form</code> element indicated by that DOM attribute.
 
-  <h5 id=menus-intro><span class=secno>3.15.4.1. </span>Introduction</h5>
+  <h5 id=menus-intro><span class=secno>4.11.4.1. </span>Introduction</h5>
 
   <p><em>This section is non-normative.</em>
 
@@ -26747,7 +27784,7 @@
 
 -->
 
-  <h5 id=building><span class=secno>3.15.4.2. </span><dfn
+  <h5 id=building><span class=secno>4.11.4.2. </span><dfn
    id=building0>Building menus and tool bars</dfn></h5>
 
   <p>A menu (or tool bar) consists of a list of zero or more of the following
@@ -26836,7 +27873,7 @@
    <li>Any separator at the start or end of the menu must be removed.
   </ol>
 
-  <h5 id=context><span class=secno>3.15.4.3. </span><dfn id=context2>Context
+  <h5 id=context><span class=secno>4.11.4.3. </span><dfn id=context2>Context
    menus</dfn></h5>
 
   <p>The <dfn id=contextmenu
@@ -26907,7 +27944,7 @@
    href="#reflect">reflect</a> the <code title=attr-contextmenu><a
    href="#contextmenu">contextmenu</a></code> content attribute.
 
-  <h5 id=toolbars><span class=secno>3.15.4.4. </span>Toolbars</h5>
+  <h5 id=toolbars><span class=secno>4.11.4.4. </span>Toolbars</h5>
 
   <p><dfn id=toolbars0>Toolbars</dfn> are a kind of menu that is always
    visible.
@@ -26924,7 +27961,7 @@
   <p>The user agent must reflect changes made to the <code><a
    href="#menu">menu</a></code>'s DOM immediately in the UI.
 
-  <h4 id=commands><span class=secno>3.15.5 </span>Commands</h4>
+  <h4 id=commands><span class=secno>4.11.5 </span>Commands</h4>
 
   <p>A <dfn id=command1 title=concept-command>command</dfn> is the
    abstraction behind menu items, buttons, and links. Once a command is
@@ -27137,7 +28174,7 @@
    href="#using7">option</a></code>, <code title=command-element><a
    href="#command3">command</a></code>.
 
-  <h5 id=using><span class=secno>3.15.5.1. </span><dfn id=using4
+  <h5 id=using><span class=secno>4.11.5.1. </span><dfn id=using4
    title=a-command>Using the <code>a</code> element to define a command</dfn></h5>
 
   <p>An <code><a href="#a">a</a></code> element with an <code
@@ -27176,7 +28213,7 @@
    from the element's <code>src</code> attribute. <!--If it is
   an <code>object</code> element then the URI is taken from the
   <code>data</code> attribute. -->
-   Relative URIs must be resolved relative to the <a href="#elements2"
+   Relative URIs must be resolved relative to the <a href="#elements3"
    title="element's base URI">base URI</a> of the image element.
    <!-- If it is an <code>svg</code> element then
   the URI is formed by taking the URI of the document and appending a
@@ -27195,7 +28232,7 @@
    command is to <a href="#firing" title="fire a click event">fire a <code
    title="">click</code> event</a> at the element.
 
-  <h5 id=using0><span class=secno>3.15.5.2. </span><dfn id=using5
+  <h5 id=using0><span class=secno>4.11.5.2. </span><dfn id=using5
    title=button-command>Using the <code>button</code> element to define a
    command</dfn></h5>
 
@@ -27221,7 +28258,7 @@
    <code>move-up</code> button type is disabled when it would have no
    effect).
 
-  <h5 id=using1><span class=secno>3.15.5.3. </span><dfn id=using6
+  <h5 id=using1><span class=secno>4.11.5.3. </span><dfn id=using6
    title=input-command>Using the <code>input</code> element to define a
    command</dfn></h5>
 
@@ -27294,7 +28331,7 @@
   is probably wrong for radio and checkbox types, depending on how we
   define <input>. -->
 
-  <h5 id=using2><span class=secno>3.15.5.4. </span><dfn id=using7
+  <h5 id=using2><span class=secno>4.11.5.4. </span><dfn id=using7
    title=option-command>Using the <code>option</code> element to define a
    command</dfn></h5>
 
@@ -27354,7 +28391,7 @@
    <code>select</code> element (if there is one), as if the selection had
    been changed directly.
 
-  <h5 id=using3><span class=secno>3.15.5.5. </span>Using the <dfn id=command3
+  <h5 id=using3><span class=secno>4.11.5.5. </span>Using the <dfn id=command3
    title=command-element><code>command</code></dfn> element to define a
    command</h5>
 
@@ -27386,7 +28423,7 @@
   <p>The <a href="#icon1" title=command-facet-Icon>Icon</a> for the command
    is the absolute URI resulting from resolving the value of the element's
    <code title=attr-command-icon><a href="#icon">icon</a></code> attribute as
-   a URI relative to the <a href="#elements2">element's base URI</a>. If the
+   a URI relative to the <a href="#elements3">element's base URI</a>. If the
    element has no <code title=attr-command-icon><a
    href="#icon">icon</a></code> attribute then the command has no <a
    href="#icon1" title=command-facet-Icon>Icon</a>.
@@ -27415,15 +28452,15 @@
   <!-- XXX update to
   point to dom-click when we remove dom-command-click -->
 
-  <h3 id=datatemplate><span class=secno>3.16 </span>Data Templates</h3>
+  <h3 id=datatemplate><span class=secno>4.12 </span>Data Templates</h3>
 
-  <h4 id=introduction0><span class=secno>3.16.1 </span>Introduction</h4>
+  <h4 id=introduction0><span class=secno>4.12.1 </span>Introduction</h4>
 
   <p><em>This section is non-normative.</em>
 
   <p class=big-issue>...examples...
 
-  <h4 id=the-datatemplate><span class=secno>3.16.2 </span>The <dfn
+  <h4 id=the-datatemplate><span class=secno>4.12.2 </span>The <dfn
    id=datatemplate0><code>datatemplate</code></dfn> element</h4>
 
   <dl class=element>
@@ -27459,7 +28496,7 @@
    brings together the various rules that form a data template. The element
    doesn't itself do anything exciting.
 
-  <h4 id=the-rule><span class=secno>3.16.3 </span>The <dfn
+  <h4 id=the-rule><span class=secno>4.12.3 </span>The <dfn
    id=rule><code>rule</code></dfn> element</h4>
 
   <dl class=element>
@@ -27536,7 +28573,7 @@
    attributes must <a href="#reflect">reflect</a> the <code
    title=attr-rule-mode><a href="#mode">mode</a></code> content attribute.
 
-  <h4 id=the-nest><span class=secno>3.16.4 </span>The <dfn
+  <h4 id=the-nest><span class=secno>4.12.4 </span>The <dfn
    id=nest><code>nest</code></dfn> element</h4>
 
   <dl class=element>
@@ -27599,7 +28636,7 @@
    attribute must <a href="#reflect">reflect</a> the <code
    title=attr-nest-mode><a href="#mode1">mode</a></code> content attribute.
 
-  <h4 id=global0><span class=secno>3.16.5 </span>Global attributes for data
+  <h4 id=global0><span class=secno>4.12.5 </span>Global attributes for data
    templates</h4>
   <!-- authoring side, with DOM reflections -->
 
@@ -27656,10 +28693,10 @@
    title=attr-registrationmark><a
    href="#registrationmark">registrationmark</a></code> content attribute.
 
-  <h4 id=processing1><span class=secno>3.16.6 </span>Processing model</h4>
+  <h4 id=processing1><span class=secno>4.12.6 </span>Processing model</h4>
   <!-- ua side -->
 
-  <h5 id=the-originalcontent><span class=secno>3.16.6.1. </span>The <code
+  <h5 id=the-originalcontent><span class=secno>4.12.6.1. </span>The <code
    title=dom-originalContent><a
    href="#originalcontent">originalContent</a></code> DOM attribute</h5>
 
@@ -27677,7 +28714,7 @@
    just as the <code title=dom-templateElement><a
    href="#templateelement">templateElement</a></code> DOM attribute can.
 
-  <h5 id=the-template><span class=secno>3.16.6.2. </span>The <code
+  <h5 id=the-template><span class=secno>4.12.6.2. </span>The <code
    title=attr-template><a href="#template">template</a></code> attribute</h5>
   <!-- XXXURL apply algorithms -->
 
@@ -27804,7 +28841,7 @@
    <code><a href="#datatemplate0">datatemplate</a></code> element. Initially,
    the attribute must have the value null.
 
-  <h5 id=the-ref><span class=secno>3.16.6.3. </span>The <code
+  <h5 id=the-ref><span class=secno>4.12.6.3. </span>The <code
    title=attr-ref><a href="#ref">ref</a></code> attribute</h5>
   <!-- XXXURL apply algorithms -->
 
@@ -27894,7 +28931,7 @@
    that is also null, in which case no template is currently being applied.
    Initially, the attribute must have the value null.
 
-  <h5 id=the-nodedatatemplate><span class=secno>3.16.6.4. </span>The <code><a
+  <h5 id=the-nodedatatemplate><span class=secno>4.12.6.4. </span>The <code><a
    href="#nodedatatemplate">NodeDataTemplate</a></code> interface</h5>
 
   <p>All objects that implement the <code>Node</code> interface must also
@@ -27913,7 +28950,7 @@
    for updating the generated content</a> of elements that are using the data
    template feature.
 
-  <h5 id=mutations><span class=secno>3.16.6.5. </span>Mutations</h5>
+  <h5 id=mutations><span class=secno>4.12.6.5. </span>Mutations</h5>
 
   <p>An element with a non-null <code title=dom-templateElement><a
    href="#templateelement">templateElement</a></code> is said to be a <dfn
@@ -27958,7 +28995,7 @@
    a template whenever either the backing data changes or the template itself
    changes.
 
-  <h5 id=updating0><span class=secno>3.16.6.6. </span>Updating the generated
+  <h5 id=updating0><span class=secno>4.12.6.6. </span>Updating the generated
    content</h5>
 
   <p>When the user agent is to <dfn id=update title=datatemplate-regen>update
@@ -28301,9 +29338,9 @@
   <!-- this is basically used for expanding
   nodeValue values -->
 
-  <h3 id=miscellaneous><span class=secno>3.17 </span>Miscellaneous elements</h3>
+  <h3 id=miscellaneous><span class=secno>4.13 </span>Miscellaneous elements</h3>
 
-  <h4 id=the-legend><span class=secno>3.17.1 </span>The <dfn
+  <h4 id=the-legend><span class=secno>4.13.1 </span>The <dfn
    id=legend><code>legend</code></dfn> element</h4>
 
   <dl class=element>
@@ -28339,7 +29376,7 @@
    or explanatory caption for the rest of the contents of the <code><a
    href="#legend">legend</a></code> element's parent element.
 
-  <h4 id=the-div><span class=secno>3.17.2 </span>The <dfn
+  <h4 id=the-div><span class=secno>4.13.2 </span>The <dfn
    id=div><code>div</code></dfn> element</h4>
 
   <dl class=element>
@@ -28382,14 +29419,14 @@
    mechanism that they are, to handle things the spec can't otherwise do
    (like making new widgets).
 
-  <h2 id=web-browsers><span class=secno>4. </span>Web browsers</h2>
+  <h2 id=browsers><span class=secno>5. </span>Web browsers</h2>
 
   <p>This section describes features that apply most directly to Web
    browsers. Having said that, unless specified elsewhere, the requirements
    defined in this section <em>do</em> apply to all user agents, whether they
    are Web browsers or not.
 
-  <h3 id=windows><span class=secno>4.1 </span>Browsing contexts</h3>
+  <h3 id=windows><span class=secno>5.1 </span>Browsing contexts</h3>
 
   <p>A <dfn id=browsing1>browsing context</dfn> is a collection of one or
    more <code>Document</code> objects, and one or more <a href="#view"
@@ -28486,7 +29523,7 @@
     new <a href="#browsing1">browsing context</a> is created.
   </dl>
 
-  <h4 id=nested><span class=secno>4.1.1 </span>Nested browsing contexts</h4>
+  <h4 id=nested><span class=secno>5.1.1 </span>Nested browsing contexts</h4>
 
   <p>Certain elements (for example, <code><a href="#iframe">iframe</a></code>
    elements) can instantiate further <a href="#browsing1" title="browsing
@@ -28544,7 +29581,7 @@
    a <code title=attr-iframe-seamless><a href="#seamless">seamless</a></code>
    attribute.
 
-  <h4 id=auxiliary><span class=secno>4.1.2 </span>Auxiliary browsing contexts</h4>
+  <h4 id=auxiliary><span class=secno>5.1.2 </span>Auxiliary browsing contexts</h4>
 
   <p>It is possible to create new browsing contexts that are related to a
    <span>top level browsing context</span> without being nested through an
@@ -28569,14 +29606,14 @@
    context was created (its <a href="#opener">opener browsing context</a>),
    if there is one and it is still available.
 
-  <h4 id=secondary><span class=secno>4.1.3 </span>Secondary browsing contexts</h4>
+  <h4 id=secondary><span class=secno>5.1.3 </span>Secondary browsing contexts</h4>
 
   <p>User agents may support <dfn id=secondary0 title="secondary browsing
    context">secondary browsing contexts</dfn>, which are <a href="#browsing1"
    title="browsing context">browsing contexts</a> that form part of the user
    agent's interface, apart from the main content area.
 
-  <h4 id=security2><span class=secno>4.1.4 </span>Security</h4>
+  <h4 id=security2><span class=secno>5.1.4 </span>Security</h4>
 
   <p>A <a href="#browsing1">browsing context</a> <var title="">A</var> is
    <dfn id=allowed>allowed to navigate</dfn> a second <a
@@ -28606,7 +29643,7 @@
     itself).
   </ul>
 
-  <h4 id=threads><span class=secno>4.1.5 </span>Threads</h4>
+  <h4 id=threads><span class=secno>5.1.5 </span>Threads</h4>
 
   <p>Each <a href="#browsing1">browsing context</a> is defined as having a
    list of zero or more <dfn id=directly>directly reachable browsing
@@ -28644,7 +29681,7 @@
  this applies to anything firing events or calling callbacks
  asynchronously. -->
 
-  <h4 id=browsing><span class=secno>4.1.6 </span>Browsing context names</h4>
+  <h4 id=browsing><span class=secno>5.1.6 </span>Browsing context names</h4>
 
   <p>Browsing contexts can have a <dfn id=browsing2>browsing context
    name</dfn>. By default, a browsing context has no name (its name is not
@@ -28741,7 +29778,7 @@
      configure the user agent to always reuse the current browsing context.</p>
   </ol>
 
-  <h3 id=the-default0><span class=secno>4.2 </span>The default view</h3>
+  <h3 id=the-default0><span class=secno>5.2 </span>The default view</h3>
 
   <p>The <code>AbstractView</code> object of <a href="#default3"
    title="default view">default views</a> must also implement the <code><a
@@ -28851,7 +29888,7 @@
    title=dom-item>have an implicit [[Get]] method</span> which returns
    <span>nested browsing contexts</span>.
 
-  <h4 id=security3><span class=secno>4.2.1 </span>Security</h4>
+  <h4 id=security3><span class=secno>5.2.1 </span>Security</h4>
 
   <p>User agents must raise a <a href="#security9">security exception</a>
    whenever any of the members of a <code><a href="#window">Window</a></code>
@@ -28878,7 +29915,7 @@
    title=dom-location><a href="#location1">location</a></code> object's
    setter.
 
-  <h4 id=constructors><span class=secno>4.2.2 </span>Constructors</h4>
+  <h4 id=constructors><span class=secno>5.2.2 </span>Constructors</h4>
 
   <p>All <code><a href="#window">Window</a></code> objects must provide the
    following constructors:
@@ -28935,7 +29972,7 @@
   <p class=big-issue>And when constructors are invoked but without using the
    constructor syntax...?
 
-  <h4 id=apis-for><span class=secno>4.2.3 </span>APIs for creating and
+  <h4 id=apis-for><span class=secno>5.2.3 </span>APIs for creating and
    navigating browsing contexts by name</h4>
 
   <p>The <dfn id=open2 title=dom-open><code>open()</code></dfn> method on
@@ -29022,7 +30059,7 @@
   <p class=note>The name <a href="#resetBCName">gets reset</a> when the
    browsing context is navigated to another domain.
 
-  <h4 id=accessing><span class=secno>4.2.4 </span>Accessing other browsing
+  <h4 id=accessing><span class=secno>5.2.4 </span>Accessing other browsing
    contexts</h4>
 
   <p>The <dfn id=length7 title=dom-length><code>length</code></dfn> DOM
@@ -29039,7 +30076,7 @@
    those browsing contexts.</p>
   <!-- XXX DOMB -->
 
-  <h3 id=origin><span class=secno>4.3 </span>Origin</h3>
+  <h3 id=origin><span class=secno>5.3 </span>Origin</h3>
   <!-- Hallowed are the Ori -->
 
   <p>The <dfn id=origin0>origin</dfn> of a resource and the <dfn
@@ -29360,7 +30397,7 @@
     <p>Return true.
   </ol>
 
-  <h4 id=relaxing><span class=secno>4.3.1 </span>Relaxing the same-origin
+  <h4 id=relaxing><span class=secno>5.3.1 </span>Relaxing the same-origin
    restriction</h4>
 
   <p>The <dfn id=domain title=dom-document-domain><code>domain</code></dfn>
@@ -29428,7 +30465,7 @@
    href="#domain">domain</a></code> attribute is used to enable pages on
    different hosts of a domain to access each others' DOMs.
 
-  <h4 id=the-string><span class=secno>4.3.2 </span>The string representing
+  <h4 id=the-string><span class=secno>5.3.2 </span>The string representing
    the script's domain in IDNA format</h4>
   <!-- XXX this is only used by the TCPConnection stuff and will be
   removed when that part is next updated -->
@@ -29446,7 +30483,7 @@
    tuple, then the string representing the script's domain in IDNA format
    cannot be obtained. (ToUnicode is defined to never fail.)
 
-  <h3 id=scripting><span class=secno>4.4 </span>Scripting</h3>
+  <h3 id=scripting><span class=secno>5.4 </span>Scripting</h3>
 
   <p>Various mechanisms can cause author-provided executable code to run in
    the context of a document. These mechanisms include, but are probably not
@@ -29471,7 +30508,7 @@
     scripting features.
   </ul>
 
-  <h4 id=script0><span class=secno>4.4.1 </span>Script execution contexts</h4>
+  <h4 id=script0><span class=secno>5.4.1 </span>Script execution contexts</h4>
 
   <p>The <dfn id=script2>script execution context</dfn> of a script is
    defined when that script is created. It is typically a <code><a
@@ -29532,11 +30569,11 @@
    will disable any event handler attributes, event listeners, timeouts, etc,
    that were set by scripts in the document.
 
-  <h4 id=security4><span class=secno>4.4.2 </span>Security exceptions</h4>
+  <h4 id=security4><span class=secno>5.4.2 </span>Security exceptions</h4>
 
   <p class=big-issue>Define <dfn id=security9>security exception</dfn>.
 
-  <h4 id=javascript-protocol><span class=secno>4.4.3 </span><dfn
+  <h4 id=javascript-protocol><span class=secno>5.4.3 </span><dfn
    id=the-javascript title="javascript protocol">The <code
    title="">javascript:</code> protocol</dfn></h4>
   <!-- XXXURL merge into URLs section? (we could define 'fetch'/'download' while we're at it?) -->
@@ -29589,13 +30626,13 @@
   <!-- XXXURL JSURL issue -->
 
   <p>Otherwise, the URI must be treated in a manner equivalent to an HTTP
-   resource with a 200 OK response whose <a href="#content-type8"
+   resource with a 200 OK response whose <a href="#content-type5"
    title=Content-Type>Content-Type metadata</a> is <code
    title="">text/html</code> and whose response body is the return value
    converted to a string value.
 
   <p class=note>Certain contexts, in particular <code><a
-   href="#img">img</a></code> elements, ignore the <a href="#content-type8"
+   href="#img">img</a></code> elements, ignore the <a href="#content-type5"
    title=Content-Type>Content-Type metadata</a>.
 
   <div class=example> <!-- XXXURL JSURL issue -->
@@ -29625,7 +30662,7 @@
    execute (and just return void) in certain cases, e.g. in a sandbox or when
    the user has disabled scripting altogether.
 
-  <h4 id=events><span class=secno>4.4.4 </span>Events</h4>
+  <h4 id=events><span class=secno>5.4.4 </span>Events</h4>
 
   <p class=big-issue>We need to define how to handle events that are to be
    fired on a Document that is no longer the active document of its browsing
@@ -29636,7 +30673,7 @@
    element section, which says scripts don't run when the document isn't
    active.
 
-  <h5 id=event-handler-attributes><span class=secno>4.4.4.1. </span>Event
+  <h5 id=event-handler-attributes><span class=secno>5.4.4.1. </span>Event
    handler attributes</h5>
 
   <p><a href="#html-elements">HTML elements</a> can have <dfn id=event2>event
@@ -30034,7 +31071,7 @@
    otherwise. (The <var title=dom-event-listener>listener</var> argument is
    emphatically <em>not</em> the event handler attribute itself.)
 
-  <h5 id=event><span class=secno>4.4.4.2. </span>Event firing</h5>
+  <h5 id=event><span class=secno>5.4.4.2. </span>Event firing</h5>
 
   <p class=big-issue>maybe this should be moved higher up (terminology?
    conformance? DOM?) Also, the whole terminology thing should be changed so
@@ -30125,7 +31162,7 @@
    actions are defined in terms of <em>any</em> event of the right type on
    that element, not those that are dispatched in expected ways.
 
-  <h5 id=events0><span class=secno>4.4.4.3. </span>Events and the <code><a
+  <h5 id=events0><span class=secno>5.4.4.3. </span>Events and the <code><a
    href="#window">Window</a></code> object</h5>
 
   <p>When an event is dispatched at a DOM node in a <code>Document</code> in
@@ -30144,7 +31181,7 @@
     bubbling has been prevented.
   </ol>
 
-  <h5 id=runtime-script-errors><span class=secno>4.4.4.4. </span>Runtime
+  <h5 id=runtime-script-errors><span class=secno>5.4.4.4. </span>Runtime
    script errors</h5>
 
   <p><em>This section only applies to user agents that support scripting in
@@ -30192,9 +31229,9 @@
   <p>The initial value of <code title=handler-onerror><a
    href="#onerror">onerror</a></code> must be <code>undefined</code>.
 
-  <h3 id=user-prompts><span class=secno>4.5 </span>User prompts</h3>
+  <h3 id=user-prompts><span class=secno>5.5 </span>User prompts</h3>
 
-  <h4 id=simple0><span class=secno>4.5.1 </span>Simple dialogs</h4>
+  <h4 id=simple0><span class=secno>5.5.1 </span>Simple dialogs</h4>
 
   <p>The <dfn id=alert title=dom-alert><code>alert(<var
    title="">message</var>)</code></dfn> method, when invoked, must show the
@@ -30222,7 +31259,7 @@
    aborts, then the method must return null; otherwise, the method must
    return the string that the user responded with.
 
-  <h4 id=printing><span class=secno>4.5.2 </span>Printing</h4>
+  <h4 id=printing><span class=secno>5.5.2 </span>Printing</h4>
 
   <p>The <dfn id=print title=dom-print><code>print()</code></dfn> method,
    when invoked, must run the <a href="#printing0">printing steps</a>.
@@ -30284,7 +31321,7 @@
      other.</p>
   </ol>
 
-  <h4 id=dialogs><span class=secno>4.5.3 </span>Dialogs implemented using
+  <h4 id=dialogs><span class=secno>5.5.3 </span>Dialogs implemented using
    separate documents</h4>
 
   <p>The <dfn id=showmodaldialog
@@ -30428,7 +31465,7 @@
    of its browsing context, and on setting, must set the <a
    href="#return">return value</a> to the given new value.
 
-  <h4 id=notifications><span class=secno>4.5.4 </span>Notifications</h4>
+  <h4 id=notifications><span class=secno>5.5.4 </span>Notifications</h4>
   <!-- v2 feature requests:
 
    - ability to snooze a notification so it comes again later
@@ -30609,7 +31646,7 @@
    brought to the user's attention, and the <var title="">onclick</var>
    callback should then be invoked.
 
-  <h3 id=browser><span class=secno>4.6 </span>Browser state</h3>
+  <h3 id=browser><span class=secno>5.6 </span>Browser state</h3>
 
   <p>The <dfn id=navigator title=dom-navigator><code>navigator</code></dfn>
    attribute of the <code><a href="#window">Window</a></code> interface must
@@ -30627,7 +31664,7 @@
 <!-- XXX there are other attributes! -->};</pre>
   <!-- also, see window.external.AddSearchProvider() and similar DOM APIs from IE -->
 
-  <h4 id=custom-handlers><span class=secno>4.6.1 </span>Custom protocol and
+  <h4 id=custom-handlers><span class=secno>5.6.1 </span>Custom protocol and
    content handlers</h4>
 
   <p>The <dfn id=registerprotocolhandler
@@ -30773,7 +31810,7 @@
    non-idempotent transaction), as the remote site would not be able to fetch
    the same data.
 
-  <h5 id=security5><span class=secno>4.6.1.1. </span>Security and privacy</h5>
+  <h5 id=security5><span class=secno>5.6.1.1. </span>Security and privacy</h5>
 
   <p>These mechanisms can introduce a number of concerns, in particular
    privacy concerns.
@@ -30855,7 +31892,7 @@
    trust the third-party handler, a decision many users are unable to make or
    even understand).
 
-  <h5 id=sample-handler-impl><span class=secno>4.6.1.2. </span>Sample user
+  <h5 id=sample-handler-impl><span class=secno>5.6.1.2. </span>Sample user
    interface</h5>
 
   <p><em>This section is non-normative.</em>
@@ -30941,15 +31978,15 @@
    would work equivalently, but for unknown MIME types instead of unknown
    protocols.
 
-  <h3 id=offline><span class=secno>4.7 </span>Offline Web applications</h3>
+  <h3 id=offline><span class=secno>5.7 </span>Offline Web applications</h3>
 
-  <h4 id=introduction1><span class=secno>4.7.1 </span>Introduction</h4>
+  <h4 id=introduction1><span class=secno>5.7.1 </span>Introduction</h4>
 
   <p><em>This section is non-normative.</em>
 
   <p class=big-issue>...
 
-  <h4 id=appcache><span class=secno>4.7.2 </span>Application caches</h4>
+  <h4 id=appcache><span class=secno>5.7.2 </span>Application caches</h4>
   <!-- XXXURL change to URL -->
 
   <p>An <dfn id=application0>application cache</dfn> is a collection of
@@ -31087,9 +32124,9 @@
    <li>which application cache the user prefers.
   </ul>
 
-  <h4 id=manifests><span class=secno>4.7.3 </span>The cache manifest syntax</h4>
+  <h4 id=manifests><span class=secno>5.7.3 </span>The cache manifest syntax</h4>
 
-  <h5 id=writing><span class=secno>4.7.3.1. </span>Writing cache manifests</h5>
+  <h5 id=writing><span class=secno>5.7.3.1. </span>Writing cache manifests</h5>
 
   <p>Manifests must be served using the <code
    title="">text/cache-manifest</code> MIME type. All resources served using
@@ -31223,7 +32260,7 @@
 
   <p>URIs in manifests must not have fragment identifiers.
 
-  <h5 id=parsing0><span class=secno>4.7.3.2. </span>Parsing cache manifests</h5>
+  <h5 id=parsing0><span class=secno>5.7.3.2. </span>Parsing cache manifests</h5>
 
   <p>When a user agent is to <dfn id=parse0>parse a manifest</dfn>, it means
    that the user agent must run the following steps:
@@ -31453,7 +32490,7 @@
    the cached copy will only be used if it is opened from a top-level
    browsing context.
 
-  <h4 id=updating1><span class=secno>4.7.4 </span>Updating an application
+  <h4 id=updating1><span class=secno>5.7.4 </span>Updating an application
    cache</h4>
 
   <p>When the user agent is required (by other parts of this specification)
@@ -31853,7 +32890,7 @@
      progress. Abort the update process.
   </ol>
 
-  <h4 id=processing2><span class=secno>4.7.5 </span>Processing model</h4>
+  <h4 id=processing2><span class=secno>5.7.5 </span>Processing model</h4>
 
   <p>The processing model of application caches for offline support in Web
    applications is part of the <a href="#navigate"
@@ -32025,7 +33062,7 @@
    update process</a> for that cache; otherwise, nothing special happens with
    respect to application caches.
 
-  <h5 id=changes><span class=secno>4.7.5.1. </span>Changes to the networking
+  <h5 id=changes><span class=secno>5.7.5.1. </span>Changes to the networking
    model</h5>
 
   <p>When a browsing context is associated with an <a
@@ -32084,7 +33121,7 @@
    cache has been primed the first time), making the testing of offline
    applications simpler.
 
-  <h4 id=application><span class=secno>4.7.6 </span>Application cache API</h4>
+  <h4 id=application><span class=secno>5.7.6 </span>Application cache API</h4>
 
   <pre class=idl>interface <dfn id=applicationcache>ApplicationCache</dfn> {
 
@@ -32446,7 +33483,7 @@
      href="#applicationcache">ApplicationCache</a></code> object.
   </dl>
 
-  <h4 id=browser0><span class=secno>4.7.7 </span>Browser state</h4>
+  <h4 id=browser0><span class=secno>5.7.7 </span>Browser state</h4>
 
   <p>The <dfn id=navigator.online
    title=dom-navigator-onLine><code>navigator.onLine</code></dfn> attribute
@@ -32471,9 +33508,9 @@
    href="#the-body1">the body element</a>.</p>
   <!-- XXX ononline onoffline need to be defined -->
 
-  <h3 id=history><span class=secno>4.8 </span>Session history and navigation</h3>
+  <h3 id=history><span class=secno>5.8 </span>Session history and navigation</h3>
 
-  <h4 id=the-session><span class=secno>4.8.1 </span>The session history of
+  <h4 id=the-session><span class=secno>5.8.1 </span>The session history of
    browsing contexts</h4>
 
   <p>The sequence of <code>Document</code>s in a <a
@@ -32589,7 +33626,7 @@
    timers, intervals, XMLHttpRequests, database transactions, etc, must be
    killed
 
-  <h4 id=the-history><span class=secno>4.8.2 </span>The <code><a
+  <h4 id=the-history><span class=secno>5.8.2 </span>The <code><a
    href="#history2">History</a></code> interface</h4>
 
   <pre class=idl>interface <dfn id=history2>History</dfn> {
@@ -32738,7 +33775,7 @@
    the last entry for that <code>Document</code> object in the session
    history.
 
-  <h4 id=activating><span class=secno>4.8.3 </span><dfn id=activating0
+  <h4 id=activating><span class=secno>5.8.3 </span><dfn id=activating0
    title="activate the state object">Activating state object entries</dfn></h4>
 
   <p>When an entry in the session history is activated (which happens during
@@ -32789,7 +33826,7 @@
    represents the context information for the event, or null, if the state
    represented is the initial state of the <code>Document</code>.
 
-  <h4 id=the-location><span class=secno>4.8.4 </span>The <code><a
+  <h4 id=the-location><span class=secno>5.8.4 </span>The <code><a
    href="#location2">Location</a></code> interface</h4>
 
   <p>Each <code>Document</code> object in a browsing context's session
@@ -32823,13 +33860,13 @@
 
   <!-- XXXURL change to URL
  -->  // <a href="#uri-decomposition">URI decomposition attributes</a> <!-- blame brendan for these "innovative" names -->
-           attribute DOMString <a href="#protocol" title=dom-location-protocol>protocol</a>;
-           attribute DOMString <a href="#host" title=dom-location-host>host</a>;
-           attribute DOMString <a href="#hostname" title=dom-location-hostname>hostname</a>;
-           attribute DOMString <a href="#port" title=dom-location-port>port</a>;
-           attribute DOMString <a href="#pathname" title=dom-location-pathname>pathname</a>;
-           attribute DOMString <a href="#search" title=dom-location-search>search</a>;
-           attribute DOMString <a href="#hash" title=dom-location-hash>hash</a>;
+           attribute DOMString <a href="#protocol0" title=dom-location-protocol>protocol</a>;
+           attribute DOMString <a href="#host0" title=dom-location-host>host</a>;
+           attribute DOMString <a href="#hostname0" title=dom-location-hostname>hostname</a>;
+           attribute DOMString <a href="#port0" title=dom-location-port>port</a>;
+           attribute DOMString <a href="#pathname0" title=dom-location-pathname>pathname</a>;
+           attribute DOMString <a href="#search0" title=dom-location-search>search</a>;
+           attribute DOMString <a href="#hash0" title=dom-location-hash>hash</a>;
 };</pre>
   <!-- XXXURL change to URL -->
 
@@ -32884,8 +33921,8 @@
   <p>Relative <var title="">url</var> arguments for <code
    title=dom-location-assign><a href="#assign">assign()</a></code> and <code
    title=dom-location-replace><a href="#replace">replace()</a></code> must be
-   resolved relative to the <a href="#scripts0" title="script's base
-   URI">base URI of the script</a> that made the method call.</p>
+   resolved relative to the <a href="#scripts" title="script's base URI">base
+   URI of the script</a> that made the method call.</p>
   <!-- XXX what about if
   the base URI is data: or javascript: or about: or something else
   without a way to resolve base URIs? -->
@@ -32893,13 +33930,13 @@
 
   <p>The <code><a href="#location2">Location</a></code> interface also has
    the complement of <a href="#uri-decomposition">URI decomposition
-   attributes</a>, <dfn id=protocol
-   title=dom-location-protocol><code>protocol</code></dfn>, <dfn id=host
-   title=dom-location-host><code>host</code></dfn>, <dfn id=port
-   title=dom-location-port><code>port</code></dfn>, <dfn id=hostname
-   title=dom-location-hostname><code>hostname</code></dfn>, <dfn id=pathname
-   title=dom-location-pathname><code>pathname</code></dfn>, <dfn id=search
-   title=dom-location-search><code>search</code></dfn>, and <dfn id=hash
+   attributes</a>, <dfn id=protocol0
+   title=dom-location-protocol><code>protocol</code></dfn>, <dfn id=host0
+   title=dom-location-host><code>host</code></dfn>, <dfn id=port0
+   title=dom-location-port><code>port</code></dfn>, <dfn id=hostname0
+   title=dom-location-hostname><code>hostname</code></dfn>, <dfn id=pathname0
+   title=dom-location-pathname><code>pathname</code></dfn>, <dfn id=search0
+   title=dom-location-search><code>search</code></dfn>, and <dfn id=hash0
    title=dom-location-hash><code>hash</code></dfn>. These must follow the
    rules given for URI decomposition attributes, with the <a href="#input"
    title=concept-uda-input>input</a> being the address of the page
@@ -32921,7 +33958,7 @@
 user reload must be equivalent to .reload()
 -->
 
-  <h5 id=security6><span class=secno>4.8.4.1. </span>Security</h5>
+  <h5 id=security6><span class=secno>5.8.4.1. </span>Security</h5>
 
   <p>User agents must raise a <a href="#security9">security exception</a>
    whenever any of the members of a <code><a
@@ -32944,7 +33981,7 @@
    title=dom-location-href><a href="#href5">href</a></code> attribute's
    setter.
 
-  <h4 id=history-notes><span class=secno>4.8.5 </span>Implementation notes
+  <h4 id=history-notes><span class=secno>5.8.5 </span>Implementation notes
    for session history</h4>
 
   <p><em>This section is non-normative.</em>
@@ -32983,9 +34020,9 @@
    that are invoked on a timer, or from event handlers that do not represent
    a clear user action, or that are invoked in rapid succession.
 
-  <h3 id=browsing0><span class=secno>4.9 </span>Browsing the Web</h3>
+  <h3 id=browsing0><span class=secno>5.9 </span>Browsing the Web</h3>
 
-  <h4 id=navigating><span class=secno>4.9.1 </span>Navigating across
+  <h4 id=navigating><span class=secno>5.9.1 </span>Navigating across
    documents</h4>
 
   <p>Certain actions cause the <a href="#browsing1">browsing context</a> to
@@ -33148,7 +34185,7 @@
 
    <li>
     <p>If the document's out-of-band metadata (e.g. HTTP headers), not
-     counting any <a href="#content-type8" title=Content-Type>type
+     counting any <a href="#content-type5" title=Content-Type>type
      information</a> (such as the Content-Type HTTP header), requires some
      sort of processing that will not affect the browsing context, then
      perform that processing and abort these steps.</p>
@@ -33303,7 +34340,7 @@
     </dl>
   </ol>
 
-  <h4 id=read-html><span class=secno>4.9.2 </span><dfn id=page-load
+  <h4 id=read-html><span class=secno>5.9.2 </span><dfn id=page-load
    title=navigate-html>Page load processing model for HTML files</dfn></h4>
 
   <p>When an HTML document is to be loaded in a <a href="#browsing1">browsing
@@ -33317,7 +34354,7 @@
    characters for use in the <span>tokeniser</span><!-- XXX xref
   -->. This
    process relies, in part, on character encoding information found in the
-   real <a href="#content-type8" title=Content-Type>Content-Type metadata</a>
+   real <a href="#content-type5" title=Content-Type>Content-Type metadata</a>
    of the resource; the "sniffed type" is not used for this purpose.</p>
   <!-- next two paragraphs are nearly identical to the navigate-text
   section, keep them in sync -->
@@ -33334,7 +34371,7 @@
    title=concept-appcache-init-with-attribute>Application cache selection</a>
    happens <a href="#parser-appcache">in the HTML parser</a>.
 
-  <h4 id=read-xml><span class=secno>4.9.3 </span><dfn id=page-load0
+  <h4 id=read-xml><span class=secno>5.9.3 </span><dfn id=page-load0
    title=navigate-xml>Page load processing model for XML files</dfn></h4>
 
   <p>When faced with displaying an XML file inline, user agents must first
@@ -33359,7 +34396,7 @@
    inserted into the DOM, the user agent must run the <a href="#application2"
    title=concept-appcache-init-with-attribute>application cache selection
    algorithm</a> with the value of that attribute, resolved relative to the
-   <a href="#elements2">element's base URI</a>, as the manifest URI.
+   <a href="#elements3">element's base URI</a>, as the manifest URI.
    Otherwise, as soon as the root element is inserted into the DOM, the user
    agent must run the <a href="#application3"
    title=concept-appcache-init-no-attribute>application cache selection
@@ -33394,7 +34431,7 @@
   <p>Error messages from the parse process (e.g. namespace well-formedness
    errors) may be reported inline by mutating the <code>Document</code>.
 
-  <h4 id=read-text><span class=secno>4.9.4 </span><dfn id=page-load1
+  <h4 id=read-text><span class=secno>5.9.4 </span><dfn id=page-load1
    title=navigate-text>Page load processing model for text files</dfn></h4>
 
   <p>When a plain text document is to be loaded in a <a
@@ -33403,7 +34440,7 @@
    title="HTML documents">HTML document</a>, create an <a href="#html-0">HTML
    parser</a>, associate it with the document, act as if the tokeniser had
    emitted a start tag token with the tag name "pre", set the <a
-   href="#tokenisation0">tokenisation</a> stage's <a href="#content2">content
+   href="#tokenisation0">tokenisation</a> stage's <a href="#content3">content
    model flag</a> to <i>PLAINTEXT</i>, and begin to pass the stream of
    characters in the plain text document to that tokeniser.
 
@@ -33437,7 +34474,7 @@
    binding, providing script, giving the document a <code><a
    href="#title1">title</a></code>, etc.
 
-  <h4 id=read-image><span class=secno>4.9.5 </span><dfn id=page-load2
+  <h4 id=read-image><span class=secno>5.9.5 </span><dfn id=page-load2
    title=navigate-image>Page load processing model for images</dfn></h4>
 
   <p>When an image resource is to be loaded in a <a
@@ -33473,7 +34510,7 @@
    binding, to provide a script, to give the document a <code><a
    href="#title1">title</a></code>, etc.
 
-  <h4 id=read-plugin><span class=secno>4.9.6 </span><dfn id=page-load3
+  <h4 id=read-plugin><span class=secno>5.9.6 </span><dfn id=page-load3
    title=navigate-plugin>Page load processing model for content that uses
    plugins</dfn></h4>
 
@@ -33516,7 +34553,7 @@
    href="#embed">embed</a></code> element will <a
    href="#sandboxPluginEmbed">fail to render the content</a>.
 
-  <h4 id=read-ua-inline><span class=secno>4.9.7 </span><dfn id=page-load4
+  <h4 id=read-ua-inline><span class=secno>5.9.7 </span><dfn id=page-load4
    title=navigate-ua-inline>Page load processing model for inline content
    that doesn't have a DOM</dfn></h4>
 
@@ -33543,7 +34580,7 @@
    the page has been completely set up, the user agent must <a
    href="#update2">update the session history with the new page</a>.
 
-  <h4 id=scroll-to-fragid><span class=secno>4.9.8 </span><dfn id=navigating0
+  <h4 id=scroll-to-fragid><span class=secno>5.9.8 </span><dfn id=navigating0
    title=navigate-fragid>Navigating to a fragment identifier</dfn></h4>
   <!-- XXXURL change to URL; XXXDOCURL? -->
 
@@ -33609,7 +34646,7 @@
    an element; otherwise there is no <i>target element</i>. <a
    href="#refsSELECTORS">[SELECTORS]</a>
 
-  <h4 id=history0><span class=secno>4.9.9 </span>History traversal</h4>
+  <h4 id=history0><span class=secno>5.9.9 </span>History traversal</h4>
 
   <p>When a user agent is required to <dfn id=traverse>traverse the
    history</dfn> to a <i>specified entry</i>, the user agent must act as
@@ -33741,809 +34778,12 @@
   <p class=big-issue>how does the changing of the global attributes affect
    .watch() when seen from other Windows?
 
-  <h3 id=content-type-sniffing><span class=secno>4.10 </span>Determining the
-   type of a new resource in a browsing context</h3>
-
-  <p class=warning>It is imperative that the rules in this section be
-   followed exactly. When a user agent uses different heuristics for content
-   type detection than the server expects, security problems can occur. For
-   example, if a server believes that the client will treat a contributed
-   file as an image (and thus treat it as benign), but a Web browser believes
-   the content to be HTML (and thus execute any scripts contained therein),
-   the end user can be exposed to malicious content, making the user
-   vulnerable to cookie theft attacks and other cross-site scripting attacks.
-
-  <p>The <dfn id=sniffed title="Content-Type sniffing">sniffed type of a
-   resource</dfn> must be found as follows:
-
-  <ol>
-   <li>
-    <p>Let <var title="">official type</var> be the type given by the <a
-     href="#content-type8" title=Content-Type>Content-Type metadata</a> for
-     the resource (in lowercase<!-- XXX ASCII case folding -->, ignoring any
-     parameters). If there is no such type, jump to the <em
-     title="content-type sniffing: unknown type"><a
-     href="#content-type5">unknown type</a></em> step below.
-
-   <li>
-    <p>If the user agent is configured to strictly obey Content-Type headers
-     for this resource, then jump to the last step in this set of steps.
-
-   <li>
-    <p>If the resource was fetched over an HTTP protocol and there is an HTTP
-     Content-Type header and the value of the first such header has bytes
-     that exactly match one of the following lines:</p>
-
-    <table>
-     <thead>
-      <tr>
-       <th>Bytes in Hexadecimal
-
-       <th>Textual representation
-
-     <tbody>
-      <tr><!-- Very old Apache default -->
-
-       <td>74 65 78 74 2f 70 6c 61 69 6e
-
-       <td><code title="">text/plain</code>
-
-      <tr><!-- Old Apache default -->
-
-       <td>74 65 78 74 2f 70 6c 61 69 6e 3b 20 63 68 61 72 73 65 74 3d 49 53
-        4f 2d 38 38 35 39 2d 31
-
-       <td><code title="">text/plain; charset=ISO-8859-1</code>
-
-      <tr><!-- Debian's arbitrarily different Apache default -->
-
-       <td>74 65 78 74 2f 70 6c 61 69 6e 3b 20 63 68 61 72 73 65 74 3d 69 73
-        6f 2d 38 38 35 39 2d 31
-
-       <td><code title="">text/plain; charset=iso-8859-1</code>
-
-      <tr><!-- Someone else's arbitrarily different Apache default (who?) -->
-
-       <td>74 65 78 74 2f 70 6c 61 69 6e 3b 20 63 68 61 72 73 65 74 3d 55 54
-        46 2d 38
-
-       <td><code title="">text/plain; charset=UTF-8</code>
-    </table>
-
-    <p>...then jump to the <em title="content-type sniffing: text or
-     binary"><a href="#content-type4">text or binary</a></em> section below.</p>
-    <!-- while IE sniffs all text/plain, this will continue to grow as
-    people add new defaults. Hopefully IE will stop the madness in due
-    course and stop sniffing anything but the above... -->
-    
-
-   <li>
-    <p>If <var title="">official type</var> is "unknown/unknown" or
-     "application/unknown", jump to the <em title="content-type sniffing:
-     unknown type"><a href="#content-type5">unknown type</a></em> step below.</p>
-    <!-- In a study looking at many billions of pages whose first five
-   characters were "<HTML", "unknown/unknown" was used to label
-   documents about once for every 5000 pages labeled "text/html", and
-   "application/unknown" was used about once for every 35000 pages
-   labeled "text/html". -->
-
-   <li>
-    <p>If <var title="">official type</var> ends in "+xml", or if it is
-     either "text/xml" or "application/xml", then the sniffed type of the
-     resource is <var title="">official type</var>; return that and abort
-     these steps.
-   </li>
-   <!-- we don't want
-   image/svg+xml going through the next step -->
-
-   <li>
-    <p>If <var title="">official type</var> is an image type supported by the
-     user agent (e.g. "image/png", "image/gif", "image/jpeg", etc), then jump
-     to the <em title="content-type sniffing: image"><a
-     href="#content-type6">images</a></em> section below.
-
-   <li>
-    <p>If <var title="">official type</var> is "text/html", then jump to the
-     <em title="content-type sniffing: feed or html"><a
-     href="#content-type7">feed or HTML</a></em> section below.
-
-   <li>
-    <p>The sniffed type of the resource is <var title="">official type</var>.
-  </ol>
-
-  <h4 id=content-type0><span class=secno>4.10.1 </span><dfn
-   id=content-type4>Content-Type sniffing: text or binary</dfn></h4>
-
-  <ol>
-   <li>
-    <p>The user agent may wait for 512 or more bytes of the resource to be
-     available.
-
-   <li>
-    <p>Let <var title="">n</var> be the smaller of either 512 or the number
-     of bytes already available.
-
-   <li>
-    <p>If <var title="">n</var> is 4 or more, and the first bytes of the file
-     match one of the following byte sets:</p>
-
-    <table>
-     <thead>
-      <tr>
-       <th>Bytes in Hexadecimal
-
-       <th>Description
-
-     <tbody>
-      <tr>
-       <td>FE FF
-
-       <td>UTF-16BE BOM
-        <!-- followed by a character --><!-- nobody uses this: or UTF-32LE BOM -->
-        
-
-      <tr>
-       <td>FF FE
-
-       <td>UTF-16LE BOM <!-- followed by a character -->
-        <!-- nobody uses this
-      <tr>
-       <td>00 00 FE FF
-       <td>UTF-32BE BOM
--->
-        <!-- this one is redundant with the one above
-      <tr>
-       <td>FF FE 00 00
-       <td>UTF-32LE BOM
--->
-        
-
-      <tr>
-       <td>EF BB BF
-
-       <td>UTF-8 BOM
-        <!-- followed by a character, or the first byte of a multiple character sequence -->
-        <!-- nobody uses this
-      <tr>
-       <td>DD 73 66 73
-       <td>UTF-EBCDIC BOM
--->
-        
-    </table>
-
-    <p>...then the sniffed type of the resource is "text/plain".</p>
-
-   <li>
-    <p>Otherwise, if any of the first <var title="">n</var> bytes of the
-     resource are in one of the following byte ranges:</p>
-    <!-- This byte list is based on RFC 2046 Section 4.1.2. Characters
-    in the range 0x00-0x1F, with the exception of 0x09, 0x0A, 0x0C,
-    0x0D (ASCII for TAB, LF, FF, and CR), and character 0x1B
-    (reportedly used by some encodings as a shift escape), are
-    invalid. Thus, if we see them, we assume it's not text. -->
-    
-    <ul class=brief>
-     <li> 0x00 - 0x08
-
-     <li> 0x0B
-
-     <li> 0x0E - 0x1A
-
-     <li> 0x1C - 0x1F
-    </ul>
-
-    <p>...then the sniffed type of the resource is
-     "application/octet-stream".</p>
-
-    <p class=big-issue>maybe we should invoke the "Content-Type sniffing:
-     image" section now, falling back on "application/octet-stream".</p>
-
-   <li>
-    <p>Otherwise, the sniffed type of the resource is "text/plain".
-  </ol>
-
-  <h4 id=content-type1><span class=secno>4.10.2 </span><dfn
-   id=content-type5>Content-Type sniffing: unknown type</dfn></h4>
-
-  <ol>
-   <li>
-    <p>The user agent may wait for 512 or more bytes of the resource to be
-     available.
-
-   <li>
-    <p>Let <var title="">stream length</var> be the smaller of either 512 or
-     the number of bytes already available.
-
-   <li>
-    <p>For each row in the table below:</p>
-
-    <dl class=switch>
-     <dt>If the row has no "<em>WS</em>" bytes:
-
-     <dd>
-      <ol>
-       <li>Let <var title="">pattern length</var> be the length of the
-        pattern (number of bytes described by the cell in the second column
-        of the row).
-
-       <li>If <var title="">pattern length</var> is smaller than <var
-        title="">stream length</var> then skip this row.
-
-       <li>Apply the "and" operator to the first <var title="">pattern
-        length</var> bytes of the resource and the given mask (the bytes in
-        the cell of first column of that row), and let the result be the <var
-        title="">data</var>.
-
-       <li>If the bytes of the <var title="">data</var> matches the given
-        pattern bytes exactly, then the sniffed type of the resource is the
-        type given in the cell of the third column in that row; abort these
-        steps.
-      </ol>
-
-     <dt>If the row has a "<em>WS</em>" byte:
-
-     <dd>
-      <ol>
-       <li>
-        <p>Let <var title="">index<sub>pattern</sub></var> be an index into
-         the mask and pattern byte strings of the row.
-
-       <li>
-        <p>Let <var title="">index<sub>stream</sub></var> be an index into
-         the byte stream being examined.
-
-       <li>
-        <p><em>Loop</em>: If <var title="">index<sub>stream</sub></var>
-         points beyond the end of the byte stream, then this row doesn't
-         match, skip this row.
-
-       <li>
-        <p>Examine the <var title="">index<sub>stream</sub></var>th byte of
-         the byte stream as follows:</p>
-
-        <dl class=switch>
-         <dt>If the <var title="">index<sub>stream</sub></var>th byte of the
-          pattern is a normal hexadecimal byte and not a "<em>WS</em>" byte:
-
-         <dd>
-          <p>If the "and" operator, applied to the <var
-           title="">index<sub>stream</sub></var>th byte of the stream and the
-           <var title="">index<sub>pattern</sub></var>th byte of the mask,
-           yield a value different that the <var
-           title="">index<sub>pattern</sub></var>th byte of the pattern, then
-           skip this row.</p>
-
-          <p>Otherwise, increment <var title="">index<sub>pattern</sub></var>
-           to the next byte in the mask and pattern and <var
-           title="">index<sub>stream</sub></var> to the next byte in the byte
-           stream.</p>
-
-         <dt>Otherwise, if the <var title="">index<sub>stream</sub></var>th
-          byte of the pattern is a "<em>WS</em>" byte:
-
-         <dd>
-          <p>"<em>WS</em>" means "whitespace", and allows insignificant
-           whitespace to be skipped when sniffing for a type signature.</p>
-
-          <p>If the <var title="">index<sub>stream</sub></var>th byte of the
-           stream is one of 0x09 (ASCII TAB), 0x0A (ASCII LF), 0x0C (ASCII
-           FF), 0x0D (ASCII CR), or 0x20 (ASCII space), then increment only
-           the <var title="">index<sub>stream</sub></var> to the next byte in
-           the byte stream.</p>
-
-          <p>Otherwise, increment only the <var
-           title="">index<sub>pattern</sub></var> to the next byte in the
-           mask and pattern.</p>
-        </dl>
-
-       <li>
-        <p>If <var title="">index<sub>pattern</sub></var> does not point
-         beyond the end of the mask and pattern byte strings, then jump back
-         to the <em>loop</em> step in this algorithm.
-
-       <li>
-        <p>Otherwise, the sniffed type of the resource is the type given in
-         the cell of the third column in that row; abort these steps.
-      </ol>
-    </dl>
-
-   <li>
-    <p>As a last-ditch effort, jump to the <a href="#content-type4"
-     title="content-type sniffing: text or binary">text or binary</a>
-     section.
-  </ol>
-
-  <table>
-   <thead>
-    <tr>
-     <th colspan=2>Bytes in Hexadecimal
-
-     <th rowspan=2>Sniffed type
-
-     <th rowspan=2>Comment
-
-    <tr>
-     <th>Mask
-
-     <th>Pattern
-
-   <tbody>
-    <tr>
-     <td>FF FF DF DF DF DF DF DF DF FF DF DF DF DF
-
-     <td>3C 21 44 4F 43 54 59 50 45 20 48 54 4D 4C <!-- "<!DOCTYPE HTML" -->
-      <!-- common in static data -->
-
-     <td>text/html
-
-     <td>The string "<code title=""><!DOCTYPE HTML</code>" in US-ASCII or
-      compatible encodings, case-insensitively.
-
-    <tr>
-     <td>FF FF DF DF DF DF
-
-     <td><em>WS</em> 3C 48 54 4D 4C <!-- "<HTML" -->
-      <!-- common in static data -->
-
-     <td>text/html
-
-     <td>The string "<code title=""><HTML</code>" in US-ASCII or
-      compatible encodings, case-insensitively, possibly with leading spaces.
-      
-
-    <tr>
-     <td>FF FF DF DF DF DF
-
-     <td><em>WS</em> 3C 48 45 41 44 <!-- "<HEAD" -->
-      <!-- common in static data -->
-
-     <td>text/html
-
-     <td>The string "<code title=""><HEAD</code>" in US-ASCII or
-      compatible encodings, case-insensitively, possibly with leading spaces.
-      
-
-    <tr>
-     <td>FF FF DF DF DF DF DF DF
-
-     <td><em>WS</em> 3C 53 43 52 49 50 54 <!-- "<SCRIPT" -->
-      <!-- common in dynamic data -->
-
-     <td>text/html
-
-     <td>The string "<code title=""><SCRIPT</code>" in US-ASCII or
-      compatible encodings, case-insensitively, possibly with leading spaces.
-      
-
-    <tr>
-     <td>FF FF FF FF FF
-
-     <td>25 50 44 46 2D
-      <!-- "%PDF-" (from http://lxr.mozilla.org/seamonkey/source/netwerk/streamconv/converters/nsUnknownDecoder.cpp#321) -->
-      
-
-     <td>application/pdf
-
-     <td>The string "<code title="">%PDF-</code>", the PDF signature.
-
-    <tr>
-     <td>FF FF FF FF FF FF FF FF FF FF FF
-
-     <td>25 21 50 53 2D 41 64 6F 62 65 2D
-      <!-- "%!PS-Adobe-" (from http://lxr.mozilla.org/seamonkey/source/netwerk/streamconv/converters/nsUnknownDecoder.cpp#321) -->
-      
-
-     <td>application/postscript
-
-     <td>The string "<code title="">%!PS-Adobe-</code>", the PostScript
-      signature. <!-- copied from the section below -->
-
-   <tbody>
-    <tr>
-     <td>FF FF FF FF FF FF
-
-     <td>47 49 46 38 37 61 <!-- GIF87a -->
-
-     <td>image/gif
-
-     <td>The string "<code title="">GIF87a</code>", a GIF signature.
-
-    <tr>
-     <td>FF FF FF FF FF FF
-
-     <td>47 49 46 38 39 61 <!-- GIF89a -->
-
-     <td>image/gif
-
-     <td>The string "<code title="">GIF89a</code>", a GIF signature.
-
-    <tr>
-     <td>FF FF FF FF FF FF FF FF
-
-     <td>89 50 4E 47 0D 0A 1A 0A
-      <!-- [TAB]PNG[CR][LF][EOF][LF]; 137 80 78 71 13 10 26 10 -->
-
-     <td>image/png
-
-     <td>The PNG signature.
-
-    <tr>
-     <td>FF FF FF
-
-     <td>FF D8 FF
-      <!-- SOI marker followed by the first byte of another marker -->
-
-     <td>image/jpeg
-
-     <td>A JPEG SOI marker followed by the first byte of another marker.
-
-    <tr>
-     <td>FF FF
-
-     <td>42 4D
-
-     <td>image/bmp
-
-     <td>The string "<code title="">BM</code>", a BMP signature.
-
-    <tr>
-     <td>FF FF FF FF
-
-     <td>00 00 01 00
-
-     <td>image/vnd.microsoft.icon
-
-     <td>A 0 word following by a 1 word, a Windows Icon file format
-      signature.
-  </table>
-
-  <p>User agents may support further types if desired, by implicitly adding
-   to the above table. However, user agents should not use any other patterns
-   for types already mentioned in the table above, as this could then be used
-   for privilege escalation (where, e.g., a server uses the above table to
-   determine that content is not HTML and thus safe from XSS attacks, but
-   then a user agent detects it as HTML anyway and allows script to execute).
-
-  <h4 id=content-type2><span class=secno>4.10.3 </span><dfn
-   id=content-type6>Content-Type sniffing: image</dfn></h4>
-
-  <p>If the first bytes of the file match one of the byte sequences in the
-   first columns of the following table, then the sniffed type of the
-   resource is the type given in the corresponding cell in the second column
-   on the same row:
-
-  <table>
-   <thead>
-    <tr>
-     <th>Bytes in Hexadecimal
-
-     <th>Sniffed type
-
-     <th>Comment <!-- update the table above if you change this! -->
-
-   <tbody>
-    <tr>
-     <td>47 49 46 38 37 61 <!-- GIF87a -->
-
-     <td>image/gif
-
-     <td>The string "<code title="">GIF87a</code>", a GIF signature.
-
-    <tr>
-     <td>47 49 46 38 39 61 <!-- GIF89a -->
-
-     <td>image/gif
-
-     <td>The string "<code title="">GIF89a</code>", a GIF signature.
-
-    <tr>
-     <td>89 50 4E 47 0D 0A 1A 0A
-      <!-- [TAB]PNG[CR][LF][EOF][LF]; 137 80 78 71 13 10 26 10 -->
-
-     <td>image/png
-
-     <td>The PNG signature.
-
-    <tr>
-     <td>FF D8 FF
-      <!-- SOI marker followed by the first byte of another marker -->
-
-     <td>image/jpeg
-
-     <td>A JPEG SOI marker followed by the first byte of another marker.
-
-    <tr>
-     <td>42 4D
-
-     <td>image/bmp
-
-     <td>The string "<code title="">BM</code>", a BMP signature.
-
-    <tr>
-     <td>00 00 01 00
-
-     <td>image/vnd.microsoft.icon
-
-     <td>A 0 word following by a 1 word, a Windows Icon file format
-      signature.
-      <!-- XXX Mozilla also detects ART (AOL proprietary format) and Windows Cursor files -->
-      
-  </table>
-
-  <p>User agents must ignore any rows for image types that they do not
-   support.
-
-  <p>Otherwise, the sniffed type of the resource is the same as its <var
-   title="">official type</var>.
-
-  <h4 id=content-type3><span class=secno>4.10.4 </span><dfn
-   id=content-type7>Content-Type sniffing: feed or HTML</dfn></h4>
-  <!-- mostly based on:
-   http://blogs.msdn.com/rssteam/articles/PublishersGuide.aspx
-   http://lxr.mozilla.org/seamonkey/source/browser/components/feeds/src/nsFeedSniffer.cpp#192
-   http://lxr.mozilla.org/seamonkey/source/browser/components/feeds/src/nsFeedSniffer.cpp#127
-  -->
-
-  <ol>
-   <li>
-    <p>The user agent may wait for 512 or more bytes of the resource to be
-     available.
-
-   <li>
-    <p>Let <var title="">s</var> be the stream of bytes, and let <span><var
-     title="">s</var>[<var title="">i</var>]</span> represent the byte in
-     <var title="">s</var> with position <var title="">i</var>, treating <var
-     title="">s</var> as zero-indexed (so the first byte is at <span><var
-     title="">i</var>=0</span>).
-
-   <li>
-    <p>If at any point this algorithm requires the user agent to determine
-     the value of a byte in <var title="">s</var> which is not yet available,
-     or which is past the first 512 bytes of the resource, or which is beyond
-     the end of the resource, the user agent must stop this algorithm, and
-     assume that the sniffed type of the resource is "text/html".</p>
-
-    <p class=note>User agents are allowed, by the first step of this
-     algorithm, to wait until the first 512 bytes of the resource are
-     available.
-
-   <li>
-    <p>Initialise <var title="">pos</var> to 0.
-
-   <li>
-    <p>If <span><var title="">s</var>[0]</span> is 0xEF, <span><var
-     title="">s</var>[1]</span> is 0xBB, and <span><var
-     title="">s</var>[2]</span> is 0xBF, then set <var title="">pos</var> to
-     3. (This skips over a leading UTF-8 BOM, if any.)
-
-   <li>
-    <p><i>Loop start:</i> Examine <span><var title="">s</var>[<var
-     title="">pos</var>]</span>.</p>
-
-    <dl
-     class=switch><!-- skip whitespace (S token as defined in XML 1.0 section 2.3; production [3] -->
-
-     <dt>If it is 0x09 (ASCII tab), 0x20 (ASCII space), 0x0A (ASCII LF), or
-      0x0D (ASCII CR)
-
-     <dd>Increase <var title="">pos</var> by 1 and repeat this step.
-
-     <dt>If it is 0x3C (ASCII "<code title=""><</code>")
-
-     <dd>Increase <var title="">pos</var> by 1 and go to the next step.
-
-     <dt>If it is anything else
-
-     <dd>The sniffed type of the resource is "text/html". Abort these steps.
-    </dl>
-
-   <li>
-    <p>If the bytes with positions <var title="">pos</var> to <span><var
-     title="">pos</var>+2</span> in <var title="">s</var> are exactly equal
-     to 0x21, 0x2D, 0x2D respectively (ASCII for "<code
-     title="">!--</code>"), then:</p>
-
-    <ol>
-     <li>Increase <var title="">pos</var> by 3.</li>
-     <!-- skips past the " ! - - " -->
-
-     <li>If the bytes with positions <span><var title="">pos</var></span> to
-      <span><var title="">pos</var>+2</span> in <var title="">s</var> are
-      exactly equal to 0x2D, 0x2D, 0x3E respectively (ASCII for "<code
-      title="">--></code>"), then increase <var title="">pos</var> by 3
-      and jump back to the previous step (the step labeled <i>loop start</i>)
-      in the overall algorithm in this section.
-
-     <li>Otherwise, increase <var title="">pos</var> by 1.
-
-     <li>Return to step 2 in these substeps.
-    </ol>
-
-   <li>
-    <p>If <span><var title="">s</var>[<var title="">pos</var>]</span> is 0x21
-     (ASCII "<code title="">!</code>"):</p>
-    <!-- this skips past a DOCTYPE if there is one. It is brain-dead
-    because we don't have to be clever to parse the Atom and RSS x.y
-    DOCTYPEs, as they don't do anything clever like have internal
-    subsets or quoted ">" characters. If this fails, then that's ok,
-    we'll treat it as HTML which is fine since we know it's not a feed
-    in that case. -->
-    
-    <ol>
-     <li>Increase <var title="">pos</var> by 1.
-
-     <li>If <span><var title="">s</var>[<var title="">pos</var>]</span> equal
-      0x3E, then increase <var title="">pos</var> by 1 and jump back to the
-      step labeled <i>loop start</i> in the overall algorithm in this
-      section.
-
-     <li>Otherwise, return to step 1 in these substeps.
-    </ol>
-
-   <li>
-    <p>If <span><var title="">s</var>[<var title="">pos</var>]</span> is 0x3F
-     (ASCII "<code title="">?</code>"):</p>
-
-    <ol>
-     <li>Increase <var title="">pos</var> by 1.
-
-     <li>If <span><var title="">s</var>[<var title="">pos</var>]</span> and
-      <span><var title="">s</var>[<var title="">pos</var>+1]</span> equal
-      0x3F and 0x3E respectively, then increase <var title="">pos</var> by 1
-      and jump back to the step labeled <i>loop start</i> in the overall
-      algorithm in this section.
-
-     <li>Otherwise, return to step 1 in these substeps.
-    </ol>
-
-   <li>
-    <p>Otherwise, if the bytes in <var title="">s</var> starting at <var
-     title="">pos</var> match any of the sequences of bytes in the first
-     column of the following table, then the user agent must follow the steps
-     given in the corresponding cell in the second column of the same row.</p>
-
-    <table>
-     <thead>
-      <tr>
-       <th>Bytes in Hexadecimal
-
-       <th>Requirement
-
-       <th>Comment
-
-     <tbody>
-      <tr>
-       <td>72 73 73
-
-       <td>The sniffed type of the resource is "application/rss+xml"; abort
-        these steps
-
-       <td>The three ASCII characters "<code title="">rss</code>"
-
-      <tr>
-       <td>66 65 65 64
-
-       <td>The sniffed type of the resource is "application/atom+xml"; abort
-        these steps
-
-       <td>The four ASCII characters "<code title="">feed</code>"
-
-      <tr>
-       <td>72 64 66 3A 52 44 46
-
-       <td>Continue to the next step in this algorithm
-
-       <td>The ASCII characters "<code title="">rdf:RDF</code>"
-    </table>
-
-    <p>If none of the byte sequences above match the bytes in <var
-     title="">s</var> starting at <var title="">pos</var>, then the sniffed
-     type of the resource is "text/html". Abort these steps.</p>
-
-   <li>
-    <p class=big-issue>If, before the next ">", you find two xmlns*
-     attributes with http://www.w3.org/1999/02/22-rdf-syntax-ns# and
-     http://purl.org/rss/1.0/ as the namespaces, then the sniffed type of the
-     resource is "application/rss+xml", abort these steps. (maybe we only
-     need to check for http://purl.org/rss/1.0/ actually)
-
-   <li>
-    <p>Otherwise, the sniffed type of the resource is "text/html".
-  </ol>
-
-  <p class=note>For efficiency reasons, implementations may wish to implement
-   this algorithm and the algorithm for detecting the character encoding of
-   HTML documents in parallel.
-
-  <h4 id=content-type><span class=secno>4.10.5 </span>Content-Type metadata</h4>
-
-  <p>What explicit <dfn id=content-type8 title=Content-Type>Content-Type
-   metadata</dfn> is associated with the resource (the resource's type
-   information) depends on the protocol that was used to fetch the resource.
-
-  <p>For HTTP resources, only the first Content-Type HTTP header, if any,
-   contributes any type information; the explicit type of the resource is
-   then the value of that header, interpreted as described by the HTTP
-   specifications. If the Content-Type HTTP header is present but the value
-   of the first such header cannot be interpreted as described by the HTTP
-   specifications (e.g. because its value doesn't contain a U+002F SOLIDUS
-   ('/') character), then the resource has no type information (even if there
-   are multiple Content-Type HTTP headers and one of the other ones is
-   syntactically correct). <a href="#refsHTTP">[HTTP]</a>
-
-  <p>For resources fetched from the file system, user agents should use
-   platform-specific conventions, e.g. operating system extension/type
-   mappings.
-
-  <p>Extensions must not be used for determining resource types for resources
-   fetched over HTTP.
-
-  <p>For resources fetched over most other protocols, e.g. FTP, there is no
-   type information.
-
-  <p>The <dfn id=algorithm4>algorithm for extracting an encoding from a
-   Content-Type</dfn>, given a string <var title="">s</var>, is as follows.
-   It either returns an encoding or nothing.
-
-  <ol>
-   <li>
-    <p>Find the first seven characters in <var title="">s</var> that are a
-     case-insensitive<!-- XXX ASCII--> match for the word 'charset'. If no
-     such match is found, return nothing.</p>
-
-   <li>
-    <p>Skip any U+0009, U+000A, U+000C, U+000D, or U+0020 characters that
-     immediately follow the word 'charset' (there might not be any).
-
-   <li>
-    <p>If the next character is not a U+003D EQUALS SIGN ('='), return
-     nothing.
-
-   <li>
-    <p>Skip any U+0009, U+000A, U+000C, U+000D, or U+0020 characters that
-     immediately follow the equals sign (there might not be any).
-
-   <li>
-    <p>Process the next character as follows:</p>
-
-    <dl class=switch>
-     <dt>If it is a U+0022 QUOTATION MARK ('"') and there is a later U+0022
-      QUOTATION MARK ('"') in <var title="">s</var>
-
-     <dt>If it is a U+0027 APOSTROPHE ("'") and there is a later U+0027
-      APOSTROPHE ("'") in <var title="">s</var>
-
-     <dd>
-      <p>Return the string between this character and the next earliest
-       occurrence of this character.
-
-     <dt>If it is an unmatched U+0022 QUOTATION MARK ('"')
-
-     <dt>If it is an unmatched U+0027 APOSTROPHE ("'")
-
-     <dt>If there is no next character
-
-     <dd>
-      <p>Return nothing.
-
-     <dt>Otherwise
-
-     <dd>
-      <p>Return the string from this character to the first U+0009, U+000A,
-       U+000C, U+000D, U+0020, or U+003B character or the end of <var
-       title="">s</var>, whichever comes first.
-    </dl>
-  </ol>
-
-  <p class=note>The above algorithm is a willful violation of the HTTP
-   specification. <a href="#refsRFC2616">[RFC2616]</a>
-
-  <h3 id=structured><span class=secno>4.11 </span>Structured client-side
+  <h3 id=structured><span class=secno>5.10 </span>Structured client-side
    storage</h3>
 
-  <h4 id=storage><span class=secno>4.11.1 </span>Storing name/value pairs</h4>
+  <h4 id=storage><span class=secno>5.10.1 </span>Storing name/value pairs</h4>
 
-  <h5 id=introduction2><span class=secno>4.11.1.1. </span>Introduction</h5>
+  <h5 id=introduction2><span class=secno>5.10.1.1. </span>Introduction</h5>
 
   <p><em>This section is non-normative.</em>
 
@@ -34638,7 +34878,7 @@
    store structured data in a storage area, you must first convert it to a
    string.
 
-  <h5 id=the-storage><span class=secno>4.11.1.2. </span>The <code><a
+  <h5 id=the-storage><span class=secno>5.10.1.2. </span>The <code><a
    href="#storage0">Storage</a></code> interface</h5>
   <!-- XXX shouldn't we define somewhere how null values get handled
   in these methods? Do they get converted to the empty string or
@@ -34755,7 +34995,7 @@
   not normative, see the sections below for the normative statement
   -->
 
-  <h5 id=the-sessionstorage><span class=secno>4.11.1.3. </span>The <code
+  <h5 id=the-sessionstorage><span class=secno>5.10.1.3. </span>The <code
    title=dom-sessionStorage><a
    href="#sessionstorage">sessionStorage</a></code> attribute</h5>
 
@@ -34828,7 +35068,7 @@
    title=event-storage><a href="#storage1">storage</a></code> event must be
    fired, as <a href="#storage1" title=event-storage>described below</a>.
 
-  <h5 id=the-localstorage><span class=secno>4.11.1.4. </span>The <code
+  <h5 id=the-localstorage><span class=secno>5.10.1.4. </span>The <code
    title=dom-localStorage><a href="#localstorage">localStorage</a></code>
    attribute</h5>
 
@@ -34874,7 +35114,7 @@
    must be fired, as <a href="#storage1" title=event-storage>described
    below</a>.
 
-  <h5 id=the-storage0><span class=secno>4.11.1.5. </span>The <code
+  <h5 id=the-storage0><span class=secno>5.10.1.5. </span>The <code
    title=event-storage><a href="#storage1">storage</a></code> event</h5>
 
   <p>The <dfn id=storage1 title=event-storage><code>storage</code></dfn>
@@ -34918,7 +35158,7 @@
    the two documents are in the same <a href="#unit-of">unit of related
    browsing contexts</a>, or null otherwise.
 
-  <h6 id=event0><span class=secno>4.11.1.5.1. </span>Event definition</h6>
+  <h6 id=event0><span class=secno>5.10.1.5.1. </span>Event definition</h6>
 
   <pre class=idl>interface <dfn id=storageevent>StorageEvent</dfn> : Event {
   readonly attribute DOMString <a href="#key" title=dom-StorageEvent-key>key</a>;
@@ -34957,7 +35197,7 @@
    represents the <code><a href="#window">Window</a></code> that changed the
    key.
 
-  <h5 id=threads0><span class=secno>4.11.1.6. </span>Threads</h5>
+  <h5 id=threads0><span class=secno>5.10.1.6. </span>Threads</h5>
 
   <p>Multiple browsing contexts must be able to access the local storage
    areas simultaneously in a predictable manner. Scripts must not be able to
@@ -34982,14 +35222,14 @@
    execution. This specification does not require any particular
    implementation strategy, so long as the requirement above is met.
 
-  <h4 id=sql><span class=secno>4.11.2 </span>Database storage</h4>
+  <h4 id=sql><span class=secno>5.10.2 </span>Database storage</h4>
   <!-- Feature requests for future versions (v2):
         * deleting databases
         * determining how much storage room is left
         * handling the database getting corrupted
   -->
 
-  <h5 id=introduction3><span class=secno>4.11.2.1. </span>Introduction</h5>
+  <h5 id=introduction3><span class=secno>5.10.2.1. </span>Introduction</h5>
 
   <p><em>This section is non-normative.</em>
 
@@ -35003,7 +35243,7 @@
    executeSql('SELECT rowid FROM t WHERE c IN (' + q + ')', array, ...);
 -->
 
-  <h5 id=databases><span class=secno>4.11.2.2. </span>Databases</h5>
+  <h5 id=databases><span class=secno>5.10.2.2. </span>Databases</h5>
 
   <p>Each <i><a href="#origin0">origin</a></i> has an associated set of
    databases. Each database has a name and a current version. There is no way
@@ -35130,7 +35370,7 @@
     href="#changeversion">changeVersion()</a></code> method.
   </ol>
 
-  <h5 id=executing><span class=secno>4.11.2.3. </span>Executing SQL
+  <h5 id=executing><span class=secno>5.10.2.3. </span>Executing SQL
    statements</h5>
 
   <p>The <code title=dom-database-transaction><a
@@ -35251,7 +35491,7 @@
   <p class=note>A future version of this specification will probably define
    the exact SQL subset required in more detail.
 
-  <h5 id=database><span class=secno>4.11.2.4. </span>Database query results</h5>
+  <h5 id=database><span class=secno>5.10.2.4. </span>Database query results</h5>
 
   <p>The <code title=dom-transaction-executeSql>executeSql()</code> method
    invokes its callback with a <code><a
@@ -35313,7 +35553,7 @@
    have the name of the column and the value of the cell, as they were
    returned by the database.
 
-  <h5 id=errors><span class=secno>4.11.2.5. </span>Errors</h5>
+  <h5 id=errors><span class=secno>5.10.2.5. </span>Errors</h5>
 
   <p>Errors in the database API are reported using callbacks that have a
    <code><a href="#sqlerror">SQLError</a></code> object as one of their
@@ -35395,7 +35635,7 @@
    return an error message describing the error encountered. The message
    should be localized to the user's language.
 
-  <h5 id=processing3><span class=secno>4.11.2.6. </span>Processing model</h5>
+  <h5 id=processing3><span class=secno>5.10.2.6. </span>Processing model</h5>
 
   <p>The <dfn id=transaction0>transaction steps</dfn> are as follows. These
    steps must be run asynchronously. These steps are invoked with a
@@ -35524,7 +35764,7 @@
      Any still-pending statements in the transaction are discarded.
   </ol>
 
-  <h4 id=disk-space><span class=secno>4.11.3 </span>Disk space</h4>
+  <h4 id=disk-space><span class=secno>5.10.3 </span>Disk space</h4>
 
   <p>User agents should limit the total amount of space allowed for storage
    areas and databases.
@@ -35548,9 +35788,9 @@
    Implementation feedback is welcome and will be used to update this
    suggestion in future.
 
-  <h4 id=privacy><span class=secno>4.11.4 </span>Privacy</h4>
+  <h4 id=privacy><span class=secno>5.10.4 </span>Privacy</h4>
 
-  <h5 id=user-tracking><span class=secno>4.11.4.1. </span>User tracking</h5>
+  <h5 id=user-tracking><span class=secno>5.10.4.1. </span>User tracking</h5>
 
   <p>A third-party advertiser (or any entity capable of getting content
    distributed to multiple sites) could use a unique identifier stored in its
@@ -35646,7 +35886,7 @@
    headers and configuration settings) to combine separate sessions into
    coherent user profiles.
 
-  <h5 id=cookie><span class=secno>4.11.4.2. </span>Cookie resurrection</h5>
+  <h5 id=cookie><span class=secno>5.10.4.2. </span>Cookie resurrection</h5>
 
   <p>If the user interface for persistent storage presents data in the
    persistent storage features separately from data in HTTP session cookies,
@@ -35654,9 +35894,9 @@
    allow sites to use the two features as redundant backup for each other,
    defeating a user's attempts to protect his privacy.
 
-  <h4 id=security7><span class=secno>4.11.5 </span>Security</h4>
+  <h4 id=security7><span class=secno>5.10.5 </span>Security</h4>
 
-  <h5 id=dns-spoofing><span class=secno>4.11.5.1. </span>DNS spoofing attacks</h5>
+  <h5 id=dns-spoofing><span class=secno>5.10.5.1. </span>DNS spoofing attacks</h5>
 
   <p>Because of the potential for DNS spoofing attacks, one cannot guarantee
    that a host claiming to be in a certain domain really is from that domain.
@@ -35664,7 +35904,7 @@
    pages using SSL that have certificates identifying them as being from the
    same domain can access their local storage areas and databases.
 
-  <h5 id=cross-directory><span class=secno>4.11.5.2. </span>Cross-directory
+  <h5 id=cross-directory><span class=secno>5.10.5.2. </span>Cross-directory
    attacks</h5>
 
   <p>Different authors sharing one host name, for example users hosting
@@ -35678,7 +35918,7 @@
    usual DOM scripting security model would make it trivial to bypass this
    protection and access the data from any path.
 
-  <h5 id=implementation><span class=secno>4.11.5.3. </span>Implementation
+  <h5 id=implementation><span class=secno>5.10.5.3. </span>Implementation
    risks</h5>
 
   <p>The two primary risks when implementing these persistent storage
@@ -35703,7 +35943,7 @@
   <p>Thus, strictly following the <a href="#origin0">origin</a> model
    described in this specification is important for user security.
 
-  <h5 id=sql-and><span class=secno>4.11.5.4. </span>SQL and user agents</h5>
+  <h5 id=sql-and><span class=secno>5.10.5.4. </span>SQL and user agents</h5>
 
   <p>User agent implementors are strongly encouraged to audit all their
    supported SQL statements for security implications. For example, <code
@@ -35716,7 +35956,7 @@
    disk representation of the data, as all data in ECMAScript is implicitly
    UTF-16.
 
-  <h5 id=sql-injection><span class=secno>4.11.5.5. </span>SQL injection</h5>
+  <h5 id=sql-injection><span class=secno>5.10.5.5. </span>SQL injection</h5>
 
   <p>Authors are strongly recommended to make use of the <code
    title="">?</code> placeholder feature of the <code
@@ -35724,9 +35964,9 @@
    href="#executesql">executeSql()</a></code> method, and to never construct
    SQL statements on the fly.
 
-  <h3 id=links><span class=secno>4.12 </span>Links</h3>
+  <h3 id=links><span class=secno>5.11 </span>Links</h3>
 
-  <h4 id=hyperlink><span class=secno>4.12.1 </span>Hyperlink elements</h4>
+  <h4 id=hyperlink><span class=secno>5.11.1 </span>Hyperlink elements</h4>
 
   <p>The <code><a href="#a">a</a></code>, <code><a
    href="#area">area</a></code>, and <code><a href="#link">link</a></code>
@@ -35806,7 +36046,7 @@
    fetching the resource, user agents must not use metadata included in the
    link to the resource to determine its type.
 
-  <h4 id=following><span class=secno>4.12.2 </span><dfn
+  <h4 id=following><span class=secno>5.11.2 </span><dfn
    id=following0>Following hyperlinks</dfn></h4>
   <!-- XXXURL change to URL -->
 
@@ -35868,7 +36108,7 @@
    hyperlink's element in question is associated as the <a
    href="#source0">source browsing context</a>.
 
-  <h5 id=hyperlink0><span class=secno>4.12.2.1. </span>Hyperlink auditing</h5>
+  <h5 id=hyperlink0><span class=secno>5.11.2.1. </span>Hyperlink auditing</h5>
   <!-- XXXURL change to URL, algorithms -->
 
   <p>If an <code><a href="#a">a</a></code> or <code><a
@@ -35878,7 +36118,7 @@
    title=attr-hyperlink-ping><a href="#ping">ping</a></code> attribute's
    value, <span title="split the string on spaces">split that string on
    spaces</span>, treat each resulting token as a URI (resolving relative
-   URIs according to <a href="#elements2">element's base URI</a><!--
+   URIs according to <a href="#elements3">element's base URI</a><!--
   XXXURL -->)
    and then should send a request (as described below) to each of the
    resulting URIs. This may be done in parallel with the primary request, and
@@ -35977,7 +36217,7 @@
    it sounds kooky. -->
    </div>
 
-  <h4 id=linkTypes><span class=secno>4.12.3 </span>Link types</h4>
+  <h4 id=linkTypes><span class=secno>5.11.3 </span>Link types</h4>
 
   <p>The following table summarizes the link types that are defined by this
    specification. This table is non-normative; the actual definitions for the
@@ -36209,7 +36449,7 @@
       the previous document in the series is the referenced document.
 
     <tr>
-     <td><code title=rel-search><a href="#search0">search</a></code></td>
+     <td><code title=rel-search><a href="#search1">search</a></code></td>
      <!-- used quite a bit -->
 
      <td><a href="#hyperlink1" title="hyperlink link">Hyperlink</a>
@@ -36299,7 +36539,7 @@
 
     -->
 
-  <h5 id=link-type><span class=secno>4.12.3.1. </span>Link type "<dfn
+  <h5 id=link-type><span class=secno>5.11.3.1. </span>Link type "<dfn
    id=alternate title=rel-alternate><code>alternate</code></dfn>"</h5>
 
   <p>The <code title=rel-alternate><a href="#alternate">alternate</a></code>
@@ -36376,7 +36616,7 @@
    document, it is also implying that those two documents are alternative
    representations of each other.
 
-  <h5 id=link-type0><span class=secno>4.12.3.2. </span>Link type "<dfn
+  <h5 id=link-type0><span class=secno>5.11.3.2. </span>Link type "<dfn
    id=archives title=rel-archives><code>archives</code></dfn>"</h5>
 
   <p>The <code title=rel-archives><a href="#archives">archives</a></code>
@@ -36396,7 +36636,7 @@
    treat the keyword "<code title="">archive</code>" like the <code
    title=rel-archives><a href="#archives">archives</a></code> keyword.
 
-  <h5 id=link-type1><span class=secno>4.12.3.3. </span>Link type "<dfn
+  <h5 id=link-type1><span class=secno>5.11.3.3. </span>Link type "<dfn
    id=author title=rel-author><code>author</code></dfn>"</h5>
 
   <p>The <code title=rel-author><a href="#author">author</a></code> keyword
@@ -36429,7 +36669,7 @@
    "<code>made</code>" as having the <code title=rel-author><a
    href="#author">author</a></code> keyword specified as a link relationship.
 
-  <h5 id=link-type2><span class=secno>4.12.3.4. </span>Link type "<dfn
+  <h5 id=link-type2><span class=secno>5.11.3.4. </span>Link type "<dfn
    id=bookmark title=rel-bookmark><code>bookmark</code></dfn>"</h5>
 
   <p>The <code title=rel-bookmark><a href="#bookmark">bookmark</a></code>
@@ -36493,7 +36733,7 @@
   page as a whole.</p>
 -->
 
-  <h5 id=link-type3><span class=secno>4.12.3.5. </span>Link type "<dfn
+  <h5 id=link-type3><span class=secno>5.11.3.5. </span>Link type "<dfn
    id=external title=rel-external><code>external</code></dfn>"</h5>
 
   <p>The <code title=rel-external><a href="#external">external</a></code>
@@ -36504,7 +36744,7 @@
    keyword indicates that the link is leading to a document that is not part
    of the site that the current document forms a part of.
 
-  <h5 id=link-type4><span class=secno>4.12.3.6. </span>Link type "<dfn
+  <h5 id=link-type4><span class=secno>5.11.3.6. </span>Link type "<dfn
    id=feed title=rel-feed><code>feed</code></dfn>"</h5>
 
   <p>The <code title=rel-feed><a href="#feed">feed</a></code> keyword may be
@@ -36548,7 +36788,7 @@
  </ul></pre>
   </div>
 
-  <h5 id=link-type5><span class=secno>4.12.3.7. </span>Link type "<dfn
+  <h5 id=link-type5><span class=secno>5.11.3.7. </span>Link type "<dfn
    id=help title=rel-help><code>help</code></dfn>"</h5>
 
   <p>The <code title=rel-help><a href="#help">help</a></code> keyword may be
@@ -36576,7 +36816,7 @@
    title=rel-help><a href="#help">help</a></code> keyword indicates that the
    referenced document provides help for the page as a whole.
 
-  <h5 id=rel-icon><span class=secno>4.12.3.8. </span>Link type "<dfn id=icon3
+  <h5 id=rel-icon><span class=secno>5.11.3.8. </span>Link type "<dfn id=icon3
    title=rel-icon><code>icon</code></dfn>"</h5>
 
   <p>The <code title=rel-icon><a href="#icon3">icon</a></code> keyword may be
@@ -36696,7 +36936,7 @@
   ...</pre>
   </div>
 
-  <h5 id=link-type6><span class=secno>4.12.3.9. </span>Link type "<dfn
+  <h5 id=link-type6><span class=secno>5.11.3.9. </span>Link type "<dfn
    id=license title=rel-license><code>license</code></dfn>"</h5>
 
   <p>The <code title=rel-license><a href="#license">license</a></code>
@@ -36713,7 +36953,7 @@
    treat the keyword "<code title="">copyright</code>" like the <code
    title=rel-license><a href="#license">license</a></code> keyword.
 
-  <h5 id=link-type7><span class=secno>4.12.3.10. </span>Link type "<dfn
+  <h5 id=link-type7><span class=secno>5.11.3.10. </span>Link type "<dfn
    id=nofollow title=rel-nofollow><code>nofollow</code></dfn>"</h5>
 
   <p>The <code title=rel-nofollow><a href="#nofollow">nofollow</a></code>
@@ -36726,7 +36966,7 @@
    included primarily because of a commercial relationship between people
    affiliated with the two pages.
 
-  <h5 id=link-type8><span class=secno>4.12.3.11. </span>Link type "<dfn
+  <h5 id=link-type8><span class=secno>5.11.3.11. </span>Link type "<dfn
    id=noreferrer title=rel-noreferrer><code>noreferrer</code></dfn>"</h5>
 
   <p>The <code title=rel-noreferrer><a
@@ -36740,7 +36980,7 @@
    include a <code title="">Referer</code> HTTP header (or equivalent for
    other protocols) in the request.
 
-  <h5 id=link-type9><span class=secno>4.12.3.12. </span>Link type "<dfn
+  <h5 id=link-type9><span class=secno>5.11.3.12. </span>Link type "<dfn
    id=pingback title=rel-pingback><code>pingback</code></dfn>"</h5>
 
   <p>The <code title=rel-pingback><a href="#pingback">pingback</a></code>
@@ -36752,7 +36992,7 @@
    href="#pingback">pingback</a></code> keyword, see the Pingback 1.0
    specification. <a href="#refsPINGBACK">[PINGBACK]</a>
 
-  <h5 id=link-type10><span class=secno>4.12.3.13. </span>Link type "<dfn
+  <h5 id=link-type10><span class=secno>5.11.3.13. </span>Link type "<dfn
    id=prefetch title=rel-prefetch><code>prefetch</code></dfn>"</h5>
 
   <p>The <code title=rel-prefetch><a href="#prefetch">prefetch</a></code>
@@ -36768,28 +37008,28 @@
   <p>There is no default type for resources given by the <code
    title=rel-prefetch><a href="#prefetch">prefetch</a></code> keyword.
 
-  <h5 id=link-type11><span class=secno>4.12.3.14. </span>Link type "<dfn
-   id=search0 title=rel-search><code>search</code></dfn>"</h5>
+  <h5 id=link-type11><span class=secno>5.11.3.14. </span>Link type "<dfn
+   id=search1 title=rel-search><code>search</code></dfn>"</h5>
 
-  <p>The <code title=rel-search><a href="#search0">search</a></code> keyword
+  <p>The <code title=rel-search><a href="#search1">search</a></code> keyword
    may be used with <code><a href="#link">link</a></code>, <code><a
    href="#a">a</a></code>, and <code><a href="#area">area</a></code>
    elements. For <code><a href="#link">link</a></code> elements, it creates a
    <a href="#hyperlink1" title="hyperlink link">hyperlink</a>.
 
-  <p>The <code title=rel-search><a href="#search0">search</a></code> keyword
+  <p>The <code title=rel-search><a href="#search1">search</a></code> keyword
    indicates that the referenced document provides an interface specifically
    for searching the document and its related resources.
 
   <p class=note>OpenSearch description documents can be used with <code><a
    href="#link">link</a></code> elements and the <code title=rel-search><a
-   href="#search0">search</a></code> link type to enable user agents to
+   href="#search1">search</a></code> link type to enable user agents to
    autodiscover search interfaces. <a href="#refsOPENSEARCH">[OPENSEARCH]</a></p>
   <!-- XXX
   http://www.opensearch.org/Specifications/OpenSearch/1.1#Autodiscovery_in_HTML.2FXHTML
   -->
 
-  <h5 id=link-type12><span class=secno>4.12.3.15. </span>Link type "<dfn
+  <h5 id=link-type12><span class=secno>5.11.3.15. </span>Link type "<dfn
    id=stylesheet title=rel-stylesheet><code>stylesheet</code></dfn>"</h5>
 
   <p>The <code title=rel-stylesheet><a
@@ -36812,12 +37052,12 @@
    is <code title="">text/css</code>.
 
   <p><strong>Quirk:</strong> If the document has been set to <a
-   href="#quirks">quirks mode</a> and the <a href="#content-type8"
+   href="#quirks">quirks mode</a> and the <a href="#content-type5"
    title=Content-Type>Content-Type metadata</a> of the external resource is
    not a supported style sheet type, the user agent must instead assume it to
    be <code title="">text/css</code>.
 
-  <h5 id=link-type13><span class=secno>4.12.3.16. </span>Link type "<dfn
+  <h5 id=link-type13><span class=secno>5.11.3.16. </span>Link type "<dfn
    id=sidebar title=rel-sidebar><code>sidebar</code></dfn>"</h5>
 
   <p>The <code title=rel-sidebar><a href="#sidebar">sidebar</a></code>
@@ -36837,7 +37077,7 @@
    specified is a <dfn id=sidebar0 title=rel-sidebar-hyperlink>sidebar
    hyperlink</dfn>.
 
-  <h5 id=link-type14><span class=secno>4.12.3.17. </span>Link type "<dfn
+  <h5 id=link-type14><span class=secno>5.11.3.17. </span>Link type "<dfn
    id=tag title=rel-tag><code>tag</code></dfn>"</h5>
 
   <p>The <code title=rel-tag><a href="#tag">tag</a></code> keyword may be
@@ -36850,7 +37090,7 @@
    that the <em>tag</em> that the referenced document represents applies to
    the current document.
 
-  <h5 id=hierarchical><span class=secno>4.12.3.18. </span>Hierarchical link
+  <h5 id=hierarchical><span class=secno>5.11.3.18. </span>Hierarchical link
    types</h5>
 
   <p>Some documents form part of a hierarchical structure of documents.
@@ -36862,7 +37102,7 @@
 
   <p>A document may be part of multiple hierarchies.
 
-  <h6 id=link-type15><span class=secno>4.12.3.18.1. </span>Link type "<dfn
+  <h6 id=link-type15><span class=secno>5.11.3.18.1. </span>Link type "<dfn
    id=index0 title=rel-index><code>index</code></dfn>"</h6>
 
   <p>The <code title=rel-index><a href="#index0">index</a></code> keyword may
@@ -36882,7 +37122,7 @@
    title="">contents</code>", and "<code title="">toc</code>" like the <code
    title=rel-index><a href="#index0">index</a></code> keyword.
 
-  <h6 id=link-type16><span class=secno>4.12.3.18.2. </span>Link type "<dfn
+  <h6 id=link-type16><span class=secno>5.11.3.18.2. </span>Link type "<dfn
    id=up title=rel-up><code>up</code></dfn>"</h6>
 
   <p>The <code title=rel-up><a href="#up">up</a></code> keyword may be used
@@ -36950,7 +37190,7 @@
    <code title=rel-up><a href="#up">up</a></code> keywords (the interface
    hides duplicates).
 
-  <h5 id=sequential><span class=secno>4.12.3.19. </span>Sequential link types</h5>
+  <h5 id=sequential><span class=secno>5.11.3.19. </span>Sequential link types</h5>
 
   <p>Some documents form part of a sequence of documents.
 
@@ -36961,7 +37201,7 @@
 
   <p>A document may be part of multiple sequences.
 
-  <h6 id=link-type17><span class=secno>4.12.3.19.1. </span>Link type "<dfn
+  <h6 id=link-type17><span class=secno>5.11.3.19.1. </span>Link type "<dfn
    id=first title=rel-first><code>first</code></dfn>"</h6>
 
   <p>The <code title=rel-first><a href="#first">first</a></code> keyword may
@@ -36980,7 +37220,7 @@
    title="">start</code>" like the <code title=rel-first><a
    href="#first">first</a></code> keyword.
 
-  <h6 id=link-type18><span class=secno>4.12.3.19.2. </span>Link type "<dfn
+  <h6 id=link-type18><span class=secno>5.11.3.19.2. </span>Link type "<dfn
    id=last title=rel-last><code>last</code></dfn>"</h6>
 
   <p>The <code title=rel-last><a href="#last">last</a></code> keyword may be
@@ -36997,7 +37237,7 @@
    treat the keyword "<code title="">end</code>" like the <code
    title=rel-last><a href="#last">last</a></code> keyword.
 
-  <h6 id=link-type19><span class=secno>4.12.3.19.3. </span>Link type "<dfn
+  <h6 id=link-type19><span class=secno>5.11.3.19.3. </span>Link type "<dfn
    id=next title=rel-next><code>next</code></dfn>"</h6>
 
   <p>The <code title=rel-next><a href="#next">next</a></code> keyword may be
@@ -37010,7 +37250,7 @@
    indicates that the document is part of a sequence, and that the link is
    leading to the document that is the next logical document in the sequence.
 
-  <h6 id=link-type20><span class=secno>4.12.3.19.4. </span>Link type "<dfn
+  <h6 id=link-type20><span class=secno>5.11.3.19.4. </span>Link type "<dfn
    id=prev title=rel-prev><code>prev</code></dfn>"</h6>
 
   <p>The <code title=rel-prev><a href="#prev">prev</a></code> keyword may be
@@ -37028,7 +37268,7 @@
    treat the keyword "<code title="">previous</code>" like the <code
    title=rel-prev><a href="#prev">prev</a></code> keyword.
 
-  <h5 id=other0><span class=secno>4.12.3.20. </span>Other link types</h5>
+  <h5 id=other0><span class=secno>5.11.3.20. </span>Other link types</h5>
 
   <p>Other than the types defined above, only types defined as extensions in
    the <a href="http://wiki.whatwg.org/wiki/RelExtensions">WHATWG Wiki
@@ -37155,246 +37395,22 @@
    described above, with the "proposal" status.
 
   <p>This specification does not define how new values will get approved. It
-   is expected that the Wiki will have a community that addresses this.</p>
-  <!-- XXXURL change to URL -->
+   is expected that the Wiki will have a community that addresses this.
 
-  <h3 id=interfaces><span class=secno>4.13 </span>Interfaces for URI
-   manipulation</h3>
-  <!-- XXXURL change to URL -->
-
-  <p>An interface that has a complement of <dfn id=uri-decomposition>URI
-   decomposition attributes</dfn> will have seven attributes with the
-   following definitions:
-
-  <pre class=idl>
-           attribute DOMString <a href="#protocol0" title=dom-uda-protocol>protocol</a>;
-           attribute DOMString <a href="#host0" title=dom-uda-host>host</a>;
-           attribute DOMString <a href="#hostname0" title=dom-uda-hostname>hostname</a>;
-           attribute DOMString <a href="#port0" title=dom-uda-port>port</a>;
-           attribute DOMString <a href="#pathname0" title=dom-uda-pathname>pathname</a>;
-           attribute DOMString <a href="#search1" title=dom-uda-search>search</a>;
-           attribute DOMString <a href="#hash0" title=dom-uda-hash>hash</a>;
-</pre>
-  <!-- XXXURL change to URL -->
-
-  <p>The attributes defined to be URI decomposition attributes must act as
-   described for the attributes with the same corresponding names in this
-   section.</p>
-  <!-- XXXURL change to URL -->
-
-  <p>In addition, an interface with a complement of URI decomposition
-   attributes will define an <dfn id=input
-   title=concept-uda-input>input</dfn>, which is a URI that the attributes
-   act on, and a <dfn id=common3 title=concept-uda-setter>common setter
-   action</dfn>, which is a set of steps invoked when any of the attributes'
-   setters are invoked.</p>
-  <!-- XXXURL change to URL -->
-
-  <p>The seven URI decomposition attributes have similar requirements.</p>
-  <!-- XXXURL change to URL -->
-
-  <p>On getting, if the <a href="#input" title=concept-uda-input>input</a>
-   fulfills the condition given in the "getter condition" column
-   corresponding to the attribute in the table below, the user agent must
-   return the part of the <a href="#input" title=concept-uda-input>input</a>
-   URI given in the "component" column, with any prefixes specified in the
-   "prefix" column appropriately added to the start of the string and any
-   suffixes specified in the "suffix" column appropriately added to the end
-   of the string. Otherwise, the attribute must return the empty string.</p>
-  <!-- XXXURL change to URL; algorithms or something? -->
-
-  <p>On setting, the new value must first be mutated as described by the
-   "setter preprocessor" column, then mutated by %-escaping any characters in
-   the new value that are not valid in the relevant component as given by the
-   "component" column. Then, if the resulting new value fulfills the
-   condition given in the "setter condition" column, the user agent must make
-   a new string <var title="">output</var> by replacing the component of the
-   URI given by the "component" column in the <a href="#input"
-   title=concept-uda-input>input</a> URI with the new value; otherwise, the
-   user agent must let <var title="">output</var> be equal to the <a
-   href="#input" title=concept-uda-input>input</a>. Finally, the user agent
-   must invoke the <a href="#common3" title=concept-uda-setter>common setter
-   action</a> with the value of <var title="">output</var>.</p>
-  <!-- XXXURL change to URL -->
-
-  <p>When replacing a component in the URI, if the component is part of an
-   optional group in the URI syntax consisting of a character followed by the
-   component, the component (including its prefix character) must be included
-   even if the new value is the empty string.
-
-  <p class=note>The previous paragraph applies in particular to the "<code
-   title="">:</code>" before a <port> component, the "<code
-   title="">?</code>" before a <query> component, and the "<code
-   title="">#</code>" before a <fragment> component.</p>
-  <!-- XXXURL change to URL; algorithms -->
-
-  <p>The rules for parsing and constructing URIs are described in RFC 3986
-   and RFC 3987. <a href="#refsRFC3986">[RFC3986]</a> <a
-   href="#refsRFC3987">[RFC3987]</a>
-
-  <table>
-   <thead>
-    <tr>
-     <th>Attribute
-
-     <th>Component
-
-     <th>Getter Condition
-
-     <th>Prefix
-
-     <th>Suffix
-
-     <th>Setter Preprocessor
-
-     <th>Setter Condition
-
-   <tbody>
-    <tr>
-     <td><dfn id=protocol0 title=dom-uda-protocol><code>protocol</code></dfn>
-      
-
-     <td><scheme>
-
-     <td>—
-
-     <td>—
-
-     <td>U+003A COLON ("<code title="">:</code>")
-
-     <td>Remove all trailing U+003A COLON ("<code title="">:</code>")
-      characters
-
-     <td>The new value is not the empty string
-
-    <tr>
-     <td><dfn id=host0 title=dom-uda-host><code>host</code></dfn>
-
-     <td><a href="#lthostportgt"><hostport></a>
-
-     <td><a href="#input" title=concept-uda-input>input</a> is hierarchical
-      and uses a server-based naming authority
-
-     <td>—
-
-     <td>—
-
-     <td>—
-
-     <td>—
-
-    <tr>
-     <td><dfn id=hostname0 title=dom-uda-hostname><code>hostname</code></dfn>
-      
-
-     <td><host>/<ihost>
-
-     <td><a href="#input" title=concept-uda-input>input</a> is hierarchical
-      and uses a server-based naming authority
-
-     <td>—
-
-     <td>—
-
-     <td>Remove all leading U+002F SOLIDUS ("<code title="">/</code>")
-      characters
-
-     <td>—
-
-    <tr>
-     <td><dfn id=port0 title=dom-uda-port><code>port</code></dfn>
-
-     <td><port>
-
-     <td><a href="#input" title=concept-uda-input>input</a> is hierarchical
-      and uses a server-based naming authority
-
-     <td>—
-
-     <td>—
-
-     <td>Remove any characters in the new value that are not in the range
-      U+0030 DIGIT ZERO .. U+0039 DIGIT NINE. If the resulting string is
-      empty, set it to a single U+0030 DIGIT ZERO character ('0').
-
-     <td>—
-
-    <tr>
-     <td><dfn id=pathname0 title=dom-uda-pathname><code>pathname</code></dfn>
-      
-
-     <td><abs_path>
-
-     <td><a href="#input" title=concept-uda-input>input</a> is hierarchical
-
-     <td>—
-
-     <td>—
-
-     <td>If it has no leading U+002F SOLIDUS ("<code title="">/</code>")
-      character, prepend a U+002F SOLIDUS ("<code title="">/</code>")
-      character to the new value
-
-     <td>—
-
-    <tr>
-     <td><dfn id=search1 title=dom-uda-search><code>search</code></dfn>
-
-     <td><query>
-
-     <td><a href="#input" title=concept-uda-input>input</a> is hierarchical
-
-     <td>U+003F QUESTION MARK ("<code title="">?</code>")
-
-     <td>—
-
-     <td>Remove one leading U+003F QUESTION MARK ("<code title="">?</code>")
-      character, if any
-
-     <td>—
-
-    <tr>
-     <td><dfn id=hash0 title=dom-uda-hash><code>hash</code></dfn>
-
-     <td><fragment>
-
-     <td>Fragment identifier is longer than zero characters
-
-     <td>U+0023 NUMBER SIGN ("<code title="">#</code>")
-
-     <td>—
-
-     <td>Remove one leading U+0023 NUMBER SIGN ("<code title="">#</code>")
-      character, if any
-
-     <td>—
-  </table>
-
-  <p>The <dfn id=lthostportgt><hostport></dfn> component is defined as
-   being the <host>/<ihost> component, followed by a colon and
-   the <port> component, but with the colon and <port> component
-   omitted if the given port matches the default port for the protocol given
-   by the <scheme> component.</p>
-  <!--
-  http://www.hixie.ch/tests/adhoc/dom/level0/location/components/
-  http://lxr.mozilla.org/seamonkey/source/dom/src/base/nsLocation.cpp
-  http://wp.netscape.com/eng/mozilla/3.0/handbook/javascript/ref_h-l.htm#84722
--->
-
-  <h2 id=editing><span class=secno>5. </span><dfn id=user-interaction>User
+  <h2 id=editing><span class=secno>6. </span><dfn id=user-interaction>User
    Interaction</dfn></h2>
 
   <p>This section describes various features that allow authors to enable
    users to edit documents and parts of documents interactively.
 
-  <h3 id=editing-intro><span class=secno>5.1 </span>Introduction</h3>
+  <h3 id=editing-intro><span class=secno>6.1 </span>Introduction</h3>
 
   <p><em>This section is non-normative.</em>
 
   <p class=big-issue>Would be nice to explain how these features work
    together.
 
-  <h3 id=the-irrelevant><span class=secno>5.2 </span>The <dfn id=irrelevant
+  <h3 id=the-irrelevant><span class=secno>6.2 </span>The <dfn id=irrelevant
    title=attr-irrelevant><code>irrelevant</code></dfn> attribute</h3>
 
   <p>All elements may have the <code title=attr-irrelevant><a
@@ -37448,7 +37464,7 @@
    title=dom-irrelevant><code>irrelevant</code></dfn> DOM attribute must <a
    href="#reflect">reflect</a> the content attribute of the same name.
 
-  <h3 id=activation><span class=secno>5.3 </span>Activation</h3>
+  <h3 id=activation><span class=secno>6.3 </span>Activation</h3>
 
   <p>The <dfn id=click1 title=dom-click>click()</dfn> method must <a
    href="#firing">fire a <code>click</code> event</a> at the element, whose
@@ -37461,7 +37477,7 @@
    href="#activation0">activation behavior</a>; the first element, in reverse
    tree order, to have one, must have its activation behavior executed.
 
-  <h3 id=scrolling><span class=secno>5.4 </span>Scrolling elements into view</h3>
+  <h3 id=scrolling><span class=secno>6.4 </span>Scrolling elements into view</h3>
 
   <p>The <dfn id=scrollintoview
    title=dom-scrollIntoView><code>scrollIntoView([<var
@@ -37486,7 +37502,7 @@
    media-specific manner most useful to the user.</p>
   <!-- XXX maybe this should move to CSSOM -->
 
-  <h3 id=focus><span class=secno>5.5 </span>Focus</h3>
+  <h3 id=focus><span class=secno>6.5 </span>Focus</h3>
   <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%20%0A...%3Cform%3E%3Cinput%20name%3Da%20onfocus%3D%22value%2B%3D1%3Bd.name%3D%27a%27%3Bname%3D%27d%27%3Bb.focus()%22%3E%0A%3Cinput%20name%3Db%20onfocus%3D%22value%2B%3D1%3Bc.focus()%22%3E%0A%3Cinput%20name%3Dc%20onfocus%3D%22value%2B%3D1%3Bd.focus()%22%3E%0A%3Cinput%20name%3Dd%20onfocus%3D%22value%2B%3D1%3Ba.focus()%22%3E -->
   <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A...%3Cform%3E%0A%3Ctextarea%20name%3Dt%20cols%3D100%20rows%3D3%3E%3C%2Ftextarea%3E%3Cp%3E%0A%3Cinput%20name%3Da%20onfocus%3D%22t.value%2B%3D%27af1%20%27%3Bb.focus()%3Balert(document.activeElement.name)%3Bt.value%2B%3D%27af2%20%27%3B%22%20onblur%3D%22t.value%2B%3D%27ab%20%27%3B%22%3E%0A%3Cinput%20name%3Db%20onfocus%3D%22t.value%2B%3D%27bf1%20%27%3Bc.focus()%3Bt.value%2B%3D%27bf2%20%27%3B%22%20onblur%3D%22t.value%2B%3D%27bb%20%27%3B%22%3E%0A%3Cinput%20name%3Dc%20onfocus%3D%22t.value%2B%3D%27cf1%20%27%3Bc.focus()%3Bt.value%2B%3D%27cf2%20%27%3B%22%20onblur%3D%22t.value%2B%3D%27cb%20%27%3B%22%3E%0A -->
   <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%3Cbody%20onload%3D%22document.forms%5B0%5D.a.focus()%22%3E%0A...%3Cform%3E%0A%3Ctextarea%20name%3Dt%20cols%3D100%20rows%3D3%3E%3C%2Ftextarea%3E%3Cp%3E%0A%3Cinput%20name%3Da%20onblur%3D%22t.value%2B%3D'ab%20'%3B%20b.focus()%3B%22%3E%0A%3Cinput%20name%3Db%20onfocus%3D%22t.value%2B%3D'bf1%20'%3Ba.focus()%3Bt.value%2B%3D'bf2%20'%3B%22%20onblur%3D%22t.value%2B%3D'bb%20'%3B%22%3E -->
@@ -37507,7 +37523,7 @@
    <a href="#top-level">top-level browsing context</a> itself has the
    <em>system focus</em>.
 
-  <h4 id=focus-management><span class=secno>5.5.1 </span>Focus management</h4>
+  <h4 id=focus-management><span class=secno>6.5.1 </span>Focus management</h4>
 
   <p>The <dfn id=focusing>focusing steps</dfn> are as follows:
 
@@ -37598,7 +37614,7 @@
    title="browsing context">browsing contexts</a>, or any element in the
    document or its browsing contexts currently has the system focus.
 
-  <h4 id=sequential0><span class=secno>5.5.2 </span>Sequential focus
+  <h4 id=sequential0><span class=secno>6.5.2 </span>Sequential focus
    navigation</h4>
 
   <p>The <dfn id=tabindex title=attr-tabindex><code>tabindex</code></dfn>
@@ -37763,7 +37779,7 @@
    http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/focus.asp
 -->
 
-  <h3 id=selection><span class=secno>5.6 </span>The text selection APIs</h3>
+  <h3 id=selection><span class=secno>6.6 </span>The text selection APIs</h3>
 
   <p>Every <a href="#browsing1">browsing context</a> has <dfn id=a-selection
    title="the selection">a selection</dfn>. The selection can be empty, and
@@ -37820,7 +37836,7 @@
    href="#selection1">::selection</a></code> pseudo-element. <a
    href="#refsSELECTORS">[SELECTORS]</a> <a href="#refsCSS21">[CSS21]</a>
 
-  <h4 id=documentSelection><span class=secno>5.6.1 </span>APIs for the
+  <h4 id=documentSelection><span class=secno>6.6.1 </span>APIs for the
    browsing context selection</h4>
 
   <p>The <dfn id=getselection
@@ -38022,7 +38038,7 @@
    interface has no relation to the <code><a
    href="#datagridselection">DataGridSelection</a></code> interface.
 
-  <h4 id=textFieldSelection><span class=secno>5.6.2 </span>APIs for the text
+  <h4 id=textFieldSelection><span class=secno>6.6.2 </span>APIs for the text
    field selections</h4>
 
   <p class=big-issue>When we define HTMLTextAreaElement and HTMLInputElement
@@ -38112,7 +38128,7 @@
    elements that are not displaying simple text fields, they must raise an
    <code>INVALID_STATE_ERR</code> exception.
 
-  <h3 id=contenteditable><span class=secno>5.7 </span>The <code
+  <h3 id=contenteditable><span class=secno>6.7 </span>The <code
    title=attr-contenteditable><a
    href="#contenteditable0">contenteditable</a></code> attribute</h3>
 
@@ -38209,7 +38225,7 @@
   <!-- XXX would be useful to have a way to mark an element as
   unremovable. -->
 
-  <h4 id=user-editing><span class=secno>5.7.1 </span>User editing actions</h4>
+  <h4 id=user-editing><span class=secno>6.7.1 </span>User editing actions</h4>
 
   <p>There are several actions that the user agent should allow the user to
    perform while the user is interacting with an editing host. How exactly
@@ -38397,7 +38413,7 @@
    href="#a-selection">the selection</a> followed by a request to break the
    paragraph at that position.
 
-  <h4 id=making><span class=secno>5.7.2 </span>Making entire documents
+  <h4 id=making><span class=secno>6.7.2 </span>Making entire documents
    editable</h4>
 
   <p>Documents have a <dfn id=designMode
@@ -38432,7 +38448,7 @@
    href="#designModeScriptBlocked">causes scripts in general to be
    disabled</a> and the document to become editable.
 
-  <h3 id=dnd><span class=secno>5.8 </span><dfn id=drag-and>Drag and
+  <h3 id=dnd><span class=secno>6.8 </span><dfn id=drag-and>Drag and
    drop</dfn></h3>
   <!--XXX
 
@@ -38488,13 +38504,13 @@
    (so if the operation is not canceled, there must be at least one element
    in the middle step).
 
-  <h4 id=introduction4><span class=secno>5.8.1 </span>Introduction</h4>
+  <h4 id=introduction4><span class=secno>6.8.1 </span>Introduction</h4>
 
   <p><em>This section is non-normative.</em>
 
   <p class=big-issue>It's also currently non-existent.
 
-  <h4 id=the-dragevent><span class=secno>5.8.2 </span>The <code><a
+  <h4 id=the-dragevent><span class=secno>6.8.2 </span>The <code><a
    href="#dragevent">DragEvent</a></code> and <code><a
    href="#datatransfer0">DataTransfer</a></code> interfaces</h4>
 
@@ -38645,7 +38661,7 @@
    the drag feedback</a>. It adds an element to the <code><a
    href="#datatransfer0">DataTransfer</a></code> object.
 
-  <h4 id=events1><span class=secno>5.8.3 </span>Events fired during a
+  <h4 id=events1><span class=secno>6.8.3 </span>Events fired during a
    drag-and-drop action</h4>
 
   <p>The following events are involved in the drag-and-drop model. Whenever
@@ -38899,7 +38915,7 @@
      <td><code title="">copy</code>
   </table>
 
-  <h4 id=drag-and-drop><span class=secno>5.8.4 </span>Drag-and-drop
+  <h4 id=drag-and-drop><span class=secno>6.8.4 </span>Drag-and-drop
    processing model</h4>
 
   <p>When the user attempts to begin a drag operation, the user agent must
@@ -39337,7 +39353,7 @@
     </ol>
   </ol>
 
-  <h5 id=when-the><span class=secno>5.8.4.1. </span>When the drag-and-drop
+  <h5 id=when-the><span class=secno>6.8.4.1. </span>When the drag-and-drop
    operation starts or ends in another document</h5>
 
   <p>The model described above is independent of which <code>Document</code>
@@ -39348,7 +39364,7 @@
   source in the events to the target, or is that obvious enough from
   the requirements in the event section above? -->
 
-  <h5 id=when-the0><span class=secno>5.8.4.2. </span>When the drag-and-drop
+  <h5 id=when-the0><span class=secno>6.8.4.2. </span>When the drag-and-drop
    operation starts or ends in another application</h5>
 
   <p>If the drag is initiated in another application, the <a
@@ -39372,7 +39388,7 @@
    ended in another application from the case of a drag-and-drop operation
    being started or ended in another document from another domain.
 
-  <h4 id=the-draggable><span class=secno>5.8.5 </span>The <dfn id=draggable
+  <h4 id=the-draggable><span class=secno>6.8.5 </span>The <dfn id=draggable
    title=attr-draggable><code>draggable</code></dfn> attribute</h4>
 
   <p>All elements may have the <code title=attr-draggable><a
@@ -39422,7 +39438,7 @@
    href="#draggable">draggable</a></code> content attribute must be set to
    the literal value <code title="">true</code>.
 
-  <h4 id=copy-and><span class=secno>5.8.6 </span>Copy and paste</h4>
+  <h4 id=copy-and><span class=secno>6.8.6 </span>Copy and paste</h4>
 
   <p>Copy-and-paste is a form of drag-and-drop: the "copy" part is equivalent
    to dragging content to another application (the "clipboard"), and the
@@ -39433,7 +39449,7 @@
    System) is equivalent to a drag-and-drop operation where the source is the
    selection.
 
-  <h5 id=copy-to><span class=secno>5.8.6.1. </span>Copy to clipboard</h5>
+  <h5 id=copy-to><span class=secno>6.8.6.1. </span>Copy to clipboard</h5>
 
   <p>When the user invokes a copy operation, the user agent must act as if
    the user had invoked a drag on the current selection. If the drag-and-drop
@@ -39445,14 +39461,14 @@
    agent should then follow the relevant platform-specific conventions for
    copy operations (e.g. updating the clipboard).
 
-  <h5 id=cut-to><span class=secno>5.8.6.2. </span>Cut to clipboard</h5>
+  <h5 id=cut-to><span class=secno>6.8.6.2. </span>Cut to clipboard</h5>
 
   <p>When the user invokes a cut operation, the user agent must act as if the
    user had invoked a copy operation (see the previous section), followed, if
    the copy was completed successfully, by <a
    href="#contenteditable-delete">a selection delete operation</a>.
 
-  <h5 id=paste><span class=secno>5.8.6.3. </span>Paste from clipboard</h5>
+  <h5 id=paste><span class=secno>6.8.6.3. </span>Paste from clipboard</h5>
 
   <p>When the user invokes a clipboard paste operation, the user agent must
    act as if the user had invoked a drag on a hypothetical application
@@ -39464,7 +39480,7 @@
    keyboard focus, and then ended the drag-and-drop operation without
    canceling it.
 
-  <h5 id=paste0><span class=secno>5.8.6.4. </span>Paste from selection</h5>
+  <h5 id=paste0><span class=secno>6.8.6.4. </span>Paste from selection</h5>
 
   <p>When the user invokes a selection paste operation, the user agent must
    act as if the user had invoked a drag on the current selection, then
@@ -39472,7 +39488,7 @@
    element with the keyboard focus, and then ended the drag-and-drop
    operation without canceling it.
 
-  <h4 id=security8><span class=secno>5.8.7 </span>Security risks in the
+  <h4 id=security8><span class=secno>6.8.7 </span>Security risks in the
    drag-and-drop model</h4>
 
   <p>User agents must not make the data added to the <code><a
@@ -39498,7 +39514,7 @@
    sensitive sources and dropped into hostile documents without the user's
    consent.
 
-  <h3 id=undo><span class=secno>5.9 </span><dfn id=undo-history>Undo
+  <h3 id=undo><span class=secno>6.9 </span><dfn id=undo-history>Undo
    history</dfn></h3>
 
   <p class=big-issue>There has got to be a better way of doing this, surely.
@@ -39517,7 +39533,7 @@
    of one or more of the following:
 
   <ul>
-   <li>Changes to the <a href="#content">content attributes</a> of an
+   <li>Changes to the <a href="#content0">content attributes</a> of an
     <code>Element</code> node.
 
    <li>Changes to the <a href="#dom-attributes">DOM attributes</a> of a
@@ -39544,7 +39560,7 @@
    actions (such as interactions with server-side state, or in the
    implementation of a drawing tool).
 
-  <h4 id=the-undomanager><span class=secno>5.9.1 </span>The <code><a
+  <h4 id=the-undomanager><span class=secno>6.9.1 </span>The <code><a
    href="#undomanager">UndoManager</a></code> interface</h4>
 
   <div class=big-issue>
@@ -39687,7 +39703,7 @@
    "startBatchingDOMChangesForUndo()" and after that the changes to the DOM
    go in as if the user had done them.
 
-  <h4 id=undo-moving><span class=secno>5.9.2 </span><dfn id=undo-moving0
+  <h4 id=undo-moving><span class=secno>6.9.2 </span><dfn id=undo-moving0
    title=do-undo>Undo: moving back in the undo transaction history</dfn></h4>
 
   <p>When the user invokes an undo operation, or when the <code
@@ -39729,7 +39745,7 @@
    used to populate the redo history, and will then be used if the user
    invokes the "redo" command to undo his undo.
 
-  <h4 id=redo-moving><span class=secno>5.9.3 </span><dfn id=redo-moving0
+  <h4 id=redo-moving><span class=secno>6.9.3 </span><dfn id=redo-moving0
    title=do-redo>Redo: moving forward in the undo transaction history</dfn></h4>
 
   <p>When the user invokes a redo operation, or when the <code
@@ -39768,7 +39784,7 @@
    on the <code>Document</code> object, using the <a href="#undo-object">undo
    object</a> entry's associated undo object as the event's data.
 
-  <h4 id=the-undomanagerevent><span class=secno>5.9.4 </span>The <code><a
+  <h4 id=the-undomanagerevent><span class=secno>6.9.4 </span>The <code><a
    href="#undomanagerevent">UndoManagerEvent</a></code> interface and the
    <code title=event-undo><a href="#undo0">undo</a></code> and <code
    title=event-redo><a href="#redo">redo</a></code> events</h4>
@@ -39800,7 +39816,7 @@
    <code title=dom-UndoManagerEvent-data><a href="#data3">data</a></code>
    field containing the relevant <a href="#undo-object">undo object</a>.
 
-  <h4 id=implementation0><span class=secno>5.9.5 </span>Implementation notes</h4>
+  <h4 id=implementation0><span class=secno>6.9.5 </span>Implementation notes</h4>
 
   <p>How user agents present the above conceptual model to the user is not
    defined. The undo interface could be a filtered view of the <a
@@ -39817,7 +39833,7 @@
    history</a> described in this section, however, such that to a script
    there is no detectable difference.
 
-  <h3 id=command><span class=secno>5.10 </span>Command APIs</h3>
+  <h3 id=command><span class=secno>6.10 </span>Command APIs</h3>
 
   <p>The <dfn id=execCommand
    title=dom-document-execCommand><code>execCommand(<var
@@ -40358,9 +40374,9 @@
  "justifycenter", "justifyright", "justifyfull", "indent", "outdent"
 -->
 
-  <h2 id=comms><span class=secno>6. </span>Communication</h2>
+  <h2 id=comms><span class=secno>7. </span>Communication</h2>
 
-  <h3 id=event1><span class=secno>6.1 </span>Event definitions</h3>
+  <h3 id=event1><span class=secno>7.1 </span>Event definitions</h3>
 
   <p>Messages in <a href="#cross-document">cross-document messaging</a> and
    in <a href="#server-sent">server-sent DOM events</a>, use the <dfn
@@ -40405,7 +40421,7 @@
    represents, in <a href="#cross-document">cross-document messaging</a>, the
    <code><a href="#window">Window</a></code> from which the message came.
 
-  <h3 id=server-sent-events><span class=secno>6.2 </span><dfn
+  <h3 id=server-sent-events><span class=secno>7.2 </span><dfn
    id=server-sent>Server-sent DOM events</dfn></h3>
   <!-- event-source -->
 
@@ -40414,7 +40430,7 @@
    href="#event-source">event-source</a></code> element provides a simple
    interface to this mechanism.
 
-  <h4 id=the-remoteeventtarget><span class=secno>6.2.1 </span>The <dfn
+  <h4 id=the-remoteeventtarget><span class=secno>7.2.1 </span>The <dfn
    id=remoteeventtarget><code>RemoteEventTarget</code></dfn> interface</h4>
 
   <p>Any object that implements the <code>EventTarget</code> interface must
@@ -40449,7 +40465,7 @@
   <p>Relative URIs must be resolved relative to <span
    class=big-issue>...</span>.
 
-  <h4 id=connecting><span class=secno>6.2.2 </span>Connecting to an event
+  <h4 id=connecting><span class=secno>7.2.2 </span>Connecting to an event
    stream</h4>
 
   <p>Each object implementing the <code>EventTarget</code> and <code><a
@@ -40519,7 +40535,7 @@
   XXX define this better once that spec is more stable -->
    
 
-  <p>HTTP 200 OK responses with a <a href="#content-type8">Content-Type</a>
+  <p>HTTP 200 OK responses with a <a href="#content-type5">Content-Type</a>
    header specifying the type <code>text/event-stream</code> that are either
    from <a href="#domain0">the document's domain</a> or explicitly allowed by
    the Access-Control HTTP headers must be processed line by line <a
@@ -40535,7 +40551,7 @@
    reconnection time of the event source.
 
   <p>HTTP 200 OK responses that have a <a
-   href="#content-type8">Content-Type</a> other than
+   href="#content-type5">Content-Type</a> other than
    <code>text/event-stream</code> (or some other supported type), and HTTP
    responses whose Access-Control headers indicate that the resource are not
    to be used, must be ignored and must prevent the user agent from
@@ -40596,7 +40612,7 @@
 
   <p>For non-HTTP protocols, UAs should act in equivalent ways.
 
-  <h4 id=parsing1><span class=secno>6.2.3 </span>Parsing an event stream</h4>
+  <h4 id=parsing1><span class=secno>7.2.3 </span>Parsing an event stream</h4>
 
   <p>This event stream format's MIME type is <code>text/event-stream</code>.
 
@@ -40628,7 +40644,7 @@
    FEED (CRLF) character pair, a single U+000A LINE FEED (LF) character, or a
    single U+000D CARRIAGE RETURN (CR) character.
 
-  <h4 id=event-stream-interpretation><span class=secno>6.2.4
+  <h4 id=event-stream-interpretation><span class=secno>7.2.4
    </span>Interpreting an event stream</h4>
 
   <p>Bytes or sequences of bytes that are not valid UTF-8 sequences must be
@@ -40866,7 +40882,7 @@
    <p>This is because the space after the colon is ignored if present.</p>
   </div>
 
-  <h4 id=notes><span class=secno>6.2.5 </span>Notes</h4>
+  <h4 id=notes><span class=secno>7.2.5 </span>Notes</h4>
 
   <p>Legacy proxy servers are known to, in certain cases, drop HTTP
    connections after a short timeout. To protect against such proxy servers,
@@ -40893,7 +40909,7 @@
    href="#event-source">event-source</a></code> functionality on a per-page
    basis.
 
-  <h3 id=network><span class=secno>6.3 </span>Network connections</h3>
+  <h3 id=network><span class=secno>7.3 </span>Network connections</h3>
 
   <p>To enable Web applications to communicate with each other in local area
    networks, and to maintain bidirectional communications with their
@@ -40919,7 +40935,7 @@
    underlying network. For example, this interface could not be used to
    implement an IRC client without proxying messages through a custom server.
 
-  <h4 id=network-intro><span class=secno>6.3.1 </span>Introduction</h4>
+  <h4 id=network-intro><span class=secno>7.3.1 </span>Introduction</h4>
 
   <p><em>This section is non-normative.</em>
 
@@ -40943,7 +40959,7 @@
    have to implement a compliant HTTP server as well, etc
   -->
 
-  <h4 id=the-connection><span class=secno>6.3.2 </span>The <code><a
+  <h4 id=the-connection><span class=secno>7.3.2 </span>The <code><a
    href="#connection0">Connection</a></code> interface</h4>
 
   <pre class=idl>interface <dfn id=connection0>Connection</dfn> {
@@ -41046,7 +41062,7 @@
    href="#readystate1">readyState</a></code> attribute's value to change, as
    <a href="#closeConnection">described above</a>.
 
-  <h4 id=connection><span class=secno>6.3.3 </span>Connection Events</h4>
+  <h4 id=connection><span class=secno>7.3.3 </span>Connection Events</h4>
 
   <p>All the events described in this section are events in no namespace,
    which do not bubble, are not cancelable, and have no default action.
@@ -41113,7 +41129,7 @@
    completed.</p>
   <!-- XXX make this more generic -->
 
-  <h4 id=tcp-connections><span class=secno>6.3.4 </span>TCP connections</h4>
+  <h4 id=tcp-connections><span class=secno>7.3.4 </span>TCP connections</h4>
 
   <p>The <dfn id=tcpconnection
    title=dom-TCPConnection><code>TCPConnection(<var title="">subdomain</var>,
@@ -41202,7 +41218,7 @@
    title=dom-TCPConnection><a href="#tcpconnection">TCPConnection</a></code>
    constructor.
 
-  <h4 id=broadcast><span class=secno>6.3.5 </span>Broadcast connections</h4>
+  <h4 id=broadcast><span class=secno>7.3.5 </span>Broadcast connections</h4>
 
   <p>The <dfn id=localbroadcastconnection
    title=dom-LocalBroadcastConnection><code>LocalBroadcastConnection()</code></dfn>
@@ -41247,7 +41263,7 @@
    <code title=event-connection-open><a href="#open3">open</a></code> event
    must be fired. Broadcast connections are never closed.
 
-  <h5 id=broadcasting><span class=secno>6.3.5.1. </span>Broadcasting over
+  <h5 id=broadcasting><span class=secno>7.3.5.1. </span>Broadcasting over
    TCP/IP</h5>
 
   <p class=big-issue>Should we drop this altogether? Letting people fill the
@@ -41328,19 +41344,19 @@
    can keep link-local IP addresses secret while still allowing for
    applications to distinguish between multiple participants?
 
-  <h5 id=bluetooth-broadcast><span class=secno>6.3.5.2. </span>Broadcasting
+  <h5 id=bluetooth-broadcast><span class=secno>7.3.5.2. </span>Broadcasting
    over Bluetooth</h5>
 
   <p class=big-issue>Does anyone know enough about Bluetooth to write this
    section?
 
-  <h5 id=irda-broadcast><span class=secno>6.3.5.3. </span>Broadcasting over
+  <h5 id=irda-broadcast><span class=secno>7.3.5.3. </span>Broadcasting over
    IrDA</h5>
 
   <p class=big-issue>Does anyone know enough about IrDA to write this
    section?
 
-  <h4 id=peer-to-peer><span class=secno>6.3.6 </span>Peer-to-peer connections</h4>
+  <h4 id=peer-to-peer><span class=secno>7.3.6 </span>Peer-to-peer connections</h4>
 
   <p>The <dfn id=peertopeerconnection
    title=dom-PeerToPeerConnection><code>PeerToPeerConnection()</code></dfn>
@@ -41400,7 +41416,7 @@
    href="#closeConnection">closed the connection</a>, and stop trying to
    connect.
 
-  <h5 id=peer-to-peer0><span class=secno>6.3.6.1. </span>Peer-to-peer
+  <h5 id=peer-to-peer0><span class=secno>7.3.6.1. </span>Peer-to-peer
    connections over TCP/IP</h5>
 
   <p class=big-issue>Should we replace this section with something that uses
@@ -41449,13 +41465,13 @@
    <em>secure</em> (encrypted) peer-to-peer connections at this time. <span
    class=big-issue>If you can see a good way to do this, let me know.</span>
 
-  <h5 id=bluetooth-peer><span class=secno>6.3.6.2. </span>Peer-to-peer
+  <h5 id=bluetooth-peer><span class=secno>7.3.6.2. </span>Peer-to-peer
    connections over Bluetooth</h5>
 
   <p class=big-issue>Does anyone know enough about Bluetooth to write this
    section?
 
-  <h5 id=irda-peer><span class=secno>6.3.6.3. </span>Peer-to-peer connections
+  <h5 id=irda-peer><span class=secno>7.3.6.3. </span>Peer-to-peer connections
    over IrDA</h5>
 
   <p class=big-issue>Does anyone know enough about IrDA to write this
@@ -41532,7 +41548,7 @@
 > > should it be under the control of the author or user?
 -->
 
-  <h4 id=the-common><span class=secno>6.3.7 </span>The common protocol for
+  <h4 id=the-common><span class=secno>7.3.7 </span>The common protocol for
    TCP-based connections</h4>
 
   <p>The same protocol is used for <code title=dom-TCPConnection><a
@@ -41544,7 +41560,7 @@
    received over such connections (which is the same for both clients and
    servers).
 
-  <h5 id=clients><span class=secno>6.3.7.1. </span><dfn id=clients0>Clients
+  <h5 id=clients><span class=secno>7.3.7.1. </span><dfn id=clients0>Clients
    connecting over TCP</dfn></h5>
 
   <p>This section defines the client-side requirements of the protocol used
@@ -41607,7 +41623,7 @@
    connection</a> and give up trying to connect.</p>
   <!-- XXX we should support automatic reconnect -->
 
-  <h5 id=servers><span class=secno>6.3.7.2. </span><dfn id=servers0>Servers
+  <h5 id=servers><span class=secno>7.3.7.2. </span><dfn id=servers0>Servers
    accepting connections over TCP</dfn></h5>
 
   <p>This section defines the server side of the protocol described in the
@@ -41667,7 +41683,7 @@
    connection</a> and give up trying to connect.</p>
   <!-- XXX we should support automatic reconnect -->
 
-  <h5 id=sending><span class=secno>6.3.7.3. </span><dfn id=sending0>Sending
+  <h5 id=sending><span class=secno>7.3.7.3. </span><dfn id=sending0>Sending
    and receiving data over TCP</dfn></h5>
 
   <p>When the <code title=dom-Connection-send><a href="#send">send(<var
@@ -41705,7 +41721,7 @@
     all occurrences of 0x17 with 0xFF 0x00, or similar.
    -->
 
-  <h4 id=network-security><span class=secno>6.3.8 </span>Security</h4>
+  <h4 id=network-security><span class=secno>7.3.8 </span>Security</h4>
 
   <p class=big-issue>Need to write this section.
 
@@ -41720,7 +41736,7 @@
   <p class=big-issue>Should consider dropping the subdomain-only restriction.
    It doesn't seem to add anything, and prevents cross-domain chatter.
 
-  <h4 id=network-other-specs><span class=secno>6.3.9 </span>Relationship to
+  <h4 id=network-other-specs><span class=secno>7.3.9 </span>Relationship to
    other standards</h4>
 
   <p class=big-issue>Should have a section talking about the fact that we
@@ -41733,7 +41749,7 @@
    protocol makes it much easier to do RAD; HTTP doesn't fit the needs and
    doesn't have the security model needed; etc)
 
-  <h3 id=crossDocumentMessages><span class=secno>6.4 </span><dfn
+  <h3 id=crossDocumentMessages><span class=secno>7.4 </span><dfn
    id=cross-document>Cross-document messaging</dfn></h3>
 
   <p>Web browsers, for security and privacy reasons, prevent documents in
@@ -41746,7 +41762,7 @@
    to communicate with each other regardless of their source domain, in a way
    designed to not enable cross-site scripting attacks.
 
-  <h4 id=processing4><span class=secno>6.4.1 </span>Processing model</h4>
+  <h4 id=processing4><span class=secno>7.4.1 </span>Processing model</h4>
 
   <p>When a script invokes the <dfn id=postmessage
    title=dom-window-postMessage><code>postMessage(<var
@@ -41871,15 +41887,15 @@
    security reasons. It also requires that UAs be careful to allow access to
    certain properties but not others.
 
-  <h2 id=repetition><span class=secno>7. </span>Repetition templates</h2>
+  <h2 id=repetition><span class=secno>8. </span>Repetition templates</h2>
 
   <p class=big-issue>See <a
    href="http://www.whatwg.org/specs/web-forms/current-work/#repeatingFormControls">WF2</a>
    for now
 
-  <h2 id=syntax><span class=secno>8. </span>The HTML syntax</h2>
+  <h2 id=syntax><span class=secno>9. </span>The HTML syntax</h2>
 
-  <h3 id=writing0><span class=secno>8.1 </span>Writing HTML documents</h3>
+  <h3 id=writing0><span class=secno>9.1 </span>Writing HTML documents</h3>
 
   <p><em>This section only applies to documents, authoring tools, and markup
    generators. In particular, it does not apply to conformance checkers;
@@ -41900,7 +41916,7 @@
     and <a href="#space" title="space character">space characters</a>.
 
    <li>The root element, in the form of an <code><a
-    href="#html">html</a></code> <a href="#elements3"
+    href="#html">html</a></code> <a href="#elements4"
     title=syntax-elements>element</a>.
 
    <li>Any number of <a href="#comments0" title=syntax-comments>comments</a>
@@ -41932,7 +41948,7 @@
     element but before the <code><a href="#head">head</a></code> element.</p>
   </div>
 
-  <h4 id=the-doctype><span class=secno>8.1.1 </span>The DOCTYPE</h4>
+  <h4 id=the-doctype><span class=secno>9.1.1 </span>The DOCTYPE</h4>
 
   <p>A <dfn id=doctype title=syntax-doctype>DOCTYPE</dfn> is a mostly
    useless, but required, header.
@@ -41995,9 +42011,9 @@
   <p class=note>In other words, <code><!DOCTYPE HTML></code>,
    case-insensitively.
 
-  <h4 id=elements0><span class=secno>8.1.2 </span>Elements</h4>
+  <h4 id=elements1><span class=secno>9.1.2 </span>Elements</h4>
 
-  <p>There are five different kinds of <dfn id=elements3
+  <p>There are five different kinds of <dfn id=elements4
    title=syntax-elements>elements</dfn>: void elements, CDATA elements,
    RCDATA elements, foreign elements, and normal elements.
 
@@ -42082,7 +42098,7 @@
    is <em>not</em> marked as self-closing can have <a href="#text2"
    title=syntax-text>text</a>, <a href="#character3"
    title=syntax-charref>character references</a>, <a href="#cdata0"
-   title=syntax-cdata>CDATA blocks</a>, other <a href="#elements3"
+   title=syntax-cdata>CDATA blocks</a>, other <a href="#elements4"
    title=syntax-elements>elements</a>, and <a href="#comments0"
    title=syntax-comments>comments</a>, but the text must not contain the
    character U+003C LESS-THAN SIGN (<code><</code>) or an <a
@@ -42091,7 +42107,7 @@
 
   <p>Normal elements can have <a href="#text2" title=syntax-text>text</a>, <a
    href="#character3" title=syntax-charref>character references</a>, other <a
-   href="#elements3" title=syntax-elements>elements</a>, and <a
+   href="#elements4" title=syntax-elements>elements</a>, and <a
    href="#comments0" title=syntax-comments>comments</a>, but the text must
    not contain the character U+003C LESS-THAN SIGN (<code><</code>) or an
    <a href="#ambiguous" title=syntax-ambiguous-ampersand>ambiguous
@@ -42110,7 +42126,7 @@
    mix of lower- and uppercase letters that, when converted to all-lowercase,
    matches the element's tag name; tag names are case-insensitive.
 
-  <h5 id=start><span class=secno>8.1.2.1. </span>Start tags</h5>
+  <h5 id=start><span class=secno>9.1.2.1. </span>Start tags</h5>
 
   <p><dfn id=start6 title=syntax-start-tags>Start tags</dfn> must have the
    following format:
@@ -42145,7 +42161,7 @@
     (<code>></code>) character.
   </ol>
 
-  <h5 id=end-tags><span class=secno>8.1.2.2. </span>End tags</h5>
+  <h5 id=end-tags><span class=secno>9.1.2.2. </span>End tags</h5>
 
   <p><dfn id=end-tags0 title=syntax-end-tags>End tags</dfn> must have the
    following format:
@@ -42167,7 +42183,7 @@
     (<code>></code>) character.
   </ol>
 
-  <h5 id=attributes1><span class=secno>8.1.2.3. </span>Attributes</h5>
+  <h5 id=attributes1><span class=secno>9.1.2.3. </span>Attributes</h5>
 
   <p><dfn id=attributes2 title=syntax-attributes>Attributes</dfn> for an
    element are expressed inside the element's start tag.
@@ -42295,7 +42311,7 @@
      href="#space">space character</a> separating the two.</p>
   </dl>
 
-  <h5 id=optional><span class=secno>8.1.2.4. </span>Optional tags</h5>
+  <h5 id=optional><span class=secno>9.1.2.4. </span>Optional tags</h5>
 
   <p>Certain tags can be <dfn id=omitted
    title=syntax-tag-omission>omitted</dfn>.</p>
@@ -42492,7 +42508,7 @@
   <p><strong>However</strong>, a <span title=syntax-start-tag>start
    tag</span> must never be omitted if it has any attributes.
 
-  <h5 id=element-restrictions><span class=secno>8.1.2.5. </span>Restrictions
+  <h5 id=element-restrictions><span class=secno>9.1.2.5. </span>Restrictions
    on content models</h5>
 
   <p>For historical reasons, certain elements have extra restrictions beyond
@@ -42529,7 +42545,7 @@
    <pre><pre><br>Hello</pre></pre>
   </div>
 
-  <h5 id=cdata-rcdata-restrictions><span class=secno>8.1.2.6.
+  <h5 id=cdata-rcdata-restrictions><span class=secno>9.1.2.6.
    </span>Restrictions on the contents of CDATA and RCDATA elements</h5>
 
   <p>The text in CDATA and RCDATA elements must not contain any occurrences
@@ -42571,7 +42587,7 @@
    that is not followed by an <a href="#escaping1"
    title=syntax-escape-end>escaping text span end</a>.
 
-  <h4 id=text0><span class=secno>8.1.3 </span>Text</h4>
+  <h4 id=text0><span class=secno>9.1.3 </span>Text</h4>
 
   <p><dfn id=text2 title=syntax-text>Text</dfn> is allowed inside elements,
    attributes, and comments. Text must consist of Unicode characters. Text
@@ -42581,14 +42597,14 @@
    Extra constraints are placed on what is and what is not allowed in text
    based on where the text is to be put, as described in the other sections.
 
-  <h5 id=newlines><span class=secno>8.1.3.1. </span>Newlines</h5>
+  <h5 id=newlines><span class=secno>9.1.3.1. </span>Newlines</h5>
 
   <p><dfn id=newlines0 title=syntax-newlines>Newlines</dfn> in HTML may be
    represented either as U+000D CARRIAGE RETURN (CR) characters, U+000A LINE
    FEED (LF) characters, or pairs of U+000D CARRIAGE RETURN (CR), U+000A LINE
    FEED (LF) characters in that order.
 
-  <h4 id=character><span class=secno>8.1.4 </span>Character references</h4>
+  <h4 id=character><span class=secno>9.1.4 </span>Character references</h4>
 
   <p>In certain cases described in other sections, <a href="#text2"
    title=syntax-text>text</a> may be mixed with <dfn id=character3
@@ -42638,7 +42654,7 @@
    a <a href="#space">space character</a>, a U+003C LESS-THAN SIGN character
    ('<'), or another U+0026 AMPERSAND (<code>&</code>) character.
 
-  <h4 id=cdata><span class=secno>8.1.5 </span>CDATA blocks</h4>
+  <h4 id=cdata><span class=secno>9.1.5 </span>CDATA blocks</h4>
 
   <p><dfn id=cdata0 title=syntax-cdata>CDATA blocks</dfn> must start with the
    character sequence U+003C LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+005B
@@ -42654,7 +42670,7 @@
    U+005D RIGHT SQUARE BRACKET, U+003E GREATER-THAN SIGN (<code
    title="">]]></code>).
 
-  <h4 id=comments><span class=secno>8.1.6 </span>Comments</h4>
+  <h4 id=comments><span class=secno>9.1.6 </span>Comments</h4>
 
   <p><dfn id=comments0 title=syntax-comments>Comments</dfn> must start with
    the four character sequence U+003C LESS-THAN SIGN, U+0021 EXCLAMATION
@@ -42670,7 +42686,7 @@
    three character sequence U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS, U+003E
    GREATER-THAN SIGN (<code title="">--></code>).
 
-  <h3 id=parsing><span class=secno>8.2 </span>Parsing HTML documents</h3>
+  <h3 id=parsing><span class=secno>9.2 </span>Parsing HTML documents</h3>
 
   <p><em>This section only applies to user agents, data mining tools, and
    conformance checkers.</em>
@@ -42727,7 +42743,7 @@
    also verify that the document obeys all the other conformance requirements
    described in this specification.
 
-  <h4 id=overview><span class=secno>8.2.1 </span>Overview of the parsing
+  <h4 id=overview><span class=secno>9.2.1 </span>Overview of the parsing
    model</h4>
 
   <p>The input to the HTML parsing process consists of a stream of Unicode
@@ -42767,7 +42783,7 @@
 ...</pre>
   </div>
 
-  <h4 id=the-input0><span class=secno>8.2.2 </span>The <dfn id=input0>input
+  <h4 id=the-input0><span class=secno>9.2.2 </span>The <dfn id=input0>input
    stream</dfn></h4>
 
   <p>The stream of Unicode characters that consists the input to the
@@ -42781,7 +42797,7 @@
    determine the character encoding is given by the XML specification. This
    section does not apply to XML documents. <a href="#refsXML">[XML]</a>
 
-  <h5 id=determining><span class=secno>8.2.2.1. </span>Determining the
+  <h5 id=determining><span class=secno>9.2.2.1. </span>Determining the
    character encoding</h5>
 
   <p>In some cases, it might be impractical to unambiguously determine the
@@ -42799,7 +42815,7 @@
    <dfn id=encoding0>encoding sniffing algorithm</dfn>) to determine the
    character encoding to use when decoding a document in the first pass. This
    algorithm takes as input any out-of-band metadata available to the user
-   agent (e.g. the <a href="#content-type8" title=Content-Type>Content-Type
+   agent (e.g. the <a href="#content-type5" title=Content-Type>Content-Type
    metadata</a> of the document) and all the bytes available so far, and
    returns an encoding and a <dfn id=confidence
    title=concept-encoding-confidence>confidence</dfn>. The confidence is
@@ -42936,12 +42952,11 @@
 
          <li>
           <p>Otherwise, the attribute's name is "<code
-           title="">content</code>": apply the <a
-           href="#algorithm4">algorithm for extracting an encoding from a
-           Content-Type</a>, giving the attribute's value as the string to
-           parse. If an encoding is returned, let <var title="">charset</var>
-           be that encoding. Otherwise, return to step 2 in these inner
-           steps.
+           title="">content</code>": apply the <a href="#algorithm">algorithm
+           for extracting an encoding from a Content-Type</a>, giving the
+           attribute's value as the string to parse. If an encoding is
+           returned, let <var title="">charset</var> be that encoding.
+           Otherwise, return to step 2 in these inner steps.
 
          <li>
           <p>If <var title="">charset</var> is a UTF-16 encoding, change it
@@ -43208,7 +43223,7 @@
    time as the user agent uses the returned value to select the decoder to
    use for the input stream.
 
-  <h5 id=character0><span class=secno>8.2.2.2. </span>Character encoding
+  <h5 id=character0><span class=secno>9.2.2.2. </span>Character encoding
    requirements</h5>
 
   <p>User agents must at a minimum support the UTF-8 and Windows-1252
@@ -43358,7 +43373,7 @@
    UTF-32 in its algorithms; support and use of UTF-32 can thus lead to
    unexpected behavior in implementations of this specification.
 
-  <h5 id=preprocessing><span class=secno>8.2.2.3. </span>Preprocessing the
+  <h5 id=preprocessing><span class=secno>9.2.2.3. </span>Preprocessing the
    input stream</h5>
 
   <p>Given an encoding, the bytes in the input stream must be converted to
@@ -43430,7 +43445,7 @@
    method) is consumed. Otherwise, the "EOF" character is not a real
    character in the stream, but rather the lack of any further characters.
 
-  <h5 id=changing><span class=secno>8.2.2.4. </span>Changing the encoding
+  <h5 id=changing><span class=secno>9.2.2.4. </span>Changing the encoding
    while parsing</h5>
 
   <p>When the parser requires the user agent to <dfn id=change>change the
@@ -43473,9 +43488,9 @@
     the document is marked as not being cacheable.
   </ol>
 
-  <h4 id=parse><span class=secno>8.2.3 </span>Parse state</h4>
+  <h4 id=parse><span class=secno>9.2.3 </span>Parse state</h4>
 
-  <h5 id=the-insertion><span class=secno>8.2.3.1. </span>The insertion mode</h5>
+  <h5 id=the-insertion><span class=secno>9.2.3.1. </span>The insertion mode</h5>
 
   <p>Initially the <span>insertion mode</span> is "<a href="#initial"
    title="insertion mode: initial">initial</a>". It can change to "<a
@@ -43639,7 +43654,7 @@
    <li>Return to step 3.
   </ol>
 
-  <h5 id=the-stack><span class=secno>8.2.3.2. </span>The stack of open
+  <h5 id=the-stack><span class=secno>9.2.3.2. </span>The stack of open
    elements</h5>
 
   <p>Initially the <dfn id=stack>stack of open elements</dfn> is empty. The
@@ -43833,7 +43848,7 @@
    misnested formatting elements</a>), the stack is manipulated in a
    random-access fashion.
 
-  <h5 id=the-list><span class=secno>8.2.3.3. </span>The list of active
+  <h5 id=the-list><span class=secno>9.2.3.3. </span>The list of active
    formatting elements</h5>
 
   <p>Initially the <dfn id=list-of4>list of active formatting elements</dfn>
@@ -43923,7 +43938,7 @@
    <li>Go to step 1.
   </ol>
 
-  <h5 id=the-element><span class=secno>8.2.3.4. </span>The element pointers</h5>
+  <h5 id=the-element><span class=secno>9.2.3.4. </span>The element pointers</h5>
 
   <p>Initially the <dfn id=head-element><code title="">head</code> element
    pointer</dfn> and the <dfn id=form-element><code title="">form</code>
@@ -43939,14 +43954,14 @@
    associate with forms in the face of dramatically bad markup, for
    historical reasons.
 
-  <h5 id=the-scripting><span class=secno>8.2.3.5. </span>The scripting state</h5>
+  <h5 id=the-scripting><span class=secno>9.2.3.5. </span>The scripting state</h5>
 
   <p>The <dfn id=scripting2>scripting flag</dfn> is set to "enabled" if the
    <code>Document</code> with which the parser is associated was <a
    href="#with-script">with script</a> when the parser was created, and
    "disabled" otherwise.
 
-  <h4 id=tokenisation><span class=secno>8.2.4 </span><dfn
+  <h4 id=tokenisation><span class=secno>9.2.4 </span><dfn
    id=tokenisation0>Tokenisation</dfn></h4>
 
   <p>Implementations must act as if they used the following state machine to
@@ -43959,7 +43974,7 @@
    and can consume several characters before switching to another state.
 
   <p>The exact behavior of certain states depends on a <dfn
-   id=content2>content model flag</dfn> that is set after certain tokens are
+   id=content3>content model flag</dfn> that is set after certain tokens are
    emitted. The flag has several states: <em title="">PCDATA</em>, <em
    title="">RCDATA</em>, <em title="">CDATA</em>, and <em
    title="">PLAINTEXT</em>. Initially it must be in the PCDATA state. In the
@@ -43984,7 +43999,7 @@
 
   <p>When a token is emitted, it must immediately be handled by the <a
    href="#tree-construction0">tree construction</a> stage. The tree
-   construction stage can affect the state of the <a href="#content2">content
+   construction stage can affect the state of the <a href="#content3">content
    model flag</a>, and can insert additional characters into the stream. (For
    example, the <code><a href="#script1">script</a></code> element can result
    in scripts executing and using the <a href="#dynamic2">dynamic markup
@@ -43995,7 +44010,7 @@
    flag">acknowledged</dfn> when it is processed by the tree construction
    stage, that is a <a href="#parse1">parse error</a>.
 
-  <p>When an end tag token is emitted, the <a href="#content2">content model
+  <p>When an end tag token is emitted, the <a href="#content3">content model
    flag</a> must be switched to the PCDATA state.
 
   <p>When an end tag token is emitted with attributes, that is a <a
@@ -44026,7 +44041,7 @@
     <dl class=switch>
      <dt>U+0026 AMPERSAND (&)
 
-     <dd>When the <a href="#content2">content model flag</a> is set to one of
+     <dd>When the <a href="#content3">content model flag</a> is set to one of
       the PCDATA or RCDATA states and the <a href="#escape">escape flag</a>
       is false: switch to the <a href="#character4">character reference data
       state</a>.
@@ -44036,7 +44051,7 @@
      <dt>U+002D HYPHEN-MINUS (-)
 
      <dd>
-      <p>If the <a href="#content2">content model flag</a> is set to either
+      <p>If the <a href="#content3">content model flag</a> is set to either
        the RCDATA state or the CDATA state, and the <a href="#escape">escape
        flag</a> is false, and there are at least three characters before this
        one in the input stream, and the last four characters in the input
@@ -44049,10 +44064,10 @@
 
      <dt>U+003C LESS-THAN SIGN (<)
 
-     <dd>When the <a href="#content2">content model flag</a> is set to the
+     <dd>When the <a href="#content3">content model flag</a> is set to the
       PCDATA state: switch to the <a href="#tag-open">tag open state</a>.
 
-     <dd>When the <a href="#content2">content model flag</a> is set to either
+     <dd>When the <a href="#content3">content model flag</a> is set to either
       the RCDATA state or the CDATA state and the <a href="#escape">escape
       flag</a> is false: switch to the <a href="#tag-open">tag open
       state</a>.
@@ -44062,7 +44077,7 @@
      <dt>U+003E GREATER-THAN SIGN (>)
 
      <dd>
-      <p>If the <a href="#content2">content model flag</a> is set to either
+      <p>If the <a href="#content3">content model flag</a> is set to either
        the RCDATA state or the CDATA state, and the <a href="#escape">escape
        flag</a> is true, and the last three characters in the input stream
        including this one are U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS,
@@ -44089,7 +44104,7 @@
    <dt><dfn id=character4>Character reference data state</dfn>
 
    <dd>
-    <p><em>(This cannot happen if the <a href="#content2">content model
+    <p><em>(This cannot happen if the <a href="#content3">content model
      flag</a> is set to the CDATA state.)</em></p>
 
     <p>Attempt to <a href="#consume">consume a character reference</a>, with
@@ -44104,11 +44119,11 @@
    <dt><dfn id=tag-open>Tag open state</dfn>
 
    <dd>
-    <p>The behavior of this state depends on the <a href="#content2">content
+    <p>The behavior of this state depends on the <a href="#content3">content
      model flag</a>.</p>
 
     <dl>
-     <dt>If the <a href="#content2">content model flag</a> is set to the
+     <dt>If the <a href="#content3">content model flag</a> is set to the
       RCDATA or CDATA states
 
      <dd>
@@ -44118,7 +44133,7 @@
        token and reconsume the current input character in the <a
        href="#data-state">data state</a>.</p>
 
-     <dt>If the <a href="#content2">content model flag</a> is set to the
+     <dt>If the <a href="#content3">content model flag</a> is set to the
       PCDATA state
 
      <dd>
@@ -44171,10 +44186,10 @@
    <dt><dfn id=close1>Close tag open state</dfn>
 
    <dd>
-    <p>If the <a href="#content2">content model flag</a> is set to the RCDATA
+    <p>If the <a href="#content3">content model flag</a> is set to the RCDATA
      or CDATA states but no start tag token has ever been emitted by this
      instance of the tokeniser (<a href="#fragment">fragment case</a>), or,
-     if the <a href="#content2">content model flag</a> is set to the RCDATA
+     if the <a href="#content3">content model flag</a> is set to the RCDATA
      or CDATA states and the next few characters do not match the tag name of
      the last start tag token emitted (case insensitively), or if they do but
      they are not immediately followed by one of the following characters:</p>
@@ -44200,7 +44215,7 @@
      character token, and switch to the <a href="#data-state">data state</a>
      to process the <a href="#next-input">next input character</a>.</p>
 
-    <p>Otherwise, if the <a href="#content2">content model flag</a> is set to
+    <p>Otherwise, if the <a href="#content3">content model flag</a> is set to
      the PCDATA state, or if the next few characters <em>do</em> match that
      tag name, consume the <a href="#next-input">next input character</a>:</p>
 
@@ -44695,7 +44710,7 @@
    <dt><dfn id=bogus>Bogus comment state</dfn>
 
    <dd>
-    <p><em>(This can only happen if the <a href="#content2">content model
+    <p><em>(This can only happen if the <a href="#content3">content model
      flag</a> is set to the PCDATA state.)</em></p>
 
     <p>Consume every character up to the first U+003E GREATER-THAN SIGN
@@ -44714,7 +44729,7 @@
    <dt><dfn id=markup>Markup declaration open state</dfn>
 
    <dd>
-    <p><em>(This can only happen if the <a href="#content2">content model
+    <p><em>(This can only happen if the <a href="#content3">content model
      flag</a> is set to the PCDATA state.)</em></p>
 
     <p>If the next two characters are both U+002D HYPHEN-MINUS (-)
@@ -44737,7 +44752,7 @@
      the string "[CDATA[" (the five uppercase letters "CDATA" with a U+005B
      LEFT SQUARE BRACKET character before and after), then consume those
      characters and switch to the <a href="#cdata1">CDATA block state</a>
-     (which is unrelated to the <a href="#content2">content model flag</a>'s
+     (which is unrelated to the <a href="#content3">content model flag</a>'s
      CDATA state).</p>
 
     <p>Otherwise, this is a <a href="#parse1">parse error</a>. Switch to the
@@ -45359,9 +45374,9 @@
    <dt><dfn id=cdata1>CDATA block state</dfn>
 
    <dd>
-    <p><em>(This can only happen if the <a href="#content2">content model
+    <p><em>(This can only happen if the <a href="#content3">content model
      flag</a> is set to the PCDATA state, and is unrelated to the <a
-     href="#content2">content model flag</a>'s CDATA state.)</em></p>
+     href="#content3">content model flag</a>'s CDATA state.)</em></p>
 
     <p>Consume every character up to the next occurrence of the three
      character sequence U+005D RIGHT SQUARE BRACKET U+005D RIGHT SQUARE
@@ -45376,7 +45391,7 @@
     <p>If the end of the file was reached, reconsume the EOF character.</p>
   </dl>
 
-  <h5 id=tokenising><span class=secno>8.2.4.1. </span>Tokenising character
+  <h5 id=tokenising><span class=secno>9.2.4.1. </span>Tokenising character
    references</h5>
 
   <p>This section defines how to <dfn id=consume>consume a character
@@ -45761,7 +45776,7 @@
     </div>
   </dl>
 
-  <h4 id=tree-construction><span class=secno>8.2.5 </span><dfn
+  <h4 id=tree-construction><span class=secno>9.2.5 </span><dfn
    id=tree-construction0>Tree construction</dfn></h4>
 
   <p>The input to the tree construction stage is a sequence of tokens from
@@ -45809,7 +45824,7 @@
    href="#hardwareLimitations">practical concerns</a> will likely force user
    agents to impose nesting depths.
 
-  <h5 id=creating><span class=secno>8.2.5.1. </span>Creating and inserting
+  <h5 id=creating><span class=secno>9.2.5.1. </span>Creating and inserting
    elements</h5>
 
   <p>When the steps below require the UA to <dfn id=create title="create an
@@ -46078,9 +46093,9 @@
    <li>
     <p>If the algorithm that was invoked is the <a href="#generic">generic
      CDATA parsing algorithm</a>, switch the tokeniser's <a
-     href="#content2">content model flag</a> to the CDATA state; otherwise
+     href="#content3">content model flag</a> to the CDATA state; otherwise
      the algorithm invoked was the <a href="#generic0">generic RCDATA parsing
-     algorithm</a>, switch the tokeniser's <a href="#content2">content model
+     algorithm</a>, switch the tokeniser's <a href="#content3">content model
      flag</a> to the RCDATA state.
 
    <li>
@@ -46094,7 +46109,7 @@
      all those tokens' characters, to the new element node.
 
    <li>
-    <p>The tokeniser's <a href="#content2">content model flag</a> will have
+    <p>The tokeniser's <a href="#content3">content model flag</a> will have
      switched back to the PCDATA state.
 
    <li>
@@ -46103,7 +46118,7 @@
      this is a <a href="#parse1">parse error</a>.
   </ol>
 
-  <h5 id=closing><span class=secno>8.2.5.2. </span>Closing elements that have
+  <h5 id=closing><span class=secno>9.2.5.2. </span>Closing elements that have
    implied end tags</h5>
 
   <p>When the steps below require the UA to <dfn id=generate>generate implied
@@ -46120,7 +46135,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.
 
-  <h5 id=foster><span class=secno>8.2.5.3. </span>Foster parenting</h5>
+  <h5 id=foster><span class=secno>9.2.5.3. </span>Foster parenting</h5>
 
   <p>Foster parenting happens when content is misnested in tables.
 
@@ -46161,7 +46176,7 @@
    <em>appended</em> to the <i><a href="#foster1">foster parent
    element</a></i>.
 
-  <h5 id=the-initial><span class=secno>8.2.5.4. </span>The "<dfn id=initial
+  <h5 id=the-initial><span class=secno>9.2.5.4. </span>The "<dfn id=initial
    title="insertion mode: initial">initial</dfn>" insertion mode</h5>
 
   <p>When the <span>insertion mode</span> is "<a href="#initial"
@@ -46427,7 +46442,7 @@
     </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
+     following list, then set the document to <a href="#limited1">limited
      quirks mode</a>:</p>
 
     <ul class=brief>
@@ -46467,7 +46482,7 @@
      current token.</p>
   </dl>
 
-  <h5 id=the-before><span class=secno>8.2.5.5. </span>The "<dfn id=before4
+  <h5 id=the-before><span class=secno>9.2.5.5. </span>The "<dfn id=before4
    title="insertion mode: before html">before html</dfn>" insertion mode</h5>
 
   <p>When the <span>insertion mode</span> is "<a href="#before4"
@@ -46546,7 +46561,7 @@
    content continues being appended to the nodes as described in the next
    section.
 
-  <h5 id=the-before0><span class=secno>8.2.5.6. </span>The "<dfn id=before5
+  <h5 id=the-before0><span class=secno>9.2.5.6. </span>The "<dfn id=before5
    title="insertion mode: before head">before head</dfn>" insertion mode</h5>
 
   <p>When the <span>insertion mode</span> is "<a href="#before5"
@@ -46616,7 +46631,7 @@
      after head">after head</a>" <span>insertion mode</span>.</p>
   </dl>
 
-  <h5 id=parsing-main-inhead><span class=secno>8.2.5.7. </span>The "<dfn
+  <h5 id=parsing-main-inhead><span class=secno>9.2.5.7. </span>The "<dfn
    id=in-head title="insertion mode: in head">in head</dfn>" insertion mode</h5>
 
   <p>When the <span>insertion mode</span> is "<a href="#in-head"
@@ -46685,7 +46700,7 @@
 
     <p>Otherwise, if the element has a <code title=attr-meta-charset><a
      href="#charset1">content</a></code> attribute, and applying the <a
-     href="#algorithm4">algorithm for extracting an encoding from a
+     href="#algorithm">algorithm for extracting an encoding from a
      Content-Type</a> to its value returns a supported encoding <var
      title="">encoding</var>, and the <a href="#confidence"
      title=concept-encoding-confidence>confidence</a> is currently
@@ -46727,7 +46742,7 @@
      script will execute in-line, instead of blowing the document away, as
      would happen in most other cases.</p>
 
-    <p>Switch the tokeniser's <a href="#content2">content model flag</a> to
+    <p>Switch the tokeniser's <a href="#content3">content model flag</a> to
      the CDATA state.</p>
 
     <p>Then, collect all the character tokens that the tokeniser returns
@@ -46739,7 +46754,7 @@
      href="#script1">script</a></code> element node whose contents is the
      concatenation of all those tokens' characters.</p>
 
-    <p>The tokeniser's <a href="#content2">content model flag</a> will have
+    <p>The tokeniser's <a href="#content3">content model flag</a> will have
      switched back to the PCDATA state.</p>
 
     <p>If the next token is not an end tag token with the tag name "script",
@@ -46868,7 +46883,7 @@
      get put into the head. Do we want to copy that?</p>
   </dl>
 
-  <h5 id=parsing-main-inheadnoscript><span class=secno>8.2.5.8. </span>The
+  <h5 id=parsing-main-inheadnoscript><span class=secno>9.2.5.8. </span>The
    "<dfn id=in-head0 title="insertion mode: in head noscript">in head
    noscript</dfn>" insertion mode</h5>
 
@@ -46934,7 +46949,7 @@
      name "noscript" had been seen and reprocess the current token.</p>
   </dl>
 
-  <h5 id=the-after><span class=secno>8.2.5.9. </span>The "<dfn id=after4
+  <h5 id=the-after><span class=secno>9.2.5.9. </span>The "<dfn id=after4
    title="insertion mode: after head">after head</dfn>" insertion mode</h5>
 
   <p>When the <span>insertion mode</span> is "<a href="#after4"
@@ -47018,7 +47033,7 @@
      had been seen, and then reprocess the current token.</p>
   </dl>
 
-  <h5 id=parsing-main-inbody><span class=secno>8.2.5.10. </span>The "<dfn
+  <h5 id=parsing-main-inbody><span class=secno>9.2.5.10. </span>The "<dfn
    id=in-body title="insertion mode: in body">in body</dfn>" insertion mode</h5>
 
   <p>When the <span>insertion mode</span> is "<a href="#in-body"
@@ -47311,13 +47326,13 @@
 
     <p><a href="#insert0">Insert an HTML element</a> for the token.</p>
 
-    <p>Switch the <a href="#content2">content model flag</a> to the PLAINTEXT
+    <p>Switch the <a href="#content3">content model flag</a> to the PLAINTEXT
      state.</p>
 
     <p class=note>Once a start tag with the tag name "plaintext" has been
      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>
+     href="#content3">content model flag</a> out of the PLAINTEXT state.</p>
    </dd>
    <!-- end tags for non-phrasing flow content elements -->
    <!-- the normal ones -->
@@ -47945,7 +47960,7 @@
      <code>form</code> element pointed to by the <a
      href="#form-element"><code title="">form</code> element pointer</a>.</p>
 
-    <p>Switch the tokeniser's <a href="#content2">content model flag</a> to
+    <p>Switch the tokeniser's <a href="#content3">content model flag</a> to
      the RCDATA state.</p>
 
     <p>If the next token is a U+000A LINE FEED (LF) character token, then
@@ -47960,7 +47975,7 @@
      single <code>Text</code> node, whose contents is the concatenation of
      all those tokens' characters, to the new element node.</p>
 
-    <p>The tokeniser's <a href="#content2">content model flag</a> will have
+    <p>The tokeniser's <a href="#content3">content model flag</a> will have
      switched back to the PCDATA state.</p>
 
     <p>If the next token is an end tag token with the tag name "textarea",
@@ -48168,7 +48183,7 @@
     </ol>
   </dl>
 
-  <h5 id=parsing-main-intable><span class=secno>8.2.5.11. </span>The "<dfn
+  <h5 id=parsing-main-intable><span class=secno>9.2.5.11. </span>The "<dfn
    id=in-table title="insertion mode: in table">in table</dfn>" insertion
    mode</h5>
 
@@ -48353,7 +48368,7 @@
    href="#html">html</a></code> element after this process is a <a
    href="#fragment">fragment case</a>.
 
-  <h5 id=parsing-main-incaption><span class=secno>8.2.5.12. </span>The "<dfn
+  <h5 id=parsing-main-incaption><span class=secno>9.2.5.12. </span>The "<dfn
    id=in-caption title="insertion mode: in caption">in caption</dfn>"
    insertion mode</h5>
 
@@ -48416,7 +48431,7 @@
      <span>insertion mode</span>.</p>
   </dl>
 
-  <h5 id=parsing-main-incolgroup><span class=secno>8.2.5.13. </span>The "<dfn
+  <h5 id=parsing-main-incolgroup><span class=secno>9.2.5.13. </span>The "<dfn
    id=in-column title="insertion mode: in column group">in column
    group</dfn>" insertion mode</h5>
 
@@ -48501,7 +48516,7 @@
      href="#fragment">fragment case</a>.</p>
   </dl>
 
-  <h5 id=parsing-main-intbody><span class=secno>8.2.5.14. </span>The "<dfn
+  <h5 id=parsing-main-intbody><span class=secno>9.2.5.14. </span>The "<dfn
    id=in-table0 title="insertion mode: in table body">in table body</dfn>"
    insertion mode</h5>
 
@@ -48591,7 +48606,7 @@
    href="#html">html</a></code> element after this process is a <a
    href="#fragment">fragment case</a>.
 
-  <h5 id=parsing-main-intr><span class=secno>8.2.5.15. </span>The "<dfn
+  <h5 id=parsing-main-intr><span class=secno>9.2.5.15. </span>The "<dfn
    id=in-row title="insertion mode: in row">in row</dfn>" insertion mode</h5>
 
   <p>When the <span>insertion mode</span> is "<a href="#in-row"
@@ -48680,7 +48695,7 @@
    href="#html">html</a></code> element after this process is a <a
    href="#fragment">fragment case</a>.
 
-  <h5 id=parsing-main-intd><span class=secno>8.2.5.16. </span>The "<dfn
+  <h5 id=parsing-main-intd><span class=secno>9.2.5.16. </span>The "<dfn
    id=in-cell title="insertion mode: in cell">in cell</dfn>" insertion mode</h5>
 
   <p>When the <span>insertion mode</span> is "<a href="#in-cell"
@@ -48781,7 +48796,7 @@
    neither when the <span>insertion mode</span> is "<a href="#in-cell"
    title="insertion mode: in cell">in cell</a>".
 
-  <h5 id=parsing-main-inselect><span class=secno>8.2.5.17. </span>The "<dfn
+  <h5 id=parsing-main-inselect><span class=secno>9.2.5.17. </span>The "<dfn
    id=in-select title="insertion mode: in select">in select</dfn>" insertion
    mode</h5>
 
@@ -48903,7 +48918,7 @@
     <p><a href="#parse1">Parse error</a>. Ignore the token.</p>
   </dl>
 
-  <h5 id=parsing-main-inselectintable><span class=secno>8.2.5.18. </span>The
+  <h5 id=parsing-main-inselectintable><span class=secno>9.2.5.18. </span>The
    "<dfn id=in-select0 title="insertion mode: in select in table">in select
    in table</dfn>" insertion mode</h5>
 
@@ -48939,7 +48954,7 @@
      <span>insertion mode</span>.</p>
   </dl>
 
-  <h5 id=parsing-main-inforeign><span class=secno>8.2.5.19. </span>The "<dfn
+  <h5 id=parsing-main-inforeign><span class=secno>9.2.5.19. </span>The "<dfn
    id=in-foreign title="insertion mode: in foreign content">in foreign
    content</dfn>" insertion mode</h5>
 
@@ -49113,7 +49128,7 @@
      flag">acknowledge the token's <i>self-closing flag</i></a>.</p>
   </dl>
 
-  <h5 id=parsing-main-afterbody><span class=secno>8.2.5.20. </span>The "<dfn
+  <h5 id=parsing-main-afterbody><span class=secno>9.2.5.20. </span>The "<dfn
    id=after5 title="insertion mode: after body">after body</dfn>" insertion
    mode</h5>
 
@@ -49177,7 +49192,7 @@
      body</a>" and reprocess the token.</p>
   </dl>
 
-  <h5 id=parsing-main-inframeset><span class=secno>8.2.5.21. </span>The "<dfn
+  <h5 id=parsing-main-inframeset><span class=secno>9.2.5.21. </span>The "<dfn
    id=in-frameset title="insertion mode: in frameset">in frameset</dfn>"
    insertion mode</h5>
 
@@ -49272,7 +49287,7 @@
     <p><a href="#parse1">Parse error</a>. Ignore the token.</p>
   </dl>
 
-  <h5 id=parsing-main-afterframeset><span class=secno>8.2.5.22. </span>The
+  <h5 id=parsing-main-afterframeset><span class=secno>9.2.5.22. </span>The
    "<dfn id=after6 title="insertion mode: after frameset">after
    frameset</dfn>" insertion mode</h5>
 
@@ -49337,7 +49352,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-after0><span class=secno>8.2.5.23. </span>The "<dfn id=after7
+  <h5 id=the-after0><span class=secno>9.2.5.23. </span>The "<dfn id=after7
    title="insertion mode: after after body">after after body</dfn>" insertion
    mode</h5>
 
@@ -49379,7 +49394,7 @@
      body</a>" and reprocess the token.</p>
   </dl>
 
-  <h5 id=the-after1><span class=secno>8.2.5.24. </span>The "<dfn id=after8
+  <h5 id=the-after1><span class=secno>9.2.5.24. </span>The "<dfn id=after8
    title="insertion mode: after after frameset">after after frameset</dfn>"
    insertion mode</h5>
 
@@ -49421,7 +49436,7 @@
      frameset">in frameset</a>" and reprocess the token.</p>
   </dl>
 
-  <h4 id=the-end><span class=secno>8.2.6 </span>The end</h4>
+  <h4 id=the-end><span class=secno>9.2.6 </span>The end</h4>
 
   <p>Once the user agent <dfn id=stops title="stop parsing">stops
    parsing</dfn> the document, the user agent must follow the steps in this
@@ -49533,7 +49548,7 @@
 /parser/htmlparser/src/nsElementTable.cpp, line 1901 - // Ex: <H1><LI><H1><LI>. Inner LI has the potential of getting nested
 -->
 
-  <h3 id=namespaces><span class=secno>8.3 </span>Namespaces</h3>
+  <h3 id=namespaces><span class=secno>9.3 </span>Namespaces</h3>
 
   <p>The <dfn id=html-namespace0>HTML namespace</dfn> is:
    <code>http://www.w3.org/1999/xhtml</code>
@@ -49553,7 +49568,7 @@
   <p>The <dfn id=xmlns>XMLNS namespace</dfn> is:
    <code>http://www.w3.org/2000/xmlns/</code>
 
-  <h3 id=serializing><span class=secno>8.4 </span>Serializing HTML fragments</h3>
+  <h3 id=serializing><span class=secno>9.4 </span>Serializing HTML fragments</h3>
 
   <p>The following steps form the <dfn id=html-fragment>HTML fragment
    serialization algorithm</dfn>. The algorithm takes as input a DOM
@@ -49749,7 +49764,7 @@
    element's <span title=syntax-start-tag>start tag</span> would imply the
    end tag for the <code><a href="#p">p</a></code>).
 
-  <h3 id=parsing2><span class=secno>8.5 </span>Parsing HTML fragments</h3>
+  <h3 id=parsing2><span class=secno>9.5 </span>Parsing HTML fragments</h3>
 
   <p>The following steps form the <dfn id=html-fragment0>HTML fragment
    parsing algorithm</dfn>. The algorithm takes as input a DOM
@@ -49779,14 +49794,14 @@
    <li>
     <p>Set the <a href="#html-0">HTML parser</a>'s <a
      href="#tokenisation0">tokenisation</a> stage's <a
-     href="#content2">content model flag</a> according to the <var
+     href="#content3">content model flag</a> according to the <var
      title="">context</var> element, as follows:</p>
 
     <dl class=switch>
      <dt>If it is a <code><a href="#title1">title</a></code> or
       <code>textarea</code> element
 
-     <dd>Set the <a href="#content2">content model flag</a> to
+     <dd>Set the <a href="#content3">content model flag</a> to
       <em>RCDATA</em>.
 
      <dt>If it is a <code><a href="#style1">style</a></code>, <code><a
@@ -49794,24 +49809,24 @@
       href="#iframe">iframe</a></code>, <code>noembed</code>, or
       <code>noframes</code> element
 
-     <dd>Set the <a href="#content2">content model flag</a> to
+     <dd>Set the <a href="#content3">content model flag</a> to
       <em>CDATA</em>.
 
      <dt>If it is a <code><a href="#noscript">noscript</a></code> element
 
      <dd>If the <a href="#scripting2">scripting flag</a> is enabled, set the
-      <a href="#content2">content model flag</a> to <em>CDATA</em>.
-      Otherwise, set the <a href="#content2">content model flag</a> to
+      <a href="#content3">content model flag</a> to <em>CDATA</em>.
+      Otherwise, set the <a href="#content3">content model flag</a> to
       <em>PCDATA</em>.
 
      <dt>If it is a <code>plaintext</code> element
 
-     <dd>Set the <a href="#content2">content model flag</a> to
+     <dd>Set the <a href="#content3">content model flag</a> to
       <em>PLAINTEXT</em>.
 
      <dt>Otherwise
 
-     <dd>Set the <a href="#content2">content model flag</a> to
+     <dd>Set the <a href="#content3">content model flag</a> to
       <em>PCDATA</em>.
     </dl>
 
@@ -49856,7 +49871,7 @@
      document order.</p>
   </ol>
 
-  <h3 id=named><span class=secno>8.6 </span><dfn id=named0>Named character
+  <h3 id=named><span class=secno>9.6 </span><dfn id=named0>Named character
    references</dfn></h3>
 
   <p>This table lists the character reference names that are supported by
@@ -52019,7 +52034,7 @@
   -->
    </div>
 
-  <h2 id=rendering><span class=secno>9. </span>Rendering and user-agent
+  <h2 id=rendering><span class=secno>10. </span>Rendering and user-agent
    behavior</h2>
   <!-- XXX
 
@@ -52113,7 +52128,7 @@
   <p class=big-issue>Must define that in CSS, tag names in HTML documents,
    and class names in quirks mode documents, are case-insensitive.
 
-  <h3 id=rendering0><span class=secno>9.1 </span>Rendering and the DOM</h3>
+  <h3 id=rendering0><span class=secno>10.1 </span>Rendering and the DOM</h3>
 
   <p class=big-issue>This section is wrong. mediaMode will end up on Window,
    I think. All views implement Window.
@@ -52145,9 +52160,10 @@
    currently to enumerate all the views.</p>
   <!-- XXX examples! -->
 
-  <h3 id=rendering1><span class=secno>9.2 </span>Rendering and menus/toolbars</h3>
+  <h3 id=rendering1><span class=secno>10.2 </span>Rendering and
+   menus/toolbars</h3>
 
-  <h4 id=the-icon><span class=secno>9.2.1 </span>The 'icon' property</h4>
+  <h4 id=the-icon><span class=secno>10.2.1 </span>The 'icon' property</h4>
 
   <p>UAs should use the command's Icon as the default generic icon provided
    by the user agent when the 'icon' property computes to 'auto' on an
@@ -52155,10 +52171,10 @@
    title=command-attribute>command</code> attribute, but when the property
    computes to an actual image, it should use that image instead.
 
-  <h3 id=obsolete><span class=secno>9.3 </span>Obsolete elements, attributes,
-   and APIs</h3>
+  <h3 id=obsolete><span class=secno>10.3 </span>Obsolete elements,
+   attributes, and APIs</h3>
 
-  <h4 id=the-body0><span class=secno>9.3.1 </span>The <code><a
+  <h4 id=the-body0><span class=secno>10.3.1 </span>The <code><a
    href="#body0">body</a></code> element</h4>
 
   <p class=big-issue>Need to define the content attributes in terms of CSS or
@@ -52206,7 +52222,7 @@
    class=idl>[XXX] interface <a href="#htmlbodyelement">HTMLBodyElement</a> {
            attribute DOMString <a href="#text3" title=dom-body-text>text</a>;
            attribute DOMString <a href="#bgcolor0" title=dom-body-bgColor>bgColor</a>;
-           attribute DOMString <a href="#background" title=dom-body-background>background</a>;
+           attribute DOMString <a href="#background0" title=dom-body-background>background</a>;
            attribute DOMString <a href="#link0" title=dom-body-link>link</a>;
            attribute DOMString <a href="#vlink" title=dom-body-vLink>vLink</a>;
            attribute DOMString <a href="#alink" title=dom-body-aLink>aLink</a>;
@@ -52222,7 +52238,7 @@
    <a href="#reflect">reflect</a> the element's <code
    title=attr-body-bgcolor>bgcolor</code> content attribute.
 
-  <p>The <dfn id=background
+  <p>The <dfn id=background0
    title=dom-body-background><code>background</code></dfn> DOM attribute of
    the <code><a href="#body0">body</a></code> element must <a
    href="#reflect">reflect</a> the element's <code
@@ -52243,7 +52259,7 @@
    href="#reflect">reflect</a> the element's <code
    title=attr-body-vlink>vlink</code> content attribute.
 
-  <h4 id=the-applet><span class=secno>9.3.2 </span>The <dfn
+  <h4 id=the-applet><span class=secno>10.3.2 </span>The <dfn
    id=applet><code>applet</code></dfn> element</h4>
 
   <p>The <code><a href="#applet">applet</a></code> element is a Java-specific
@@ -52271,7 +52287,7 @@
    rooted at the <code>Document</code> node, whose filter matches only
    <code><a href="#applet">applet</a></code> elements.
 
-  <h2 id=no><span class=secno>10. </span>Things that you can't do with this
+  <h2 id=no><span class=secno>11. </span>Things that you can't do with this
    specification because they are better handled using other technologies
    that are further described herein</h2>
 
@@ -52282,7 +52298,7 @@
    because the features exist in other languages that can be integrated into
    this one. This section covers some of the more common requests.
 
-  <h3 id=localization><span class=secno>10.1 </span>Localization</h3>
+  <h3 id=localization><span class=secno>11.1 </span>Localization</h3>
 
   <p>If you wish to create localized versions of an HTML application, the
    best solution is to preprocess the files on the server, and then use HTTP
@@ -52290,19 +52306,19 @@
   <!-- <p>XXX example here</p> -->
   <!--XXXSVG (remove next section)-->
 
-  <h3 id=declarative><span class=secno>10.2 </span>Declarative 2D vector
+  <h3 id=declarative><span class=secno>11.2 </span>Declarative 2D vector
    graphics and animation</h3>
 
   <p>Embedding vector graphics into XHTML documents is the domain of SVG.</p>
   <!-- <p>XXX example here</p> -->
 
-  <h3 id=declarative0><span class=secno>10.3 </span>Declarative 3D scenes</h3>
+  <h3 id=declarative0><span class=secno>11.3 </span>Declarative 3D scenes</h3>
 
   <p>Embedding 3D imagery into XHTML documents is the domain of X3D, or
    technologies based on X3D that are namespace-aware.</p>
   <!-- <p>XXX example here</p> -->
 
-  <h3 id=timers><span class=secno>10.4 </span>Timers</h3>
+  <h3 id=timers><span class=secno>11.4 </span>Timers</h3>
 
   <p>This section is expected to be moved to the Window Object specification
    in due course.

Modified: source
===================================================================
--- source	2008-06-18 23:31:17 UTC (rev 1789)
+++ source	2008-06-19 09:27:25 UTC (rev 1790)
@@ -28,6 +28,9 @@
 
   <h2 id="introduction">Introduction</h2>
 
+
+  <h3>Background</h3>
+
   <p><em>This section is non-normative.</em></p>
 
   <p>The World Wide Web's markup language has always been HTML. HTML
@@ -89,6 +92,8 @@
   ahead.</p>
 
 
+  <h3>Relationships to other specifications</h3>
+
   <h4>Relationship to HTML 4.01 and DOM2 HTML</h4>
 
   <p><em>This section is non-normative.</em></p>
@@ -173,53 +178,105 @@
   the risk of vendor lock-in.</p>
 
 
+  <h3>HTML vs XHTML</h3>
+
+  <p><em>This section is non-normative.</em></p>
+
+  <p>This specification defines an abstract language for describing
+  documents and applications, and some APIs for interacting with
+  in-memory representations of resources that use this language.</p>
+
+  <p>The in-memory representation is known as "DOM5 HTML", or "the
+  DOM" for short.</p>
+
+  <p>There are various concrete syntaxes that can be used to transmit
+  resources that use this abstract language, two of which are defined
+  in this specification.</p>
+
+  <p>The first such concrete syntax is "HTML5". This is the format
+  recommended for most authors. It is compatible with all legacy Web
+  browsers. If a document is transmitted with the MIME type <code
+  title="">text/html</code>, then it will be processed as an "HTML5"
+  document by Web browsers.</p>
+
+  <p>The second concrete syntax uses XML, and is known as
+  "XHTML5". When a document is transmitted with an XML MIME type, such
+  as <code title="">application/xhtml+xml</code>, then it is processed
+  by an XML processor by Web browsers, and treated as an "XHTML5"
+  document. Authors are reminded that the processing for XML and HTML
+  differs; in particular, even minor syntax errors will prevent an XML
+  document from being rendered fully, whereas they would be ignored in
+  the "HTML5" syntax.</p>
+
+  <p>The "DOM5 HTML", "HTML5", and "XHTML5" representations cannot all
+  represent the same content. For example, namespaces cannot be
+  represented using "HTML5", but they are supported in "DOM5 HTML" and
+  "XHTML5". Similarly, documents that use the <code>noscript</code>
+  feature can be represented using "HTML5", but cannot be represented
+  with "XHTML5" and "DOM5 HTML". Comments that contain the string
+  "<code title="">--></code>" can be represented in "DOM5 HTML" but
+  not in "HTML5" and "XHTML5". And so forth.</p>
+
+
   <h3>Structure of this specification</h3>
 
   <p><em>This section is non-normative.</em></p>
 
-  <p>This specification is divided into the following important
+  <p>This specification is divided into the following major
   sections:</p>
 
   <dl>
 
 
-   <dt><a href="#dom">The DOM</a></dt>
+   <dt><a href="#infrastructure">Common Infrastructure</a></dt>
 
-   <dd>The DOM, or Document Object Model, provides a base for the rest
-   of the specification.</dd>
+   <dd>The conformance classes, algorithms, definitions, and the
+   common underpinnings of the rest of the specification.</dd>
 
 
-   <dt><a href="#semantics">The Semantics</a></dt>
+   <dt><a href="#dom">The DOM</a></dt>
 
    <dd>Documents are built from elements. These elements form a tree
-   using the DOM. Each element also has a predefined meaning, which is
-   explained in this section. User agent requirements for how to
-   handle each element are also given, along with rules for authors on
-   how to use the element.</dd>
+   using the DOM. This section defines the features of this DOM, as
+   well as introducing the features common to all elements, and the
+   concepts used in defining elements.</dd>
 
 
-   <dt><a href="#windows">Browsing Contexts</a></dt>
+   <dt><a href="#semantics">Elements</a></dt>
 
+   <dd>Each element has a predefined meaning, which is explained in
+   this section. User agent requirements for how to handle each
+   element are also given, along with rules for authors on how to use
+   the element.</dd>
+
+
+   <dt><a href="#browsers">Web Browsers</a></dt>
+
    <dd>HTML documents do not exist in a vacuum — this section
    defines many of the features that affect environments that deal
    with multiple pages, links between pages, and running scripts.</dd>
 
 
-   <dt>APIs</dt>
+   <dt><a href="#editing">User Interaction</a></dt>
 
-   <dd><a href="#editing">User interaction</a>: HTML documents can
-   provide a number of mechanisms for users to interact with and
-   modify content, which are described in this section.</dd>
+   <dd>HTML documents can provide a number of mechanisms for users to
+   interact with and modify content, which are described in this
+   section.</dd>
 
-   <dd><a href="#comms">The Communication APIs</a>: Applications
-   written in HTML often require mechanisms to communicate with remote
-   servers, as well as communicating with other applications from
-   different domains running on the same client.</dd>
 
-   <dd><a href="#repetition">Repetition Templates</a>: A mechanism to
-   support repeating sections in forms.</dd>
+   <dt><a href="#comms">The Communication APIs</a></dt>
 
+   <dd>Applications written in HTML often require mechanisms to
+   communicate with remote servers, as well as communicating with
+   other applications from different domains running on the same
+   client.</dd>
 
+
+   <dt><a href="#repetition">Repetition Templates</a></dt>
+
+   <dd>A mechanism to support repeating sections in forms.</dd>
+
+
    <dt><a href="#syntax">The Language Syntax</a></dt>
 
    <dd>All of these features would be for naught if they couldn't be
@@ -245,6 +302,12 @@
   cross-references.</p>
 
 
+
+
+
+  <h2 id="infrastructure">Common infrastructure</h2>
+
+
   <h3>Conformance requirements</h3>
 
   <p>All diagrams, examples, and notes in this specification are
@@ -549,41 +612,6 @@
   algorithms defined in this specification.</p>
 
 
-  <h4>Common conformance requirements for APIs exposed to
-  JavaScript</h4>
-
-  <p class="big-issue">A lot of arrays/lists/<span title="collections">collection</span>s
-  in this spec assume zero-based indexes but use the term "<var
-  title="">index</var>th" liberally. We should define those to be
-  zero-based and be clearer about this.</p>
-
-  <p>Unless otherwise specified, if a DOM attribute that is a floating
-  point number type (<code title="">float</code>) is assigned an
-  Infinity or Not-a-Number value, a <code
-  title="big-issue">NOT_SUPPORTED_ERR</code> exception must be
-  raised.</p>
-
-  <p>Unless otherwise specified, if a method with an argument that is a
-  floating point number type (<code title="">float</code>) is passed
-  an Infinity or Not-a-Number value, a <code
-  title="big-issue">NOT_SUPPORTED_ERR</code> exception must be
-  raised.</p>
-
-  <!-- XXX DOMB -->
-  <p>Unless otherwise specified, if a method is passed fewer
-  arguments than is defined for that method in its IDL definition,
-  a <code title="big-issue">NOT_SUPPORTED_ERR</code> exception must be
-  raised.</p>
-
-  <!-- XXX DOMB -->
-  <p>Unless otherwise specified, if a method is passed more arguments than
-  is defined for that method in its IDL definition, the excess
-  arguments must be ignored.</p> <!-- XXX When updating this spec for
-  Bindings-For-DOM-compliance, also remove or consider the equivalent
-  requirement in the canvas section for toDataURL() and
-  getContext(). -->
-  
-
   <h4>Dependencies</h4>
 
   <p>This specification relies on several other underlying
@@ -626,6 +654,12 @@
 
    <dd>
 
+    <p>The Document Object Model (DOM) is a representation — a
+    model — of a document and its content. The DOM is not just
+    an API; the conformance criteria of HTML implementations are
+    defined, in this specification, in terms of operations on the DOM.
+    <a href="#refsDOM3CORE">[DOM3CORE]</a></p>
+
     <p>Implementations must support some version of DOM Core and DOM
     Events, because this specification is defined in terms of the DOM,
     and some of the features are defined as extensions to the DOM Core
@@ -646,7 +680,7 @@
 
    </dd>
 
-   <dt id=mq>Media Queries</dt>
+   <dt id="mq">Media Queries</dt>
 
    <dd>
 
@@ -673,6 +707,8 @@
 
   <h4>Features defined in other specifications</h4>
 
+  <p class="big-issue">this section will be removed at some point</p>
+
   <p>Some elements are defined in terms of their DOM
   <dfn><code>textContent</code></dfn> attribute. This is an attribute
   defined on the <code>Node</code> interface in DOM3 Core. <a
@@ -705,6 +741,45 @@
   href="http://dev.w3.org/cvsweb/~checkout~/csswg/cssom/Overview.html?content-type=text/html;%20charset=utf-8">http://dev.w3.org/cvsweb/~checkout~/csswg/cssom/Overview.html?content-type=text/html;%20charset=utf-8</a></p>
 
 
+  <h4>Common conformance requirements for APIs exposed to
+  JavaScript</h4>
+
+  <p class="big-issue">This section will eventually be removed in favour of WebIDL.</p>
+
+  <p class="big-issue">A lot of arrays/lists/<span title="collections">collection</span>s
+  in this spec assume zero-based indexes but use the term "<var
+  title="">index</var>th" liberally. We should define those to be
+  zero-based and be clearer about this.</p>
+
+  <p>Unless otherwise specified, if a DOM attribute that is a floating
+  point number type (<code title="">float</code>) is assigned an
+  Infinity or Not-a-Number value, a <code
+  title="big-issue">NOT_SUPPORTED_ERR</code> exception must be
+  raised.</p>
+
+  <p>Unless otherwise specified, if a method with an argument that is a
+  floating point number type (<code title="">float</code>) is passed
+  an Infinity or Not-a-Number value, a <code
+  title="big-issue">NOT_SUPPORTED_ERR</code> exception must be
+  raised.</p>
+
+  <!-- XXX DOMB -->
+  <p>Unless otherwise specified, if a method is passed fewer
+  arguments than is defined for that method in its IDL definition,
+  a <code title="big-issue">NOT_SUPPORTED_ERR</code> exception must be
+  raised.</p>
+
+  <!-- XXX DOMB -->
+  <p>Unless otherwise specified, if a method is passed more arguments than
+  is defined for that method in its IDL definition, the excess
+  arguments must be ignored.</p> <!-- XXX When updating this spec for
+  Bindings-For-DOM-compliance, also remove or consider the equivalent
+  requirement in the canvas section for toDataURL() and
+  getContext(). -->
+  
+
+
+
   <h3>Terminology</h3>
 
   <p>This specification refers to both HTML and XML attributes and DOM
@@ -730,6 +805,22 @@
   attributes defined or mentioned in this specification have no
   namespace (they are in the per-element partition).</p>
 
+  <p>When an XML name, such as an attribute or element name, is
+  referred to in the form
+  <code><var title="">prefix</var>:<var title="">localName</var></code>, as in
+  <code>xml:id</code> or <code>svg:rect</code>, it refers to a name
+  with the local name <var title="">localName</var> and the namespace given by
+  the prefix, as defined by the following table:</p>
+
+  <dl>
+   <dt><code title="">xml</code></dt>
+   <dd><code>http://www.w3.org/XML/1998/namespace</code></dd>
+   <dt><code title="">html</code></dt>
+   <dd><code>http://www.w3.org/1999/xhtml</code></dd>
+   <dt><code title="">svg</code></dt>
+   <dd><code>http://www.w3.org/2000/svg</code></dd>
+  </dl>
+
   <p>The term <span>HTML documents</span> is sometimes used in
   contrast with <span>XML documents</span> to specifically mean
   documents that were parsed using an <span>HTML parser</span> (as
@@ -779,32 +870,12 @@
   processing of the node after it is in the DOM. A user agent must not
   mutate the DOM in such situations.</p>
 
-  <p>When an XML name, such as an attribute or element name, is
-  referred to in the form
-  <code><var title="">prefix</var>:<var title="">localName</var></code>, as in
-  <code>xml:id</code> or <code>svg:rect</code>, it refers to a name
-  with the local name <var title="">localName</var> and the namespace given by
-  the prefix, as defined by the following table:</p>
-
-  <dl>
-   <dt><code title="">xml</code></dt>
-   <dd><code>http://www.w3.org/XML/1998/namespace</code></dd>
-   <dt><code title="">html</code></dt>
-   <dd><code>http://www.w3.org/1999/xhtml</code></dd>
-   <dt><code title="">svg</code></dt>
-   <dd><code>http://www.w3.org/2000/svg</code></dd>
-  </dl>
-
   <p>For simplicity, terms such as <em>shown</em>, <em>displayed</em>,
   and <em>visible</em> might sometimes be used when referring to the
   way a document is rendered to the user. These terms are not meant to
   imply a visual medium; they must be considered to apply to other
   media in equivalent ways.</p>
 
-  <p>DOM interfaces defined in this specification use Web IDL. User
-  agents must implement these interfaces as defined by the Web IDL
-  specification. <a href="#refsWEBIDL">[WEBIDL]</a></p>
-
   <p>The construction "a <code>Foo</code> object", where
   <code>Foo</code> is actually an interface, is sometimes used instead
   of the more accurate "an object implementing the interface
@@ -869,2041 +940,281 @@
 
 
 
-  <h4>HTML vs XHTML</h4>
 
-  <p><em>This section is non-normative.</em></p>
 
-  <p>This specification defines an abstract language for describing
-  documents and applications, and some APIs for interacting with
-  in-memory representations of resources that use this language.</p>
 
-  <p>The in-memory representation is known as "DOM5 HTML", or "the
-  DOM" for short.</p>
+  <h3>URLs</h3><!-- XXXURL -->
 
-  <p>There are various concrete syntaxes that can be used to transmit
-  resources that use this abstract language, two of which are defined
-  in this specification.</p>
+  <div class="big-issue">
 
-  <p>The first such concrete syntax is "HTML5". This is the format
-  recommended for most authors. It is compatible with all legacy Web
-  browsers. If a document is transmitted with the MIME type <code
-  title="">text/html</code>, then it will be processed as an "HTML5"
-  document by Web browsers.</p>
+   <p>This section will do the following:</p>
 
-  <p>The second concrete syntax uses XML, and is known as
-  "XHTML5". When a document is transmitted with an XML MIME type, such
-  as <code title="">application/xhtml+xml</code>, then it is processed
-  by an XML processor by Web browsers, and treated as an "XHTML5"
-  document. Authors are reminded that the processing for XML and HTML
-  differs; in particular, even minor syntax errors will prevent an XML
-  document from being rendered fully, whereas they would be ignored in
-  the "HTML5" syntax.</p>
+   <ul>
 
-  <p>The "DOM5 HTML", "HTML5", and "XHTML5" representations cannot all
-  represent the same content. For example, namespaces cannot be
-  represented using "HTML5", but they are supported in "DOM5 HTML" and
-  "XHTML5". Similarly, documents that use the <code>noscript</code>
-  feature can be represented using "HTML5", but cannot be represented
-  with "XHTML5" and "DOM5 HTML". Comments that contain the string
-  "<code title="">--></code>" can be represented in "DOM5 HTML" but
-  not in "HTML5" and "XHTML5". And so forth.</p>
+    <li>define URL as IRI and replace all uses of URIs and IRIs in the
+    rest of the spec with URL</li>
 
+    <li>define "valid URL" in terms of valid URIs and IRIs and replace
+    that concept through the spec to a pointer here, getting rid of
+    references to <a href="#refsRFC3986">[RFC3986]</a> <a
+    href="#refsRFC3987">[RFC3987]</a> outside this section</li>
 
-  <h2 id="dom">The Document Object Model</h2>
+    <li>define "valid URL reference" in terms of valid URI references
+    and IRI references and replace that concept through the spec to a
+    pointer here, getting rid of references to <a
+    href="#refsRFC3986">[RFC3986]</a> <a
+    href="#refsRFC3987">[RFC3987]</a> outside this section</li>
 
-  <p>The Document Object Model (DOM) is a representation — a
-  model — of a document and its content. <a
-  href="#refsDOM3CORE">[DOM3CORE]</a> The DOM is not just an API; the
-  conformance criteria of HTML implementations are defined, in this
-  specification, in terms of operations on the DOM.</p>
+    <li>define how to parse URLs (maybe by deferring to RFCs)</li>
 
-  <p>This specification defines the language represented in the DOM by
-  features together called DOM5 HTML. DOM5 HTML consists of DOM Core
-  <code>Document</code> nodes and DOM Core <code>Element</code> nodes,
-  along with text nodes and other content.</p>
+    <li>
 
-  <p>Elements in the DOM represent things; that is, they have
-  intrinsic <em>meaning</em>, also known as semantics.</p>
+     <p>define how to handle URIs that contain non-ascii characters
+     (and it's not the same as handling as IRIs, especially if the
+     character encoding of the document isn't UTF-8)</p>
 
-  <p class="example">For example, an <code>ol</code> element represents
-  an ordered list.</p>
+     <p>First parse it (we need to define that. For some schemes it's
+     not per spec -- e.g. apparently for ftp: we should split from
+     hosts on ';'). Then handle each bit as follows:</p>
+     <p>scheme: no further processing (treat %-escaped characters literally, treat unicode characters as unicode characters).</p>
+     <p>host: expand %-encoded bytes to Unicode as UTF-8, treat unicode characters as per IDN.</p>
+     <p>path: don't expand %-encoded bytes. Re-encode unicode to UTF-8 and percent-encode.</p>
+     <p>query: don't expand %-encoded bytes. Re-encode unicode to the page's encoding. Do not percent-encode.</p>
 
-  <p>In addition, documents and elements in the DOM host APIs that
-  extend the DOM Core APIs, providing new features to application
-  developers using DOM5 HTML.</p>
+    </li>
 
+    <li>define how to resolve relative URLs in markup attributes
+    (using XMLBase as defined elsewhere right now)</li>
 
-  <h3>Documents</h3>
+    <li>define how to resolve relative URLs in APIs, using the
+    <dfn>script's base URI</dfn> maybe</li>
 
-  <p>Every XML and HTML document in an HTML UA is represented by a
-  <code>Document</code> object. <a
-  href="#refsDOM3CORE">[DOM3CORE]</a></p>
+    <li>define what it means to resolve a relative URL when the base
+    URL doesn't have a path hierarchy (e.g. data:, javascript:,
+    about:blank URLs)</li>
 
-  <p><code>Document</code> objects are assumed to be <dfn>XML
-  documents</dfn> unless they are flagged as being <dfn>HTML
-  documents</dfn> when they are created. Whether a document is an
-  <span title="HTML documents">HTML document</span> or an <span
-  title="XML documents">XML document</span> affects the behavior of
-  certain APIs, as well as a few CSS rendering rules. <a
-  href="#refsCSS21">[CSS21]</a></p>
+    <li>define "an <dfn>element's base URI</dfn>" and make the various
+    places that talk about a base URI in the context of an element use
+    that definition</li>
 
-  <p class="note">A <code>Document</code> object created by the <code
-  title="">createDocument()</code> API on the
-  <code>DOMImplementation</code> object is initially an <span
-  title="XML documents">XML document</span>, but can be made into an
-  <span title="HTML documents">HTML document</span> by calling <code
-  title="dom-document-open">document.open()</code> on it.</p>
+    <li>make the language used to refer to resolving a base URI
+    consistent throughout, maybe make it hyperlink to a definition
+    each time</li>
 
-  <p>All <code>Document</code> objects (in user agents implementing
-  this specification) must also implement the
-  <code>HTMLDocument</code> interface, available using
-  binding-specific methods. (This is the case whether or not the
-  document in question is an <span title="HTML documents">HTML
-  document</span> or indeed whether it contains any <span>HTML
-  elements</span> at all.) <code>Document</code> objects must also
-  implement the document-level interface of any other namespaces found
-  in the document that the UA supports. For example, if an HTML
-  implementation also supports SVG, then the <code>Document</code>
-  object must implement <code>HTMLDocument</code> and
-  <code>SVGDocument</code>.</p>
+    <li>define a cheap, interoperable mechanism for URL attributes and
+    anything else that relies on xml:base and the base element to
+    handle dynamic changes to those attributes and elements, possibly
+    by defining some mechanism which causes changes to be ignored in
+    some reliable way.
+<!--
+On Sat, 1 Mar 2008, Anne van Kesteren wrote:
+>
+> Note that the new base URI would only take effect once you actually did
+> something with a potentially affected object. For instance, <img> would
+> not start loading a new image if the base URI changes. <img>.src =
+> <img>.getAttribute("src") could start loading a new resource however if
+> the base URI changed since the initial load.
 
-  <p class="note">Because the <code>HTMLDocument</code> interface is
-  now obtained using binding-specific casting methods instead of
-  simply being the primary interface of the document object, it is no
-  longer defined as inheriting from <code>Document</code>.</p>
+On Sat, 1 Mar 2008, Jonas Sicking wrote:
+> 
+> Well, that was my intention with the initial proposal. But Hixie pointed    
+> out that "did something" is a very hard thing to define. For example on 
+> a <a href="...">, does the user hovering the node count? Does resizing
+> the window count? Does removing the node from the DOM and reinserting it
+> count?
 
-  <pre class="idl">interface <dfn>HTMLDocument</dfn> {
-  // <span>resource metadata management</span>
-  [PutForwards=href] readonly attribute <span>Location</span> <span title="dom-document-location">location</span>;
-  readonly attribute DOMString <span title="dom-document-URL">URL</span>;
-           attribute DOMString <span title="dom-document-domain">domain</span>;
-  readonly attribute DOMString <span title="dom-document-referrer">referrer</span>;
-           attribute DOMString <span title="dom-document-cookie">cookie</span>;
-  readonly attribute DOMString <span title="dom-document-lastModified">lastModified</span>;
-  readonly attribute DOMString <span title="dom-document-compatMode">compatMode</span>;
-           attribute DOMString <span title="dom-document-charset">charset</span>;
-  readonly attribute DOMString <span title="dom-document-characterSet">characterSet</span>;
-  readonly attribute DOMString <span title="dom-document-defaultCharset">defaultCharset</span>;
-  readonly attribute DOMString <span title="dom-document-readyState">readyState</span>;
+On Sat, 1 Mar 2008, Maciej Stachowiak wrote:
+> 
+> How about requiring that the base used is the one in effect when a given
+> relative URI is resolved, and define that URIs for resource-loading 
+> elements are resolved at the time the relevant attribute is set or
+> parsed (but for hyperlinks, at the time it is dereferenced). That is        
+> easy to implement, interoperable, and reasonably predictable. It makes
+> sense that changing <base> would affect future loads but not trigger
+> reloads of already loaded or already in progress resources.
 
-  // <span>DOM tree accessors</span>
-           attribute DOMString <span title="dom-document-title">title</span>;
-           attribute DOMString <span title="dom-document-dir">dir</span>;
-           attribute <span>HTMLElement</span> <span title="dom-document-body">body</span>;
-  readonly attribute <span>HTMLCollection</span> <span title="dom-document-images">images</span>;
-  readonly attribute <span>HTMLCollection</span> <span title="dom-document-embeds">embeds</span>;
-  readonly attribute <span>HTMLCollection</span> <span title="dom-document-plugins">plugins</span>;
-  readonly attribute <span>HTMLCollection</span> <span title="dom-document-links">links</span>;
-  readonly attribute <span>HTMLCollection</span> <span title="dom-document-forms">forms</span>;
-  readonly attribute <span>HTMLCollection</span> <span title="dom-document-anchors">anchors</span>;
-  readonly attribute <span>HTMLCollection</span> <span title="dom-document-scripts">scripts</span>;
-  NodeList <span title="dom-document-getElementsByName">getElementsByName</span>(in DOMString elementName);
-  NodeList <span title="dom-document-getElementsByClassName">getElementsByClassName</span>(in DOMString classNames);
+possibly "in the event that the xml:base or base href attribute is
+changed, user agents may, whenever convenient, pretend, for the sake
+of url resolution, that it has not changed"
 
-  // <span>dynamic markup insertion</span>
-           attribute DOMString <span title="dom-innerHTML">innerHTML</span>;
-  <span>HTMLDocument</span> <span title="dom-document-open">open</span>();
-  <span>HTMLDocument</span> <span title="dom-document-open">open</span>(in DOMString type);
-  <span>HTMLDocument</span> <span title="dom-document-open">open</span>(in DOMString type, in DOMString replace);
-  <span>Window</span> <span title="dom-document-open">open</span>(in DOMString url, in DOMString name, in DOMString features);
-  <span>Window</span> <span title="dom-document-open">open</span>(in DOMString url, in DOMString name, in DOMString features, in boolean replace);
-  void <span title="dom-document-close">close</span>();
-  void <span title="dom-document-write">write</span>(in DOMString text);
-  void <span title="dom-document-writeln">writeln</span>(in DOMString text);
+possibly define "base uri change notification behaviour" for all
+elements with URI attributes, and then define changing base href and
+xml:base to activate that behaviour on all elements in the affected
+subtree. Also make this algorithm get called when a node from another
+document is inserted into an HTML document. (we could define that
+you're allowed to do that, in the absence of a DOM Core update)
+-->
+    </li>
 
-  // <span>user interaction</span>
-  <span>Selection</span> <span title="dom-document-getSelection">getSelection</span>();
-  readonly attribute <span>Element</span> <span title="dom-document-activeElement">activeElement</span>;
-  boolean <span title="dom-document-hasFocus">hasFocus</span>();
-           attribute boolean <span title="dom-document-designMode">designMode</span>;
-  boolean <span title="dom-document-execCommand">execCommand</span>(in DOMString commandId);
-  boolean <span title="dom-document-execCommand">execCommand</span>(in DOMString commandId, in boolean showUI);
-  boolean <span title="dom-document-execCommand">execCommand</span>(in DOMString commandId, in boolean showUI, in DOMString value);
-  boolean <span title="dom-document-queryCommandEnabled">queryCommandEnabled</span>(in DOMString commandId);
-  boolean <span title="dom-document-queryCommandIndeterm">queryCommandIndeterm</span>(in DOMString commandId);
-  boolean <span title="dom-document-queryCommandState">queryCommandState</span>(in DOMString commandId);
-  boolean <span title="dom-document-queryCommandSupported">queryCommandSupported</span>(in DOMString commandId);
-  DOMString <span title="dom-document-queryCommandValue">queryCommandValue</span>(in DOMString commandId);
-  readonly attribute <span>HTMLCollection</span> <span title="dom-document-commands">commands</span>;
-};</pre>
-
-  <p>Since the <code>HTMLDocument</code> interface holds methods and
-  attributes related to a number of disparate features, the members of
-  this interface are described in various different sections.</p>
-
-
-  <h4>Security</h4>
-
-  <p>User agents must raise a <span>security exception</span> whenever
-  any of the members of an <code>HTMLDocument</code> object are
-  accessed by scripts whose <span>effective script origin</span> is
-  not the <span title="same origin">same</span> as the
-  <code>Document</code>'s <span>effective script origin</span>.</p>
-
-
-
-  <h4><dfn>Resource metadata management</dfn></h4>
-
-  <p>The <dfn title="dom-document-URL"><code>URL</code></dfn>
-  attribute must return <span>the document's address</span><!--
-  XXXDOCURL xref -->.</p>
-
-
-  <p>The <dfn
-  title="dom-document-referrer"><code>referrer</code></dfn> attribute
-  must return either the <span title="the document's
-  address">address</span><!-- XXXDOXURL xref --> of the <span>active
-  document</span> of the <span>source browsing context</span> at the
-  time the navigation was started (that is, the page which <span
-  title="navigate">navigated</span> the <span>browsing context</span>
-  to the current document), or the empty string if there is no such
-  originating page, or if the UA has been configured not to report
-  referrers in this case, or if the navigation was initiated for a
-  <span>hyperlink</span> with a <code
-  title="rel-noreferrer">noreferrer</code> keyword.</p>
-
-  <p class="note">In the case of HTTP, the <code
-  title="dom-document-referrer">referrer</code> DOM attribute will
-  match the <code title="">Referer</code> (sic) header that was sent
-  when fetching the current page.</p>
-
-  <p class="note">Typically user agents are configured to not report
-  referrers in the case where the referrer uses an encrypted protocol
-  and the current page does not (e.g. when navigating from an <code
-  title="">https:</code> page to an <code title="">http:</code>
-  page).</p>
-
-
-  <hr>
-
-  <p>The <dfn title="dom-document-cookie"><code>cookie</code></dfn>
-  attribute represents the cookies of the resource.</p>
-
-  <!-- XXX this needs work; e.g. document.open() should return the
-  cookies of the document that called document.open(), not of
-  about:blank or the document that had .open() called on, as I
-  understand it. -->
-
-  <p id="sandboxCookies">On getting, if the <span>sandboxed origin
-  browsing context flag</span> is set on the <span>browsing
-  context</span> of the document, the user agent must raise a
-  <span>security exception</span>. Otherwise, it must return the same
-  string as the value of the <code title="">Cookie</code> HTTP header
-  it would include if fetching the resource indicated by <span>the
-  document's address</span><!-- XXXDOCURL --> over HTTP, as per RFC
-  2109 section 4.3.4. <a href="#refsRFC2109">[RFC2109]</a></p>
-
-  <p>On setting, if the <span>sandboxed origin browsing context
-  flag</span> is set on the <span>browsing context</span> of the
-  document, the user agent must raise a <span>security
-  exception</span>. Otherwise, the user agent must act as it would
-  when processing cookies if it had just attempted to fetch <span>the
-  document's address</span><!-- XXXDOCURL --> over HTTP, and had
-  received a response with a <code>Set-Cookie</code> header whose
-  value was the specified value, as per RFC 2109 sections 4.3.1,
-  4.3.2, and 4.3.3. <a href="#refsRFC2109">[RFC2109]</a></p>
-
-  <p class="note">Since the <code
-  title="dom-document-cookie">cookie</code> attribute is accessible
-  across frames, the path restrictions on cookies are only a tool to
-  help manage which cookies are sent to which parts of the site, and
-  are not in any way a security feature.</p>
-
-
-  <hr> 
-
-  <p>The <dfn
-  title="dom-document-lastModified"><code>lastModified</code></dfn>
-  attribute, on getting, must return the date and time of the
-  <code>Document</code>'s source file's last modification, in the
-  user's local timezone, in the following format:</p>
-
-  <ol>
-
-   <li> The month component of the date. </li>
-
-   <li> A U+002F SOLIDUS character ('/'). </li>
-
-   <li> The day component of the date. </li>
-
-   <li> A U+002F SOLIDUS character ('/'). </li>
-
-   <li> The year component of the date. </li>
-
-   <li> A U+0020 SPACE character. </li>
-
-   <li> The hours component of the time. </li>
-
-   <li> A U+003A COLON character (':'). </li>
-
-   <li> The minutes component of the time. </li>
-
-   <li> A U+003A COLON character (':'). </li>
-
-   <li> The seconds component of the time. </li>
-
-  </ol>
-
-  <p>All the numeric components above, other than the year, must be
-  given as two digits in the range U+0030 DIGIT ZERO to U+0039 DIGIT
-  NINE representing the number in base ten, zero-padded if
-  necessary.</p>
-
-  <p>The <code>Document</code>'s source file's last modification date
-  and time must be derived from relevant features of the networking
-  protocols used, e.g. from the value of the HTTP <code
-  title="">Last-Modified</code> header of the document, or from
-  metadata in the file system for local files. If the last modification
-  date and time are not known, the attribute must return the string
-  <code title="">01/01/1970 00:00:00</code>.</p>
-
-
-  <p>A <code>Document</code> is always set to one of three modes:
-  <dfn>no quirks mode</dfn>, the default; <dfn>quirks mode</dfn>, used
-  typically for legacy documents; and <dfn>limited quirks mode</dfn>,
-  also known as "almost standards" mode. The mode is only ever changed
-  from the default by the <span>HTML parser</span>, based on the
-  presence, absence, or value of the DOCTYPE string.</p>
-
-  <p>The <dfn
-  title="dom-document-compatMode"><code>compatMode</code></dfn> DOM
-  attribute must return the literal string "<code
-  title="">CSS1Compat</code>" unless the document has been set to
-  <span>quirks mode</span> by the <span>HTML parser</span>, in which
-  case it must instead return the literal string "<code
-  title="">BackCompat</code>".</p>
-
-  <div class="big-issue">
-
-   <p>As far as parsing goes, the quirks I know of are:</p>
-
-   <ul>
-
-    <li>Comment parsing is different.</li>
-
-    <li><code>p</code> can contain <code>table</code></li>
-
-    <li>Safari and IE have special parsing rules for <% ... %>
-    (even in standards mode, though clearly this should be
-    quirks-only).</li>
-
    </ul>
 
   </div>
 
+  <!-- XXXURL change to URL -->
+  <h4>Interfaces for URI manipulation</h4>
 
+  <!-- XXXURL change to URL --> 
+ <p>An interface that has a complement of <dfn>URI decomposition
+  attributes</dfn> will have seven attributes with the following
+  definitions:</p>
 
-  <p>Documents have an associated <dfn title="document's character
-  encoding">character encoding</dfn>. When a <code>Document</code>
-  object is created, the <span>document's character encoding</span>
-  must be initialized to UTF-16. Various algorithms during page
-  loading affect this value, as does the <code
-  title="dom-document-charset">charset</code> setter.  <a
-  href="#refsIANACHARSET">[IANACHARSET]</a> <!-- XXX
-  http://www.iana.org/assignments/character-sets --></p>
+<pre class="idl">
+           attribute DOMString <span title="dom-uda-protocol">protocol</span>;
+           attribute DOMString <span title="dom-uda-host">host</span>;
+           attribute DOMString <span title="dom-uda-hostname">hostname</span>;
+           attribute DOMString <span title="dom-uda-port">port</span>;
+           attribute DOMString <span title="dom-uda-pathname">pathname</span>;
+           attribute DOMString <span title="dom-uda-search">search</span>;
+           attribute DOMString <span title="dom-uda-hash">hash</span>;
+</pre>
 
-  <p>The <dfn title="dom-document-charset"><code>charset</code></dfn>
-  DOM attribute must, on getting, return the preferred MIME name of
-  the <span>document's character encoding</span>. On setting, if the
-  new value is an IANA-registered alias for a character encoding, the
-  <span>document's character encoding</span> must be set to that
-  character encoding. (Otherwise, nothing happens.)</p>
+  <!-- XXXURL change to URL -->
+  <p>The attributes defined to be URI decomposition attributes must
+  act as described for the attributes with the same corresponding
+  names in this section.</p>
 
-  <p>The <dfn
-  title="dom-document-characterSet"><code>characterSet</code></dfn>
-  DOM attribute must, on getting, return the preferred MIME name of
-  the <span>document's character encoding</span>.</p>
+  <!-- XXXURL change to URL -->
+  <p>In addition, an interface with a complement of URI decomposition
+  attributes will define an <dfn
+  title="concept-uda-input">input</dfn>, which is a URI that the
+  attributes act on, and a <dfn title="concept-uda-setter">common
+  setter action</dfn>, which is a set of steps invoked when any of the
+  attributes' setters are invoked.</p>
 
-  <p>The <dfn
-  title="dom-document-defaultCharset"><code>defaultCharset</code></dfn>
-  DOM attribute must, on getting, return the preferred MIME name of a
-  character encoding, possibly the user's default encoding, or an
-  encoding associated with the user's current geographical location,
-  or any arbitrary encoding name.</p>
+  <!-- XXXURL change to URL -->
+  <p>The seven URI decomposition attributes have similar
+  requirements.</p>
 
-  <p>Each document has a <dfn>current document readiness</dfn>. When a
-  <code>Document</code> object is created, it must have its
-  <span>current document readiness</span> set to the string
-  "loading". Various algorithms during page loading affect this
-  value. When the value is set, the user agent must <span>fire a
-  simple event</span> called <code
-  title="event-readystatechanged">readystatechanged</code> at the
-  <code>Document</code> object.</p> <!-- XXX define
-  document.onreadystatechange -->
+  <!-- XXXURL change to URL -->
+  <p>On getting, if the <span title="concept-uda-input">input</span>
+  fulfills the condition given in the "getter condition" column
+  corresponding to the attribute in the table below, the user agent
+  must return the part of the <span
+  title="concept-uda-input">input</span> URI given in the "component"
+  column, with any prefixes specified in the "prefix" column
+  appropriately added to the start of the string and any suffixes
+  specified in the "suffix" column appropriately added to the end of
+  the string. Otherwise, the attribute must return the empty
+  string.</p>
 
-  <p>The <dfn
-  title="dom-document-readyState"><code>readyState</code></dfn> DOM
-  attribute must, on getting, return the <span>current document
-  readiness</span>.</p>
+  <!-- XXXURL change to URL; algorithms or something? -->
+  <p>On setting, the new value must first be mutated as described by
+  the "setter preprocessor" column, then mutated by %-escaping any
+  characters in the new value that are not valid in the relevant
+  component as given by the "component" column. Then, if the resulting
+  new value fulfills the condition given in the "setter condition"
+  column, the user agent must make a new string <var
+  title="">output</var> by replacing the component of the URI given by
+  the "component" column in the <span
+  title="concept-uda-input">input</span> URI with the new value;
+  otherwise, the user agent must let <var title="">output</var> be
+  equal to the <span title="concept-uda-input">input</span>. Finally,
+  the user agent must invoke the <span
+  title="concept-uda-setter">common setter action</span> with the
+  value of <var title="">output</var>.</p>
 
-
-
-  <h3>Elements</h3>
-
-  <p>The nodes representing <span>HTML elements</span> in the DOM must
-  implement, and expose to scripts, the interfaces listed for them in
-  the relevant sections of this specification. This includes
-  <span>XHTML</span> elements in <span>XML documents</span>, even when
-  those documents are in another context (e.g. inside an XSLT
-  transform).</p>
-
-  <p>The basic interface, from which all the <span>HTML
-  elements</span>' interfaces inherit, and which must be used by
-  elements that have no additional requirements, is the
-  <code>HTMLElement</code> interface.</p>
-
-  <pre class="idl">interface <dfn>HTMLElement</dfn> : <span>Element</span> {
-  // <span>DOM tree accessors</span>
-  NodeList <span title="dom-getElementsByClassName">getElementsByClassName</span>(in DOMString classNames);
-
-  // <span>dynamic markup insertion</span>
-           attribute DOMString <span title="dom-innerHTML">innerHTML</span>;
-
-  // <span>metadata attributes</span>
-           attribute DOMString <span title="dom-id">id</span>;
-           attribute DOMString <span title="dom-title">title</span>;
-           attribute DOMString <span title="dom-lang">lang</span>;
-           attribute DOMString <span title="dom-dir">dir</span>;
-           attribute <span>DOMString</span> <span title="dom-className">className</span>;
-  readonly attribute <span>DOMTokenList</span> <span title="dom-classList">classList</span>;
-  readonly attribute <span>DOMStringMap</span> <span title="dom-dataset">dataset</span>;
-
-  // <span>user interaction</span>
-           attribute boolean <span title="dom-irrelevant">irrelevant</span>;
-  void <span title="dom-click">click</span>();
-  void <span title="dom-scrollIntoView">scrollIntoView</span>();
-  void <span title="dom-scrollIntoView">scrollIntoView</span>(in boolean top);
-           attribute long <span title="dom-tabindex">tabIndex</span>;
-  void <span title="dom-focus">focus</span>();
-  void <span title="dom-blur">blur</span>();
-           attribute boolean <span title="dom-draggable">draggable</span>;
-           attribute DOMString <span title="dom-contentEditable">contentEditable</span>;
-  readonly attribute DOMString <span title="dom-isContentEditable">isContentEditable</span>;
-           attribute <span>HTMLMenuElement</span> <span title="dom-contextMenu">contextMenu</span>;
-
-  // <span>styling</span>
-  readonly attribute <span>CSSStyleDeclaration</span> <span title="dom-style">style</span>;
-
-  // <span>data templates</span>
-           attribute DOMString <span title="dom-template">template</span>;
-  readonly attribute HTMLDataTemplateElement <span title="dom-templateElement">templateElement</span>;
-           attribute DOMString <span title="dom-ref">ref</span>;
-  readonly attribute Node <span title="dom-refNode">refNode</span>;
-           attribute DOMString <span title="dom-registrationMark">registrationMark</span>;
-  readonly attribute DocumentFragment <span title="dom-originalContent">originalContent</span>;
-
-  // <span>event handler DOM attributes</span>
-           attribute <span>EventListener</span> <span title="handler-onabort">onabort</span>;
-           attribute <span>EventListener</span> <span title="handler-onbeforeunload">onbeforeunload</span>;
-           attribute <span>EventListener</span> <span title="handler-onblur">onblur</span>;
-           attribute <span>EventListener</span> <span title="handler-onchange">onchange</span>;
-           attribute <span>EventListener</span> <span title="handler-onclick">onclick</span>;
-           attribute <span>EventListener</span> <span title="handler-oncontextmenu">oncontextmenu</span>;
-           attribute <span>EventListener</span> <span title="handler-ondblclick">ondblclick</span>;
-           attribute <span>EventListener</span> <span title="handler-ondrag">ondrag</span>;
-           attribute <span>EventListener</span> <span title="handler-ondragend">ondragend</span>;
-           attribute <span>EventListener</span> <span title="handler-ondragenter">ondragenter</span>;
-           attribute <span>EventListener</span> <span title="handler-ondragleave">ondragleave</span>;
-           attribute <span>EventListener</span> <span title="handler-ondragover">ondragover</span>;
-           attribute <span>EventListener</span> <span title="handler-ondragstart">ondragstart</span>;
-           attribute <span>EventListener</span> <span title="handler-ondrop">ondrop</span>;
-           attribute <span>EventListener</span> <span title="handler-onerror">onerror</span>;
-           attribute <span>EventListener</span> <span title="handler-onfocus">onfocus</span>;
-           attribute <span>EventListener</span> <span title="handler-onkeydown">onkeydown</span>;
-           attribute <span>EventListener</span> <span title="handler-onkeypress">onkeypress</span>;
-           attribute <span>EventListener</span> <span title="handler-onkeyup">onkeyup</span>;
-           attribute <span>EventListener</span> <span title="handler-onload">onload</span>;
-           attribute <span>EventListener</span> <span title="handler-onmessage">onmessage</span>;
-           attribute <span>EventListener</span> <span title="handler-onmousedown">onmousedown</span>;
-           attribute <span>EventListener</span> <span title="handler-onmousemove">onmousemove</span>;
-           attribute <span>EventListener</span> <span title="handler-onmouseout">onmouseout</span>;
-           attribute <span>EventListener</span> <span title="handler-onmouseover">onmouseover</span>;
-           attribute <span>EventListener</span> <span title="handler-onmouseup">onmouseup</span>;
-           attribute <span>EventListener</span> <span title="handler-onmousewheel">onmousewheel</span>;
-           attribute <span>EventListener</span> <span title="handler-onresize">onresize</span>;
-           attribute <span>EventListener</span> <span title="handler-onscroll">onscroll</span>;
-           attribute <span>EventListener</span> <span title="handler-onselect">onselect</span>;
-           attribute <span>EventListener</span> <span title="handler-onstorage">onstorage</span>;
-           attribute <span>EventListener</span> <span title="handler-onsubmit">onsubmit</span>;
-           attribute <span>EventListener</span> <span title="handler-onunload">onunload</span>;
-
-};</pre>
-
-  <p>As with the <code>HTMLDocument</code> interface, the
-  <code>HTMLElement</code> interface holds methods and attributes
-  related to a number of disparate features, and the members of this
-  interface are therefore described in various different sections of
-  this specification.</p>
-
-
-  <h4>Reflecting content attributes in DOM attributes</h4>
-
-  <p>Some <span title="DOM attribute">DOM attributes</span> are
-  defined to <dfn>reflect</dfn> a particular <span>content
-  attribute</span>. This means that on getting, the DOM attribute
-  returns the current value of the content attribute, and on setting,
-  the DOM attribute changes the value of the content attribute to the
-  given value.</p>
-
-  <!-- XXXURL refer to URLs and use the "resolve to absolute URL"
-  algorithm -->
-  <p>If a reflecting DOM attribute is a <code>DOMString</code>
-  attribute whose content attribute is defined to contain a URI, then
-  on getting, the DOM attribute must return the value of the content
-  attribute, resolved to an absolute URI, and on setting, must set the
-  content attribute to the specified literal value. If the content
-  attribute is absent, the DOM attribute must return the default
-  value, if the content attribute has one, or else the empty
+  <!-- XXXURL change to URL -->
+  <p>When replacing a component in the URI, if the component is part
+  of an optional group in the URI syntax consisting of a character
+  followed by the component, the component (including its prefix
+  character) must be included even if the new value is the empty
   string.</p>
 
-  <!-- XXXURL refer to URLs and use the "resolve to absolute URL"
-  algorithm -->
-  <p>If a reflecting DOM attribute is a <code>DOMString</code>
-  attribute whose content attribute is defined to contain one or more
-  URIs, then on getting, the DOM attribute must <span title="split the
-  string on spaces">split the content attribute on spaces</span> and
-  return the concatenation of each token URI, resolved to an absolute
-  URI, with a single U+0020 SPACE character between each URI; if the
-  content attribute is absent, the DOM attribute must return the
-  default value, if the content attribute has one, or else the empty
-  string. On setting, the DOM attribute must set the content attribute
-  to the specified literal value.</p>
+  <p class="note">The previous paragraph applies in particular to the
+  "<code title="">:</code>" before a <port> component, the "<code
+  title="">?</code>" before a <query> component, and the "<code
+  title="">#</code>" before a <fragment> component.</p>
 
-  <p>If a reflecting DOM attribute is a <code>DOMString</code> whose
-  content attribute is an <span>enumerated attribute</span>, and the
-  DOM attribute is <dfn>limited to only known values</dfn>, then, on
-  getting, the DOM attribute must return the conforming value
-  associated with the state the attribute is in (in its canonical
-  case), or the empty string if the attribute is in a state that has
-  no associated keyword value; and on setting, if the new value
-  case-insensitively matches one of the keywords given for that
-  attribute, then the content attribute must be set to the conforming
-  value associated with the state that the attribute would be in if
-  set to the given new value, otherwise, if the new value is the empty
-  string, then the content attribute must be removed, otherwise, the
-  setter must raise a <code>SYNTAX_ERR</code> exception.</p>
+  <!-- XXXURL change to URL; algorithms -->
+  <p>The rules for parsing and constructing URIs are described in RFC
+  3986 and RFC 3987. <a href="#refsRFC3986">[RFC3986]</a> <a
+  href="#refsRFC3987">[RFC3987]</a></p>
 
-  <p>If a reflecting DOM attribute is a <code>DOMString</code> but
-  doesn't fall into any of the above categories, then the getting and
-  setting must be done in a transparent, case-preserving manner.</p>
-
-  <p>If a reflecting DOM attribute is a boolean attribute, then on
-  getting the DOM attribute must return true if the attribute is set,
-  and false if it is absent. On setting, the content attribute must be
-  removed if the DOM attribute is set to false, and must be set to
-  have the same value as its name if the DOM attribute is set to
-  true. (This corresponds to the rules for <span title="boolean
-  attribute">boolean content attributes</span>.)</p>
-
-  <p>If a reflecting DOM attribute is a signed integer type
-  (<code>long</code>) then, on getting, the content attribute must be
-  parsed according to <span title="rules for parsing integers">the
-  rules for parsing signed integers</span>, and if that is successful,
-  the resulting value must be returned. If, on the other hand, it
-  fails, or if the attribute is absent, then the default value must be
-  returned instead, or 0 if there is no default value. On setting, the
-  given value must be converted to the shortest possible string
-  representing the number as a <span>valid integer</span> in base ten
-  and then that string must be used as the new content attribute
-  value.</p>
-
-  <p>If a reflecting DOM attribute is an <em>unsigned</em> integer
-  type (<code>unsigned long</code>) then, on getting, the content
-  attribute must be parsed according to <span title="rules for parsing
-  non-negative integers">the rules for parsing unsigned
-  integers</span>, and if that is successful, the resulting value must
-  be returned. If, on the other hand, it fails, or if the attribute is
-  absent, the default value must be returned instead, or 0 if there is
-  no default value. On setting, the given value must be converted to
-  the shortest possible string representing the number as a
-  <span>valid non-negative integer</span> in base ten and then that
-  string must be used as the new content attribute value.</p>
-
-  <p>If a reflecting DOM attribute is an unsigned integer type
-  (<code>unsigned long</code>) that is <dfn>limited to only positive
-  non-zero numbers</dfn>, then the behavior is similar to the previous
-  case, but zero is not allowed. On getting, the content attribute
-  must first be parsed according to <span title="rules for parsing
-  non-negative integers">the rules for parsing unsigned
-  integers</span>, and if that is successful, the resulting value must
-  be returned. If, on the other hand, it fails, or if the attribute is
-  absent, the default value must be returned instead, or 1 if there is
-  no default value. On setting, if the value is zero, the user agent
-  must fire an <code>INDEX_SIZE_ERR</code> exception. Otherwise, the
-  given value must be converted to the shortest possible string
-  representing the number as a <span>valid non-negative integer</span>
-  in base ten and then that string must be used as the new content
-  attribute value.</p>
-
-  <p>If a reflecting DOM attribute is a floating point number type
-  (<code>float</code>) and the content attribute is defined to contain
-  a time offset, then, on getting, the content attribute must be
-  parsed according to <span title="rules for parsing time offsets">the
-  rules for parsing time offsets</span>, and if that is successful, the
-  resulting value, in seconds, must be returned. If that fails, or if
-  the attribute is absent, the default value must be returned, or the
-  not-a-number value (NaN) if there is no default value. On setting,
-  the given value, interpreted as a time offset in seconds, must be
-  converted to a string using the <span>time offset serialization
-  rules</span>, and that string must be used as the new content
-  attribute value.</p>
-
-  <p>If a reflecting DOM attribute is a floating point number type
-  (<code>float</code>) and it doesn't fall into one of the earlier
-  categories, then, on getting, the content attribute must be parsed
-  according to <span title="rules for parsing floating point number
-  values">the rules for parsing floating point number values</span>,
-  and if that is successful, the resulting value must be returned. If,
-  on the other hand, it fails, or if the attribute is absent, the
-  default value must be returned instead, or 0.0 if there is no
-  default value. On setting, the given value must be converted to the
-  shortest possible string representing the number as a <span>valid
-  floating point number</span> in base ten and then that string must
-  be used as the new content attribute value.</p>
-
-  <p>If a reflecting DOM attribute is of the type
-  <code>DOMTokenList</code>, then on getting it must return a
-  <code>DOMTokenList</code> object whose underlying string is the
-  element's corresponding content attribute. When the
-  <code>DOMTokenList</code> object mutates its underlying string, the
-  content attribute must itself be immediately mutated. When the
-  attribute is absent, then the string represented by the
-  <code>DOMTokenList</code> object is the empty string; when the
-  object mutates this empty string, the user agent must first add the
-  corresponding content attribute, and then mutate that attribute
-  instead. <code>DOMTokenList</code> attributes are always
-  read-only. The same <code>DOMTokenList</code> object must be
-  returned every time for each attribute.</p>
-
-  <p>If a reflecting DOM attribute has the type
-  <code>HTMLElement</code>, or an interface that descends from
-  <code>HTMLElement</code>, then, on getting, it must run the
-  following algorithm (stopping at the first point where a value is
-  returned):
-
-  <ol>
-
-   <li>If the corresponding content attribute is absent, then the
-   DOM attribute must return null.</li>
-
-   <li>Let <var title="">candidate</var> be the element that the <code
-   title="">document.getElementById()</code> method would find if it
-   was passed as its argument the current value of the corresponding
-   content attribute.</li>
-
-   <li>If <var title="">candidate</var> is null, or if it is not
-   type-compatible with the DOM attribute, then the DOM attribute must
-   return null.</li>
-
-   <li>Otherwise, it must return <var title="">candidate</var>.</li>
-
-  </ol>
-
-  <p>On setting, if the given element has an <code
-  title="attr-id">id</code> attribute, then the content attribute must
-  be set to the value of that <code title="attr-id">id</code>
-  attribute. Otherwise, the DOM attribute must be set to the empty
-  string.</p><!-- XXX or raise an exception? -->
-
-
-
-
-  <h3>Common DOM interfaces</h3>
-
-  <h4>Collections</h4>
-
-  <p>The <code>HTMLCollection</code>,
-  <code>HTMLFormControlsCollection</code>, and
-  <code>HTMLOptionsCollection</code> interfaces represent various
-  lists of DOM nodes. Collectively, objects implementing these
-  interfaces are called <dfn>collections</dfn>.</p>
-
-  <p>When a <span title="collections">collection</span> is created, a
-  filter and a root are associated with the collection.</p>
-
-  <p class="example">For example, when the <code>HTMLCollection</code>
-  object for the <code
-  title="dom-document-images">document.images</code> attribute is
-  created, it is associated with a filter that selects only
-  <code>img</code> elements, and rooted at the root of the
-  document.</p>
-
-  <p>The <span title="collections">collection</span> then <dfn
-  title="represented by the collection">represents</dfn> a
-  <span>live</span> view of the subtree rooted at the collection's
-  root, containing only nodes that match the given filter. The view is
-  linear. In the absence of specific requirements to the contrary, the
-  nodes within the collection must be sorted in <span>tree
-  order</span>.</p>
-
-  <p class="note">The <code title="dom-table-rows">rows</code> list is
-  not in tree order.</p>
-
-  <p>An attribute that returns a collection must return the same
-  object every time it is retrieved.</p>
-
-
-  <h5>HTMLCollection</h5>
-
-  <p>The <code>HTMLCollection</code> interface represents a generic
-  <span title="collections">collection</span> of elements.</p>
-
-  <pre class="idl">interface <dfn>HTMLCollection</dfn> {
-  readonly attribute unsigned long <span title="dom-HTMLCollection-length">length</span>;
-  [IndexGetter] Element <span title="dom-HTMLCollection-item">item</span>(in unsigned long index);
-  [NameGetter] Element <span title="dom-HTMLCollection-namedItem">namedItem</span>(in DOMString name);
-};</pre>
-
-  <p>The <dfn
-  title="dom-HTMLCollection-length"><code>length</code></dfn>
-  attribute must return the number of nodes <span>represented by the
-  collection</span>.</p>
-
-  <p>The <dfn title="dom-HTMLCollection-item"><code>item(<var
-  title="">index</var>)</code></dfn> method must return the <var
-  title="">index</var>th node in the collection. If there is no <var
-  title="">index</var>th node in the collection, then the method must
-  return null.</p>
-
-  <p>The <dfn
-  title="dom-HTMLCollection-namedItem"><code>namedItem(<var
-  title="">key</var>)</code></dfn> method must return the first node
-  in the collection that matches the following requirements:</p>
-
-  <ul>
-
-   <li>It is an <code>a</code>, <code>applet</code>,
-   <code>area</code>, <code>form</code>, <code>img</code>, or
-   <code>object</code> element with a <code
-   title="attr-name">name</code> attribute equal to <var
-   title="">key</var>, or,</li>
-
-   <li>It is an <span title="HTML elements">HTML element</span> of any
-   kind with an <code title="attr-id">id</code> attribute equal to
-   <var title="">key</var>. (Non-HTML elements, even if they have IDs,
-   are not searched for the purposes of <code
-   title="dom-HTMLCollection-namedItem">namedItem()</code>.)</li>
-
-  </ul>
-
-  <p>If no such elements are found, then the method must return
-  null.</p>
-
-
-
-  <h5>HTMLFormControlsCollection</h5>
-
-  <p>The <code>HTMLFormControlsCollection</code> interface represents
-  a <span title="collections">collection</span> of form controls.</p>
-
-  <pre class="idl">interface <dfn>HTMLFormControlsCollection</dfn> {
-  readonly attribute unsigned long <span title="dom-HTMLFormControlsCollection-length">length</span>;
-  [IndexGetter] <span>HTMLElement</span> <span title="dom-HTMLFormControlsCollection-item">item</span>(in unsigned long index);
-  [NameGetter] Object <span title="dom-HTMLFormControlsCollection-namedItem">namedItem</span>(in DOMString name);
-};</pre>
-
-  <p>The <dfn
-  title="dom-HTMLFormControlsCollection-length"><code>length</code></dfn>
-  attribute must return the number of nodes <span>represented by the
-  collection</span>.</p>
-
-  <p>The <dfn
-  title="dom-HTMLFormControlsCollection-item"><code>item(<var
-  title="">index</var>)</code></dfn> method must return the <var
-  title="">index</var>th node in the collection. If there is no <var
-  title="">index</var>th node in the collection, then the method must
-  return null.</p>
-
-  <p>The <dfn
-  title="dom-HTMLFormControlsCollection-namedItem"><code>namedItem(<var title="">key</var>)</code></dfn>
-  method must act according to the following algorithm:
-
-  <ol>
-
-   <li>If, at the time the method is called, there is exactly one node
-   in the collection that has either an <code
-   title="attr-id">id</code> attribute or a <code
-   title="attr-name">name</code> attribute equal to <var title="">key</var>,
-   then return that node and stop the algorithm.</li>
-
-   <li>Otherwise, if there are no nodes in the collection that have
-   either an <code title="attr-id">id</code> attribute or a <code
-   title="attr-name">name</code> attribute equal to <var
-   title="">key</var>, then return null and stop the algorithm.</li>
-
-   <li>Otherwise, create a <code>NodeList</code> object representing a
-   live view of the <code>HTMLFormControlsCollection</code> object,
-   further filtered so that the only nodes in the
-   <code>NodeList</code> object are those that have either an <code
-   title="attr-id">id</code> attribute or a <code
-   title="attr-name">name</code> attribute equal to <var
-   title="">key</var>. The nodes in the <code>NodeList</code> object
-   must be sorted in <span>tree order</span>.</li>
-
-   <li>Return that <code>NodeList</code> object.</li>
-
-  </ol>
-
-
-<!--
-http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E...%0A%3Cform%20name%3D%22a%22%3E%3Cinput%20id%3D%22x%22%20name%3D%22y%22%3E%3Cinput%20name%3D%22x%22%20id%3D%22y%22%3E%3C/form%3E%0A%3Cscript%3E%0A%20%20var%20x%3B%0A%20%20w%28x%20%3D%20document.forms%5B%27a%27%5D%5B%27x%27%5D%29%3B%0A%20%20w%28x.length%29%3B%0A%20%20x%5B0%5D.parentNode.removeChild%28x%5B0%5D%29%3B%0A%20%20w%28x.length%29%3B%0A%20%20w%28x%20%3D%3D%20document.forms%5B%27a%27%5D%5B%27x%27%5D%29%3B%0A%3C/script%3E%0A
--->
-
-
-  <h5>HTMLOptionsCollection</h5>
-
-  <p>The <code>HTMLOptionsCollection</code> interface represents
-  a list of <code>option</code> elements.</p>
-
-  <pre class="idl">interface <dfn>HTMLOptionsCollection</dfn> {
-           attribute unsigned long <span title="dom-HTMLOptionsCollection-length">length</span>;
-  [IndexGetter] HTMLOptionElement <span title="dom-HTMLOptionsCollection-item">item</span>(in unsigned long index);
-  [NameGetter] Object <span title="dom-HTMLOptionsCollection-namedItem">namedItem</span>(in DOMString name);
-};</pre>
-
-  <p>On getting, the <dfn
-  title="dom-HTMLOptionsCollection-length"><code>length</code></dfn>
-  attribute must return the number of nodes <span>represented by the
-  collection</span>.</p>
-
-  <p>On setting, the behavior depends on whether the new value is
-  equal to, greater than, or less than the number of nodes
-  <span>represented by the collection</span> at that time. If the
-  number is the same, then setting the attribute must do nothing. If
-  the new value is greater, then <var title="">n</var> new
-  <code>option</code> elements with no attributes and no child nodes
-  must be appended to the <code>select</code> element on which the
-  <code>HTMLOptionsCollection</code> is rooted, where <var
-  title="">n</var> is the difference between the two numbers (new
-  value minus old value). If the new value is lower, then the last
-  <var title="">n</var> nodes in the collection must be removed from
-  their parent nodes, where <var title="">n</var> is the difference
-  between the two numbers (old value minus new value).</p>
-
-  <p class="note">Setting <code
-  title="dom-HTMLOptionsCollection-length">length</code> never removes
-  or adds any <code>optgroup</code> elements, and never adds new
-  children to existing <code>optgroup</code> elements (though it can
-  remove children from them).</p>
-
-  <p>The <dfn title="dom-HTMLOptionsCollection-item"><code>item(<var
-  title="">index</var>)</code></dfn> method must return the <var
-  title="">index</var>th node in the collection. If there is no <var
-  title="">index</var>th node in the collection, then the method must
-  return null.</p>
-
-  <p>The <dfn
-  title="dom-HTMLOptionsCollection-namedItem"><code>namedItem(<var title="">key</var>)</code></dfn>
-  method must act according to the following algorithm:
-
-  <ol>
-
-   <li>If, at the time the method is called, there is exactly one node
-   in the collection that has either an <code
-   title="attr-id">id</code> attribute or a <code
-   title="attr-name">name</code> attribute equal to <var
-   title="">key</var>, then return that node and stop the
-   algorithm.</li>
-
-   <li>Otherwise, if there are no nodes in the collection that have
-   either an <code title="attr-id">id</code> attribute or a <code
-   title="attr-name">name</code> attribute equal to <var
-   title="">key</var>, then return null and stop the algorithm.</li>
-
-   <li>Otherwise, create a <code>NodeList</code> object representing a
-   live view of the <code>HTMLOptionsCollection</code> object, further
-   filtered so that the only nodes in the <code>NodeList</code> object
-   are those that have either an <code title="attr-id">id</code>
-   attribute or a <code title="attr-option-name">name</code> attribute
-   equal to <var title="">key</var>. The nodes in the
-   <code>NodeList</code> object must be sorted in <span>tree
-   order</span>.</li>
-
-   <li>Return that <code>NodeList</code> object.</li>
-
-  </ol>
-
-  <!-- see also http://ln.hixie.ch/?start=1161042744&count=1 -->
-
-  <p class="big-issue">We may want to add <code>add()</code> and
-  <code>remove()</code> methods here too because IE implements
-  HTMLSelectElement and HTMLOptionsCollection on the same object, and
-  so people use them almost interchangeably in the wild.</p>
-
-
-  <h4>DOMTokenList</h4>
-
-  <p>The <code>DOMTokenList</code> interface represents an interface
-  to an underlying string that consists of an <span>unordered set of
-  unique space-separated tokens</span>.</p>
-
-  <p>Which string underlies a particular <code>DOMTokenList</code>
-  object is defined when the object is created. It might be a content
-  attribute (e.g. the string that underlies the <code
-  title="dom-classList">classList</code> object is the <code
-  title="attr-class">class</code> attribute), or it might be an
-  anonymous string (e.g. when a <code>DOMTokenList</code> object is
-  passed to an author-implemented callback in the
-  <code>datagrid</code> APIs).</p>
-
-  <pre class="idl">[<span title="dom-tokenlist-toString">Stringifies</span>] interface <dfn>DOMTokenList</dfn> {
-  readonly attribute unsigned long <span title="dom-tokenlist-length">length</span>;
-  [IndexGetter] DOMString <span title="dom-tokenlist-item">item</span>(in unsigned long index);
-  boolean <span title="dom-tokenlist-has">has</span>(in DOMString token);
-  void <span title="dom-tokenlist-add">add</span>(in DOMString token);
-  void <span title="dom-tokenlist-remove">remove</span>(in DOMString token);
-  boolean <span title="dom-tokenlist-toggle">toggle</span>(in DOMString token);
-};</pre>
-
-  <p>The <dfn title="dom-tokenlist-length"><code>length</code></dfn>
-  attribute must return the number of <em>unique</em> tokens that
-  result from <span title="split a string on spaces">splitting the
-  underlying string on spaces</span>.</p>
-
-  <p>The <dfn title="dom-tokenlist-item"><code>item(<var
-  title="">index</var>)</code></dfn> method must <span title="split a
-  string on spaces">split the underlying string on spaces</span>, sort
-  the resulting list of tokens by Unicode codepoint<!-- XXX that's
-  basically nonsense. What sort order do we want here? It should be
-  the cheapest one possible that is well-defined for all Unicode. -->,
-  remove exact duplicates, and then return the <var
-  title="">index</var>th item in this list. If <var
-  title="">index</var> is equal to or greater than the number of
-  tokens, then the method must return null.</p>
-
-
-  <p>The <dfn title="dom-tokenlist-has"><code>has(<var
-  title="">token</var>)</code></dfn> method must run the following
-  algorithm:</p>
-
-  <ol>
-
-   <li>If the <var title="">token</var> argument contains any <span
-   title="space character">space characters</span>, then raise an
-   <code>INVALID_CHARACTER_ERR</code> exception and stop the
-   algorithm.</li>
-
-   <li>Otherwise, <span title="split a string on spaces">split the
-   underlying string on spaces</span> to get the list of tokens in the
-   object's underlying string.</li>
-
-   <li>If the token indicated by <var title="">token</var> is one of
-   the tokens in the object's underlying string then return true and
-   stop this algorithm.</li>
-
-   <li>Otherwise, return false.</li>
-
-  </ol>
-
-  <p>The <dfn title="dom-tokenlist-add"><code>add(<var
-  title="">token</var>)</code></dfn> method must run the following
-  algorithm:</p>
-
-  <ol>
-
-   <li>If the <var title="">token</var> argument contains any <span
-   title="space character">space characters</span>, then raise an
-   <code>INVALID_CHARACTER_ERR</code> exception and stop the
-   algorithm.</li>
-
-   <li>Otherwise, <span title="split a string on spaces">split the
-   underlying string on spaces</span> to get the list of tokens in the
-   object's underlying string.</li>
-
-   <li>If the given <var title="">token</var> is already one of the
-   tokens in the <code>DOMTokenList</code> object's underlying string
-   then stop the algorithm.</li>
-
-   <li>Otherwise, if the <code>DOMTokenList</code> object's underlying
-   string is not the empty string and the last character of that
-   string is not a <span>space character</span>, then append a U+0020
-   SPACE character to the end of that string.</li>
-
-   <li>Append the value of <var title="">token</var> to the end of the
-   <code>DOMTokenList</code> object's underlying string.</li>
-
-  </ol>
-
-  <p>The <dfn title="dom-tokenlist-remove"><code>remove(<var
-  title="">token</var>)</code></dfn> method must run the following
-  algorithm:</p>
-
-  <ol>
-
-   <li>If the <var title="">token</var> argument contains any <span
-   title="space character">space characters</span>, then raise an
-   <code>INVALID_CHARACTER_ERR</code> exception and stop the
-   algorithm.</li>
-
-   <li>Otherwise, <span title="remove a token from a string">remove
-   the given <var title="">token</var> from the underlying
-   string</span>.</li>
-
-  </ol>
-
-  <p>The <dfn title="dom-tokenlist-toggle"><code>toggle(<var
-  title="">token</var>)</code></dfn> method must run the following
-  algorithm:</p>
-
-  <ol>
-
-   <li>If the <var title="">token</var> argument contains any <span
-   title="space character">space characters</span>, then raise an
-   <code>INVALID_CHARACTER_ERR</code> exception and stop the
-   algorithm.</li>
-
-   <li>Otherwise, <span title="split a string on spaces">split the
-   underlying string on spaces</span> to get the list of tokens in the
-   object's underlying string.</li>
-
-   <li>If the given <var title="">token</var> is already one of the
-   tokens in the <code>DOMTokenList</code> object's underlying string
-   then <span title="remove a token from a string">remove the given
-   <var title="">token</var> from the underlying string</span>, and
-   stop the algorithm, returning false.</li>
-
-   <li>Otherwise, if the <code>DOMTokenList</code> object's underlying
-   string is not the empty string and the last character of that
-   string is not a <span>space character</span>, then append a U+0020
-   SPACE character to the end of that string.</li>
-
-   <li>Append the value of <var title="">token</var> to the end of the
-   <code>DOMTokenList</code> object's underlying string.</li>
-
-   <li>Return true.</li>
-
-  </ol>
-
-  <p>Objects implementing the <code>DOMTokenList</code> interface must
-  <dfn title="dom-tokenlist-toString">stringify</dfn> to the object's
-  underlying string representation.</p>
-
-
-  <h4>DOMStringMap</h4>
-
-  <p>The <code>DOMStringMap</code> interface represents a set of
-  name-value pairs. When a <code>DOMStringMap</code> object is
-  instanced, it is associated with three algorithms, one for getting
-  values from names, one for setting names to certain values, and one
-  for deleting names.</p>
-
-  <p class="big-issue">The names of the methods on this interface are
-  temporary and will be fixed when the Web IDL / "Language Bindings
-  for DOM Specifications" spec is ready to handle this case.</p>
-
-  <pre class="idl">interface <dfn>DOMStringMap</dfn> {
-  [NameGetter] DOMString <span title="dom-stringmap-XXX1">XXX1</span>(in DOMString name); <!-- XXX DOMB -->
-  [NameSetter] void <span title="dom-stringmap-XXX2">XXX2</span>(in DOMString name, in DOMString value); <!-- XXX DOMB -->
-  [XXX] boolean <span title="dom-stringmap-XXX3">XXX3</span>(in DOMString name); <!-- XXX DOMB -->
-};</pre>
-
-  <p>The <dfn title="dom-stringmap-XXX1"><code>XXX1(<var
-  title="">name</var>)</code></dfn> method must call the algorithm for
-  getting values from names, passing <var title="">name</var> as the
-  name, and must return the corresponding value, or null if <var
-  title="">name</var> has no corresponding value.</p>
-
-  <p>The <dfn title="dom-stringmap-XXX2"><code>XXX2(<var
-  title="">name</var>, <var title="">value</var>)</code></dfn> method
-  must call the algorithm for setting names to certain values, passing
-  <var title="">name</var> as the name and <var title="">value</var>
-  as the value.</p>
-
-  <p>The <dfn title="dom-stringmap-XXX3"><code>XXX3(<var
-  title="">name</var>)</code></dfn> method must call the algorithm for
-  deleting names, passing <var title="">name</var> as the name, and
-  must return true.</p>
-
-
-  <h4>DOM feature strings</h4>
-
-  <p>DOM3 Core defines mechanisms for checking for interface support,
-  and for obtaining implementations of interfaces, using <a
-  href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMFeatures">feature
-  strings</a>. <a href="#refsDOM3CORE">[DOM3CORE]</a></p>
-
-  <p>A DOM application can use the <dfn
-  title="hasFeature"><code>hasFeature(<var title="">feature</var>,
-  <var title="">version</var>)</code></dfn> method of the
-  <code>DOMImplementation</code> interface with parameter values
-  "<code title="">HTML</code>" and "<code>5.0</code>" (respectively)
-  to determine whether or not this module is supported by the
-  implementation. In addition to the feature string "<code
-  title="">HTML</code>", the feature string "<code
-  title="">XHTML</code>" (with version string "<code>5.0</code>") can
-  be used to check if the implementation supports XHTML. User agents
-  should respond with a true value when the <code>hasFeature</code>
-  method is queried with these values. Authors are cautioned, however,
-  that UAs returning true might not be perfectly compliant, and that
-  UAs returning false might well have support for features in this
-  specification; in general, therefore, use of this method is
-  discouraged.</p>
-
-  <p>The values "<code title="">HTML</code>" and "<code
-  title="">XHTML</code>" (both with version "<code>5.0</code>") should
-  also be supported in the context of the <code>getFeature()</code>
-  and <code>isSupported()</code> methods, as defined by DOM3 Core.</p>
-
-  <p class="note">The interfaces defined in this specification are not
-  always supersets of the interfaces defined in DOM2 HTML; some
-  features that were formerly deprecated, poorly supported, rarely
-  used or considered unnecessary have been removed. Therefore it is
-  not guaranteed that an implementation that supports "<code
-  title="">HTML</code>" "<code>5.0</code>" also supports "<code
-  title="">HTML</code>" "<code>2.0</code>".</p>
-
-
-
-
-  <h3><dfn>DOM tree accessors</dfn></h3>
-
-  <p><dfn>The <code>html</code> element</dfn> of a document is the
-  document's root element, if there is one and it's an
-  <code>html</code> element, or null otherwise.</p>
-
-  <p><dfn>The <code>head</code> element</dfn> of a document is the
-  first <code>head</code> element that is a child of <span>the
-  <code>html</code> element</span>, if there is one, or null
-  otherwise.</p>
-
-
-  <p><dfn>The <code>title</code> element</dfn> of a document is the
-  first <code>title</code> element in the document (in tree order), if
-  there is one, or null otherwise.</p>
-
-  <p>The <dfn id="document.title"
-  title="dom-document-title"><code>title</code></dfn> attribute must,
-  on getting, run the following algorithm:</p>
-
-  <ol>
-
-   <li><p>If the <span>root element</span> is an <code>svg</code>
-   element in the "<code title="">http://www.w3.org/2000/svg</code>"
-   namespace, and the user agent supports SVG, then the getter must
-   return the value that would have been returned by the DOM attribute
-   of the same name on the <code>SVGDocument</code>
-   interface.</p></li>
-
-   <li><p>Otherwise, it must return a concatenation of the data of all
-   the child <span title="text node">text nodes</span> of <span>the
-   <code>title</code> element</span>, in tree order, or the empty
-   string if <span>the <code>title</code> element</span> is
-   null.</p></li>
-
-  </ol>
-
-  <p>On setting, the following algorithm must be run:</p>
-
-  <ol>
-
-   <li><p>If the <span>root element</span> is an <code>svg</code>
-   element in the "<code title="">http://www.w3.org/2000/svg</code>"
-   namespace, and the user agent supports SVG, then the setter must
-   defer to the setter for the DOM attribute of the same name on the
-   <code>SVGDocument</code> interface. Stop the algorithm
-   here.</p></li>
-
-   <li>If <span>the <code>title</code> element</span> is null and
-   <span>the <code>head</code> element</span> is null, then the
-   attribute must do nothing. Stop the algorithm here.</li>
-
-   <li>If <span>the <code>title</code> element</span> is null, then a
-   new <code>title</code> element must be created and appended to
-   <span>the <code>head</code> element</span>.</li>
-
-   <li>The children of <span>the <code>title</code> element</span> (if
-   any) must all be removed.</li>
-
-   <li>A single <code>Text</code> node whose data is the new value
-   being assigned must be appended to <span>the <code>title</code>
-   element</span>.</li>
-
-  </ol>
-
-  <p>The <code title="dom-document-title">title</code> attribute on
-  the <code>HTMLDocument</code> interface should shadow the attribute
-  of the same name on the <code>SVGDocument</code> interface when the
-  user agent supports both HTML and SVG.</p>
-
-
-  <p><dfn>The body element</dfn> of a document is the first child of
-  <span>the <code>html</code> element</span> that is either a
-  <code>body</code> element or a <code>frameset</code> element. If
-  there is no such element, it is null. If the body element is null,
-  then when the specification requires that events be fired at "the
-  body element", they must instead be fired at the
-  <code>Document</code> object.</p>
-
-  <p>The <dfn title="dom-document-body"><code>body</code></dfn>
-  attribute, on getting, must return <span>the body element</span> of
-  the document (either a <code>body</code> element, a
-  <code>frameset</code> element, or null). On setting, the following
-  algorithm must be run:</p>
-
-  <ol>
-
-   <li>If the new value is not a <code>body</code> or
-   <code>frameset</code> element, then raise a
-   <code>HIERARCHY_REQUEST_ERR</code> exception and abort these
-   steps.</li>
-
-   <li>Otherwise, if the new value is the same as <span>the body
-   element</span>, do nothing. Abort these steps.</li>
-
-   <li>Otherwise, if <span>the body element</span> is not null, then
-   replace that element with the new value in the DOM, as if the root
-   element's <code title="">replaceChild()</code> method had been
-   called with the new value and <span title="the body element">the
-   incumbent body element</span> as its two arguments respectively,
-   then abort these steps.</li>
-
-   <li>Otherwise, the <span>the body element</span> is null. Append
-   the new value to the root element.</li>
-
-  </ol>
-
-  <!--XXX
-    http://lxr.mozilla.org/seamonkey/source/content/html/document/src/nsHTMLDocument.cpp
-    search for ::GetBody ::SetBody
-    http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/html/HTMLDocument.cpp
-    search for ::setBody
-    http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/dom/Document.cpp
-    search for ::body
-  -->
-
-  <p>The <dfn title="dom-document-images"><code>images</code></dfn>
-  attribute must return an <code>HTMLCollection</code> rooted at the
-  <code>Document</code> node, whose filter matches only
-  <code>img</code> elements.</p>
-
-  <p>The <dfn title="dom-document-embeds"><code>embeds</code></dfn>
-  attribute must return an <code>HTMLCollection</code> rooted at the
-  <code>Document</code> node, whose filter matches only
-  <code>embed</code> elements.</p>
-
-  <p>The <dfn title="dom-document-plugins"><code>plugins</code></dfn>
-  attribute must return the same object as that returned by the <code
-  title="dom-document-embeds">embeds</code> attribute.</p>
-
-  <p>The <dfn title="dom-document-links"><code>links</code></dfn>
-  attribute must return an <code>HTMLCollection</code> rooted at the
-  <code>Document</code> node, whose filter matches only <code>a</code>
-  elements with <code title="attr-hyperlink-href">href</code>
-  attributes and <code>area</code> elements with <code
-  title="attr-hyperlink-href">href</code> attributes.</p>
-
-  <p>The <dfn title="dom-document-forms"><code>forms</code></dfn>
-  attribute must return an <code>HTMLCollection</code> rooted at the
-  <code>Document</code> node, whose filter matches only
-  <code>form</code> elements.</p>
-
-  <p>The <dfn title="dom-document-anchors"><code>anchors</code></dfn>
-  attribute must return an <code>HTMLCollection</code> rooted at the
-  <code>Document</code> node, whose filter matches only <code>a</code>
-  elements with <code title="attr-a-name">name</code> attributes.</p><!-- XXX note that such elements are
-  non-conforming -->
-
-  <p>The <dfn title="dom-document-scripts"><code>scripts</code></dfn>
-  attribute must return an <code>HTMLCollection</code> rooted at the
-  <code>Document</code> node, whose filter matches only
-  <code>script</code> elements.</p>
-
-  <p>The <dfn
-  title="dom-document-getElementsByName"><code>getElementsByName(<var
-  title="">name</var>)</code></dfn> method a string <var
-  title="">name</var>, and must return a live <code>NodeList</code>
-  containing all the <code>a</code>, <code>applet</code>,
-  <code>button</code>, <code>form</code>, <!-- frame? frameset?
-  XXX--><code>iframe</code>, <code>img</code>, <code>input</code>,
-  <code>map</code>, <code>meta</code>, <code>object</code>,<!-- param?
-  XXX--> <code>select</code>, and <code>textarea</code> elements in
-  that document that have a <code title="">name</code> attribute whose
-  value is equal<!-- XXX case sensitivity --> to the <var
-  title="">name</var> argument.</p> <!-- XXX what about XHTML? -->
-
-  <p>The <dfn
-  title="dom-document-getElementsByClassName"><code>getElementsByClassName(<var
-  title="">classNames</var>)</code></dfn> method takes a string that
-  contains an <span>unordered set of unique space-separated
-  tokens</span> representing classes. When called, the method must
-  return a live <code>NodeList</code> object containing all the
-  elements in the document that have all the classes specified in that
-  argument, having obtained the classes by <span title="split a string
-  on spaces">splitting a string on spaces</span>. If there are no
-  tokens specified in the argument, then the method must return an
-  empty <code>NodeList</code>.</p>
-
-  <p>The <dfn
-  title="dom-getElementsByClassName"><code>getElementsByClassName()</code></dfn>
-  method on the <code>HTMLElement</code> interface must return a live
-  <code>NodeList</code> with the nodes that the
-  <code>HTMLDocument</code> <code
-  title="dom-document-getElementsByClassName">getElementsByClassName()</code>
-  method would return when passed the same argument(s), excluding any
-  elements that are not descendants of the <code>HTMLElement</code>
-  object on which the method was invoked.</p>
-
-  <p>HTML, SVG, and MathML elements define which classes they are in
-  by having an attribute in the per-element partition with the name
-  <code title="">class</code> containing a space-separated list of
-  classes to which the element belongs. Other specifications may also
-  allow elements in their namespaces to be labeled as being in
-  specific classes. UAs must not assume that all attributes of the
-  name <code title="">class</code> for elements in any namespace work
-  in this way, however, and must not assume that such attributes, when
-  used as global attributes, label other elements as being in specific
-  classes.</p>
-
-  <div class="example">
-
-   <p>Given the following XHTML fragment:</p>
-
-   <pre><div id="example">
- <p id="p1" class="aaa bbb"/>
- <p id="p2" class="aaa ccc"/>
- <p id="p3" class="bbb ccc"/>
-</div></pre>
-
-   <p>A call to
-   <code>document.getElementById('example').getElementsByClassName('aaa')</code>
-   would return a <code>NodeList</code> with the two paragraphs
-   <code>p1</code> and <code>p2</code> in it.</p>
-
-   <p>A call to <code>getElementsByClassName('ccc bbb')</code>
-   would only return one node, however, namely <code>p3</code>. A call
-   to
-   <code>document.getElementById('example').getElementsByClassName('bbb  ccc ')</code>
-   would return the same thing.</p>
-
-   <p>A call to <code>getElementsByClassName('aaa,bbb')</code> would
-   return no nodes; none of the elements above are in the "aaa,bbb"
-   class.</p>
-
-  </div>
-
-<!-- XXX
->         * xGetParentElementByClassName(rootElement, className, tagName) -
-> Navigates upwards until we hit a parent element with the given class name and
-> optional tag name.
--->
-
-  <p class="note">The <code title="dom-document-dir">dir</code>
-  attribute on the <code>HTMLDocument</code> interface is defined
-  along with the <code title="attr-dir">dir</code> content
-  attribute.</p>
-
-
-
-  <h3><dfn>Dynamic markup insertion</dfn></h3>
-
-  <p>The <code title="dom-document-write">document.write()</code>
-  family of methods and the <code
-  title="dom-innerHTML">innerHTML</code> family of DOM attributes
-  enable script authors to dynamically insert markup into the
-  document.</p>
-
-  <p class="issue">bz argues that innerHTML should be called something
-  else on XML documents and XML elements. Is the sanity worth the
-  migration pain?</p>
-
-  <p>Because these APIs interact with the parser, their behavior
-  varies depending on whether they are used with <span>HTML
-  documents</span> (and the <span>HTML parser</span>) or XHTML in
-  <span>XML documents</span> (and the <span>XML parser</span>). The
-  following table cross-references the various versions of these
-  APIs.</p>
-
   <table>
-   <thead>
+   <thead>      
     <tr>
-     <td></td>
-     <th><dfn title="dom-document-write"><code>document.write()</code></dfn></th>
-     <th><dfn title="dom-innerHTML"><code>innerHTML</code></dfn></th>
-    </tr>
-   </thead>
+     <th>Attribute
+     <th>Component
+     <th>Getter Condition
+     <th>Prefix
+     <th>Suffix
+     <th>Setter Preprocessor
+     <th>Setter Condition
    <tbody>
     <tr>
-     <th>For documents that are <span>HTML documents</span></th>
-     <td><span title="dom-document-write-HTML"><code>document.write()</code> in HTML</span></td>
-     <td><span title="dom-innerHTML-HTML"><code>innerHTML</code> in HTML</span></td>
-    </tr>
+     <td><dfn title="dom-uda-protocol"><code>protocol</code></dfn>
+     <td><scheme>
+     <td>—
+     <td>—
+     <td>U+003A COLON ("<code title="">:</code>")
+     <td>Remove all trailing U+003A COLON ("<code title="">:</code>") characters
+     <td>The new value is not the empty string
     <tr>
-     <th>For documents that are <span>XML documents</span></th>
-     <td><span title="dom-document-write-XML"><code>document.write()</code> in XML</span></td>
-     <td><span title="dom-innerHTML-XML"><code>innerHTML</code> in XML</span></td>
-    </tr>
-   </tbody>
+     <td><dfn title="dom-uda-host"><code>host</code></dfn>
+     <td><span><hostport></span>
+     <td><span title="concept-uda-input">input</span> is hierarchical and uses a server-based naming authority
+     <td>—
+     <td>—
+     <td>—
+     <td>—
+    <tr>
+     <td><dfn title="dom-uda-hostname"><code>hostname</code></dfn>
+     <td><host>/<ihost>
+     <td><span title="concept-uda-input">input</span> is hierarchical and uses a server-based naming authority
+     <td>—
+     <td>—
+     <td>Remove all leading U+002F SOLIDUS ("<code title="">/</code>") characters
+     <td>—
+    <tr>
+     <td><dfn title="dom-uda-port"><code>port</code></dfn>
+     <td><port>
+     <td><span title="concept-uda-input">input</span> is hierarchical and uses a server-based naming authority
+     <td>—
+     <td>—
+     <td>Remove any characters in the new value that are not in the range U+0030 DIGIT ZERO .. U+0039 DIGIT NINE.
+         If the resulting string is empty, set it to a single U+0030 DIGIT ZERO character ('0').
+     <td>—
+    <tr>
+     <td><dfn title="dom-uda-pathname"><code>pathname</code></dfn>
+     <td><abs_path>
+     <td><span title="concept-uda-input">input</span> is hierarchical
+     <td>—
+     <td>—
+     <td>If it has no leading U+002F SOLIDUS ("<code title="">/</code>") character, prepend a U+002F SOLIDUS ("<code title="">/</code>") character to the new value
+     <td>—
+    <tr>
+     <td><dfn title="dom-uda-search"><code>search</code></dfn>
+     <td><query>
+     <td><span title="concept-uda-input">input</span> is hierarchical
+     <td>U+003F QUESTION MARK ("<code title="">?</code>")
+     <td>—
+     <td>Remove one leading U+003F QUESTION MARK ("<code title="">?</code>") character, if any
+     <td>—
+    <tr>
+     <td><dfn title="dom-uda-hash"><code>hash</code></dfn>
+     <td><fragment>
+     <td>Fragment identifier is longer than zero characters
+     <td>U+0023 NUMBER SIGN ("<code title="">#</code>")
+     <td>—
+     <td>Remove one leading U+0023 NUMBER SIGN ("<code title="">#</code>") character, if any
+     <td>—
   </table>
 
-  <p>Regardless of the parsing mode, the <dfn
-  title="dom-document-writeln"><code>document.writeln(...)</code></dfn>
-  method must call the <code
-  title="dom-document-write">document.write()</code> method with the
-  same argument(s), and then call the <code
-  title="dom-document-write">document.write()</code> method with, as
-  its argument, a string consisting of a single line feed character
-  (U+000A).</p>
+  <p>The <dfn><hostport></dfn> component is defined as being the
+  <host>/<ihost> component, followed by a colon and the
+  <port> component, but with the colon and <port>
+  component omitted if the given port matches the default port for the
+  protocol given by the <scheme> component.</p>
 
-
-  <h4>Controlling the input stream</h4>
-
-  <p>The <dfn title="dom-document-open"><code>open()</code></dfn>
-  method comes in several variants with different numbers of
-  arguments.</p>
-
-  <p>When called with two or fewer arguments, the method must act as
-  follows:</p>
-
-  <ol>
-
-   <li><p>Let <var title="">type</var> be the value of the first
-   argument, if there is one, or "<code>text/html</code>"
-   otherwise.</p></li>
-
-   <li><p>Let <var title="">replace</var> be true if there is a second
-   argument and it has the value "replace"<!-- case-insensitive. XXX
-   -->, and false otherwise.</p></li>
-
-   <li>
-
-    <p>If the document has an <span>active parser</span><!-- XXX xref
-    --> that isn't a <span>script-created parser</span>, and the
-    <span>insertion point</span> associated with that parser's
-    <span>input stream</span> is not undefined (that is, it
-    <em>does</em> point to somewhere in the input stream), then the
-    method does nothing. Abort these steps and return the
-    <code>Document</code> object on which the method was invoked.</p>
-
-    <p class="note">This basically causes <code
-    title="dom-document-open">document.open()</code> to be ignored
-    when it's called in an inline script found during the parsing of
-    data sent over the network, while still letting it have an effect
-    when called asynchronously or on a document that is itself being
-    spoon-fed using these APIs.</p>
-
-   </li>
-
-   <li><p class="big-issue">onbeforeunload, onunload, reset timers, empty event queue, kill any pending transactions, XMLHttpRequests, etc</p></li>
-   <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E...%3Ciframe%20src%3D%22document%22%3E%3C%2Fiframe%3E%0A%3Cscript%3Eonload%20%3D%20function%20()%20{%20f%20%3D%20document.getElementsByTagName(%27iframe%27)[0]%3B%20d%20%3D%20f.contentDocument%3B%20}%3C%2Fscript%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22w(d.documentElement.innerHTML)%22%20value%3D%22dump%22%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22d.body.bgColor%3D%27red%27%22%20value%3D%22color%22%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22f.style.border%3D%27lime%20solid%27%22%20value%3D%22color%20frame%22%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22d.open()%3B%20d.write(%27%3Cp%3Etest%3C%2Fp%3E%27)%3B%20d.close()%22%20value%3D%22replace%22%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22d.open()%3B%20d.write(%27%3Cp%3E%3Cscript%3Ei%20%3D%200%3B%20setInterval(%26quot%3Bparent.w(i%2B%2B)%26quot%3B%2C%20500)%3C%2Fscript%3E%3C%2Fp%3E%27)%3B%20d.close()%22%20value%3D%22replace%20with%20timer%22%3E%0A -->
-
-   <li><p>If the document has an <span>active parser</span><!--XXX
-   xref-->, then stop that parser, and throw away any pending content
-   in the input stream. <span class="big-issue">what about if it
-   doesn't, because it's either like a text/plain, or Atom, or PDF, or
-   XHTML, or image document, or something?</span></p></li><!-- XXX see
-   also innerHTML in HTML -->
-
-   <li><p>Remove all child nodes of the document.</p></li>
-
-   <li><p>Change the <span>document's character encoding</span> to
-   UTF-16.</p></li>
-
-   <li><p>Create a new <span>HTML parser</span> and associate it with
-   the document. This is a <dfn>script-created parser</dfn> (meaning
-   that it can be closed by the <code
-   title="dom-document-open">document.open()</code> and <code
-   title="dom-document-close">document.close()</code> methods, and
-   that the tokeniser will wait for an explicit call to <code
-   title="dom-document-close">document.close()</code> before emitting
-   an end-of-file token).</p></li>
-
-   <li>Mark the document as being an <span title="HTML documents">HTML
-   document</span> (it might already be so-marked).</li>
-
-   <!-- text/plain handling --><li><p>If <var title="">type</var> does
-   not have the value "<code>text/html</code>"<!-- XXX matched how?
-   -->, then act as if the tokeniser had emitted a <code>pre</code>
-   element start tag, then set the <span>HTML parser</span>'s
-   <span>tokenisation</span> stage's <span>content model flag</span>
-   to <em>PLAINTEXT</em>.</p></li>
-
-   <li>
-
-    <p>If <var title="">replace</var> is false, then:
-
-    <ol>
-
-     <li>Remove all the entries in the <span>browsing context</span>'s
-     <span>session history</span> after the <span>current entry</span>
-     in its <code>Document</code>'s <code>History</code> object</li>
-
-     <li>Remove any earlier entries that share the same
-     <code>Document</code></li>
-
-     <li>Add a new entry just before the last entry that is associated
-     with the text that was parsed by the previous parser associated
-     with the <code>Document</code> object, as well as the state of
-     the document at the start of these steps. (This allows the user
-     to step backwards in the session history to see the page before
-     it was blown away by the <code
-     title="dom-document-open">document.open()</code> call.)</li>
-
-    </ol>
-
-   </li>
-
-   <li><p>Finally, set the <span>insertion point</span> to point at
-   just before the end of the <span>input stream</span> (which at this
-   point will be empty).</p></li>
-
-   <li><p>Return the <code>Document</code> on which the method was
-   invoked.</p></li>
-
-  </ol>
-
-  <p class="big-issue">We shouldn't hard-code <code>text/plain</code>
-  there. We should do it some other way, e.g. hand off to the section
-  on content-sniffing and handling of incoming data streams, the part
-  that defines how this all works when stuff comes over the
-  network.</p>
-
-  <!-- XXX Should we support XML/XHTML as a type to that method? -->
-
-  <p>When called with three or more arguments, the <code
-  title="dom-document-open">open()</code> method on the
-  <code>HTMLDocument</code> object must call the <code
-  title="dom-open">open()</code> method on the <code>Window</code>
-  interface of the object returned by the <code
-  title="dom-document-defaultView">defaultView</code> attribute of the
-  <code>DocumentView</code> interface of the <code>HTMLDocument</code>
-  object, with the same arguments as the original call to the <code
-  title="dom-document-open">open()</code> method, and return whatever
-  that method returned. If the <code
-  title="dom-document-defaultView">defaultView</code> attribute of the
-  <code>DocumentView</code> interface of the <code>HTMLDocument</code>
-  object is null, then the method must raise an
-  <code>INVALID_ACCESS_ERR</code> exception.</p>
-
-  <p>The <dfn title="dom-document-close"><code>close()</code></dfn>
-  method must do nothing if there is no <span>script-created
-  parser</span> associated with the document. If there is such a
-  parser, then, when the method is called, the user agent must insert
-  an <span>explicit "EOF" character</span> at the <span>insertion
-  point</span> of the parser's <span>input stream</span>.</p>
-
-
-  <h4>Dynamic markup insertion in HTML</h4>
-
-  <p>In HTML, the <dfn
-  title="dom-document-write-HTML"><code>document.write(...)</code></dfn>
-  method must act as follows:</p>
-
-  <ol>
-
-   <li>
-
-    <p>If the <span>insertion point</span> is undefined, the <code
-    title="dom-document-open">open()</code> method must be called
-    (with no arguments) on the <code title="Document">document</code>
-    object. The <span>insertion point</span> will point at just before
-    the end of the (empty) <span>input stream</span>.</p>
-
-   </li>
-
-   <li>
-
-    <p>The string consisting of the concatenation of all the arguments
-    to the method must be inserted into the <span>input
-    stream</span><!-- XXX xref --> just before the <span>insertion
-    point</span>.</p>
-
-   </li>
-
-   <li>
-
-    <p>If there is <span title="the script that will execute as soon
-    as the parser resumes">a script that will execute as soon as the
-    parser resumes</span>, then the method must now return without
-    further processing of the <span>input stream</span>.</p>
-
-   </li>
-
-   <li>
-
-    <p>Otherwise, the tokeniser must process the characters that were
-    inserted, one at a time, processing resulting tokens as they are
-    emitted, and stopping when the tokeniser reaches the insertion
-    point or when the processing of the tokeniser is aborted by the
-    tree construction stage (this can happen if a <code>script</code>
-    start tag token is emitted by the tokeniser).
-
-    <p class="note">If the <code
-    title="dom-document-write-HTML">document.write()</code> method was
-    called from script executing inline (i.e. executing because the
-    parser parsed a set of <code>script</code> tags), then this is a
-    <a href="#nestedParsing">reentrant invocation of the
-    parser</a>.</p>
-
-   </li>
-
-   <li>
-
-    <p>Finally, the method must return.</p>
-
-   </li>
-
-  </ol>
-
-  <p>In HTML, the <dfn
-  title="dom-innerHTML-HTML"><code>innerHTML</code></dfn> DOM
-  attribute of all <code>HTMLElement</code> and
-  <code>HTMLDocument</code> nodes returns a serialization of the
-  node's children using the <span>HTML syntax</span><!-- XXX xref
-  -->. On setting, it replaces the node's children with new nodes that
-  result from parsing the given value. The formal definitions
-  follow.</p>
-
-  <p>On getting, the <code title="dom-innerHTML-HTML">innerHTML</code>
-  DOM attribute must return the result of running the <span>HTML
-  fragment serialization algorithm</span> on the node.</p>
-
-  <p>On setting, if the node is a document, the <code
-  title="dom-innerHTML-HTML">innerHTML</code> DOM attribute must run
-  the following algorithm:</p>
-
-  <ol>
-
-   <li>
-
-    <p>If the document has an <span>active parser</span><!--XXX
-    xref-->, then stop that parser, and throw away any pending content
-    in the input stream. <span class="big-issue">what about if it
-    doesn't, because it's either like a text/plain, or Atom, or PDF,
-    or XHTML, or image document, or something?</span></p><!-- XXX see
-    also document.open() -->
-
-   </li>
-
-   <li>
-
-    <p>Remove the children nodes of the <code>Document</code> whose
-    <code title="dom-innerHTML-HTML">innerHTML</code> attribute is
-    being set.</p>
-
-   </li>
-
-   <li>
-
-    <p>Create a new <span>HTML parser</span>, in its initial state,
-    and associate it with the <code>Document</code> node.</p>
-
-   </li>
-
-<!-- redundant, the document is forcibly already so labeled if we get here
-   <li>
-
-    <p>Mark the <code>Document</code> object as being an <span
-    title="HTML documents">HTML document</span>.</p>
-
-   </li>
--->
-
-   <li>
-
-    <p>Place into the <span>input stream</span> for the <span>HTML
-    parser</span> just created the string being assigned into the
-    <code title="dom-innerHTML-HTML">innerHTML</code> attribute.</p>
-
-   </li>
-
-   <li>
-
-    <p>Start the parser and let it run until it has consumed all the
-    characters just inserted into the input stream. (The
-    <code>Document</code> node will have been populated with elements
-    and a <code title="event-load">load</code> event will have fired
-    on <span title="the body element">its body element</span>.)</p>
-
-   </li>
-
-  </ol>
-
-  <p>Otherwise, if the node is an element, then setting the <code
-  title="dom-innerHTML-HTML">innerHTML</code> DOM attribute must cause
-  the following algorithm to run instead:</p>
-
-  <ol>
-
-   <li>
-
-    <p>Invoke the <span>HTML fragment parsing algorithm</span>, with
-    the element whose <code
-    title="dom-innerHTML-HTML">innerHTML</code> attribute is being set
-    as the <var title="">context</var> element, and the string being
-    assigned into the <code
-    title="dom-innerHTML-HTML">innerHTML</code> attribute as the <var
-    title="">input</var>. Let <var title="">new children</var> be the
-    result of this algorithm.</p>
-
-   </li>
-
-   <li>
-
-    <p>Remove the children of the element whose <code
-    title="dom-innerHTML-HTML">innerHTML</code> attribute is being
-    set.</p>
-
-   </li>
-
-   <li>
-
-    <p>Let <var title="">target document</var> be the <code
-    title="">ownerDocument</code> of the <code>Element</code> node
-    whose <code title="dom-innerHTML-HTML">innerHTML</code> attribute
-    is being set.</p>
-
-   </li>
-
-   <li>
-
-    <p>Set the <code title="">ownerDocument</code> of all the nodes in
-    <var title="">new children</var> to the <var title="">target
-    document</var>.</p>
-
-   </li>
-
-   <li>
-
-    <p>Append all the <var title="">new children</var> nodes to the
-    node whose <code title="dom-innerHTML-HTML">innerHTML</code>
-    attribute is being set, preserving their order.</p>
-
-   </li>
-
-  </ol>
-
-  <p class="note"><code>script</code> elements inserted using <code
-  title="dom-innerHTML-HTML">innerHTML</code> do not execute when they
-  are inserted.</p>
-
-  <!-- XXX must make sure we spec that innerHTML causes mutation
-  events to fire, but document.write() doesn't. (the latter is already
-  req-stated in the parser section, btw) -->
-
-  <!-- http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/innerhtml.asp -->
-  <!-- http://lxr.mozilla.org/seamonkey/source/content/html/content/src/nsGenericHTMLElement.cpp#879
-       note script execution disabled
-       http://lxr.mozilla.org/seamonkey/source/content/base/src/nsContentUtils.cpp#3308
-       http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/html/HTMLElement.cpp#L295
-       http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/html/HTMLElement.cpp#L242
-       http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/html/HTMLTokenizer.cpp#L1742
-   -->
-
-
-  <h4>Dynamic markup insertion in XML</h4>
-
-  <p>In an XML context, the <dfn
-  title="dom-document-write-XML"><code>document.write()</code></dfn>
-  method must raise an <code>INVALID_ACCESS_ERR</code> exception.</p>
-
 <!--
-  For XHTML: content must be well-formed. Where does
-  it insert? Immediately after the script that called document.write()?</p>
-  how do we handle async scripts vs sync scripts?
-
-Consider:
-data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ document.write('<foo>Test</foo>'); ]]></script>
-data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ alert('test'); alert(document.write); try { document.write('<foo>Test</foo>'); alert(document.childNodes.length); } catch (e) { alert(e); } ]]></script>
-
+  http://www.hixie.ch/tests/adhoc/dom/level0/location/components/
+  http://lxr.mozilla.org/seamonkey/source/dom/src/base/nsLocation.cpp
+  http://wp.netscape.com/eng/mozilla/3.0/handbook/javascript/ref_h-l.htm#84722
 -->
 
-  <p>On the other hand, however, the <dfn
-  title="dom-innerHTML-XML"><code>innerHTML</code></dfn> attribute is
-  indeed usable in an XML context.</p>
 
-  <p>In an XML context, the <code
-  title="dom-innerHTML-XML">innerHTML</code> DOM attribute on
-  <code>HTMLElement</code>s must return a string in the form of an <a
-  href="http://www.w3.org/TR/xml/#wf-entities">internal general parsed
-  entity</a>, and on <code>HTMLDocument</code>s must return a string
-  in the form of a <a
-  href="http://www.w3.org/TR/xml/#sec-well-formed">document
-  entity</a>. The string returned must be XML namespace-well-formed
-  and must be an isomorphic serialization of all of that node's child
-  nodes, in document order. User agents may adjust prefixes and
-  namespace declarations in the serialization (and indeed might be
-  forced to do so in some cases to obtain namespace-well-formed
-  XML). For the <code title="dom-innerHTML-XML">innerHTML</code>
-  attribute on <code>HTMLElement</code> objects, if any of the
-  elements in the serialization are in no namespace, the default
-  namespace in scope for those elements must be explicitly declared as
-  the empty string.<!-- because otherwise round-tripping might break
-  since it'll pick up the surrounding default ns when setting -->
-  (This doesn't apply to the <code
-  title="dom-innerHTML-XML">innerHTML</code> attribute on
-  <code>HTMLDocument</code> objects.) <a href="#refsXML">[XML]</a> <a
-  href="#refsXMLNS">[XMLNS]</a></p>
 
-  <p>If any of the following cases are found in the DOM being
-  serialized, the user agent must raise an
-  <code>INVALID_STATE_ERR</code> exception:</p>
 
-  <ul>
-
-   <li>A <code>Document</code> node with no child element nodes.</li>
-
-   <li>A <code>DocumentType</code> node that has an external subset
-   public identifier or an external subset system identifier that
-   contains both a U+0022 QUOTATION MARK ('"') and a U+0027 APOSTROPHE
-   ("'").</li>
-
-   <li>A node with a prefix or local name containing a U+003A COLON
-   (":").</li>
-
-   <li>An <code>Attr</code> node, <code>Text</code> node,
-   <code>CDATASection</code> node, <code>Comment</code> node, or
-   <code>ProcessingInstruction</code> node whose data contains
-   characters that are not matched by the XML <code
-   title="">Char</code> production. <a href="#refsXML">[XML]</a></li>
-
-   <li>A <code>CDATASection</code> node whose data contains the string
-   "<code title="">]]></code>".</li>
-
-   <li>A <code>Comment</code> node whose data contains two adjacent
-   U+002D HYPHEN-MINUS (-) characters or ends with such a
-   character.</li>
-
-   <li>A <code>ProcessingInstruction</code> node whose target name is
-   the string "<code title="">xml</code>" (case insensitively)<!--
-   ASCII -->.</li>
-
-   <li>A <code>ProcessingInstruction</code> node whose target name
-   contains a U+003A COLON (":").</li>
-
-   <li>A <code>ProcessingInstruction</code> node whose data contains
-   the string "<code title="">?></code>".</li>
-
-  </ul>
-
-  <p class="note">These are the only ways to make a DOM
-  unserializable. The DOM enforces all the other XML constraints; for
-  example, trying to set an attribute with a name that contains an
-  equals sign (=) will raised an <code>INVALID_CHARACTER_ERR</code>
-  exception.</p>
-
-  <p>On setting, in an XML context, the <code
-  title="dom-innerHTML-XML">innerHTML</code> DOM attribute on
-  <code>HTMLElement</code>s and <code>HTMLDocument</code>s must run
-  the following algorithm:</p>
-
-  <ol>
-
-   <li>
-
-    <p>The user agent must create a new <span>XML parser</span>.</p>
-
-   </li>
-
-   <li>
-
-    <p>If the <code title="dom-innerHTML-XML">innerHTML</code>
-    attribute is being set on an element, the user agent must
-    <span>feed the parser</span> just created the string corresponding
-    to the start tag of that element, declaring all the namespace
-    prefixes that are in scope on that element in the DOM, as well as
-    declaring the default namespace (if any) that is in scope on that
-    element in the DOM.</p>
-
-   </li>
-
-   <li>
-
-    <p>The user agent must <span>feed the parser</span> just created
-    the string being assigned into the <code
-    title="dom-innerHTML-XML">innerHTML</code> attribute.</p>
-
-   </li>
-
-   <li>
-
-    <p>If the <code title="dom-innerHTML-XML">innerHTML</code>
-    attribute is being set on an element, the user agent must
-    <span>feed the parser</span> the string corresponding to the end
-    tag of that element.</p>
-
-   </li>
-
-   <li>
-
-    <p>If the parser found a well-formedness error, the attribute's
-    setter must raise a <code>SYNTAX_ERR</code> exception and abort
-    these steps.</p>
-
-   </li>
-
-   <li>
-
-    <p>The user agent must remove the children nodes of the node whose
-    <code title="dom-innerHTML-XML">innerHTML</code> attribute is
-    being set.</p>
-
-   </li>
-
-   <li>
-
-    <p>If the attribute is being set on a <code>Document</code> node,
-    let <var title="">new children</var> be the children of the
-    document, preserving their order. Otherwise, the attribute is
-    being set on an <code>Element</code> node; let <var title="">new
-    children</var> be the children of the document's root element,
-    preserving their order.</p>
-
-   </li>
-
-   <li>
-
-    <p>If the attribute is being set on a <code>Document</code> node,
-    let <var title="">target document</var> be that
-    <code>Document</code> node. Otherwise, the attribute is being set
-    on an <code>Element</code> node; let <var title="">target
-    document</var> be the <code title="">ownerDocument</code> of that
-    <code>Element</code>.</p>
-
-   </li>
-
-   <li>
-
-    <p>Set the <code title="">ownerDocument</code> of all the nodes in
-    <var title="">new children</var> to the <var title="">target
-    document</var>.</p>
-
-   </li>
-
-   <li>
-
-    <p>Append all the <var title="">new children</var> nodes to the
-    node whose <code title="dom-innerHTML-XML">innerHTML</code>
-    attribute is being set, preserving their order.</p>
-
-   </li>
-
-  </ol>
-
-  <p class="note"><code>script</code> elements inserted using <code
-  title="dom-innerHTML-XML">innerHTML</code> do not execute when they
-  are inserted.</p>
-
-
-
-  <h3>APIs in HTML documents</h3>
-  <!-- XXX case-sensitivity training required here. -->
-
-  <p>For <span>HTML documents</span>, and for <span>HTML
-  elements</span> in <span>HTML documents</span>, certain APIs defined
-  in DOM3 Core become case-insensitive or case-changing, as sometimes
-  defined in DOM3 Core, and as summarized or required below. <a
-  href="#refsDOM3CORE">[DOM3CORE]</a>.</p>
-
-  <p>This does not apply to <span>XML documents</span> or to elements
-  that are not in the <span>HTML namespace</span> despite being in
-  <span>HTML documents</span>.</p>
-
-  <dl>
-
-   <dt><code title="">Element.tagName</code>, <code
-   title="">Node.nodeName</code>, and <code
-   title="">Node.localName</code></dt>
-
-   <dd>
-
-    <p>These attributes return tag names in all uppercase<!-- XXX
-    xref--> and attribute names in all lowercase<!-- XXX xref -->,
-    regardless of the case with which they were created.</p>
-
-   </dd>
-
-
-   <dt><code title="">Document.createElement()</code></dt>
-
-   <dd>
-
-    <p>The canonical form of HTML markup is all-lowercase; thus, this
-    method will lowercase<!-- XXX xref --> the argument before
-    creating the requisite element. Also, the element created must be
-    in the <span>HTML namespace</span>.</p>
-
-    <p class="note">This doesn't apply to <code
-    title="">Document.createElementNS()</code>. Thus, it is possible,
-    by passing this last method a tag name in the wrong case, to
-    create an element that claims to have the tag name of an element
-    defined in this specification, but doesn't support its interfaces,
-    because it really has another tag name not accessible from the DOM
-    APIs.</p>
-
-   </dd>
-
-
-   <dt><code title="">Element.setAttributeNode()</code></dt>
-
-   <dd>
-
-    <p>When an <code>Attr</code> node is set on an <span title="HTML
-    elements">HTML element</span>, it must have its name
-    lowercased<!-- XXX xref --> before the element is affected.</p>
-
-    <p class="note">This doesn't apply to <code
-    title="">Document.setAttributeNodeNS()</code>.</p>
-
-   </dd>
-
-
-   <dt><code title="">Element.setAttribute()</code></dt>
-
-   <dd>
-
-    <p>When an attribute is set on an <span title="HTML elements">HTML
-    element</span>, the name argument must be lowercased<!-- XXX xref
-    --> before the element is affected.</p>
-
-    <p class="note">This doesn't apply to <code
-    title="">Document.setAttributeNS()</code>.</p>
-
-   </dd>
-
-
-   <dt><code title="">Document.getElementsByTagName()</code> and <code
-   title="">Element.getElementsByTagName()</code></dt>
-
-   <dd>
-
-    <p>These methods (but not their namespaced counterparts) must
-    compare the given argument case-insensitively<!-- XXX xref -->
-    when looking at <span title="HTML elements">HTML elements</span>,
-    and case-sensitively otherwise.</p>
-
-    <p class="note">Thus, in an <span title="HTML documents">HTML
-    document</span> with nodes in multiple namespaces, these methods
-    will be both case-sensitive and case-insensitive at the same
-    time.</p>
-
-   </dd>
-
-
-   <dt><code title="">Document.renameNode()</code></dt>
-
-   <dd>
-
-    <p>If the new namespace is the <span>HTML namespace</span>, then
-    the new qualified name must be lowercased before the rename takes
-    place.<!-- XXX xref --></p>
-
-   </dd>
-   
-
-  </dl>
-
-
-
-
-  <h2 id="semantics">Semantics and structure of HTML elements</h2>
-
-  <h3 id="semantics-intro">Introduction</h3>
-
-  <p><em>This section is non-normative.</em></p>
-
-  <p class="big-issue">An introduction to marking up a document.</p>
-
-
   <h3>Common microsyntaxes</h3>
 
   <p>There are various places in HTML that accept particular data
@@ -4666,126 +2977,1904 @@
   </ol>
 
 
-  <h4>URLs</h4><!-- XXXURL -->
+  <h3>Common DOM interfaces</h3>
 
-  <div class="big-issue">
+  <h4>Reflecting content attributes in DOM attributes</h4>
 
-   <p>This section will do the following:</p>
+  <p>Some <span title="DOM attribute">DOM attributes</span> are
+  defined to <dfn>reflect</dfn> a particular <span>content
+  attribute</span>. This means that on getting, the DOM attribute
+  returns the current value of the content attribute, and on setting,
+  the DOM attribute changes the value of the content attribute to the
+  given value.</p>
 
-   <ul>
+  <!-- XXXURL refer to URLs and use the "resolve to absolute URL"
+  algorithm -->
+  <p>If a reflecting DOM attribute is a <code>DOMString</code>
+  attribute whose content attribute is defined to contain a URI, then
+  on getting, the DOM attribute must return the value of the content
+  attribute, resolved to an absolute URI, and on setting, must set the
+  content attribute to the specified literal value. If the content
+  attribute is absent, the DOM attribute must return the default
+  value, if the content attribute has one, or else the empty
+  string.</p>
 
-    <li>define URL as IRI and replace all uses of URIs and IRIs in the
-    rest of the spec with URL</li>
+  <!-- XXXURL refer to URLs and use the "resolve to absolute URL"
+  algorithm -->
+  <p>If a reflecting DOM attribute is a <code>DOMString</code>
+  attribute whose content attribute is defined to contain one or more
+  URIs, then on getting, the DOM attribute must <span title="split the
+  string on spaces">split the content attribute on spaces</span> and
+  return the concatenation of each token URI, resolved to an absolute
+  URI, with a single U+0020 SPACE character between each URI; if the
+  content attribute is absent, the DOM attribute must return the
+  default value, if the content attribute has one, or else the empty
+  string. On setting, the DOM attribute must set the content attribute
+  to the specified literal value.</p>
 
-    <li>define "valid URL" in terms of valid URIs and IRIs and replace
-    that concept through the spec to a pointer here, getting rid of
-    references to <a href="#refsRFC3986">[RFC3986]</a> <a
-    href="#refsRFC3987">[RFC3987]</a> outside this section</li>
+  <p>If a reflecting DOM attribute is a <code>DOMString</code> whose
+  content attribute is an <span>enumerated attribute</span>, and the
+  DOM attribute is <dfn>limited to only known values</dfn>, then, on
+  getting, the DOM attribute must return the conforming value
+  associated with the state the attribute is in (in its canonical
+  case), or the empty string if the attribute is in a state that has
+  no associated keyword value; and on setting, if the new value
+  case-insensitively matches one of the keywords given for that
+  attribute, then the content attribute must be set to the conforming
+  value associated with the state that the attribute would be in if
+  set to the given new value, otherwise, if the new value is the empty
+  string, then the content attribute must be removed, otherwise, the
+  setter must raise a <code>SYNTAX_ERR</code> exception.</p>
 
-    <li>define "valid URL reference" in terms of valid URI references
-    and IRI references and replace that concept through the spec to a
-    pointer here, getting rid of references to <a
-    href="#refsRFC3986">[RFC3986]</a> <a
-    href="#refsRFC3987">[RFC3987]</a> outside this section</li>
+  <p>If a reflecting DOM attribute is a <code>DOMString</code> but
+  doesn't fall into any of the above categories, then the getting and
+  setting must be done in a transparent, case-preserving manner.</p>
 
-    <li>define how to parse URLs (maybe by deferring to RFCs)</li>
+  <p>If a reflecting DOM attribute is a boolean attribute, then on
+  getting the DOM attribute must return true if the attribute is set,
+  and false if it is absent. On setting, the content attribute must be
+  removed if the DOM attribute is set to false, and must be set to
+  have the same value as its name if the DOM attribute is set to
+  true. (This corresponds to the rules for <span title="boolean
+  attribute">boolean content attributes</span>.)</p>
 
-    <li>
+  <p>If a reflecting DOM attribute is a signed integer type
+  (<code>long</code>) then, on getting, the content attribute must be
+  parsed according to <span title="rules for parsing integers">the
+  rules for parsing signed integers</span>, and if that is successful,
+  the resulting value must be returned. If, on the other hand, it
+  fails, or if the attribute is absent, then the default value must be
+  returned instead, or 0 if there is no default value. On setting, the
+  given value must be converted to the shortest possible string
+  representing the number as a <span>valid integer</span> in base ten
+  and then that string must be used as the new content attribute
+  value.</p>
 
-     <p>define how to handle URIs that contain non-ascii characters
-     (and it's not the same as handling as IRIs, especially if the
-     character encoding of the document isn't UTF-8)</p>
+  <p>If a reflecting DOM attribute is an <em>unsigned</em> integer
+  type (<code>unsigned long</code>) then, on getting, the content
+  attribute must be parsed according to <span title="rules for parsing
+  non-negative integers">the rules for parsing unsigned
+  integers</span>, and if that is successful, the resulting value must
+  be returned. If, on the other hand, it fails, or if the attribute is
+  absent, the default value must be returned instead, or 0 if there is
+  no default value. On setting, the given value must be converted to
+  the shortest possible string representing the number as a
+  <span>valid non-negative integer</span> in base ten and then that
+  string must be used as the new content attribute value.</p>
 
-     <p>First parse it (we need to define that. For some schemes it's
-     not per spec -- e.g. apparently for ftp: we should split from
-     hosts on ';'). Then handle each bit as follows:</p>
-     <p>scheme: no further processing (treat %-escaped characters literally, treat unicode characters as unicode characters).</p>
-     <p>host: expand %-encoded bytes to Unicode as UTF-8, treat unicode characters as per IDN.</p>
-     <p>path: don't expand %-encoded bytes. Re-encode unicode to UTF-8 and percent-encode.</p>
-     <p>query: don't expand %-encoded bytes. Re-encode unicode to the page's encoding. Do not percent-encode.</p>
+  <p>If a reflecting DOM attribute is an unsigned integer type
+  (<code>unsigned long</code>) that is <dfn>limited to only positive
+  non-zero numbers</dfn>, then the behavior is similar to the previous
+  case, but zero is not allowed. On getting, the content attribute
+  must first be parsed according to <span title="rules for parsing
+  non-negative integers">the rules for parsing unsigned
+  integers</span>, and if that is successful, the resulting value must
+  be returned. If, on the other hand, it fails, or if the attribute is
+  absent, the default value must be returned instead, or 1 if there is
+  no default value. On setting, if the value is zero, the user agent
+  must fire an <code>INDEX_SIZE_ERR</code> exception. Otherwise, the
+  given value must be converted to the shortest possible string
+  representing the number as a <span>valid non-negative integer</span>
+  in base ten and then that string must be used as the new content
+  attribute value.</p>
 
-    </li>
+  <p>If a reflecting DOM attribute is a floating point number type
+  (<code>float</code>) and the content attribute is defined to contain
+  a time offset, then, on getting, the content attribute must be
+  parsed according to <span title="rules for parsing time offsets">the
+  rules for parsing time offsets</span>, and if that is successful, the
+  resulting value, in seconds, must be returned. If that fails, or if
+  the attribute is absent, the default value must be returned, or the
+  not-a-number value (NaN) if there is no default value. On setting,
+  the given value, interpreted as a time offset in seconds, must be
+  converted to a string using the <span>time offset serialization
+  rules</span>, and that string must be used as the new content
+  attribute value.</p>
 
-    <li>define how to resolve relative URLs in markup attributes
-    (using XMLBase as defined elsewhere right now)</li>
+  <p>If a reflecting DOM attribute is a floating point number type
+  (<code>float</code>) and it doesn't fall into one of the earlier
+  categories, then, on getting, the content attribute must be parsed
+  according to <span title="rules for parsing floating point number
+  values">the rules for parsing floating point number values</span>,
+  and if that is successful, the resulting value must be returned. If,
+  on the other hand, it fails, or if the attribute is absent, the
+  default value must be returned instead, or 0.0 if there is no
+  default value. On setting, the given value must be converted to the
+  shortest possible string representing the number as a <span>valid
+  floating point number</span> in base ten and then that string must
+  be used as the new content attribute value.</p>
 
-    <li>define how to resolve relative URLs in APIs, using the
-    <dfn>script's base URI</dfn> maybe</li>
+  <p>If a reflecting DOM attribute is of the type
+  <code>DOMTokenList</code>, then on getting it must return a
+  <code>DOMTokenList</code> object whose underlying string is the
+  element's corresponding content attribute. When the
+  <code>DOMTokenList</code> object mutates its underlying string, the
+  content attribute must itself be immediately mutated. When the
+  attribute is absent, then the string represented by the
+  <code>DOMTokenList</code> object is the empty string; when the
+  object mutates this empty string, the user agent must first add the
+  corresponding content attribute, and then mutate that attribute
+  instead. <code>DOMTokenList</code> attributes are always
+  read-only. The same <code>DOMTokenList</code> object must be
+  returned every time for each attribute.</p>
 
-    <li>define what it means to resolve a relative URL when the base
-    URL doesn't have a path hierarchy (e.g. data:, javascript:,
-    about:blank URLs)</li>
+  <p>If a reflecting DOM attribute has the type
+  <code>HTMLElement</code>, or an interface that descends from
+  <code>HTMLElement</code>, then, on getting, it must run the
+  following algorithm (stopping at the first point where a value is
+  returned):
 
-    <li>define "an <dfn>element's base URI</dfn>" and make the various
-    places that talk about a base URI in the context of an element use
-    that definition</li>
+  <ol>
 
-    <li>make the language used to refer to resolving a base URI
-    consistent throughout, maybe make it hyperlink to a definition
-    each time</li>
+   <li>If the corresponding content attribute is absent, then the
+   DOM attribute must return null.</li>
 
-    <li>define a cheap, interoperable mechanism for URL attributes and
-    anything else that relies on xml:base and the base element to
-    handle dynamic changes to those attributes and elements, possibly
-    by defining some mechanism which causes changes to be ignored in
-    some reliable way.
+   <li>Let <var title="">candidate</var> be the element that the <code
+   title="">document.getElementById()</code> method would find if it
+   was passed as its argument the current value of the corresponding
+   content attribute.</li>
+
+   <li>If <var title="">candidate</var> is null, or if it is not
+   type-compatible with the DOM attribute, then the DOM attribute must
+   return null.</li>
+
+   <li>Otherwise, it must return <var title="">candidate</var>.</li>
+
+  </ol>
+
+  <p>On setting, if the given element has an <code
+  title="attr-id">id</code> attribute, then the content attribute must
+  be set to the value of that <code title="attr-id">id</code>
+  attribute. Otherwise, the DOM attribute must be set to the empty
+  string.</p><!-- XXX or raise an exception? -->
+
+
+
+  <h4>Collections</h4>
+
+  <p>The <code>HTMLCollection</code>,
+  <code>HTMLFormControlsCollection</code>, and
+  <code>HTMLOptionsCollection</code> interfaces represent various
+  lists of DOM nodes. Collectively, objects implementing these
+  interfaces are called <dfn>collections</dfn>.</p>
+
+  <p>When a <span title="collections">collection</span> is created, a
+  filter and a root are associated with the collection.</p>
+
+  <p class="example">For example, when the <code>HTMLCollection</code>
+  object for the <code
+  title="dom-document-images">document.images</code> attribute is
+  created, it is associated with a filter that selects only
+  <code>img</code> elements, and rooted at the root of the
+  document.</p>
+
+  <p>The <span title="collections">collection</span> then <dfn
+  title="represented by the collection">represents</dfn> a
+  <span>live</span> view of the subtree rooted at the collection's
+  root, containing only nodes that match the given filter. The view is
+  linear. In the absence of specific requirements to the contrary, the
+  nodes within the collection must be sorted in <span>tree
+  order</span>.</p>
+
+  <p class="note">The <code title="dom-table-rows">rows</code> list is
+  not in tree order.</p>
+
+  <p>An attribute that returns a collection must return the same
+  object every time it is retrieved.</p>
+
+
+  <h5>HTMLCollection</h5>
+
+  <p>The <code>HTMLCollection</code> interface represents a generic
+  <span title="collections">collection</span> of elements.</p>
+
+  <pre class="idl">interface <dfn>HTMLCollection</dfn> {
+  readonly attribute unsigned long <span title="dom-HTMLCollection-length">length</span>;
+  [IndexGetter] Element <span title="dom-HTMLCollection-item">item</span>(in unsigned long index);
+  [NameGetter] Element <span title="dom-HTMLCollection-namedItem">namedItem</span>(in DOMString name);
+};</pre>
+
+  <p>The <dfn
+  title="dom-HTMLCollection-length"><code>length</code></dfn>
+  attribute must return the number of nodes <span>represented by the
+  collection</span>.</p>
+
+  <p>The <dfn title="dom-HTMLCollection-item"><code>item(<var
+  title="">index</var>)</code></dfn> method must return the <var
+  title="">index</var>th node in the collection. If there is no <var
+  title="">index</var>th node in the collection, then the method must
+  return null.</p>
+
+  <p>The <dfn
+  title="dom-HTMLCollection-namedItem"><code>namedItem(<var
+  title="">key</var>)</code></dfn> method must return the first node
+  in the collection that matches the following requirements:</p>
+
+  <ul>
+
+   <li>It is an <code>a</code>, <code>applet</code>,
+   <code>area</code>, <code>form</code>, <code>img</code>, or
+   <code>object</code> element with a <code
+   title="attr-name">name</code> attribute equal to <var
+   title="">key</var>, or,</li>
+
+   <li>It is an <span title="HTML elements">HTML element</span> of any
+   kind with an <code title="attr-id">id</code> attribute equal to
+   <var title="">key</var>. (Non-HTML elements, even if they have IDs,
+   are not searched for the purposes of <code
+   title="dom-HTMLCollection-namedItem">namedItem()</code>.)</li>
+
+  </ul>
+
+  <p>If no such elements are found, then the method must return
+  null.</p>
+
+
+
+  <h5>HTMLFormControlsCollection</h5>
+
+  <p>The <code>HTMLFormControlsCollection</code> interface represents
+  a <span title="collections">collection</span> of form controls.</p>
+
+  <pre class="idl">interface <dfn>HTMLFormControlsCollection</dfn> {
+  readonly attribute unsigned long <span title="dom-HTMLFormControlsCollection-length">length</span>;
+  [IndexGetter] <span>HTMLElement</span> <span title="dom-HTMLFormControlsCollection-item">item</span>(in unsigned long index);
+  [NameGetter] Object <span title="dom-HTMLFormControlsCollection-namedItem">namedItem</span>(in DOMString name);
+};</pre>
+
+  <p>The <dfn
+  title="dom-HTMLFormControlsCollection-length"><code>length</code></dfn>
+  attribute must return the number of nodes <span>represented by the
+  collection</span>.</p>
+
+  <p>The <dfn
+  title="dom-HTMLFormControlsCollection-item"><code>item(<var
+  title="">index</var>)</code></dfn> method must return the <var
+  title="">index</var>th node in the collection. If there is no <var
+  title="">index</var>th node in the collection, then the method must
+  return null.</p>
+
+  <p>The <dfn
+  title="dom-HTMLFormControlsCollection-namedItem"><code>namedItem(<var title="">key</var>)</code></dfn>
+  method must act according to the following algorithm:
+
+  <ol>
+
+   <li>If, at the time the method is called, there is exactly one node
+   in the collection that has either an <code
+   title="attr-id">id</code> attribute or a <code
+   title="attr-name">name</code> attribute equal to <var title="">key</var>,
+   then return that node and stop the algorithm.</li>
+
+   <li>Otherwise, if there are no nodes in the collection that have
+   either an <code title="attr-id">id</code> attribute or a <code
+   title="attr-name">name</code> attribute equal to <var
+   title="">key</var>, then return null and stop the algorithm.</li>
+
+   <li>Otherwise, create a <code>NodeList</code> object representing a
+   live view of the <code>HTMLFormControlsCollection</code> object,
+   further filtered so that the only nodes in the
+   <code>NodeList</code> object are those that have either an <code
+   title="attr-id">id</code> attribute or a <code
+   title="attr-name">name</code> attribute equal to <var
+   title="">key</var>. The nodes in the <code>NodeList</code> object
+   must be sorted in <span>tree order</span>.</li>
+
+   <li>Return that <code>NodeList</code> object.</li>
+
+  </ol>
+
+
 <!--
-On Sat, 1 Mar 2008, Anne van Kesteren wrote:
->
-> Note that the new base URI would only take effect once you actually did
-> something with a potentially affected object. For instance, <img> would
-> not start loading a new image if the base URI changes. <img>.src =
-> <img>.getAttribute("src") could start loading a new resource however if
-> the base URI changed since the initial load.
+http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E...%0A%3Cform%20name%3D%22a%22%3E%3Cinput%20id%3D%22x%22%20name%3D%22y%22%3E%3Cinput%20name%3D%22x%22%20id%3D%22y%22%3E%3C/form%3E%0A%3Cscript%3E%0A%20%20var%20x%3B%0A%20%20w%28x%20%3D%20document.forms%5B%27a%27%5D%5B%27x%27%5D%29%3B%0A%20%20w%28x.length%29%3B%0A%20%20x%5B0%5D.parentNode.removeChild%28x%5B0%5D%29%3B%0A%20%20w%28x.length%29%3B%0A%20%20w%28x%20%3D%3D%20document.forms%5B%27a%27%5D%5B%27x%27%5D%29%3B%0A%3C/script%3E%0A
+-->
 
-On Sat, 1 Mar 2008, Jonas Sicking wrote:
-> 
-> Well, that was my intention with the initial proposal. But Hixie pointed    
-> out that "did something" is a very hard thing to define. For example on 
-> a <a href="...">, does the user hovering the node count? Does resizing
-> the window count? Does removing the node from the DOM and reinserting it
-> count?
 
-On Sat, 1 Mar 2008, Maciej Stachowiak wrote:
-> 
-> How about requiring that the base used is the one in effect when a given
-> relative URI is resolved, and define that URIs for resource-loading 
-> elements are resolved at the time the relevant attribute is set or
-> parsed (but for hyperlinks, at the time it is dereferenced). That is        
-> easy to implement, interoperable, and reasonably predictable. It makes
-> sense that changing <base> would affect future loads but not trigger
-> reloads of already loaded or already in progress resources.
+  <h5>HTMLOptionsCollection</h5>
 
-possibly "in the event that the xml:base or base href attribute is
-changed, user agents may, whenever convenient, pretend, for the sake
-of url resolution, that it has not changed"
+  <p>The <code>HTMLOptionsCollection</code> interface represents
+  a list of <code>option</code> elements.</p>
 
-possibly define "base uri change notification behaviour" for all
-elements with URI attributes, and then define changing base href and
-xml:base to activate that behaviour on all elements in the affected
-subtree. Also make this algorithm get called when a node from another
-document is inserted into an HTML document. (we could define that
-you're allowed to do that, in the absence of a DOM Core update)
+  <pre class="idl">interface <dfn>HTMLOptionsCollection</dfn> {
+           attribute unsigned long <span title="dom-HTMLOptionsCollection-length">length</span>;
+  [IndexGetter] HTMLOptionElement <span title="dom-HTMLOptionsCollection-item">item</span>(in unsigned long index);
+  [NameGetter] Object <span title="dom-HTMLOptionsCollection-namedItem">namedItem</span>(in DOMString name);
+};</pre>
+
+  <p>On getting, the <dfn
+  title="dom-HTMLOptionsCollection-length"><code>length</code></dfn>
+  attribute must return the number of nodes <span>represented by the
+  collection</span>.</p>
+
+  <p>On setting, the behavior depends on whether the new value is
+  equal to, greater than, or less than the number of nodes
+  <span>represented by the collection</span> at that time. If the
+  number is the same, then setting the attribute must do nothing. If
+  the new value is greater, then <var title="">n</var> new
+  <code>option</code> elements with no attributes and no child nodes
+  must be appended to the <code>select</code> element on which the
+  <code>HTMLOptionsCollection</code> is rooted, where <var
+  title="">n</var> is the difference between the two numbers (new
+  value minus old value). If the new value is lower, then the last
+  <var title="">n</var> nodes in the collection must be removed from
+  their parent nodes, where <var title="">n</var> is the difference
+  between the two numbers (old value minus new value).</p>
+
+  <p class="note">Setting <code
+  title="dom-HTMLOptionsCollection-length">length</code> never removes
+  or adds any <code>optgroup</code> elements, and never adds new
+  children to existing <code>optgroup</code> elements (though it can
+  remove children from them).</p>
+
+  <p>The <dfn title="dom-HTMLOptionsCollection-item"><code>item(<var
+  title="">index</var>)</code></dfn> method must return the <var
+  title="">index</var>th node in the collection. If there is no <var
+  title="">index</var>th node in the collection, then the method must
+  return null.</p>
+
+  <p>The <dfn
+  title="dom-HTMLOptionsCollection-namedItem"><code>namedItem(<var title="">key</var>)</code></dfn>
+  method must act according to the following algorithm:
+
+  <ol>
+
+   <li>If, at the time the method is called, there is exactly one node
+   in the collection that has either an <code
+   title="attr-id">id</code> attribute or a <code
+   title="attr-name">name</code> attribute equal to <var
+   title="">key</var>, then return that node and stop the
+   algorithm.</li>
+
+   <li>Otherwise, if there are no nodes in the collection that have
+   either an <code title="attr-id">id</code> attribute or a <code
+   title="attr-name">name</code> attribute equal to <var
+   title="">key</var>, then return null and stop the algorithm.</li>
+
+   <li>Otherwise, create a <code>NodeList</code> object representing a
+   live view of the <code>HTMLOptionsCollection</code> object, further
+   filtered so that the only nodes in the <code>NodeList</code> object
+   are those that have either an <code title="attr-id">id</code>
+   attribute or a <code title="attr-option-name">name</code> attribute
+   equal to <var title="">key</var>. The nodes in the
+   <code>NodeList</code> object must be sorted in <span>tree
+   order</span>.</li>
+
+   <li>Return that <code>NodeList</code> object.</li>
+
+  </ol>
+
+  <!-- see also http://ln.hixie.ch/?start=1161042744&count=1 -->
+
+  <p class="big-issue">We may want to add <code>add()</code> and
+  <code>remove()</code> methods here too because IE implements
+  HTMLSelectElement and HTMLOptionsCollection on the same object, and
+  so people use them almost interchangeably in the wild.</p>
+
+
+  <h4>DOMTokenList</h4>
+
+  <p>The <code>DOMTokenList</code> interface represents an interface
+  to an underlying string that consists of an <span>unordered set of
+  unique space-separated tokens</span>.</p>
+
+  <p>Which string underlies a particular <code>DOMTokenList</code>
+  object is defined when the object is created. It might be a content
+  attribute (e.g. the string that underlies the <code
+  title="dom-classList">classList</code> object is the <code
+  title="attr-class">class</code> attribute), or it might be an
+  anonymous string (e.g. when a <code>DOMTokenList</code> object is
+  passed to an author-implemented callback in the
+  <code>datagrid</code> APIs).</p>
+
+  <pre class="idl">[<span title="dom-tokenlist-toString">Stringifies</span>] interface <dfn>DOMTokenList</dfn> {
+  readonly attribute unsigned long <span title="dom-tokenlist-length">length</span>;
+  [IndexGetter] DOMString <span title="dom-tokenlist-item">item</span>(in unsigned long index);
+  boolean <span title="dom-tokenlist-has">has</span>(in DOMString token);
+  void <span title="dom-tokenlist-add">add</span>(in DOMString token);
+  void <span title="dom-tokenlist-remove">remove</span>(in DOMString token);
+  boolean <span title="dom-tokenlist-toggle">toggle</span>(in DOMString token);
+};</pre>
+
+  <p>The <dfn title="dom-tokenlist-length"><code>length</code></dfn>
+  attribute must return the number of <em>unique</em> tokens that
+  result from <span title="split a string on spaces">splitting the
+  underlying string on spaces</span>.</p>
+
+  <p>The <dfn title="dom-tokenlist-item"><code>item(<var
+  title="">index</var>)</code></dfn> method must <span title="split a
+  string on spaces">split the underlying string on spaces</span>, sort
+  the resulting list of tokens by Unicode codepoint<!-- XXX that's
+  basically nonsense. What sort order do we want here? It should be
+  the cheapest one possible that is well-defined for all Unicode. -->,
+  remove exact duplicates, and then return the <var
+  title="">index</var>th item in this list. If <var
+  title="">index</var> is equal to or greater than the number of
+  tokens, then the method must return null.</p>
+
+
+  <p>The <dfn title="dom-tokenlist-has"><code>has(<var
+  title="">token</var>)</code></dfn> method must run the following
+  algorithm:</p>
+
+  <ol>
+
+   <li>If the <var title="">token</var> argument contains any <span
+   title="space character">space characters</span>, then raise an
+   <code>INVALID_CHARACTER_ERR</code> exception and stop the
+   algorithm.</li>
+
+   <li>Otherwise, <span title="split a string on spaces">split the
+   underlying string on spaces</span> to get the list of tokens in the
+   object's underlying string.</li>
+
+   <li>If the token indicated by <var title="">token</var> is one of
+   the tokens in the object's underlying string then return true and
+   stop this algorithm.</li>
+
+   <li>Otherwise, return false.</li>
+
+  </ol>
+
+  <p>The <dfn title="dom-tokenlist-add"><code>add(<var
+  title="">token</var>)</code></dfn> method must run the following
+  algorithm:</p>
+
+  <ol>
+
+   <li>If the <var title="">token</var> argument contains any <span
+   title="space character">space characters</span>, then raise an
+   <code>INVALID_CHARACTER_ERR</code> exception and stop the
+   algorithm.</li>
+
+   <li>Otherwise, <span title="split a string on spaces">split the
+   underlying string on spaces</span> to get the list of tokens in the
+   object's underlying string.</li>
+
+   <li>If the given <var title="">token</var> is already one of the
+   tokens in the <code>DOMTokenList</code> object's underlying string
+   then stop the algorithm.</li>
+
+   <li>Otherwise, if the <code>DOMTokenList</code> object's underlying
+   string is not the empty string and the last character of that
+   string is not a <span>space character</span>, then append a U+0020
+   SPACE character to the end of that string.</li>
+
+   <li>Append the value of <var title="">token</var> to the end of the
+   <code>DOMTokenList</code> object's underlying string.</li>
+
+  </ol>
+
+  <p>The <dfn title="dom-tokenlist-remove"><code>remove(<var
+  title="">token</var>)</code></dfn> method must run the following
+  algorithm:</p>
+
+  <ol>
+
+   <li>If the <var title="">token</var> argument contains any <span
+   title="space character">space characters</span>, then raise an
+   <code>INVALID_CHARACTER_ERR</code> exception and stop the
+   algorithm.</li>
+
+   <li>Otherwise, <span title="remove a token from a string">remove
+   the given <var title="">token</var> from the underlying
+   string</span>.</li>
+
+  </ol>
+
+  <p>The <dfn title="dom-tokenlist-toggle"><code>toggle(<var
+  title="">token</var>)</code></dfn> method must run the following
+  algorithm:</p>
+
+  <ol>
+
+   <li>If the <var title="">token</var> argument contains any <span
+   title="space character">space characters</span>, then raise an
+   <code>INVALID_CHARACTER_ERR</code> exception and stop the
+   algorithm.</li>
+
+   <li>Otherwise, <span title="split a string on spaces">split the
+   underlying string on spaces</span> to get the list of tokens in the
+   object's underlying string.</li>
+
+   <li>If the given <var title="">token</var> is already one of the
+   tokens in the <code>DOMTokenList</code> object's underlying string
+   then <span title="remove a token from a string">remove the given
+   <var title="">token</var> from the underlying string</span>, and
+   stop the algorithm, returning false.</li>
+
+   <li>Otherwise, if the <code>DOMTokenList</code> object's underlying
+   string is not the empty string and the last character of that
+   string is not a <span>space character</span>, then append a U+0020
+   SPACE character to the end of that string.</li>
+
+   <li>Append the value of <var title="">token</var> to the end of the
+   <code>DOMTokenList</code> object's underlying string.</li>
+
+   <li>Return true.</li>
+
+  </ol>
+
+  <p>Objects implementing the <code>DOMTokenList</code> interface must
+  <dfn title="dom-tokenlist-toString">stringify</dfn> to the object's
+  underlying string representation.</p>
+
+
+  <h4>DOMStringMap</h4>
+
+  <p>The <code>DOMStringMap</code> interface represents a set of
+  name-value pairs. When a <code>DOMStringMap</code> object is
+  instanced, it is associated with three algorithms, one for getting
+  values from names, one for setting names to certain values, and one
+  for deleting names.</p>
+
+  <p class="big-issue">The names of the methods on this interface are
+  temporary and will be fixed when the Web IDL / "Language Bindings
+  for DOM Specifications" spec is ready to handle this case.</p>
+
+  <pre class="idl">interface <dfn>DOMStringMap</dfn> {
+  [NameGetter] DOMString <span title="dom-stringmap-XXX1">XXX1</span>(in DOMString name); <!-- XXX DOMB -->
+  [NameSetter] void <span title="dom-stringmap-XXX2">XXX2</span>(in DOMString name, in DOMString value); <!-- XXX DOMB -->
+  [XXX] boolean <span title="dom-stringmap-XXX3">XXX3</span>(in DOMString name); <!-- XXX DOMB -->
+};</pre>
+
+  <p>The <dfn title="dom-stringmap-XXX1"><code>XXX1(<var
+  title="">name</var>)</code></dfn> method must call the algorithm for
+  getting values from names, passing <var title="">name</var> as the
+  name, and must return the corresponding value, or null if <var
+  title="">name</var> has no corresponding value.</p>
+
+  <p>The <dfn title="dom-stringmap-XXX2"><code>XXX2(<var
+  title="">name</var>, <var title="">value</var>)</code></dfn> method
+  must call the algorithm for setting names to certain values, passing
+  <var title="">name</var> as the name and <var title="">value</var>
+  as the value.</p>
+
+  <p>The <dfn title="dom-stringmap-XXX3"><code>XXX3(<var
+  title="">name</var>)</code></dfn> method must call the algorithm for
+  deleting names, passing <var title="">name</var> as the name, and
+  must return true.</p>
+
+
+  <h4>DOM feature strings</h4>
+
+  <p>DOM3 Core defines mechanisms for checking for interface support,
+  and for obtaining implementations of interfaces, using <a
+  href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMFeatures">feature
+  strings</a>. <a href="#refsDOM3CORE">[DOM3CORE]</a></p>
+
+  <p>A DOM application can use the <dfn
+  title="hasFeature"><code>hasFeature(<var title="">feature</var>,
+  <var title="">version</var>)</code></dfn> method of the
+  <code>DOMImplementation</code> interface with parameter values
+  "<code title="">HTML</code>" and "<code>5.0</code>" (respectively)
+  to determine whether or not this module is supported by the
+  implementation. In addition to the feature string "<code
+  title="">HTML</code>", the feature string "<code
+  title="">XHTML</code>" (with version string "<code>5.0</code>") can
+  be used to check if the implementation supports XHTML. User agents
+  should respond with a true value when the <code>hasFeature</code>
+  method is queried with these values. Authors are cautioned, however,
+  that UAs returning true might not be perfectly compliant, and that
+  UAs returning false might well have support for features in this
+  specification; in general, therefore, use of this method is
+  discouraged.</p>
+
+  <p>The values "<code title="">HTML</code>" and "<code
+  title="">XHTML</code>" (both with version "<code>5.0</code>") should
+  also be supported in the context of the <code>getFeature()</code>
+  and <code>isSupported()</code> methods, as defined by DOM3 Core.</p>
+
+  <p class="note">The interfaces defined in this specification are not
+  always supersets of the interfaces defined in DOM2 HTML; some
+  features that were formerly deprecated, poorly supported, rarely
+  used or considered unnecessary have been removed. Therefore it is
+  not guaranteed that an implementation that supports "<code
+  title="">HTML</code>" "<code>5.0</code>" also supports "<code
+  title="">HTML</code>" "<code>2.0</code>".</p>
+
+
+
+  <h3 id="content-type-sniffing">Determining the type of a resource</h3>
+
+  <p class="warning">It is imperative that the rules in this section
+  be followed exactly. When a user agent uses different heuristics for
+  content type detection than the server expects, security problems
+  can occur. For example, if a server believes that the client will
+  treat a contributed file as an image (and thus treat it as benign),
+  but a Web browser believes the content to be HTML (and thus execute
+  any scripts contained therein), the end user can be exposed to
+  malicious content, making the user vulnerable to cookie theft
+  attacks and other cross-site scripting attacks.</p>
+
+
+  <h4 id="content-type">Content-Type metadata</h4>
+
+  <p>What explicit <dfn title="Content-Type">Content-Type
+  metadata</dfn> is associated with the resource (the resource's type
+  information) depends on the protocol that was used to fetch the
+  resource.</p>
+
+  <p>For HTTP resources, only the first Content-Type HTTP header, if
+  any, contributes any type information; the explicit type of the
+  resource is then the value of that header, interpreted as described
+  by the HTTP specifications. If the Content-Type HTTP header is
+  present but the value of the first such header cannot be interpreted
+  as described by the HTTP specifications (e.g. because its value
+  doesn't contain a U+002F SOLIDUS ('/') character), then the resource
+  has no type information (even if there are multiple Content-Type
+  HTTP headers and one of the other ones is syntactically correct). <a
+  href="#refsHTTP">[HTTP]</a></p>
+
+  <p>For resources fetched from the file system, user agents should use
+  platform-specific conventions, e.g. operating system extension/type
+  mappings.</p>
+
+  <p>Extensions must not be used for determining resource types for
+  resources fetched over HTTP.</p>
+
+  <p>For resources fetched over most other protocols, e.g. FTP, there
+  is no type information.</p>
+
+
+  <p>The <dfn>algorithm for extracting an encoding from a
+  Content-Type</dfn>, given a string <var title="">s</var>, is as
+  follows. It either returns an encoding or nothing.</p>
+
+  <ol>
+
+   <li><p>Find the first seven characters in <var title="">s</var>
+   that are a case-insensitive<!-- XXX ASCII--> match for the word
+   'charset'. If no such match is found, return nothing.</p>
+
+   <li><p>Skip any U+0009, U+000A, U+000C, U+000D, or U+0020
+   characters that immediately follow the word 'charset' (there might
+   not be any).</p></li>
+
+   <li><p>If the next character is not a U+003D EQUALS SIGN ('='),
+   return nothing.</p></li>
+
+   <li><p>Skip any U+0009, U+000A, U+000C, U+000D, or U+0020
+   characters that immediately follow the equals sign (there might not
+   be any).</p></li>
+
+   <li><p>Process the next character as follows:</p>
+
+    <dl class="switch">
+
+     <dt>If it is a U+0022 QUOTATION MARK ('"') and there is a later
+     U+0022 QUOTATION MARK ('"') in <var title="">s</var></dt>
+
+     <dt>If it is a U+0027 APOSTROPHE ("'") and there is a later
+     U+0027 APOSTROPHE ("'") in  <var title="">s</var></dt>
+
+     <dd><p>Return the string between this character and the next
+     earliest occurrence of this character.</dd>
+
+
+     <dt>If it is an unmatched U+0022 QUOTATION MARK ('"')</dt>
+     <dt>If it is an unmatched U+0027 APOSTROPHE ("'")</dt>
+     <dt>If there is no next character</dt>
+
+     <dd><p>Return nothing.</dd>
+
+
+     <dt>Otherwise</dt>
+
+     <dd><p>Return the string from this character to the first U+0009,
+     U+000A, U+000C, U+000D, U+0020, or U+003B character or the end of
+     <var title="">s</var>, whichever comes first.</dd>
+
+    </dl>
+
+   </li>
+
+  </ol>
+
+  <p class="note">The above algorithm is a willful violation of the
+  HTTP specification. <a href="#refsRFC2616">[RFC2616]</a></p>
+
+
+  <h4>Content-Type sniffing: Web pages</h4>
+
+  <p>The <dfn title="Content-Type sniffing">sniffed type of a
+  resource</dfn> must be found as follows:</p>
+
+  <ol>
+
+   <li><p>Let <var title="">official type</var> be the type given by
+   the <span title="Content-Type">Content-Type metadata</span> for the
+   resource (in lowercase<!-- XXX ASCII case folding -->, ignoring any
+   parameters). If there is no such type, jump to the <em
+   title="content-type sniffing: unknown type">unknown type</em> step
+   below.</p></li>
+
+   <li><p>If the user agent is configured to strictly obey
+   Content-Type headers for this resource, then jump to the last step
+   in this set of steps.</p></li>
+
+   <li><p>If the resource was fetched over an HTTP protocol and there
+   is an HTTP Content-Type header and the value of the first such
+   header has bytes that exactly match one of the following lines:</p>
+
+    <table>
+     <thead>
+      <tr>
+       <th>Bytes in Hexadecimal
+       <th>Textual representation
+     <tbody>
+      <tr> <!-- Very old Apache default -->
+       <td>74 65 78 74 2f 70 6c 61 69 6e
+       <td><code title="">text/plain</code>
+      <tr> <!-- Old Apache default -->
+       <td>74 65 78 74 2f 70 6c 61 69 6e 3b 20 63 68 61 72 73 65 74 3d 49 53 4f 2d 38 38 35 39 2d 31
+       <td><