(X)HTML5 Tracking

Filter

Affects:

Stability:

Revision

(omit for the latest revision)


  1. [Gecko] [Internet Explorer] [Opera] [Webkit] Remove tag soup support. Authors should use other syntaxes. (credit: dt)
Index: source
===================================================================
--- source	(revision 2942)
+++ source	(revision 2943)
@@ -207,43 +207,29 @@
 
   <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
+  <p>The 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
+  document. Authors are reminded that even minor syntax errors will
+  prevent an XML document from being rendered fully.</p>
+
+  <p>The "DOM5 HTML" and "XHTML5" representations cannot all
+  represent the same content. For example, documents that use the
+  <code>noscript</code> feature cannot be represented
   with "XHTML5" and "DOM5 HTML". Comments that contain the string
   "<code title="">--&gt;</code>" can be represented in "DOM5 HTML" but
-  not in "HTML5" and "XHTML5". And so forth.</p>
+  not in "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 major
   sections:</p>
@@ -62549,7990 +62535,16 @@ interface <dfn>MessagePort</dfn> {
 
   <!-- XXX what about ports in the ports attribute of a MessageEvent
   that isn't dispatched yet? -->
 
   </div>
 
 
 
-  <h2 id="syntax"><dfn>The HTML syntax</dfn></h2>
-
-  <p class="note">This section only describes the rules for <code
-  title="">text/html</code> resources. Rules for XML resources are
-  discussed in the section below entitled "<span>The XHTML
-  syntax</span>".</p>
-
-  <h3>Writing HTML documents</h3>
-
-  <div class="impl">
-
-  <p><em>This section only applies to documents, authoring tools, and
-  markup generators. In particular, it does not apply to conformance
-  checkers; conformance checkers must use the requirements given in
-  the next section ("parsing HTML documents").</em></p>
-
-  </div>
-
-  <p>Documents must consist of the following parts, in the given
-  order:</p>
-
-  <ol>
-
-   <li>Optionally, a single U+FEFF BYTE ORDER MARK (BOM) character.</li>
-
-   <li>Any number of <span title="syntax-comments">comments</span> and
-   <span title="space character">space characters</span>.</li>
-
-   <li>A <span title="syntax-doctype">DOCTYPE</span>.
-
-   <li>Any number of <span title="syntax-comments">comments</span> and
-   <span title="space character">space characters</span>.</li>
-
-   <li>The root element, in the form of an <code>html</code> <span
-   title="syntax-elements">element</span>.</li>
-
-   <li>Any number of <span title="syntax-comments">comments</span> and
-   <span title="space character">space characters</span>.</li>
-
-  </ol>
-
-  <p>The various types of content mentioned above are described in the
-  next few sections.</p>
-
-  <p>In addition, there are some restrictions on how <span>character
-  encoding declarations</span> are to be serialized, as discussed in
-  the section on that topic.</p>
-
-  <div class="note">
-
-   <p>Space characters before the root <code>html</code> element, and
-   space characters at the start of the <code>html</code> element and
-   before the <code>head</code> element, will be dropped when the
-   document is parsed; space characters <em>after</em> the root
-   <code>html</code> element will be parsed as if they were at the end
-   of the <code>body</code> element. Thus, space characters around the
-   root element do not round-trip.</p>
-
-   <p>It is suggested that newlines be inserted after the DOCTYPE,
-   after any comments that are before the root element, after the
-   <code>html</code> element's start tag (if it is not <span
-   title="syntax-tag-omission">omitted</span>), and after any comments
-   that are inside the <code>html</code> element but before the
-   <code>head</code> element.</p>
-
-  </div>
-
-  <p>Many strings in the HTML syntax (e.g. the names of elements and
-  their attributes) are case-insensitive, but only for characters in
-  the ranges U+0041 .. U+005A (LATIN CAPITAL LETTER A to LATIN CAPITAL
-  LETTER Z) and U+0061 .. U+007A (LATIN SMALL LETTER A to LATIN SMALL
-  LETTER Z). For convenience, in this section this is just referred to
-  as "case-insensitive".</p>
-
-
-  <h4>The DOCTYPE</h4>
-
-  <p>A <dfn title="syntax-doctype">DOCTYPE</dfn> is a mostly useless,
-  but required, header.</p>
-
-  <p class="note">DOCTYPEs are required for legacy reasons. When
-  omitted, browsers tend to use a different rendering mode that is
-  incompatible with some specifications. Including the DOCTYPE in a
-  document ensures that the browser makes a best-effort attempt at
-  following the relevant specifications.</p>
-
-  <p>A DOCTYPE must consist of the following characters, in this
-  order:</p>
-
-  <ol class="brief">
-   <li>A U+003C LESS-THAN SIGN (<code>&lt;</code>) character.</li>
-   <li>A U+0021 EXCLAMATION MARK (<code>!</code>) character.</li>
-   <li>A string that is an <span>ASCII case-insensitive</span> match for the string "<code title="">DOCTYPE</code>".</li>
-   <li>One or more <span title="space character">space characters</span>.</li>
-   <li>A string that is an <span>ASCII case-insensitive</span> match for the string "<code title="">HTML</code>".</li>
-   <li>Optionally, a <span>DOCTYPE legacy string</span> (defined below).</li>
-   <li>Zero or more <span title="space character">space characters</span>.</li>
-   <li>A U+003E GREATER-THAN SIGN (<code>&gt;</code>) character.</li>
-  </ol>
-
-  <p class="note">In other words, <code>&lt;!DOCTYPE HTML></code>,
-  case-insensitively.</p>
-
-  <p>For the purposes of HTML generators that cannot output HTML
-  markup with the short DOCTYPE "<code title="">&lt;!DOCTYPE
-  HTML></code>", a <dfn>DOCTYPE legacy string</dfn> may be inserted
-  into the DOCTYPE (in the position defined above). This string must
-  consist of:</p>
-
-  <ol class="brief">
-   <li>One or more <span title="space character">space characters</span>.</li>
-   <li>A string that is an <span>ASCII case-insensitive</span> match for the string "<code title="">SYSTEM</code>".</li>
-   <li>One or more <span title="space character">space characters</span>.</li>
-   <li>A U+0022 QUOTATION MARK or U+0027 APOSTROPHE character (the <i>quote mark</i>).</li>
-   <li>The literal string "<code title="">about:legacy-compat</code>".</li>
-   <li>A matching U+0022 QUOTATION MARK or U+0027 APOSTROPHE character (i.e. the same character as in the earlier step marked <i>quote mark</i>).</li>
-  </ol>
-
-  <p class="note">In other words, <code>&lt;!DOCTYPE HTML SYSTEM
-  "about:legacy-compat"></code> or <code>&lt;!DOCTYPE HTML SYSTEM
-  'about:legacy-compat'></code>, case-insensitively except for the bit
-  in quotes.</p>
-
-  <p>The <span>DOCTYPE legacy string</span> should not be used unless
-  the document is generated from a system that cannot output the
-  shorter string.</p>
-
-
-
-  <h4>Elements</h4>
-
-  <p>There are five different kinds of <dfn
-  title="syntax-elements">elements</dfn>: void elements, CDATA
-  elements, RCDATA elements, foreign elements, and normal
-  elements.</p>
-
-  <dl>
-
-   <dt><dfn>Void elements</dfn></dt>
-
-   <dd><code>base</code>, <code>command</code>, <code>link</code>,
-   <code>meta</code>, <code>hr</code>, <code>br</code>,
-   <code>img</code>, <code>embed</code>, <code>param</code>,
-   <code>area</code>, <code>col</code>, <code>input</code>,
-   <code>source</code></dd>
-
-   <dt>CDATA elements</dt>
-
-   <dd><code>style</code>, <code>script</code></dd> <!-- iframe and
-   noscript don't count as CDATA for syntax purposes -->
-
-   <dt>RCDATA elements</dt>
-
-   <dd><code>title</code>, <code>textarea</code></dd>
-
-   <dt>Foreign elements</dt>
-
-   <dd>Elements from the <span>MathML namespace</span>
-   and the <span>SVG namespace</span>.</dd>
-
-   <dt>Normal elements</dt>
-
-   <dd>All other allowed <span>HTML elements</span> are normal
-   elements.</dd>
-
-  </dl>
-
-  <p><dfn title="syntax-tags">Tags</dfn> are used to delimit the start
-  and end of elements in the markup. CDATA, RCDATA, and normal
-  elements have a <span title="syntax-start-tag">start tag</span> to
-  indicate where they begin, and an <span title="syntax-end-tag">end
-  tag</span> to indicate where they end. The start and end tags of
-  certain normal elements can be <span
-  title="syntax-tag-omission">omitted</span>, as described
-  later. Those that cannot be omitted must not be omitted. <span>Void
-  elements</span> only have a start tag; end tags must not be
-  specified for void elements. Foreign elements must either have a
-  start tag and an end tag, or a start tag that is marked as
-  self-closing, in which case they must not have an end tag.</p>
-
-  <p>The contents of the element must be placed between just after the
-  start tag (which <span title="syntax-tag-omission">might be implied,
-  in certain cases</span>) and just before the end tag (which again,
-  <span title="syntax-tag-omission">might be implied in certain
-  cases</span>). The exact allowed contents of each individual element
-  depends on the content model of that element, as described earlier
-  in this specification. Elements must not contain content that their
-  content model disallows. In addition to the restrictions placed on
-  the contents by those content models, however, the five types of
-  elements have additional <em>syntactic</em> requirements.</p>
-
-  <p><span>Void elements</span> can't have any contents (since there's
-  no end tag, no content can be put between the start tag and the end
-  tag).</p>
-
-  <p>CDATA elements can have <span title="syntax-text">text</span>,
-  though it has <a href="#cdata-rcdata-restrictions">restrictions</a>
-  described below.</p>
-
-  <p>RCDATA elements can have <span title="syntax-text">text</span>
-  and <span title="syntax-charref">character references</span>, but
-  the text must not contain an <span
-  title="syntax-ambiguous-ampersand">ambiguous ampersand</span>.
-  There are also <a href="#cdata-rcdata-restrictions">further
-  restrictions</a> described below.</p>
-
-  <p>Foreign elements whose start tag is marked as self-closing can't
-  have any contents (since, again, as there's no end tag, no content
-  can be put between the start tag and the end tag). Foreign elements
-  whose start tag is <em>not</em> marked as self-closing can have
-  <span title="syntax-text">text</span>, <span
-  title="syntax-charref">character references</span>, <span
-  title="syntax-cdata">CDATA sections</span>, other <span
-  title="syntax-elements">elements</span>, and <span
-  title="syntax-comments">comments</span>, but the text must not
-  contain the character U+003C LESS-THAN SIGN (<code>&lt;</code>) or
-  an <span title="syntax-ambiguous-ampersand">ambiguous
-  ampersand</span>.</p>
-
-  <p>Normal elements can have <span title="syntax-text">text</span>,
-  <span title="syntax-charref">character references</span>, other
-  <span title="syntax-elements">elements</span>, and <span
-  title="syntax-comments">comments</span>, but the text must not
-  contain the character U+003C LESS-THAN SIGN (<code>&lt;</code>) or
-  an <span title="syntax-ambiguous-ampersand">ambiguous
-  ampersand</span>. Some normal elements also have <a
-  href="#element-restrictions">yet more restrictions</a> on what
-  content they are allowed to hold, beyond the restrictions imposed by
-  the content model and those described in this paragraph. Those
-  restrictions are described below.</p>
-
-  <p>Tags contain a <dfn title="syntax-tag-name">tag name</dfn>,
-  giving the element's name. HTML elements all have names that only
-  use characters in the range U+0030 DIGIT ZERO ..  U+0039 DIGIT NINE,
-  U+0061 LATIN SMALL LETTER A .. U+007A LATIN SMALL LETTER Z, U+0041
-  LATIN CAPITAL LETTER A .. U+005A LATIN CAPITAL LETTER Z, and U+002D
-  HYPHEN-MINUS (<code>-</code>). In the HTML syntax, tag names may be
-  written with any mix of lower- and uppercase letters that, when
-  converted to all-lowercase, matches the element's tag name; tag
-  names are case-insensitive.</p>
-
-
-  <h5>Start tags</h5>
-
-  <p><dfn title="syntax-start-tag">Start tags</dfn> must have the
-  following format:</p>
-
-  <ol>
-
-   <li>The first character of a start tag must be a U+003C LESS-THAN
-   SIGN (<code>&lt;</code>).</li>
-
-   <li>The next few characters of a start tag must be the element's
-   <span title="syntax-tag-name">tag name</span>.</li>
-
-   <li>If there are to be any attributes in the next step, there must
-   first be one or more <span title="space character">space
-   characters</span>.</li>
-
-   <li>Then, the start tag may have a number of attributes, the <span
-   title="syntax-attributes">syntax for which</span> is described
-   below. Attributes may be separated from each other by one or more
-   <span title="space character">space characters</span>.</li>
-
-   <li>After the attributes, there may be one or more <span
-   title="space character">space characters</span>. (Some attributes
-   are required to be followed by a space. See the <span
-   title="syntax-attributes">attributes section</span> below.)</li>
-
-   <li>Then, if the element is one of the <span>void elements</span>,
-   or if the element is a foreign element, then there may be a single
-   U+002F SOLIDUS (<code>/</code>) character. This character has no
-   effect on void elements, but on foreign elements it marks the start
-   tag as self-closing.</li>
-
-   <li>Finally, start tags must be closed by a U+003E GREATER-THAN
-   SIGN (<code>&gt;</code>) character.</li>
-
-  </ol>
-
-
-  <h5>End tags</h5>
-
-  <p><dfn title="syntax-end-tag">End tags</dfn> must have the
-  following format:</p>
-
-  <ol>
-
-   <li>The first character of an end tag must be a U+003C LESS-THAN
-   SIGN (<code>&lt;</code>).</li>
-
-   <li>The second character of an end tag must be a U+002F SOLIDUS
-   (<code>/</code>).</li>
-
-   <li>The next few characters of an end tag must be the element's
-   <span title="syntax-tag-name">tag name</span>.</li>
-
-   <li>After the tag name, there may be one or more <span title="space
-   character">space characters</span>.</li>
-
-   <li>Finally, end tags must be closed by a U+003E GREATER-THAN
-   SIGN (<code>&gt;</code>) character.</li>
-
-  </ol>
-
-
-  <h5>Attributes</h5>
-
-  <p><dfn title="syntax-attributes">Attributes</dfn> for an element
-  are expressed inside the element's start tag.</p>
-
-  <p>Attributes have a name and a value. <dfn
-  title="syntax-attribute-name">Attribute names</dfn> must consist of
-  one or more characters other than the <span title="space
-  character">space characters</span>, U+0000 NULL, U+0022 QUOTATION
-  MARK (&#x22;), U+0027 APOSTROPHE (&#x27;), U+003E GREATER-THAN SIGN
-  (&gt;), U+002F SOLIDUS (/), and U+003D EQUALS SIGN (=) characters,
-  the control characters, and any characters that are not defined by
-  Unicode. In the HTML syntax, attribute names may be written with any
-  mix of lower- and uppercase letters that are an <span>ASCII
-  case-insensitive</span> match for the attribute's name.</p>
-
-  <p><dfn title="syntax-attribute-value">Attribute values</dfn> are a
-  mixture of <span title="syntax-text">text</span> and <span
-  title="syntax-charref">character references</span>, except with the
-  additional restriction that the text cannot contain an <span
-  title="syntax-ambiguous-ampersand">ambiguous ampersand</span>.</p>
-
-  <p>Attributes can be specified in four different ways:</p>
-
-  <dl>
-
-   <dt>Empty attribute syntax</dt>
-
-   <dd>
-
-    <p>Just the <span title="syntax-attribute-name">attribute
-    name</span>.</p>
-
-    <div class="example">
-
-     <p>In the following example, the <code
-     title="attr-fe-disabled">disabled</code> attribute is given with
-     the empty attribute syntax:</p>
-
-     <pre>&lt;input <em>disabled</em>&gt;</pre>
-
-    </div>
-
-    <p>If an attribute using the empty attribute syntax is to be
-    followed by another attribute, then there must be a <span>space
-    character</span> separating the two.</p>
-
-   </dd>
-
-   <dt>Unquoted attribute value syntax</dt>
-
-   <dd>
-
-    <p>The <span title="syntax-attribute-name">attribute name</span>,
-    followed by zero or more <span title="space character">space
-    characters</span>, followed by a single U+003D EQUALS SIGN
-    character, followed by zero or more <span title="space
-    character">space characters</span>, followed by the <span
-    title="syntax-attribute-value">attribute value</span>, which, in
-    addition to the requirements given above for attribute values,
-    must not contain any literal <span title="space character">space
-    characters</span>, any U+0022 QUOTATION MARK (<code>&#x22;</code>)
-    characters, U+0027 APOSTROPHE (<code>&#x27;</code>) characters,
-    U+003D EQUALS SIGN (<code>=</code>) characters, or U+003E
-    GREATER-THAN SIGN (<code>&gt;</code>) characters, and must not be
-    the empty string.</p>
-
-    <div class="example">
-
-     <p>In the following example, the <code
-     title="attr-input-value">value</code> attribute is given
-     with the unquoted attribute value syntax:</p>
-
-     <pre>&lt;input <em>value=yes</em>&gt;</pre>
-
-    </div>
-
-    <p>If an attribute using the unquoted attribute syntax is to be
-    followed by another attribute or by one of the optional U+002F
-    SOLIDUS (<code>/</code>) characters allowed in step 6 of the <span
-    title="syntax-start-tag">start tag</span> syntax above, then there
-    must be a <span>space character</span> separating the two.</p>
-
-   </dd>
-
-   <dt>Single-quoted attribute value syntax</dt>
-
-   <dd>
-
-    <p>The <span title="syntax-attribute-name">attribute name</span>,
-    followed by zero or more <span title="space character">space
-    characters</span>, followed by a single U+003D EQUALS SIGN
-    character, followed by zero or more <span title="space
-    character">space characters</span>, followed by a single U+0027
-    APOSTROPHE (<code>'</code>) character, followed by the <span
-    title="syntax-attribute-value">attribute value</span>, which, in
-    addition to the requirements given above for attribute values,
-    must not contain any literal U+0027 APOSTROPHE (<code>'</code>)
-    characters, and finally followed by a second single U+0027
-    APOSTROPHE (<code>'</code>) character.</p>
-
-    <div class="example">
-
-     <p>In the following example, the <code
-     title="attr-input-type">type</code> attribute is given with the
-     single-quoted attribute value syntax:</p>
-
-     <pre>&lt;input <em>type='checkbox'</em>&gt;</pre>
-
-    </div>
-
-    <p>If an attribute using the single-quoted attribute syntax is to
-    be followed by another attribute, then there must be a <span>space
-    character</span> separating the two.</p>
-
-   </dd>
-
-   <dt>Double-quoted attribute value syntax</dt>
-
-   <dd>
-
-    <p>The <span title="syntax-attribute-name">attribute name</span>,
-    followed by zero or more <span title="space character">space
-    characters</span>, followed by a single U+003D EQUALS SIGN
-    character, followed by zero or more <span title="space
-    character">space characters</span>, followed by a single U+0022
-    QUOTATION MARK (<code>"</code>) character, followed by the <span
-    title="syntax-attribute-value">attribute value</span>, which, in
-    addition to the requirements given above for attribute values,
-    must not contain any literal U+0022 QUOTATION MARK
-    (<code>"</code>) characters, and finally followed by a second
-    single U+0022 QUOTATION MARK (<code>"</code>) character.</p>
-
-    <div class="example">
-
-     <p>In the following example, the <code
-     title="attr-fe-name">name</code> attribute is given with the
-     double-quoted attribute value syntax:</p>
-
-     <pre>&lt;input <em>name="be evil"</em>&gt;</pre>
-
-    </div>
-
-    <p>If an attribute using the double-quoted attribute syntax is to
-    be followed by another attribute, then there must be a <span>space
-    character</span> separating the two.</p>
-
-   </dd>
-
-  </dl>
-
-  <p>There must never be two or more attributes on the same start tag
-  whose names are an <span>ASCII case-insensitive</span> match for
-  each other.</p>
-
-  <h5>Optional tags</h5>
-
-  <p>Certain tags can be <dfn
-  title="syntax-tag-omission">omitted</dfn>.</p>
-
-  <!-- <html> -->
-  <p>An <code>html</code> element's <span
-  title="syntax-start-tag">start tag</span> may be omitted if the
-  first thing inside the <code>html</code> element is not a <span
-  title="syntax-comments">comment</span>.</p>
-
-  <!-- </html> -->
-  <p>An <code>html</code> element's <span title="syntax-end-tag">end
-  tag</span> may be omitted if the <code>html</code> element is not
-  immediately followed by a <span
-  title="syntax-comments">comment</span>.</p>
-
-  <!-- <head> -->
-  <p>A <code>head</code> element's <span
-  title="syntax-start-tag">start tag</span> may be omitted if the
-  first thing inside the <code>head</code> element is an element.</p>
-
-  <!-- </head> -->
-  <p>A <code>head</code> element's <span title="syntax-end-tag">end
-  tag</span> may be omitted if the <code>head</code> element is not
-  immediately followed by a <span>space character</span> or a <span
-  title="syntax-comments">comment</span>.</p>
-
-  <!-- <body> -->
-  <p>A <code>body</code> element's <span
-  title="syntax-start-tag">start tag</span> may be omitted if the
-  first thing inside the <code>body</code> element is not a
-  <span>space character</span> or a <span
-  title="syntax-comments">comment</span>, except if the first thing
-  inside the <code>body</code> element is a <code>script</code> or
-  <code>style</code> element. <!-- Note that even if the </head> end
-  tag is present, the parser makes <style> and <script> elements
-  between </head> and <body> end up in the <head> instead of implying
-  the <body> --></p>
-
-  <!-- </body> -->
-  <p>A <code>body</code> element's <span title="syntax-end-tag">end
-  tag</span> may be omitted if the <code>body</code> element is not
-  immediately followed by a <span
-  title="syntax-comments">comment</span>.</p>
-
-  <!-- </li> -->
-  <p>A <code>li</code> element's <span title="syntax-end-tag">end
-  tag</span> may be omitted if the <code>li</code> element is
-  immediately followed by another <code>li</code> element or if there
-  is no more content in the parent element.</p>
-
-  <!-- </dt> -->
-  <p>A <code>dt</code> element's <span title="syntax-end-tag">end
-  tag</span> may be omitted if the <code>dt</code> element is
-  immediately followed by another <code>dt</code> element or a
-  <code>dd</code> element.</p>
-
-  <!-- </dd> -->
-  <p>A <code>dd</code> element's <span title="syntax-end-tag">end
-  tag</span> may be omitted if the <code>dd</code> element is
-  immediately followed by another <code>dd</code> element or a
-  <code>dt</code> element, or if there is no more content in the
-  parent element.</p>
-
-  <!-- </p> -->
-  <p>A <code>p</code> element's <span title="syntax-end-tag">end
-  tag</span> may be omitted if the <code>p</code> element is
-  immediately followed by an <code>address</code>,
-  <code>article</code>, <code>aside</code>, <code>blockquote</code>,
-  <code>datagrid</code>, <code>dialog</code>, <code>dir</code>,
-  <code>div</code>, <code>dl</code>, <code>fieldset</code>,
-  <code>footer</code>, <code>form</code>, <code>h1</code>,
-  <code>h2</code>, <code>h3</code>, <code>h4</code>, <code>h5</code>,
-  <code>h6</code>, <code>header</code>, <code>hr</code>,
-  <code>menu</code>, <code>nav</code>, <code>ol</code>,
-  <code>p</code>, <code>pre</code>, <code>section</code>,
-  <code>table</code>, or <code>ul</code>, element, or if there is no
-  more content in the parent element and the parent element is not an
-  <code>a</code> element.</p>
-
-  <!-- </rt> -->
-  <p>An <code>rt</code> element's <span title="syntax-end-tag">end
-  tag</span> may be omitted if the <code>rt</code> element is
-  immediately followed by an <code>rt</code> or <code>rp</code>
-  element, or if there is no more content in the parent element.</p>
-
-  <!-- </rp> -->
-  <p>An <code>rp</code> element's <span title="syntax-end-tag">end
-  tag</span> may be omitted if the <code>rp</code> element is
-  immediately followed by an <code>rt</code> or <code>rp</code>
-  element, or if there is no more content in the parent element.</p>
-
-  <!-- </optgroup> (the text assumes <optgroup> can only be inside a
-  <select>; commented out text below can handle the non-<select> case
-  if we ever allow it) -->
-  <p>An <code>optgroup</code> element's <span
-  title="syntax-end-tag">end tag</span> may be omitted if the
-  <code>optgroup</code> element <!--has an ancestor
-  <code>select</code> element and--> is immediately followed by
-  another <code>optgroup</code> element, or if <!--all of the elements
-  that are ancestors of the <code>optgroup</code> element, up to and
-  including the first ancestor element that is not an
-  <code>optgroup</code> element, have no more content--> there is no
-  more content in the parent element.</p>
-  <!-- so e.g. the max number of </optgroup>s are omitted here:
-   <select><optgroup></select>
-   <p id=x><optgroup></optgroup>x</p>
-   <p id=x><optgroup><optgroup></optgroup></optgroup>x</p>
-   <p><optgroup id=x><optgroup></optgroup>x</p>
-   <p><optgroup><optgroup id=x>x</p>
-  -->
-
-  <!-- </option> -->
-  <p>An <code>option</code> element's <span title="syntax-end-tag">end
-  tag</span> may be omitted if the <code>option</code> element is
-  immediately followed by another <code>option</code> element, or if
-  it is immediately followed by an <code>optgroup</code> element, or
-  if there is no more content in the parent element.</p>
-
-  <!-- <colgroup> -->
-  <p>A <code>colgroup</code> element's <span
-  title="syntax-start-tag">start tag</span> may be omitted if the
-  first thing inside the <code>colgroup</code> element is a
-  <code>col</code> element, and if the element is not immediately
-  preceded by another <code>colgroup</code> element whose <span
-  title="syntax-end-tag">end tag</span> has been omitted.</p>
-
-  <!-- </colgroup> -->
-  <p>A <code>colgroup</code> element's <span
-  title="syntax-end-tag">end tag</span> may be omitted if the
-  <code>colgroup</code> element is not immediately followed by a
-  <span>space character</span> or a <span
-  title="syntax-comments">comment</span>.</p>
-
-  <!-- </thead> -->
-  <p>A <code>thead</code> element's <span title="syntax-end-tag">end
-  tag</span> may be omitted if the <code>thead</code> element is
-  immediately followed by a <code>tbody</code> or <code>tfoot</code>
-  element.</p>
-
-  <!-- <tbody> -->
-  <p>A <code>tbody</code> element's <span
-  title="syntax-start-tag">start tag</span> may be omitted if the
-  first thing inside the <code>tbody</code> element is a
-  <code>tr</code> element, and if the element is not immediately
-  preceded by a <code>tbody</code>, <code>thead</code>, or
-  <code>tfoot</code> element whose <span title="syntax-end-tag">end
-  tag</span> has been omitted.</p>
-
-  <!-- </tbody> -->
-  <p>A <code>tbody</code> element's <span title="syntax-end-tag">end
-  tag</span> may be omitted if the <code>tbody</code> element is
-  immediately followed by a <code>tbody</code> or <code>tfoot</code>
-  element, or if there is no more content in the parent element.</p>
-
-  <!-- </tfoot> -->
-  <p>A <code>tfoot</code> element's <span title="syntax-end-tag">end
-  tag</span> may be omitted if the <code>tfoot</code> element is
-  immediately followed by a <code>tbody</code> element, or if there is
-  no more content in the parent element.</p>
-
-  <!-- </tr> -->
-  <p>A <code>tr</code> element's <span title="syntax-end-tag">end
-  tag</span> may be omitted if the <code>tr</code> element is
-  immediately followed by another <code>tr</code> element, or if there
-  is no more content in the parent element.</p>
-
-  <!-- </td> -->
-  <p>A <code>td</code> element's <span title="syntax-end-tag">end
-  tag</span> may be omitted if the <code>td</code> element is
-  immediately followed by a <code>td</code> or <code>th</code>
-  element, or if there is no more content in the parent element.</p>
-
-  <!-- </th> -->
-  <p>A <code>th</code> element's <span title="syntax-end-tag">end
-  tag</span> may be omitted if the <code>th</code> element is
-  immediately followed by a <code>td</code> or <code>th</code>
-  element, or if there is no more content in the parent element.</p>
-
-  <p><strong>However</strong>, a <span title="syntax-start-tag">start
-  tag</span> must never be omitted if it has any attributes.</p>
-
-
-  <h5 id="element-restrictions">Restrictions on content models</h5>
-
-  <p>For historical reasons, certain elements have extra restrictions
-  beyond even the restrictions given by their content model.</p>
-
-  <p>A <code>table</code> element must not contain <code>tr</code>
-  elements, even though these elements are technically allowed inside
-  <code>table</code> elements according to the content models
-  described in this specification. (If a <code>tr</code> element is
-  put inside a <code>table</code> in the markup, it will in fact imply
-  a <code>tbody</code> start tag before it.)</p>
-
-  <p>A single U+000A LINE FEED (LF) character may be placed
-  immediately after the <span title="syntax-start-tag">start
-  tag</span> of <code>pre</code> and <code>textarea</code>
-  elements. This does not affect the processing of the element. The
-  otherwise optional U+000A LINE FEED (LF) character <em>must</em> be
-  included if the element's contents start with that character
-  (because otherwise the leading newline in the contents would be
-  treated like the optional newline, and ignored).</p>
-
-  <div class="example">
-   <p>The following two <code>pre</code> blocks are equivalent:</p>
-   <pre>&lt;pre>Hello&lt;/pre></pre>
-   <pre>&lt;pre><br>Hello&lt;/pre></pre>
-  </div>
-
-
-  <h5 id="cdata-rcdata-restrictions">Restrictions on the contents of CDATA and RCDATA elements</h5>
-
-  <p>The text in CDATA and RCDATA elements must not contain any
-  occurrences of the string "<code title="">&lt;/</code>" (U+003C
-  LESS-THAN SIGN, U+002F SOLIDUS) followed by characters that
-  case-insensitively match the tag name of the element followed by one
-  of U+0009 CHARACTER TABULATION, U+000A LINE FEED (LF), U+000C FORM
-  FEED (FF), U+0020 SPACE, U+003E GREATER-THAN SIGN (>), or U+002F
-  SOLIDUS (/), unless that string is part of an <span
-  title="syntax-escape">escaping text span</span>.</p>
-
-  <p>An <dfn title="syntax-escape">escaping text span</dfn> is a span
-  of <span title="syntax-text">text</span> that starts with an <span
-  title="syntax-escape-start">escaping text span start</span> that is
-  not itself in an <span title="syntax-escape">escaping text
-  span</span>, and ends at the next <span
-  title="syntax-escape-end">escaping text span end</span>. There
-  cannot be any <span title="syntax-charref">character
-  references</span> inside an <span title="syntax-escape">escaping
-  text span</span> &mdash; sequences of characters that would look
-  like <span title="syntax-charref">character references</span> do not
-  have special meaning.</p>
-
-  <p>An <dfn title="syntax-escape-start">escaping text span
-  start</dfn> is a part of <span title="syntax-text">text</span> that
-  consists of the four character sequence "<code
-  title="">&lt;!--</code>" (U+003C LESS-THAN SIGN, U+0021 EXCLAMATION
-  MARK, U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS).</p>
-
-  <p>An <dfn title="syntax-escape-end">escaping text span end</dfn> is
-  a part of <span title="syntax-text">text</span> that consists of the
-  three character sequence "<code title="">--&gt;</code>" (U+002D
-  HYPHEN-MINUS, U+002D HYPHEN-MINUS, U+003E GREATER-THAN SIGN) whose
-  U+003E GREATER-THAN SIGN (&gt;).</p>
-
-  <p>An <span title="syntax-escape-start">escaping text span
-  start</span> may share its U+002D HYPHEN-MINUS characters with its
-  corresponding <span title="syntax-escape-end">escaping text span
-  end</span>.</p>
-
-  <p>The text in CDATA and RCDATA elements must not have an <span
-  title="syntax-escape-start">escaping text span start</span> that is
-  not followed by an <span title="syntax-escape-end">escaping text
-  span end</span>.</p>
-
-
-  <h4>Text</h4>
-
-  <p><dfn title="syntax-text">Text</dfn> is allowed inside elements,
-  attributes, and comments. Text must consist of Unicode characters.
-  Text must not contain U+0000 characters. Text must not contain
-  permanently undefined Unicode characters. Text must not contain
-  control characters other than <span title="space character">space
-  characters</span>. 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.</p>
-
-
-  <h5>Newlines</h5>
-
-  <p><dfn 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.</p>
-
-
-  <h4>Character references</h4>
-
-  <p>In certain cases described in other sections, <span
-  title="syntax-text">text</span> may be mixed with <dfn
-  title="syntax-charref">character references</dfn>. These can be used
-  to escape characters that couldn't otherwise legally be included in
-  <span title="syntax-text">text</span>.</p>
-
-  <p>Character references must start with a U+0026 AMPERSAND
-  (<code>&amp;</code>). Following this, there are three possible kinds
-  of character references:</p>
-
-  <dl>
-
-   <dt>Named character references</dt>
-
-   <dd>The ampersand must be followed by one of the names given in the
-   <span>named character references</span> section, using the same
-   case. The name must be one that is terminated by a U+003B SEMICOLON
-   (<code title="">;</code>) character.</dd>
-
-
-   <dt>Decimal numeric character reference</dt>
-
-   <dd>The ampersand must be followed by a U+0023 NUMBER SIGN
-   (<code>#</code>) character, followed by one or more digits in the
-   range U+0030 DIGIT ZERO .. U+0039 DIGIT NINE, representing a
-   base-ten integer that itself is a Unicode code point that is
-   not U+0000, U+000D, in the range U+0080 .. U+009F, or in the range
-   0xD800 .. 0xDFFF (surrogates). The digits must then be followed by
-   a U+003B SEMICOLON character (<code title="">;</code>).</dd>
-
-
-   <dt>Hexadecimal numeric character reference</dt>
-
-   <dd>The ampersand must be followed by a U+0023 NUMBER SIGN
-   (<code>#</code>) character, which must be followed by either a
-   U+0078 LATIN SMALL LETTER X or a U+0058 LATIN CAPITAL LETTER X
-   character, which must then be followed by one or more digits in the
-   range U+0030 DIGIT ZERO .. U+0039 DIGIT NINE, U+0061 LATIN SMALL
-   LETTER A .. U+0066 LATIN SMALL LETTER F, and U+0041 LATIN CAPITAL
-   LETTER A .. U+0046 LATIN CAPITAL LETTER F, representing a
-   base-sixteen integer that itself is a Unicode code point that is
-   not U+0000, U+000D, in the range U+0080 .. U+009F, or in the range
-   0xD800 .. 0xDFFF (surrogates). The digits must then be followed by
-   a U+003B SEMICOLON character (<code title="">;</code>).</dd>
-
-  </dl>
-
-  <p>An <dfn title="syntax-ambiguous-ampersand">ambiguous
-  ampersand</dfn> is a U+0026 AMPERSAND (<code>&amp;</code>) character
-  that is followed by some <span title="syntax-text">text</span> other
-  than a <span>space character</span>, a U+003C LESS-THAN SIGN
-  character ('&lt;'), or another U+0026 AMPERSAND (<code>&amp;</code>)
-  character.</p>
-
-
-  <h4>CDATA sections</h4>
-
-  <p><dfn title="syntax-cdata">CDATA sections</dfn> must start with
-  the character sequence U+003C LESS-THAN SIGN, U+0021 EXCLAMATION
-  MARK, U+005B LEFT SQUARE BRACKET, U+0043 LATIN CAPITAL LETTER C,
-  U+0044 LATIN CAPITAL LETTER D, U+0041 LATIN CAPITAL LETTER A, U+0054
-  LATIN CAPITAL LETTER T, U+0041 LATIN CAPITAL LETTER A, U+005B LEFT
-  SQUARE BRACKET (<code title="">&lt;![CDATA[</code>). Following this
-  sequence, the CDATA section may have <span
-  title="syntax-text">text</span>, with the additional restriction
-  that the text must not contain the three character sequence U+005D
-  RIGHT SQUARE BRACKET, U+005D RIGHT SQUARE BRACKET, U+003E
-  GREATER-THAN SIGN (<code title="">]]></code>). Finally, the CDATA
-  section must be ended by the three character sequence U+005D RIGHT
-  SQUARE BRACKET, U+005D RIGHT SQUARE BRACKET, U+003E GREATER-THAN
-  SIGN (<code title="">]]></code>).</p>
-
-
-  <h4>Comments</h4>
-
-  <p><dfn title="syntax-comments">Comments</dfn> must start with the
-  four character sequence U+003C LESS-THAN SIGN, U+0021 EXCLAMATION
-  MARK, U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS (<code
-  title="">&lt;!--</code>). Following this sequence, the comment may
-  have <span title="syntax-text">text</span>, with the additional
-  restriction that the text must not start with a single U+003E
-  GREATER-THAN SIGN ('&gt;') character, nor start with a U+002D
-  HYPHEN-MINUS (<code title="">-</code>) character followed by a
-  U+003E GREATER-THAN SIGN ('&gt;') character, nor contain two
-  consecutive U+002D HYPHEN-MINUS (<code title="">-</code>)
-  characters, nor end with a U+002D HYPHEN-MINUS (<code
-  title="">-</code>) character. Finally, the comment must be ended by
-  the three character sequence U+002D HYPHEN-MINUS, U+002D
-  HYPHEN-MINUS, U+003E GREATER-THAN SIGN (<code
-  title="">--&gt;</code>).</p>
-
-
-  <div class="impl">
-
-  <h3 id="parsing">Parsing HTML documents</h3>
-
-  <p><em>This section only applies to user agents, data mining tools,
-  and conformance checkers.</em></p>
- 
-  <p>The rules for parsing <span>XML documents</span> (and thus
-  <span>XHTML</span> documents) into DOM trees are covered by the next
-  section, entitled "<span>The XHTML syntax</span>".</p>
-
-  <p>For <span>HTML documents</span>, user agents must use the parsing
-  rules described in this section to generate the DOM trees. Together,
-  these rules define what is referred to as the <dfn>HTML
-  parser</dfn>.</p>
-
-  <div class="note">
-
-   <p>While the HTML form of HTML5 bears a close resemblance to SGML
-   and XML, it is a separate language with its own parsing rules.</p>
-
-   <p>Some earlier versions of HTML (in particular from HTML2 to
-   HTML4) were based on SGML and used SGML parsing rules. However, few
-   (if any) web browsers ever implemented true SGML parsing for HTML
-   documents; the only user agents to strictly handle HTML as an SGML
-   application have historically been validators. The resulting
-   confusion &mdash; with validators claiming documents to have one
-   representation while widely deployed Web browsers interoperably
-   implemented a different representation &mdash; has wasted decades
-   of productivity. This version of HTML thus returns to a non-SGML
-   basis.</p>
-
-   <p>Authors interested in using SGML tools in their authoring
-   pipeline are encouraged to use XML tools and the XML serialization
-   of HTML5.</p>
-
-  </div>
-
-  <p>This specification defines the parsing rules for HTML documents,
-  whether they are syntactically correct or not. Certain points in the
-  parsing algorithm are said to be <dfn title="parse error">parse
-  errors</dfn>. The error handling for parse errors is well-defined:
-  user agents must either act as described below when encountering
-  such problems, or must abort processing at the first error that they
-  encounter for which they do not wish to apply the rules described
-  below.</p>
-
-  <p>Conformance checkers must report at least one parse error
-  condition to the user if one or more parse error conditions exist in
-  the document and must not report parse error conditions if none
-  exist in the document. Conformance checkers may report more than one
-  parse error condition if more than one parse error conditions exist
-  in the document. Conformance checkers are not required to recover
-  from parse errors.</p>
-
-  <p class="note">Parse errors are only errors with the
-  <em>syntax</em> of HTML. In addition to checking for parse errors,
-  conformance checkers will also verify that the document obeys all
-  the other conformance requirements described in this
-  specification.</p>
-
-
-  <h4>Overview of the parsing model</h4>
-
-  <p>The input to the HTML parsing process consists of a stream of
-  Unicode characters, which is passed through a
-  <span>tokenization</span> stage (lexical analysis) followed by a
-  <span>tree construction</span> stage (semantic analysis). The output
-  is a <code>Document</code> object.</p>
-
-  <p class="note">Implementations that <a href="#non-scripted">do not
-  support scripting</a> do not have to actually create a DOM
-  <code>Document</code> object, but the DOM tree in such cases is
-  still used as the model for the rest of the specification.</p>
-
-  <p>In the common case, the data handled by the tokenization stage
-  comes from the network, but <span title="dynamic markup
-  insertion">it can also come from script</span>, e.g. using the <code
-  title="dom-document-write">document.write()</code> API.</p>
-
-  <p><img src="images/parsing-model-overview.png" alt=""></p>
-
-  <p id="nestedParsing">There is only one set of state for the
-  tokeniser stage and the tree construction stage, but the tree
-  construction stage is reentrant, meaning that while the tree
-  construction stage is handling one token, the tokeniser might be
-  resumed, causing further tokens to be emitted and processed before
-  the first token's processing is complete.</p>
-
-  <div class="example">
-
-   <p>In the following example, the tree construction stage will be
-   called upon to handle a "p" start tag token while handling the
-   "script" start tag token:</p>
-
-   <pre>...
-&lt;script>
- document.write('&lt;p>');
-&lt;/script>
-...</pre>
-
-  </div>
-
-  <p>To handle these cases, parsers have a <dfn>script nesting
-  level</dfn>, which must be initially set to zero, and a <dfn>parser
-  pause flag</dfn>, which must be initially set to false.</p>
-
-
-  <h4>The <dfn>input stream</dfn></h4>
-
-  <p>The stream of Unicode characters that consists the input to the
-  tokenization stage will be initially seen by the user agent as a
-  stream of bytes (typically coming over the network or from the local
-  file system). The bytes encode the actual characters according to a
-  particular <em>character encoding</em>, which the user agent must
-  use to decode the bytes into characters.</p>
-
-  <p class="note">For XML documents, the algorithm user agents must
-  use to determine the character encoding is given by the XML
-  specification. This section does not apply to XML documents. <a
-  href="#refsXML">[XML]</a></p>
-
-
-  <h5>Determining the character encoding</h5>
-
-  <p>In some cases, it might be impractical to unambiguously determine
-  the encoding before parsing the document. Because of this, this
-  specification provides for a two-pass mechanism with an optional
-  pre-scan. Implementations are allowed, as described below, to apply
-  a simplified parsing algorithm to whatever bytes they have available
-  before beginning to parse the document. Then, the real parser is
-  started, using a tentative encoding derived from this pre-parse and
-  other out-of-band metadata. If, while the document is being loaded,
-  the user agent discovers an encoding declaration that conflicts with
-  this information, then the parser can get reinvoked to perform a
-  parse of the document with the real encoding.</p>
-
-  <p id="documentEncoding">User agents must use the following
-  algorithm (the <dfn>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 <span
-  title="Content-Type">Content-Type metadata</span> of the document)
-  and all the bytes available so far, and returns an encoding and a
-  <dfn title="concept-encoding-confidence">confidence</dfn>. The
-  confidence is either <i>tentative</i>, <i>certain</i>, or
-  <i>irrelevant</i>. The encoding used, and whether the confidence in
-  that encoding is <i>tentative</i> or <i>confident</i>, is <a
-  href="#meta-charset-during-parse">used during the parsing</a> to
-  determine whether to <span>change the encoding</span>. If no
-  encoding is necessary, e.g. because the parser is operating on a
-  stream of Unicode characters and doesn't have to use an encoding at
-  all, then the <span
-  title="concept-encoding-confidence">confidence</span> is
-  <i>irrelevant</i>.</p>
-
-  <ol>
-
-   <li><p>If the transport layer specifies an encoding, and it is
-   supported, return that encoding with the <span
-   title="concept-encoding-confidence">confidence</span>
-   <i>certain</i>, and abort these steps.</p></li>
-
-   <li><p>The user agent may wait for more bytes of the resource to be
-   available, either in this step or at any later step in this
-   algorithm. For instance, a user agent might wait 500ms or 512
-   bytes, whichever came first. In general preparsing the source to
-   find the encoding improves performance, as it reduces the need to
-   throw away the data structures used when parsing upon finding the
-   encoding information. However, if the user agent delays too long to
-   obtain data to determine the encoding, then the cost of the delay
-   could outweigh any performance improvements from the
-   preparse.</p></li>
-
-   <li><p>For each of the rows in the following table, starting with
-   the first one and going down, if there are as many or more bytes
-   available than the number of bytes in the first column, and the
-   first bytes of the file match the bytes given in the first column,
-   then return the encoding given in the cell in the second column of
-   that row, with the <span
-   title="concept-encoding-confidence">confidence</span>
-   <i>certain</i>, and abort these steps:</p>
-
-    <!-- this table is present in several forms in this file; keep them in sync -->
-    <table>
-     <thead>
-      <tr>
-       <th>Bytes in Hexadecimal
-       <th>Encoding
-     <tbody>
-<!-- nobody uses this
-      <tr>
-       <td>00 00 FE FF
-       <td>UTF-32BE
-      <tr>
-       <td>FF FE 00 00
-       <td>UTF-32LE
--->
-      <tr>
-       <td>FE FF
-       <td>UTF-16BE
-      <tr>
-       <td>FF FE
-       <td>UTF-16LE
-      <tr>
-       <td>EF BB BF
-       <td>UTF-8
-<!-- nobody uses this
-      <tr>
-       <td>DD 73 66 73
-       <td>UTF-EBCDIC
--->
-    </table>
-
-   <p class="note">This step looks for Unicode Byte Order Marks
-   (BOMs).</p></li>
-
-   <li><p>Otherwise, the user agent will have to search for explicit
-   character encoding information in the file itself. This should
-   proceed as follows:
-
-    <p>Let <var title="">position</var> be a pointer to a byte in the
-    input stream, initially pointing at the first byte. If at any
-    point during these substeps the user agent either runs out of
-    bytes or decides that scanning further bytes would not be
-    efficient, then skip to the next step of the overall character
-    encoding detection algorithm. User agents may decide that scanning
-    <em>any</em> bytes is not efficient, in which case these substeps
-    are entirely skipped.</p>
-
-    <p>Now, repeat the following "two" steps until the algorithm
-    aborts (either because user agent aborts, as described above, or
-    because a character encoding is found):</p>
-
-    <ol>
-
-     <li><p>If <var title="">position</var> points to:</p>
-
-      <dl class="switch">
-
-       <dt>A sequence of bytes starting with: 0x3C 0x21 0x2D 0x2D (ASCII '&lt;!--')</dt>
-       <dd>
-
-        <p>Advance the <var title="">position</var> pointer so that it
-        points at the first 0x3E byte which is preceded by two 0x2D
-        bytes (i.e. at the end of an ASCII '-->' sequence) and comes
-        after the 0x3C byte that was found. (The two 0x2D bytes can be
-        the same as the those in the '&lt;!--' sequence.)</p>
-
-       </dd>
-
-       <dt>A sequence of bytes starting with: 0x3C, 0x4D or 0x6D, 0x45 or 0x65, 0x54 or 0x74, 0x41 or 0x61, and finally one of 0x09, 0x0A, 0x0C, 0x0D, 0x20, 0x2F (case-insensitive ASCII '&lt;meta' followed by a space or slash)</dt>
-       <dd>
-
-        <ol>
-
-         <li><p>Advance the <var title="">position</var> pointer so
-         that it points at the next 0x09, 0x0A, 0x0C, 0x0D, 0x20, or
-         0x2F byte (the one in sequence of characters matched
-         above).</p></li>
-
-         <li><p><span title="concept-get-attributes-when-sniffing">Get
-         an attribute</span> and its value. If no attribute was
-         sniffed, then skip this inner set of steps, and jump to the
-         second step in the overall "two step" algorithm.</p></li>
-
-         <li><p>If the attribute's name is neither "<code
-         title="">charset</code>" nor "<code title="">content</code>",
-         then return to step 2 in these inner steps.</p></li>
-
-         <li><p>If the attribute's name is "<code
-         title="">charset</code>", let <var title="">charset</var> be
-         the attribute's value, interpreted as a character
-         encoding.</p></li>
-
-         <li><p>Otherwise, the attribute's name is "<code
-         title="">content</code>": apply the <span>algorithm for
-         extracting an encoding from a Content-Type</span>, 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.</p></li>
-
-         <li><p>If <var title="">charset</var> is a UTF-16 encoding,
-         change it to UTF-8.</p></li>
-
-         <li><p>If <var title="">charset</var> is a supported
-         character encoding, then return the given encoding, with
-         <span title="concept-encoding-confidence">confidence</span>
-         <i>tentative</i>, and abort all these steps.</p></li>
-
-         <li><p>Otherwise, return to step 2 in these inner
-         steps.</p></li>
-
-        </ol>
-
-       </dd>
-
-       <dt>A sequence of bytes starting with a 0x3C byte (ASCII '&lt;'), optionally a 0x2F byte (ASCII '/'), and finally a byte in the range 0x41-0x5A or 0x61-0x7A (an ASCII letter)</dt>
-       <dd>
-
-        <ol>
-
-         <li><p>Advance the <var title="">position</var> pointer so
-         that it points at the next 0x09 (ASCII TAB), 0x0A (ASCII LF),
-         0x0C (ASCII FF), 0x0D (ASCII CR), 0x20 (ASCII space), or 0x3E
-         (ASCII '>') byte.</p></li>
-
-         <li><p>Repeatedly <span
-         title="concept-get-attributes-when-sniffing">get an
-         attribute</span> until no further attributes can be found,
-         then jump to the second step in the overall "two step"
-         algorithm.</p></li>
-
-        </ol>
-
-       </dd>
-
-       <dt>A sequence of bytes starting with: 0x3C 0x21 (ASCII '&lt;!')</dt>
-       <dt>A sequence of bytes starting with: 0x3C 0x2F (ASCII '&lt;/')</dt>
-       <dt>A sequence of bytes starting with: 0x3C 0x3F (ASCII '&lt;?')</dt>
-       <dd>
-
-        <p>Advance the <var title="">position</var> pointer so that it
-        points at the first 0x3E byte (ASCII '>') that comes after the
-        0x3C byte that was found.</p>
-
-       </dd>
-
-       <dt>Any other byte</dt>
-       <dd>
-
-        <p>Do nothing with that byte.</p>
-
-       </dd>
-
-      </dl>
-
-     </li>
-
-     <li>Move <var title="">position</var> so it points at the next
-     byte in the input stream, and return to the first step of this
-     "two step" algorithm.</li>
-
-    </ol>
-
-    <p>When the above "two step" algorithm says to <dfn
-    title="concept-get-attributes-when-sniffing">get an
-    attribute</dfn>, it means doing this:</p>
-
-    <ol>
-
-     <li><p>If the byte at <var title="">position</var> is one of 0x09
-     (ASCII TAB), 0x0A (ASCII LF), 0x0C (ASCII FF), 0x0D (ASCII CR),
-     0x20 (ASCII space), or 0x2F (ASCII '/') then advance <var
-     title="">position</var> to the next byte and redo this
-     substep.</p></li>
-
-     <li><p>If the byte at <var title="">position</var> is 0x3E (ASCII
-     '>'), then abort the "get an attribute" algorithm. There isn't
-     one.</p></li>
-
-     <li><p>Otherwise, the byte at <var title="">position</var> is the
-     start of the attribute name. Let <var title="">attribute
-     name</var> and <var title="">attribute value</var> be the empty
-     string.</p></li>
-
-     <li><p><em>Attribute name</em>: Process the byte at <var
-     title="">position</var> as follows:</p>
-
-      <dl class="switch">
-
-       <dt>If it is 0x3D (ASCII '='), and the <var title="">attribute
-       name</var> is longer than the empty string</dt>
-
-       <dd>Advance <var title="">position</var> to the next byte and
-       jump to the step below labeled <em>value</em>.</dd>
-
-       <dt>If it is 0x09 (ASCII TAB), 0x0A (ASCII LF), 0x0C (ASCII
-       FF), 0x0D (ASCII CR), or 0x20 (ASCII space)</dt>
-
-       <dd>Jump to the step below labeled <em>spaces</em>.</dd>
-
-       <dt>If it is 0x2F (ASCII '/') or 0x3E (ASCII '>')</dt>
-
-       <dd>Abort the "get an attribute" algorithm. The attribute's
-       name is the value of <var title="">attribute name</var>, its
-       value is the empty string.</dd>
-
-       <dt>If it is in the range 0x41 (ASCII 'A') to 0x5A (ASCII
-       'Z')</dt>
-
-       <dd>Append the Unicode character with codepoint <span title=""><var
-       title="">b</var>+0x20</span> to <var title="">attribute
-       name</var> (where <var title="">b</var> is the value of the
-       byte at <var title="">position</var>).</dd>
-
-       <dt>Anything else</dt>
-
-       <dd>Append the Unicode character with the same codepoint as the
-       value of the byte at <var title="">position</var>) to <var
-       title="">attribute name</var>. (It doesn't actually matter how
-       bytes outside the ASCII range are handled here, since only
-       ASCII characters can contribute to the detection of a character
-       encoding.)</dd>
-
-      </dl>
-
-     </li>
-
-     <li><p>Advance <var title="">position</var> to the next byte and
-     return to the previous step.</p></li>
-
-     <li><p><em>Spaces.</em> If the byte at <var
-     title="">position</var> is one of 0x09 (ASCII TAB), 0x0A (ASCII
-     LF), 0x0C (ASCII FF), 0x0D (ASCII CR), or 0x20 (ASCII space) then
-     advance <var title="">position</var> to the next byte, then,
-     repeat this step.</p></li>
-
-     <li><p>If the byte at <var title="">position</var> is
-     <em>not</em> 0x3D (ASCII '='), abort the "get an attribute"
-     algorithm. The attribute's name is the value of <var
-     title="">attribute name</var>, its value is the empty
-     string.</p></li>
-
-     <li><p>Advance <var title="">position</var> past the 0x3D (ASCII
-     '=') byte.</p></li>
-
-     <li><p><em>Value.</em> If the byte at <var
-     title="">position</var> is one of 0x09 (ASCII TAB), 0x0A (ASCII
-     LF), 0x0C (ASCII FF), 0x0D (ASCII CR), or 0x20 (ASCII space) then
-     advance <var title="">position</var> to the next byte, then,
-     repeat this step.</p></li>
-
-     <li><p>Process the byte at <var title="">position</var> as
-     follows:</p>
-
-      <dl class="switch">
-
-       <dt>If it is 0x22 (ASCII '"') or 0x27 ("'")</dt>
-
-       <dd>
-
-        <ol>
-
-         <li>Let <var title="">b</var> be the value of the byte at
-         <var title="">position</var>.</li>
-
-         <li>Advance <var title="">position</var> to the next
-         byte.</li>
-
-         <li>If the value of the byte at <var title="">position</var>
-         is the value of <var title="">b</var>, then advance <var
-         title="">position</var> to the next byte and abort the "get
-         an attribute" algorithm. The attribute's name is the value of
-         <var title="">attribute name</var>, and its value is the
-         value of <var title="">attribute value</var>.</li>
-
-         <li>Otherwise, if the value of the byte at <var
-         title="">position</var> is in the range 0x41 (ASCII 'A') to
-         0x5A (ASCII 'Z'), then append a Unicode character to <var
-         title="">attribute value</var> whose codepoint is 0x20 more
-         than the value of the byte at <var
-         title="">position</var>.</li>
-
-         <li>Otherwise, append a Unicode character to <var
-         title="">attribute value</var> whose codepoint is the same as
-         the value of the byte at <var title="">position</var>.</li>
-
-         <li>Return to the second step in these substeps.</li>
-
-        </ol>
-
-       </dd>
-
-       <dt>If it is 0x3E (ASCII '>')</dt>
-
-       <dd>Abort the "get an attribute" algorithm. The attribute's
-       name is the value of <var title="">attribute name</var>, its
-       value is the empty string.</dd>
-
-
-       <dt>If it is in the range 0x41 (ASCII 'A') to 0x5A (ASCII
-       'Z')</dt>
-
-       <dd>Append the Unicode character with codepoint <span title=""><var
-       title="">b</var>+0x20</span> to <var title="">attribute
-       value</var> (where <var title="">b</var> is the value of the
-       byte at <var title="">position</var>). Advance <var
-       title="">position</var> to the next byte.</dd>
-
-       <dt>Anything else</dt>
-
-       <dd>Append the Unicode character with the same codepoint as the
-       value of the byte at <var title="">position</var>) to <var
-       title="">attribute value</var>. Advance <var
-       title="">position</var> to the next byte.</dd>
-
-      </dl>
-
-     </li>
-
-     <li><p>Process the byte at <var title="">position</var> as
-     follows:</p>
-
-      <dl class="switch">
-
-       <dt>If it is 0x09 (ASCII TAB), 0x0A (ASCII LF), 0x0C (ASCII
-       FF), 0x0D (ASCII CR), 0x20 (ASCII space), or 0x3E (ASCII
-       '>')</dt>
-
-       <dd>Abort the "get an attribute" algorithm. The attribute's
-       name is the value of <var title="">attribute name</var> and its
-       value is the value of <var title="">attribute value</var>.</dd>
-
-       <dt>If it is in the range 0x41 (ASCII 'A') to 0x5A (ASCII
-       'Z')</dt>
-
-       <dd>Append the Unicode character with codepoint <span title=""><var
-       title="">b</var>+0x20</span> to <var title="">attribute
-       value</var> (where <var title="">b</var> is the value of the
-       byte at <var title="">position</var>).</dd>
-
-       <dt>Anything else</dt>
-
-       <dd>Append the Unicode character with the same codepoint as the
-       value of the byte at <var title="">position</var>) to <var
-       title="">attribute value</var>.</dd>
-
-      </dl>
-
-     </li>
-
-     <li><p>Advance <var title="">position</var> to the next byte and
-     return to the previous step.</p></li>
-
-    </ol>
-
-    <p>For the sake of interoperability, user agents should not use a
-    pre-scan algorithm that returns different results than the one
-    described above. (But, if you do, please at least let us know, so
-    that we can improve this algorithm and benefit everyone...)</p>
-
-   </li>
-
-   <li><p>If the user agent has information on the likely encoding for
-   this page, e.g. based on the encoding of the page when it was last
-   visited, then return that encoding, with the <span
-   title="concept-encoding-confidence">confidence</span>
-   <i>tentative</i>, and abort these steps.</p></li>
-
-   <li><p>The user agent may attempt to autodetect the character
-   encoding from applying frequency analysis or other algorithms to
-   the data stream. If autodetection succeeds in determining a
-   character encoding, then return that encoding, with the <span
-   title="concept-encoding-confidence">confidence</span>
-   <i>tentative</i>, and abort these steps. <a
-   href="#refsUNIVCHARDET">[UNIVCHARDET]</a></p></li> <!--
-   http://www.mozilla.org/projects/intl/UniversalCharsetDetection.html
-   -->
-
-   <li><p>Otherwise, return an implementation-defined or
-   user-specified default character encoding, with the <span
-   title="concept-encoding-confidence">confidence</span>
-   <i>tentative</i>. In non-legacy environments, the more
-   comprehensive <code title="">UTF-8</code> encoding is
-   recommended. Due to its use in legacy content, <code
-   title="">windows-1252</code> is recommended as a default in
-   predominantly Western demographics instead. Since these encodings
-   can in many cases be distinguished by inspection, a user agent may
-   heuristically decide which to use as a default.</p></li>
-
-  </ol>
-
-  <p>The <span>document's character encoding</span> must immediately
-  be set to the value returned from this algorithm, at the same time
-  as the user agent uses the returned value to select the decoder to
-  use for the input stream.</p>
-
-
-
-  <h5>Preprocessing the input stream</h5>
-
-  <p>Given an encoding, the bytes in the input stream must be
-  converted to Unicode characters for the tokeniser, as described by
-  the rules for that encoding, except that the leading U+FEFF BYTE
-  ORDER MARK character, if any, must not be stripped by the encoding
-  layer (it is stripped by the rule below).</p> <!-- this is to
-  prevent two leading BOMs from being both stripped, once by the
-  decoder, and once by the parser -->
-
-  <p>Bytes or sequences of bytes in the original byte stream that
-  could not be converted to Unicode characters must be converted to
-  U+FFFD REPLACEMENT CHARACTER code points.</p>
-
-  <p class="note">Bytes or sequences of bytes in the original byte
-  stream that did not conform to the encoding specification
-  (e.g. invalid UTF-8 byte sequences in a UTF-8 input stream) are
-  errors that conformance checkers are expected to report.</p>
-
-  <p>Any byte or sequences of bytes in the original byte stream that
-  is <span>misinterpreted for compatibility</span> is a <span>parse
-  error</span>.</p>
-
-  <p>One leading U+FEFF BYTE ORDER MARK character must be ignored if
-  any are present.</p>
-
-  <p>All U+0000 NULL characters in the input must be replaced by
-  U+FFFD REPLACEMENT CHARACTERs. Any occurrences of such characters is
-  a <span>parse error</span>.</p>
-
-  <p>Any occurrences of any characters in the ranges U+0001 to U+0008,
-  <!-- HT, LF allowed --> <!-- U+000B is in the next list --> <!-- FF,
-  CR allowed --> U+000E to U+001F, <!-- ASCII allowed --> U+007F
-  <!--to U+0084, (U+0085 NEL not allowed), U+0086--> to U+009F, U+D800
-  to U+DFFF<!-- surrogates not allowed -->, U+FDD0 to U+FDEF, and
-  characters U+000B, U+FFFE, U+FFFF, U+1FFFE, U+1FFFF, U+2FFFE,
-  U+2FFFF, U+3FFFE, U+3FFFF, U+4FFFE, U+4FFFF, U+5FFFE, U+5FFFF,
-  U+6FFFE, U+6FFFF, U+7FFFE, U+7FFFF, U+8FFFE, U+8FFFF, U+9FFFE,
-  U+9FFFF, U+AFFFE, U+AFFFF, U+BFFFE, U+BFFFF, U+CFFFE, U+CFFFF,
-  U+DFFFE, U+DFFFF, U+EFFFE, U+EFFFF, U+FFFFE, U+FFFFF, U+10FFFE, and
-  U+10FFFF are <span title="parse error">parse errors</span>. (These
-  are all control characters or permanently undefined Unicode
-  characters.)</p>
-
-  <p>U+000D CARRIAGE RETURN (CR) characters and U+000A LINE FEED (LF)
-  characters are treated specially. Any CR characters that are
-  followed by LF characters must be removed, and any CR characters not
-  followed by LF characters must be converted to LF characters. Thus,
-  newlines in HTML DOMs are represented by LF characters, and there
-  are never any CR characters in the input to the
-  <span>tokenization</span> stage.</p>
-
-  <p>The <dfn>next input character</dfn> is the first character in the
-  input stream that has not yet been <dfn>consumed</dfn>. Initially,
-  the <i>next input character</i> is the first character in the
-  input. The <dfn>current input character</dfn> is the last character
-  to have been <i>consumed</i>.</p>
-
-  <p>The <dfn>insertion point</dfn> is the position (just before a
-  character or just before the end of the input stream) where content
-  inserted using <code
-  title="dom-document-write">document.write()</code> is actually
-  inserted. The insertion point is relative to the position of the
-  character immediately after it, it is not an absolute offset into
-  the input stream. Initially, the insertion point is
-  uninitialized.</p>
-
-  <p>The "EOF" character in the tables below is a conceptual character
-  representing the end of the <span>input stream</span>. If the parser
-  is a <span>script-created parser</span>, then the end of the
-  <span>input stream</span> is reached when an <dfn>explicit "EOF"
-  character</dfn> (inserted by the <code
-  title="dom-document-close">document.close()</code> method) is
-  consumed. Otherwise, the "EOF" character is not a real character in
-  the stream, but rather the lack of any further characters.</p>
-
-
-  <h5>Changing the encoding while parsing</h5>
-
-  <p>When the parser requires the user agent to <dfn>change the
-  encoding</dfn>, it must run the following steps. This might happen
-  if the <span>encoding sniffing algorithm</span> described above
-  failed to find an encoding, or if it found an encoding that was not
-  the actual encoding of the file.</p>
-
-  <ol>
-
-   <li>If the new encoding is a UTF-16 encoding, change it to
-   UTF-8.</li>
-
-   <li>If the new encoding is identical or equivalent to the encoding
-   that is already being used to interpret the input stream, then set
-   the <span title="concept-encoding-confidence">confidence</span> to
-   <i>confident</i> and abort these steps. This happens when the
-   encoding information found in the file matches what the
-   <span>encoding sniffing algorithm</span> determined to be the
-   encoding, and in the second pass through the parser if the first
-   pass found that the encoding sniffing algorithm described in the
-   earlier section failed to find the right encoding.</li>
-
-   <li>If all the bytes up to the last byte converted by the current
-   decoder have the same Unicode interpretations in both the current
-   encoding and the new encoding, and if the user agent supports
-   changing the converter on the fly, then the user agent may change
-   to the new converter for the encoding on the fly. Set the
-   <span>document's character encoding</span> and the encoding used to
-   convert the input stream to the new encoding, set the <span
-   title="concept-encoding-confidence">confidence</span> to
-   <i>confident</i>, and abort these steps.</li>
-
-   <li>Otherwise, <span>navigate</span> to the document again, with
-   <span>replacement enabled</span>, and using the same <span>source
-   browsing context</span>, but this time skip the <span>encoding
-   sniffing algorithm</span> and instead just set the encoding to the
-   new encoding and the <span
-   title="concept-encoding-confidence">confidence</span> to
-   <i>confident</i>. Whenever possible, this should be done without
-   actually contacting the network layer (the bytes should be
-   re-parsed from memory), even if, e.g., the document is marked as
-   not being cacheable. If this is not possible and contacting the
-   network layer would involve repeating a request that uses a method
-   other than HTTP GET (<span title="concept-http-equivalent-get">or
-   equivalent</span> for non-HTTP URLs), then instead set the <span
-   title="concept-encoding-confidence">confidence</span> to
-   <i>confident</i> and ignore the new encoding. The resource will be
-   misinterpreted. User agents may notify the user of the situation,
-   to aid in application development.</li>
-
-  </ol>
-
-
-
-  <h4>Parse state</h4>
-
-  <h5>The insertion mode</h5>
-
-  <p>The <dfn>insertion mode</dfn> is a flag that controls the primary
-  operation of the tree construction stage.</p>
-
-  <p>Initially the <span>insertion mode</span> is "<span
-  title="insertion mode: initial">initial</span>". It can change to
-  "<span title="insertion mode: before html">before html</span>",
-  "<span title="insertion mode: before head">before head</span>",
-  "<span title="insertion mode: in head">in head</span>", "<span
-  title="insertion mode: in head noscript">in head noscript</span>",
-  "<span title="insertion mode: after head">after head</span>", "<span
-  title="insertion mode: in body">in body</span>", "<span
-  title="insertion mode: in CDATA/RCDATA">in CDATA/RCDATA</span>",
-  "<span title="insertion mode: in table">in table</span>", "<span
-  title="insertion mode: in caption">in caption</span>", "<span
-  title="insertion mode: in column group">in column group</span>",
-  "<span title="insertion mode: in table body">in table body</span>",
-  "<span title="insertion mode: in row">in row</span>", "<span
-  title="insertion mode: in cell">in cell</span>", "<span
-  title="insertion mode: in select">in select</span>", "<span
-  title="insertion mode: in select in table">in select in
-  table</span>", "<span title="insertion mode: in foreign content">in
-  foreign content</span>", "<span title="insertion mode: after
-  body">after body</span>", "<span title="insertion mode: in
-  frameset">in frameset</span>", "<span title="insertion mode: after
-  frameset">after frameset</span>", "<span title="insertion mode:
-  after after body">after after body</span>", and "<span
-  title="insertion mode: after after frameset">after after
-  frameset</span>" during the course of the parsing, as described in
-  the <span>tree construction</span> stage. The insertion mode affects
-  how tokens are processed and whether CDATA sections are
-  supported.</p>
-
-  <p>Seven of these modes, namely "<span title="insertion mode: in
-  head">in head</span>", "<span title="insertion mode: in body">in
-  body</span>", "<span title="insertion mode: in CDATA/RCDATA">in
-  CDATA/RCDATA</span>", "<span title="insertion mode: in table">in
-  table</span>", "<span title="insertion mode: in table body">in table
-  body</span>", "<span title="insertion mode: in row">in row</span>",
-  "<span title="insertion mode: in cell">in cell</span>", and "<span
-  title="insertion mode: in select">in select</span>", are special, in
-  that the other modes defer to them at various times. When the
-  algorithm below says that the user agent is to do something
-  "<dfn>using the rules for</dfn> the <var title="">m</var> insertion
-  mode", where <var title="">m</var> is one of these modes, the user
-  agent must use the rules described under the <var title="">m</var>
-  <span>insertion mode</span>'s section, but must leave the
-  <span>insertion mode</span> unchanged unless the rules in <var
-  title="">m</var> themselves switch the <span>insertion mode</span>
-  to a new value.</p>
-
-  <p>When the insertion mode is switched to "<span title="insertion
-  mode: in CDATA/RCDATA">in CDATA/RCDATA</span>", the <dfn>original
-  insertion mode</dfn> is also set. This is the insertion mode to
-  which the tree construction stage will return when the corresponding
-  end tag is parsed.</p>
-
-  <p>When the insertion mode is switched to "<span title="insertion
-  mode: in foreign content">in foreign content</span>", the
-  <dfn>secondary insertion mode</dfn> is also set. This secondary mode
-  is used within the rules for the "<span title="insertion mode: in
-  foreign content">in foreign content</span>" mode to handle HTML
-  (i.e. not foreign) content.</p>
-
-  <hr>
-
-  <p>When the steps below require the UA to <dfn>reset the insertion
-  mode appropriately</dfn>, it means the UA must follow these
-  steps:</p>
-
-  <ol>
-
-   <li>Let <var title="">last</var> be false.</li>
-
-   <li>Let <var title="">node</var> be the last node in the
-   <span>stack of open elements</span>.</li>
-
-   <li>If <var title="">node</var> is the first node in the stack of
-   open elements, then set <var title="">last</var> to true and set
-   <var title="">node</var> to the <var title="">context</var>
-   element. (<span>fragment case</span>)</li>
-
-   <li>If <var title="">node</var> is a <code>select</code> element,
-   then switch the <span>insertion mode</span> to "<span
-   title="insertion mode: in select">in select</span>" and abort these
-   steps. (<span>fragment case</span>)</li>
-
-   <li>If <var title="">node</var> is a <code>td</code> or
-   <code>th</code> element and <var title="">last</var> is false, then
-   switch the <span>insertion mode</span> to "<span title="insertion
-   mode: in cell">in cell</span>" and abort these steps.</li>
-
-   <li>If <var title="">node</var> is a <code>tr</code> element, then
-   switch the <span>insertion mode</span> to "<span title="insertion
-   mode: in row">in row</span>" and abort these steps.</li>
-
-   <li>If <var title="">node</var> is a <code>tbody</code>,
-   <code>thead</code>, or <code>tfoot</code> element, then switch the
-   <span>insertion mode</span> to "<span title="insertion mode: in
-   table body">in table body</span>" and abort these steps.</li>
-
-   <li>If <var title="">node</var> is a <code>caption</code> element,
-   then switch the <span>insertion mode</span> to "<span
-   title="insertion mode: in caption">in caption</span>" and abort
-   these steps.</li>
-
-   <li>If <var title="">node</var> is a <code>colgroup</code> element,
-   then switch the <span>insertion mode</span> to "<span
-   title="insertion mode: in column group">in column group</span>" and
-   abort these steps. (<span>fragment case</span>)</li>
-
-   <li>If <var title="">node</var> is a <code>table</code> element,
-   then switch the <span>insertion mode</span> to "<span
-   title="insertion mode: in table">in table</span>" and abort these
-   steps.</li>
-
-   <li>If <var title="">node</var> is an element from the <span>MathML
-   namespace</span> or the <span>SVG namespace</span>, then switch the
-   <span>insertion mode</span> to "<span title="insertion mode: in
-   foreign content">in foreign content</span>", let the
-   <span>secondary insertion mode</span> be "<span title="insertion
-   mode: in body">in body</span>", and abort these steps.</li>
-
-   <li>If <var title="">node</var> is a <code>head</code> element,
-   then switch the <span>insertion mode</span> to "<span
-   title="insertion mode: in body">in body</span>" ("<span
-   title="insertion mode: in body">in body</span>"! <em> not "<span
-   title="insertion mode: in head">in head</span>"</em>!) and abort
-   these steps. (<span>fragment case</span>)</li> <!-- This is only
-   here for now in case people think that the spec accidentally
-   omitted it and try to "fix" it. Note that noscript-in-head is also
-   handled this way. This is all intentional. The only thing it
-   doesn't handle is the scripting-disabled fragment parsing case for
-   a <head> element containing a <noscript> which itself contains
-   something other than a <link> or a <style> element; you'd expect
-   that to break out of the <noscript> but it doesn't. This is an edge
-   case that doesn't affect the spec, since the algorithm for fragment
-   parsing is only used for innerHTML/outerHTML/insertAdjacentHTML(),
-   where we know scripting is enabled. (XXX except maybe if innerHTML
-   is set from another browsing context on a document with designMode
-   set?) -->
-
-   <li>If <var title="">node</var> is a <code>body</code> element,
-   then switch the <span>insertion mode</span> to "<span
-   title="insertion mode: in body">in body</span>" and abort these
-   steps.</li>
-
-   <li>If <var title="">node</var> is a <code>frameset</code> element,
-   then switch the <span>insertion mode</span> to "<span
-   title="insertion mode: in frameset">in frameset</span>" and abort
-   these steps. (<span>fragment case</span>)</li>
-
-   <li>If <var title="">node</var> is an <code>html</code> element,
-   then: if the <span><code title="">head</code> element
-   pointer</span> is null, switch the <span>insertion mode</span> to
-   "<span title="insertion mode: before head">before head</span>",
-   otherwise, switch the <span>insertion mode</span> to "<span
-   title="insertion mode: after head">after head</span>". In either
-   case, abort these steps. (<span>fragment case</span>)</li> <!-- XXX
-   can the head element pointer ever be non-null when we're going
-   through these steps? -->
-
-   <li>If <var title="">last</var> is true, then switch the
-   <span>insertion mode</span> to "<span title="insertion mode: in
-   body">in body</span>" and abort these steps. (<span>fragment
-   case</span>)</li>
-
-   <li>Let <var title="">node</var> now be the node before <var
-   title="">node</var> in the <span>stack of open
-   elements</span>.</li>
-
-   <li>Return to step 3.</li>
-
-  </ol>
-
-
-  <h5>The stack of open elements</h5>
-
-  <p>Initially the <dfn>stack of open elements</dfn> is empty. The
-  stack grows downwards; the topmost node on the stack is the first
-  one added to the stack, and the bottommost node of the stack is the
-  most recently added node in the stack (notwithstanding when the
-  stack is manipulated in a random access fashion as part of <a
-  href="#adoptionAgency">the handling for misnested tags</a>).</p>
-
-  <p>The "<span title="insertion mode: before html">before
-  html</span>" <span>insertion mode</span> creates the
-  <code>html</code> root element node, which is then added to the
-  stack.</p>
-
-  <p>In the <span>fragment case</span>, the <span>stack of open
-  elements</span> is initialized to contain an <code>html</code>
-  element that is created as part of <span title="html fragment
-  parsing algorithm">that algorithm</span>. (The <span>fragment
-  case</span> skips the "<span title="insertion mode: before
-  html">before html</span>" <span>insertion mode</span>.)</p>
-
-  <p>The <code>html</code> node, however it is created, is the topmost
-  node of the stack. It never gets popped off the stack.</p>
-
-  <p>The <dfn>current node</dfn> is the bottommost node in this
-  stack.</p>
-
-  <p>The <dfn>current table</dfn> is the last <code>table</code>
-  element in the <span>stack of open elements</span>, if there is
-  one. If there is no <code>table</code> element in the <span>stack of
-  open elements</span> (<span>fragment case</span>), then the
-  <span>current table</span> is the first element in the <span>stack
-  of open elements</span> (the <code>html</code> element).</p>
-
-  <p>Elements in the stack fall into the following categories:</p>
-
-  <dl>
-
-   <dt><dfn>Special</dfn></dt>
-
-   <dd><p>The following HTML elements have varying levels of special
-   parsing rules: <code>address</code>, <code>area</code>,
-   <code>article</code>, <code>aside</code>, <code>base</code>,
-   <code>basefont</code>, <code>bgsound</code>,
-   <code>blockquote</code>, <code>body</code>, <code>br</code>,
-   <code>center</code>, <code>col</code>, <code>colgroup</code>,
-   <code>command</code>, <code>datagrid</code>, <code>dd</code>,
-   <code>details</code>, <code>dialog</code>, <code>dir</code>,
-   <code>div</code>, <code>dl</code>, <code>dt</code>,
-   <code>embed</code>, <code>fieldset</code>, <code>figure</code>,
-   <code>footer</code>, <code>form</code>, <code>frame</code>,
-   <code>frameset</code>, <code>h1</code>, <code>h2</code>,
-   <code>h3</code>, <code>h4</code>, <code>h5</code>, <code>h6</code>,
-   <code>head</code>, <code>header</code>, <code>hr</code>,
-   <code>iframe</code>, <!-- <code>image</code>, (commented out
-   because this isn't an element that can end up on the stack, so it
-   doesn't matter) --> <code>img</code>, <code>input</code>,
-   <code>isindex</code>, <code>li</code>, <code>link</code>,
-   <code>listing</code>, <code>menu</code>, <code>meta</code>,
-   <code>nav</code>, <code>noembed</code>, <code>noframes</code>,
-   <code>noscript</code>, <code>ol</code>, <code>p</code>,
-   <code>param</code>, <code>plaintext</code>, <code>pre</code>,
-   <code>script</code>, <code>section</code>, <code>select</code>,
-   <code>spacer</code>, <code>style</code>, <code>tbody</code>,
-   <code>textarea</code>, <code>tfoot</code>, <code>thead</code>,
-   <code>title</code>, <code>tr</code>, <code>ul</code>, and
-   <code>wbr</code>.</p></dd>
-
-   <dt><dfn>Scoping</dfn></dt>
-   <dd><p>The following HTML elements introduce new <span title="has
-   an element in scope">scopes</span> for various parts of the
-   parsing: <code>applet</code>, <code>button</code>,
-   <code>caption</code>, <code>html</code>, <code>marquee</code>,
-   <code>object</code>, <code>table</code>, <code>td</code>,
-   <code>th</code>, and SVG's <code>foreignObject</code>.</p></dd>
-
-   <dt><dfn>Formatting</dfn></dt>
-   <dd><p>The following HTML elements are those that end up in the
-   <span>list of active formatting elements</span>: <code>a</code>,
-   <code>b</code>, <code>big</code>, <code>code</code>,
-   <code>em</code>, <code>font</code>, <code>i</code>,
-   <code>nobr</code>, <code>s</code>, <code>small</code>,
-   <code>strike</code>, <code>strong</code>, <code>tt</code>, and
-   <code>u</code>.</p></dd>
-
-   <dt><dfn>Phrasing</dfn></dt>
-   <dd><p>All other elements found while parsing an HTML
-   document.</p></dd>
-
-  </dl>
-
-  <p>The <span>stack of open elements</span> is said to <dfn
-  title="has an element in scope">have an element in scope</dfn> when
-  the following algorithm terminates in a match state:</p>
-
-  <ol>
-
-   <li><p>Initialize <var title="">node</var> to be the <span>current
-   node</span> (the bottommost node of the stack).</p></li>
-
-   <li><p>If <var title="">node</var> is the target node, terminate in
-   a match state.</p></li>
-
-   <li><p>Otherwise, if <var title="">node</var> is one of the
-   following elements, terminate in a failure state:</p>
-    <ul class="brief">
-     <li><code>applet</code> in the HTML namespace</li>
-     <li><code>caption</code> in the HTML namespace</li>
-     <li><code>html</code> in the HTML namespace</li> <!-- (This can only happen if the <var title="">node</var> is the topmost node of the <span>stack of open elements</span>, and prevents the next step from being invoked if there are no more elements in the stack.) -->
-     <li><code>table</code> in the HTML namespace</li>
-     <li><code>td</code> in the HTML namespace</li>
-     <li><code>th</code> in the HTML namespace</li>
-     <li><code>button</code> in the HTML namespace</li>
-     <li><code>marquee</code> in the HTML namespace</li>
-     <li><code>object</code> in the HTML namespace</li>
-     <li><code title="">foreignObject</code> in the SVG namespace</li>
-    </ul>
-   </li>
-
-   <li><p>Otherwise, set <var title="">node</var> to the previous
-   entry in the <span>stack of open elements</span> and return to step
-   2. (This will never fail, since the loop will always terminate in
-   the previous step if the top of the stack &mdash; an
-   <code>html</code> element &mdash; is reached.)</p></li>
-
-  </ol>
-
-  <p>The <span>stack of open elements</span> is said to <dfn
-  title="has an element in table scope">have an element in <em>table
-  scope</em></dfn> when the following algorithm terminates in a match
-  state:</p>
-
-  <ol>
-
-   <li><p>Initialize <var title="">node</var> to be the <span>current
-   node</span> (the bottommost node of the stack).</p></li>
-
-   <li><p>If <var title="">node</var> is the target node, terminate in
-   a match state.</p></li>
-
-   <li><p>Otherwise, if <var title="">node</var> is one of the
-   following elements, terminate in a failure state:</p>
-    <ul class="brief">
-     <li><code>html</code> in the HTML namespace</li> <!-- (This can only happen if the <var title="">node</var> is the topmost node of the <span>stack of open elements</span>, and prevents the next step from being invoked if there are no more elements in the stack.) -->
-     <li><code>table</code> in the HTML namespace</li>
-    </ul>
-   </li>
-
-   <li><p>Otherwise, set <var title="">node</var> to the previous
-   entry in the <span>stack of open elements</span> and return to step
-   2. (This will never fail, since the loop will always terminate in
-   the previous step if the top of the stack &mdash; an
-   <code>html</code> element &mdash; is reached.)</p></li>
-
-  </ol>
-
-  <p>Nothing happens if at any time any of the elements in the
-  <span>stack of open elements</span> are moved to a new location in,
-  or removed from, the <code>Document</code> tree. In particular, the
-  stack is not changed in this situation. This can cause, amongst
-  other strange effects, content to be appended to nodes that are no
-  longer in the DOM.</p>
-
-  <p class="note">In some cases (namely, when <a
-  href="#adoptionAgency">closing misnested formatting elements</a>),
-  the stack is manipulated in a random-access fashion.</p>
-
-
-  <h5>The list of active formatting elements</h5>
-
-  <p>Initially the <dfn>list of active formatting elements</dfn> is
-  empty. It is used to handle mis-nested <span
-  title="formatting">formatting element tags</span>.</p>
-
-  <p>The list contains elements in the <span>formatting</span>
-  category, and scope markers. The scope markers are inserted when
-  entering <code>applet</code> elements, buttons, <code>object</code>
-  elements, marquees, table cells, and table captions, and are used to
-  prevent formatting from "leaking" into <code>applet</code> elements,
-  buttons, <code>object</code> elements, marquees, and tables.</p>
-
-  <p>When the steps below require the UA to <dfn>reconstruct the
-  active formatting elements</dfn>, the UA must perform the following
-  steps:</p>
-
-  <ol>
-
-   <li>If there are no entries in the <span>list of active formatting
-   elements</span>, then there is nothing to reconstruct; stop this
-   algorithm.</li>
-
-   <li>If the last (most recently added) entry in the <span>list of
-   active formatting elements</span> is a marker, or if it is an
-   element that is in the <span>stack of open elements</span>, then
-   there is nothing to reconstruct; stop this algorithm.</li>
-
-   <li>Let <var title="">entry</var> be the last (most recently added)
-   element in the <span>list of active formatting
-   elements</span>.</li>
-
-   <li>If there are no entries before <var title="">entry</var> in the
-   <span>list of active formatting elements</span>, then jump to step
-   8.</li>
-
-   <li>Let <var title="">entry</var> be the entry one earlier than
-   <var title="">entry</var> in the <span>list of active formatting
-   elements</span>.</li>
-
-   <li>If <var title="">entry</var> is neither a marker nor an element
-   that is also in the <span>stack of open elements</span>, go to step
-   4.</li>
-
-   <li>Let <var title="">entry</var> be the element one later than
-   <var title="">entry</var> in the <span>list of active formatting
-   elements</span>.</li>
-
-   <li>Perform a shallow clone of the element <var title="">entry</var> to
-   obtain <var title="">clone</var>. <a
-   href="#refsDOM3CORE">[DOM3CORE]</a></li>
-
-   <li>Append <var title="">clone</var> to the <span>current
-   node</span> and push it onto the <span>stack of open
-   elements</span> so that it is the new <span>current
-   node</span>.</li>
-
-   <li>Replace the entry for <var title="">entry</var> in the list
-   with an entry for <var title="">clone</var>.</li>
-
-   <li>If the entry for <var title="">clone</var> in the <span>list of
-   active formatting elements</span> is not the last entry in the
-   list, return to step 7.</li>
-
-  </ol>
-
-  <p>This has the effect of reopening all the formatting elements that
-  were opened in the current body, cell, or caption (whichever is
-  youngest) that haven't been explicitly closed.</p>
-
-  <p class="note">The way this specification is written, the
-  <span>list of active formatting elements</span> always consists of
-  elements in chronological order with the least recently added
-  element first and the most recently added element last (except for
-  while steps 8 to 11 of the above algorithm are being executed, of
-  course).</p>
-
-  <p>When the steps below require the UA to <dfn>clear the list of
-  active formatting elements up to the last marker</dfn>, the UA must
-  perform the following steps:</p>
-
-  <ol>
-
-   <li>Let <var title="">entry</var> be the last (most recently added)
-   entry in the <span>list of active formatting elements</span>.</li>
-
-   <li>Remove <var title="">entry</var> from the <span>list of active
-   formatting elements</span>.</li>
-
-   <li>If <var title="">entry</var> was a marker, then stop the
-   algorithm at this point. The list has been cleared up to the last
-   marker.</li>
-
-   <li>Go to step 1.</li>
-
-  </ol>
-
-
-  <h5>The element pointers</h5>
-
-  <p>Initially the <dfn><code title="">head</code> element
-  pointer</dfn> and the <dfn><code title="">form</code> element
-  pointer</dfn> are both null.</p>
-
-  <p>Once a <code>head</code> element has been parsed (whether
-  implicitly or explicitly) the <span><code title="">head</code>
-  element pointer</span> gets set to point to this node.</p>
-
-  <p>The <span><code title="">form</code> element pointer</span>
-  points to the last <code>form</code> element that was opened and
-  whose end tag has not yet been seen. It is used to make form
-  controls associate with forms in the face of dramatically bad
-  markup, for historical reasons.</p>
-
-
-  <h5>Other parsing state flags</h5>
-
-  <p>The <dfn>scripting flag</dfn> is set to "enabled" if <span
-  title="concept-n-script">scripting was enabled</span> for the
-  <code>Document</code> with which the parser is associated when the
-  parser was created, and "disabled" otherwise.</p>
-
-  <p>The <dfn>frameset-ok flag</dfn> is set to "ok" when the parser is
-  created. It is set to "not ok" after certain tokens are seen.</p>
-
-
-  <h4><dfn>Tokenization</dfn></h4>
-
-  <p>Implementations must act as if they used the following state
-  machine to tokenise HTML. The state machine must start in the
-  <span>data state</span>. Most states consume a single character,
-  which may have various side-effects, and either switches the state
-  machine to a new state to <em>reconsume</em> the same character, or
-  switches it to a new state (to consume the next character), or
-  repeats the same state (to consume the next character). Some states
-  have more complicated behavior and can consume several characters
-  before switching to another state.</p>
-
-  <p>The exact behavior of certain states depends on a <dfn>content
-  model flag</dfn> that is set after certain tokens are emitted. The
-  flag has several states: <i title="">PCDATA</i>, <i
-  title="">RCDATA</i>, <i title="">CDATA</i>, and <i
-  title="">PLAINTEXT</i>. Initially it must be in the PCDATA
-  state. In the RCDATA and CDATA states, a further <dfn>escape
-  flag</dfn> is used to control the behavior of the tokeniser. It is
-  either true or false, and initially must be set to the false
-  state. The <span>insertion mode</span> and the <span>stack of open
-  elements</span> also affects tokenization.</p>
-
-  <p>The output of the tokenization step is a series of zero or more
-  of the following tokens: DOCTYPE, start tag, end tag, comment,
-  character, end-of-file. DOCTYPE tokens have a name, a public
-  identifier, a system identifier, and a <i>force-quirks
-  flag</i>. When a DOCTYPE token is created, its name, public
-  identifier, and system identifier must be marked as missing (which
-  is a distinct state from the empty string), and the <i>force-quirks
-  flag</i> must be set to <i>off</i> (its other state is
-  <i>on</i>). Start and end tag tokens have a tag name, a
-  <i>self-closing flag</i>, and a list of attributes, each of which
-  has a name and a value. When a start or end tag token is created,
-  its <i>self-closing flag</i> must be unset (its other state is that
-  it be set), and its attributes list must be empty. Comment and
-  character tokens have data.</p>
-
-  <p>When a token is emitted, it must immediately be handled by the
-  <span>tree construction</span> stage. The tree construction stage
-  can affect the state of the <span>content model flag</span>, and can
-  insert additional characters into the stream. (For example, the
-  <code>script</code> element can result in scripts executing and
-  using the <span>dynamic markup insertion</span> APIs to insert
-  characters into the stream being tokenised.)</p>
-
-  <p>When a start tag token is emitted with its <i>self-closing
-  flag</i> set, if the flag is not <dfn title="acknowledge
-  self-closing flag">acknowledged</dfn> when it is processed by the
-  tree construction stage, that is a <span>parse error</span>.</p>
-
-  <p>When an end tag token is emitted, the <span>content model
-  flag</span> must be switched to the PCDATA state.</p>
-
-  <p>When an end tag token is emitted with attributes, that is a
-  <span>parse error</span>.</p>
-
-  <p>When an end tag token is emitted with its <i>self-closing
-  flag</i> set, that is a <span>parse error</span>.</p>
-
-  <p>Before each step of the tokeniser, the user agent must first
-  check the <span>parser pause flag</span>. If it is true, then the
-  tokeniser must abort the processing of any nested invocations of the
-  tokeniser, yielding control back to the caller. If it is false, then
-  the user agent may then check to see if either one of the scripts in
-  the <span>list of scripts that will execute as soon as
-  possible</span> or the first script in the <span>list of scripts
-  that will execute asynchronously</span>, has <span>completed
-  loading</span>. If one has, then it must be <span title="executing a
-  script block">executed</span> and removed from its list.</p>
-
-  <p>The tokeniser state machine consists of the states defined in the
-  following subsections.</p>
-
-  <!-- XXX should go through these reordering the entries so that
-  they're in some consistent order, like, by Unicode, errors last, or
-  something -->
-
-  <h5><dfn>Data state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0026 AMPERSAND (&amp;)</dt>
-   <dd>When the <span>content model flag</span> is set to one of the
-   PCDATA or RCDATA states and the <span>escape flag</span> is
-   false: switch to the <span>character reference data
-   state</span>.</dd> <dd>Otherwise: treat it as per the "anything
-   else" entry below.</dd>
-
-   <dt>U+002D HYPHEN-MINUS (-)</dt>
-   <dd>
-
-    <p>If the <span>content model flag</span> is set to either the
-    RCDATA state or the CDATA state, and the <span>escape flag</span>
-    is false, and there are at least three characters before this
-    one in the input stream, and the last four characters in the
-    input stream, including this one, are U+003C LESS-THAN SIGN,
-    U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, and U+002D
-    HYPHEN-MINUS ("&lt;!--"), then set the <span>escape flag</span>
-    to true.</p>
-
-    <p>In any case, emit the input character as a character
-    token. Stay in the <span>data state</span>.</p>
-
-   </dd>
-
-   <dt>U+003C LESS-THAN SIGN (&lt;)</dt>
-   <dd>When the <span>content model flag</span> is set to the PCDATA
-   state: switch to the <span>tag open state</span>.</dd>
-   <dd>When the <span>content model flag</span> is set to either the
-   RCDATA state or the CDATA state, and the <span>escape flag</span>
-   is false: switch to the <span>tag open state</span>.</dd>
-   <dd>Otherwise: treat it as per the "anything else" entry
-   below.</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd>
-
-    <p>If the <span>content model flag</span> is set to either the
-    RCDATA state or the CDATA state, and the <span>escape
-    flag</span> is true, and the last three characters in the input
-    stream including this one are U+002D HYPHEN-MINUS, U+002D
-    HYPHEN-MINUS, U+003E GREATER-THAN SIGN ("--&gt;"), set the
-    <span>escape flag</span> to false.</p> <!-- no need to check
-    that there are enough characters, since you can only run into
-    this if the flag is true in the first place, which requires four
-    characters. -->
-
-    <p>In any case, emit the input character as a character
-    token. Stay in the <span>data state</span>.</p>
-
-   </dd>
-
-   <dt>EOF</dt>
-   <dd>Emit an end-of-file token.</dd>
-
-   <dt>Anything else</dt>
-   <dd>Emit the input character as a character token. Stay in the
-   <span>data state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>Character reference data state</dfn></h5>
-
-  <p><em>(This cannot happen if the <span>content model flag</span>
-  is set to the CDATA state.)</em></p>
-
-  <p>Attempt to <span>consume a character reference</span>, with no
-  <span>additional allowed character</span>.</p>
-
-  <p>If nothing is returned, emit a U+0026 AMPERSAND character
-  token.</p>
-
-  <p>Otherwise, emit the character token that was returned.</p>
-
-  <p>Finally, switch to the <span>data state</span>.</p>
-
-
-  <h5><dfn>Tag open state</dfn></h5>
-
-  <p>The behavior of this state depends on the <span>content model
-  flag</span>.</p>
-
-  <dl>
-
-   <dt>If the <span>content model flag</span> is set to the RCDATA
-   or CDATA states</dt>
-
-   <dd>
-
-    <p>Consume the <span>next input character</span>. If it is a
-    U+002F SOLIDUS (/) character, switch to the <span>close tag open
-    state</span>. Otherwise, emit a U+003C LESS-THAN SIGN character
-    token and reconsume the <span>current input character</span> in the
-    <span>data state</span>.</p>
-
-   </dd>
-
-   <dt>If the <span>content model flag</span> is set to the PCDATA
-   state</dt>
-
-   <dd>
-
-    <p>Consume the <span>next input character</span>:</p>
-
-    <dl class="switch">
-
-     <dt>U+0021 EXCLAMATION MARK (!)</dt>
-     <dd>Switch to the <span>markup declaration open state</span>.</dd>
-
-     <dt>U+002F SOLIDUS (/)</dt>
-     <dd>Switch to the <span>close tag open state</span>.</dd>
-
-     <dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL LETTER Z</dt>
-     <dd>Create a new start tag token, set its tag name to the
-     lowercase version of the input character (add 0x0020 to the
-     character's code point), then switch to the <span>tag name
-     state</span>. (Don't emit the token yet; further details will
-     be filled in before it is emitted.)</dd>
-
-     <dt>U+0061 LATIN SMALL LETTER A through to U+007A LATIN SMALL LETTER Z</dt>
-     <dd>Create a new start tag token, set its tag name to the input
-     character, then switch to the <span>tag name
-     state</span>. (Don't emit the token yet; further details will
-     be filled in before it is emitted.)</dd>
-
-     <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-     <dd><span>Parse error</span>. Emit a U+003C LESS-THAN SIGN
-     character token and a U+003E GREATER-THAN SIGN character
-     token. Switch to the <span>data state</span>.</dd>
-
-     <dt>U+003F QUESTION MARK (?)</dt>
-     <dd><span>Parse error</span>. Switch to the <span>bogus
-     comment state</span>.</dd>
-
-     <dt>Anything else</dt>
-     <dd><span>Parse error</span>. Emit a U+003C LESS-THAN SIGN
-     character token and reconsume the <span>current input character</span> in the
-     <span>data state</span>.</dd>
-
-    </dl>
-
-   </dd>
-
-  </dl>
-
-
-  <h5><dfn>Close tag open state</dfn></h5>
-
-  <p>If the <span>content model flag</span> is set to the RCDATA or
-  CDATA states but no start tag token has ever been emitted by this
-  instance of the tokeniser (<span>fragment case</span>), or, if the
-  <span>content model flag</span> 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 (compared in an <span>ASCII
-  case-insensitive</span> manner), or if they do but they are not
-  immediately followed by one of the following characters:</p>
-
-  <ul class="brief">
-   <li>U+0009 CHARACTER TABULATION</li>
-   <li>U+000A LINE FEED (LF)</li>
-   <li>U+000C FORM FEED (FF)</li>
-   <!--<li>U+000D CARRIAGE RETURN (CR)</li>-->
-   <li>U+0020 SPACE</li>
-   <li>U+003E GREATER-THAN SIGN (&gt;)</li>
-   <li>U+002F SOLIDUS (/)</li>
-   <li>EOF</li>
-  </ul>
-
-  <p>...then emit a U+003C LESS-THAN SIGN character token, a U+002F
-  SOLIDUS character token, and switch to the <span>data state</span>
-  to process the <span>next input character</span>.</p>
-
-  <p>Otherwise, if the <span>content model flag</span> is set to the
-  PCDATA state, or if the next few characters <em>do</em> match that tag
-  name, consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL LETTER Z</dt>
-   <dd>Create a new end tag token, set its tag name to the lowercase
-   version of the input character (add 0x0020 to the character's
-   code point), then switch to the <span>tag name
-   state</span>. (Don't emit the token yet; further details will be
-   filled in before it is emitted.)</dd>
-
-   <dt>U+0061 LATIN SMALL LETTER A through to U+007A LATIN SMALL LETTER Z</dt>
-   <dd>Create a new end tag token, set its tag name to the input
-   character, then switch to the <span>tag name state</span>. (Don't
-   emit the token yet; further details will be filled in before it
-   is emitted.)</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd><span>Parse error</span>. Switch to the <span>data
-   state</span>.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Emit a U+003C LESS-THAN SIGN
-   character token and a U+002F SOLIDUS character token.  Reconsume
-   the EOF character in the <span>data state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd><span>Parse error</span>. Switch to the <span>bogus
-   comment state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>Tag name state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0009 CHARACTER TABULATION</dt>
-   <dt>U+000A LINE FEED (LF)</dt>
-   <dt>U+000C FORM FEED (FF)</dt>
-   <!--<dt>U+000D CARRIAGE RETURN (CR)</dt>-->
-   <dt>U+0020 SPACE</dt>
-   <dd>Switch to the <span>before attribute name state</span>.</dd>
-
-   <dt>U+002F SOLIDUS (/)</dt>
-   <dd>Switch to the <span>self-closing start tag state</span>.</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd>Emit the current tag token. Switch to the <span>data
-   state</span>.</dd>
-
-   <dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL LETTER Z</dt>
-   <dd>Append the lowercase version of the <span>current input character</span>
-   (add 0x0020 to the character's code point) to the current tag
-   token's tag name. Stay in the <span>tag name state</span>.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Emit the current tag
-   token. Reconsume the EOF character in the <span>data
-   state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd>Append the <span>current input character</span> to the current tag token's
-   tag name. Stay in the <span>tag name state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>Before attribute name state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0009 CHARACTER TABULATION</dt>
-   <dt>U+000A LINE FEED (LF)</dt>
-   <dt>U+000C FORM FEED (FF)</dt>
-   <!--<dt>U+000D CARRIAGE RETURN (CR)</dt>-->
-   <dt>U+0020 SPACE</dt>
-   <dd>Stay in the <span>before attribute name state</span>.</dd>
-
-   <dt>U+002F SOLIDUS (/)</dt>
-   <dd>Switch to the <span>self-closing start tag state</span>.</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd>Emit the current tag token. Switch to the <span>data
-   state</span>.</dd>
-
-   <dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL LETTER Z</dt>
-   <dd>Start a new attribute in the current tag token. Set that
-   attribute's name to the lowercase version of the <span>current input
-   character</span> (add 0x0020 to the character's code point), and its
-   value to the empty string. Switch to the <span>attribute name
-   state</span>.</dd>
-
-   <dt>U+0022 QUOTATION MARK (&quot;)</dt>
-   <dt>U+0027 APOSTROPHE (')</dt>
-   <dt>U+003D EQUALS SIGN (=)</dt>
-   <dd><span>Parse error</span>. Treat it as per the "anything else"
-   entry below.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Emit the current tag
-   token. Reconsume the EOF character in the <span>data
-   state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd>Start a new attribute in the current tag token. Set that
-   attribute's name to the <span>current input character</span>, and its value to
-   the empty string. Switch to the <span>attribute name
-   state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>Attribute name state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0009 CHARACTER TABULATION</dt>
-   <dt>U+000A LINE FEED (LF)</dt>
-   <dt>U+000C FORM FEED (FF)</dt>
-   <!--<dt>U+000D CARRIAGE RETURN (CR)</dt>-->
-   <dt>U+0020 SPACE</dt>
-   <dd>Switch to the <span>after attribute name state</span>.</dd>
-
-   <dt>U+002F SOLIDUS (/)</dt>
-   <dd>Switch to the <span>self-closing start tag state</span>.</dd>
-
-   <dt>U+003D EQUALS SIGN (=)</dt>
-   <dd>Switch to the <span>before attribute value state</span>.</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd>Emit the current tag token. Switch to the <span>data
-   state</span>.</dd>
-
-   <dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL LETTER Z</dt>
-   <dd>Append the lowercase version of the <span>current input character</span>
-   (add 0x0020 to the character's code point) to the current
-   attribute's name. Stay in the <span>attribute name
-   state</span>.</dd>
-
-   <dt>U+0022 QUOTATION MARK (&quot;)</dt>
-   <dt>U+0027 APOSTROPHE (')</dt>
-   <dd><span>Parse error</span>. Treat it as per the "anything else"
-   entry below.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Emit the current tag
-   token. Reconsume the EOF character in the <span>data
-   state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd>Append the <span>current input character</span> to the current attribute's
-   name. Stay in the <span>attribute name state</span>.</dd>
-
-  </dl>
-
-  <p>When the user agent leaves the attribute name state (and before
-  emitting the tag token, if appropriate), the complete attribute's
-  name must be compared to the other attributes on the same token;
-  if there is already an attribute on the token with the exact same
-  name, then this is a <span>parse error</span> and the new
-  attribute must be dropped, along with the value that gets
-  associated with it (if any).</p>
-
-
-  <h5><dfn>After attribute name state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0009 CHARACTER TABULATION</dt>
-   <dt>U+000A LINE FEED (LF)</dt>
-   <dt>U+000C FORM FEED (FF)</dt>
-   <!--<dt>U+000D CARRIAGE RETURN (CR)</dt>-->
-   <dt>U+0020 SPACE</dt>
-   <dd>Stay in the <span>after attribute name state</span>.</dd>
-
-   <dt>U+002F SOLIDUS (/)</dt>
-   <dd>Switch to the <span>self-closing start tag state</span>.</dd>
-
-   <dt>U+003D EQUALS SIGN (=)</dt>
-   <dd>Switch to the <span>before attribute value state</span>.</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd>Emit the current tag token. Switch to the <span>data
-   state</span>.</dd>
-
-   <dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL LETTER Z</dt>
-   <dd>Start a new attribute in the current tag token. Set that
-   attribute's name to the lowercase version of the <span>current input character</span>
-   (add 0x0020 to the character's code point), and its value to
-   the empty string. Switch to the <span>attribute name
-   state</span>.</dd>
-
-   <dt>U+0022 QUOTATION MARK (&quot;)</dt>
-   <dt>U+0027 APOSTROPHE (')</dt>
-   <dd><span>Parse error</span>. Treat it as per the "anything else"
-   entry below.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Emit the current tag
-   token. Reconsume the EOF character in the <span>data
-   state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd>Start a new attribute in the current tag token. Set that
-   attribute's name to the <span>current input character</span>, and its value to
-   the empty string. Switch to the <span>attribute name
-   state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>Before attribute value state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0009 CHARACTER TABULATION</dt>
-   <dt>U+000A LINE FEED (LF)</dt>
-   <dt>U+000C FORM FEED (FF)</dt>
-   <!--<dt>U+000D CARRIAGE RETURN (CR)</dt>-->
-   <dt>U+0020 SPACE</dt>
-   <dd>Stay in the <span>before attribute value state</span>.</dd>
-
-   <dt>U+0022 QUOTATION MARK (&quot;)</dt>
-   <dd>Switch to the <span>attribute value (double-quoted) state</span>.</dd>
-
-   <dt>U+0026 AMPERSAND (&amp;)</dt>
-   <dd>Switch to the <span>attribute value (unquoted) state</span>
-   and reconsume this input character.</dd>
-
-   <dt>U+0027 APOSTROPHE (')</dt>
-   <dd>Switch to the <span>attribute value (single-quoted) state</span>.</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd><span>Parse error</span>. Emit the current tag token. Switch to
-   the <span>data state</span>.</dd>
-
-   <dt>U+003D EQUALS SIGN (=)</dt>
-   <dd><span>Parse error</span>. Treat it as per the "anything else"
-   entry below.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Emit the current tag
-   token. Reconsume the character in the <span>data
-   state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd>Append the <span>current input character</span> to the current attribute's
-   value. Switch to the <span>attribute value (unquoted)
-   state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>Attribute value (double-quoted) state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0022 QUOTATION MARK (&quot;)</dt>
-   <dd>Switch to the <span>after attribute value (quoted)
-   state</span>.</dd>
-
-   <dt>U+0026 AMPERSAND (&amp;)</dt>
-   <dd>Switch to the <span>character reference in attribute value
-   state</span>, with the <span>additional allowed character</span>
-   being U+0022 QUOTATION MARK (&quot;).</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Emit the current tag
-   token. Reconsume the character in the <span>data
-   state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd>Append the <span>current input character</span> to the current attribute's
-   value. Stay in the <span>attribute value (double-quoted)
-   state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>Attribute value (single-quoted) state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0027 APOSTROPHE (')</dt>
-   <dd>Switch to the <span>after attribute value (quoted)
-   state</span>.</dd>
-
-   <dt>U+0026 AMPERSAND (&amp;)</dt>
-   <dd>Switch to the <span>character reference in attribute value
-   state</span>, with the <span>additional allowed character</span>
-   being U+0027 APOSTROPHE (').</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Emit the current tag
-   token. Reconsume the character in the <span>data
-   state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd>Append the <span>current input character</span> to the current attribute's
-   value. Stay in the <span>attribute value (single-quoted)
-   state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>Attribute value (unquoted) state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0009 CHARACTER TABULATION</dt>
-   <dt>U+000A LINE FEED (LF)</dt>
-   <dt>U+000C FORM FEED (FF)</dt>
-   <!--<dt>U+000D CARRIAGE RETURN (CR)</dt>-->
-   <dt>U+0020 SPACE</dt>
-   <dd>Switch to the <span>before attribute name state</span>.</dd>
-
-   <dt>U+0026 AMPERSAND (&amp;)</dt>
-   <dd>Switch to the <span>character reference in attribute value
-   state</span>, with no <span>additional allowed
-   character</span>.</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd>Emit the current tag token. Switch to the <span>data
-   state</span>.</dd>
-
-   <dt>U+0022 QUOTATION MARK (&quot;)</dt>
-   <dt>U+0027 APOSTROPHE (')</dt>
-   <dt>U+003D EQUALS SIGN (=)</dt>
-   <dd><span>Parse error</span>. Treat it as per the "anything else"
-   entry below.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Emit the current tag
-   token. Reconsume the character in the <span>data
-   state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd>Append the <span>current input character</span> to the current attribute's
-   value. Stay in the <span>attribute value (unquoted)
-   state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>Character reference in attribute value state</dfn></h5>
-
-  <p>Attempt to <span>consume a character reference</span>.</p>
-
-  <p>If nothing is returned, append a U+0026 AMPERSAND character to
-  the current attribute's value.</p>
-
-  <p>Otherwise, append the returned character token to the current
-  attribute's value.</p>
-
-  <p>Finally, switch back to the attribute value state that you were
-  in when were switched into this state.</p>
-
-
-  <h5><dfn>After attribute value (quoted) state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0009 CHARACTER TABULATION</dt>
-   <dt>U+000A LINE FEED (LF)</dt>
-   <dt>U+000C FORM FEED (FF)</dt>
-   <!--<dt>U+000D CARRIAGE RETURN (CR)</dt>-->
-   <dt>U+0020 SPACE</dt>
-   <dd>Switch to the <span>before attribute name state</span>.</dd>
-
-   <dt>U+002F SOLIDUS (/)</dt>
-   <dd>Switch to the <span>self-closing start tag state</span>.</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd>Emit the current tag token. Switch to the <span>data
-   state</span>.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Emit the current tag
-   token. Reconsume the EOF character in the <span>data
-   state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd><span>Parse error</span>. Reconsume the character in
-   the <span>before attribute name state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>Self-closing start tag state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd>Set the <i>self-closing flag</i> of the current tag
-   token. Emit the current tag token. Switch to the <span>data
-   state</span>.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Emit the current tag
-   token. Reconsume the EOF character in the <span>data
-   state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd><span>Parse error</span>. Reconsume the character in
-   the <span>before attribute name state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>Bogus comment state</dfn></h5>
-
-  <p><em>(This can only happen if the <span>content model
-  flag</span> is set to the PCDATA state.)</em></p>
-
-  <p>Consume every character up to and including the first U+003E
-  GREATER-THAN SIGN character (&gt;) or the end of the file (EOF),
-  whichever comes first. Emit a comment token whose data is the
-  concatenation of all the characters starting from and including
-  the character that caused the state machine to switch into the
-  bogus comment state, up to and including the character immediately
-  before the last consumed character (i.e. up to the character just
-  before the U+003E or EOF character). (If the comment was started
-  by the end of the file (EOF), the token is empty.)</p>
-
-  <p>Switch to the <span>data state</span>.</p>
-
-  <p>If the end of the file was reached, reconsume the EOF
-  character.</p>
-
-
-  <h5><dfn>Markup declaration open state</dfn></h5>
-
-  <p><em>(This can only happen if the <span>content model
-  flag</span> is set to the PCDATA state.)</em></p>
-
-  <p>If the next two characters are both U+002D HYPHEN-MINUS (-)
-  characters, consume those two characters, create a comment token
-  whose data is the empty string, and switch to the <span>comment
-  start state</span>.</p>
-
-  <p>Otherwise, if the next seven characters are an <span>ASCII
-  case-insensitive</span> match for the word "DOCTYPE", then consume
-  those characters and switch to the <span>DOCTYPE state</span>.</p>
-
-  <p>Otherwise, if the <span>insertion mode</span> is "<span
-  title="insertion mode: in foreign content">in foreign
-  content</span>" and the <span>current node</span> is not an element
-  in the <span>HTML namespace</span> and the next seven characters are
-  an <span>ASCII case-sensitive</span> match for 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 <span>CDATA section state</span> (which is
-  unrelated to the <span>content model flag</span>'s CDATA state).</p>
-
-  <p>Otherwise, this is a <span>parse error</span>. Switch to the
-  <span>bogus comment state</span>. The next character that is
-  consumed, if any, is the first character that will be in the
-  comment.</p>
-
-
-  <h5><dfn>Comment start state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+002D HYPHEN-MINUS (-)</dt>
-   <dd>Switch to the <span>comment start dash state</span>.</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd><span>Parse error</span>. Emit the comment token. Switch to
-   the <span>data state</span>.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Emit the comment token. Reconsume
-   the EOF character in the <span>data state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd>Append the input character to the comment token's
-   data. Switch to the <span>comment state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>Comment start dash state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+002D HYPHEN-MINUS (-)</dt>
-   <dd>Switch to the <span>comment end state</span></dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd><span>Parse error</span>. Emit the comment token. Switch to
-   the <span>data state</span>.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Emit the comment token. Reconsume
-   the EOF character in the <span>data state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd>Append a U+002D HYPHEN-MINUS (-) character and the input
-   character to the comment token's data. Switch to the
-   <span>comment state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn id="comment">Comment state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+002D HYPHEN-MINUS (-)</dt>
-   <dd>Switch to the <span>comment end dash state</span></dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Emit the comment token. Reconsume
-   the EOF character in the <span>data state</span>.</dd> <!-- For
-   security reasons: otherwise, hostile user could put a <script> in
-   a comment e.g. in a blog comment and then DOS the server so that
-   the end tag isn't read, and then the commented <script> tag would
-   be treated as live code -->
-
-   <dt>Anything else</dt>
-   <dd>Append the input character to the comment token's data. Stay
-   in the <span>comment state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>Comment end dash state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+002D HYPHEN-MINUS (-)</dt>
-   <dd>Switch to the <span>comment end state</span></dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Emit the comment token. Reconsume
-   the EOF character in the <span>data state</span>.</dd> <!-- For
-   security reasons: otherwise, hostile user could put a <script> in
-   a comment e.g. in a blog comment and then DOS the server so that
-   the end tag isn't read, and then the commented <script> tag would
-   be treated as live code -->
-
-   <dt>Anything else</dt>
-   <dd>Append a U+002D HYPHEN-MINUS (-) character and the input
-   character to the comment token's data. Switch to the
-   <span>comment state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>Comment end state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd>Emit the comment token. Switch to the <span>data
-   state</span>.</dd>
-
-   <dt>U+002D HYPHEN-MINUS (-)</dt>
-   <dd><span>Parse error</span>. Append a U+002D HYPHEN-MINUS
-   (-) character to the comment token's data. Stay in the
-   <span>comment end state</span>.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Emit the comment token. Reconsume
-   the EOF character in the <span>data state</span>.</dd> <!-- For
-   security reasons: otherwise, hostile user could put a <script> in
-   a comment e.g. in a blog comment and then DOS the server so that
-   the end tag isn't read, and then the commented <script> tag would
-   be treated as live code -->
-
-   <dt>Anything else</dt>
-   <dd><span>Parse error</span>. Append two U+002D HYPHEN-MINUS (-)
-   characters and the input character to the comment token's
-   data. Switch to the <span>comment state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>DOCTYPE state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0009 CHARACTER TABULATION</dt>
-   <dt>U+000A LINE FEED (LF)</dt>
-   <dt>U+000C FORM FEED (FF)</dt>
-   <!--<dt>U+000D CARRIAGE RETURN (CR)</dt>-->
-   <dt>U+0020 SPACE</dt>
-   <dd>Switch to the <span>before DOCTYPE name state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd><span>Parse error</span>. Reconsume the current
-   character in the <span>before DOCTYPE name state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>Before DOCTYPE name state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0009 CHARACTER TABULATION</dt>
-   <dt>U+000A LINE FEED (LF)</dt>
-   <dt>U+000C FORM FEED (FF)</dt>
-   <!--<dt>U+000D CARRIAGE RETURN (CR)</dt>-->
-   <dt>U+0020 SPACE</dt>
-   <dd>Stay in the <span>before DOCTYPE name state</span>.</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd><span>Parse error</span>. Create a new DOCTYPE token. Set its
-   <i>force-quirks flag</i> to <i>on</i>. Emit the token. Switch to
-   the <span>data state</span>.</dd>
-
-   <dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL LETTER Z</dt>
-   <dd>Create a new DOCTYPE token. Set the token's name to the
-   lowercase version of the input character (add 0x0020 to the
-   character's code point). Switch to the <span>DOCTYPE name
-   state</span>.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Create a new DOCTYPE token. Set its
-   <i>force-quirks flag</i> to <i>on</i>. Emit the token. Reconsume
-   the EOF character in the <span>data state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd>Create a new DOCTYPE token. Set the token's name to the
-   <span>current input character</span>. Switch to the <span>DOCTYPE name
-   state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>DOCTYPE name state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0009 CHARACTER TABULATION</dt>
-   <dt>U+000A LINE FEED (LF)</dt>
-   <dt>U+000C FORM FEED (FF)</dt>
-   <!--<dt>U+000D CARRIAGE RETURN (CR)</dt>-->
-   <dt>U+0020 SPACE</dt>
-   <dd>Switch to the <span>after DOCTYPE name state</span>.</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd>Emit the current DOCTYPE token. Switch to the <span>data
-   state</span>.</dd>
-
-   <dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL LETTER Z</dt>
-   <dd>Append the lowercase version of the input character (add 0x0020
-   to the character's code point) to the current DOCTYPE token's
-   name. Stay in the <span>DOCTYPE name state</span>.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Set the DOCTYPE token's
-   <i>force-quirks flag</i> to <i>on</i>. Emit that DOCTYPE token.
-   Reconsume the EOF character in the <span>data state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd>Append the <span>current input character</span> to the current DOCTYPE
-   token's name. Stay in the <span>DOCTYPE name state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>After DOCTYPE name state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0009 CHARACTER TABULATION</dt>
-   <dt>U+000A LINE FEED (LF)</dt>
-   <dt>U+000C FORM FEED (FF)</dt>
-   <!--<dt>U+000D CARRIAGE RETURN (CR)</dt>-->
-   <dt>U+0020 SPACE</dt>
-   <dd>Stay in the <span>after DOCTYPE name state</span>.</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd>Emit the current DOCTYPE token. Switch to the <span>data
-   state</span>.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Set the DOCTYPE token's
-   <i>force-quirks flag</i> to <i>on</i>. Emit that DOCTYPE token.
-   Reconsume the EOF character in the <span>data state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd>
-
-    <p>If the six characters starting from the <span>current input
-    character</span> are an <span>ASCII case-insensitive</span> match
-    for the word "PUBLIC", then consume those characters and switch to
-    the <span>before DOCTYPE public identifier state</span>.</p>
-
-    <p>Otherwise, if the six characters starting from the
-    <span>current input character</span> are an <span>ASCII
-    case-insensitive</span> match for the word "SYSTEM", then consume
-    those characters and switch to the <span>before DOCTYPE system
-    identifier state</span>.</p>
-
-    <p>Otherwise, this is the <span>parse error</span>. Set the
-    DOCTYPE token's <i>force-quirks flag</i> to <i>on</i>. Switch to
-    the <span>bogus DOCTYPE state</span>.</p>
-
-   </dd>
-
-  </dl>
-
-
-  <h5><dfn>Before DOCTYPE public identifier state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0009 CHARACTER TABULATION</dt>
-   <dt>U+000A LINE FEED (LF)</dt>
-   <dt>U+000C FORM FEED (FF)</dt>
-   <!--<dt>U+000D CARRIAGE RETURN (CR)</dt>-->
-   <dt>U+0020 SPACE</dt>
-   <dd>Stay in the <span>before DOCTYPE public identifier state</span>.</dd>
-
-   <dt>U+0022 QUOTATION MARK (&quot;)</dt>
-   <dd>Set the DOCTYPE token's public identifier to the empty string
-   (not missing), then switch to the <span>DOCTYPE public identifier
-   (double-quoted) state</span>.</dd>
-
-   <dt>U+0027 APOSTROPHE (')</dt>
-   <dd>Set the DOCTYPE token's public identifier to the empty string
-   (not missing), then switch to the <span>DOCTYPE public identifier
-   (single-quoted) state</span>.</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd><span>Parse error</span>. Set the DOCTYPE token's
-   <i>force-quirks flag</i> to <i>on</i>. Emit that DOCTYPE
-   token. Switch to the <span>data state</span>.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Set the DOCTYPE token's
-   <i>force-quirks flag</i> to <i>on</i>. Emit that DOCTYPE token.
-   Reconsume the EOF character in the <span>data state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd><span>Parse error</span>.  Set the DOCTYPE token's
-   <i>force-quirks flag</i> to <i>on</i>. Switch to the <span>bogus
-   DOCTYPE state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>DOCTYPE public identifier (double-quoted) state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0022 QUOTATION MARK (&quot;)</dt>
-   <dd>Switch to the <span>after DOCTYPE public identifier state</span>.</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd><span>Parse error</span>. Set the DOCTYPE token's
-   <i>force-quirks flag</i> to <i>on</i>. Emit that DOCTYPE
-   token. Switch to the <span>data state</span>.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Set the DOCTYPE token's
-   <i>force-quirks flag</i> to <i>on</i>. Emit that DOCTYPE token.
-   Reconsume the EOF character in the <span>data state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd>Append the <span>current input character</span> to the current DOCTYPE
-   token's public identifier. Stay in the <span>DOCTYPE public
-   identifier (double-quoted) state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>DOCTYPE public identifier (single-quoted) state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0027 APOSTROPHE (')</dt>
-   <dd>Switch to the <span>after DOCTYPE public identifier state</span>.</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd><span>Parse error</span>. Set the DOCTYPE token's
-   <i>force-quirks flag</i> to <i>on</i>. Emit that DOCTYPE
-   token. Switch to the <span>data state</span>.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Set the DOCTYPE token's
-   <i>force-quirks flag</i> to <i>on</i>. Emit that DOCTYPE token.
-   Reconsume the EOF character in the <span>data state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd>Append the <span>current input character</span> to the current DOCTYPE
-   token's public identifier. Stay in the <span>DOCTYPE public
-   identifier (single-quoted) state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>After DOCTYPE public identifier state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0009 CHARACTER TABULATION</dt>
-   <dt>U+000A LINE FEED (LF)</dt>
-   <dt>U+000C FORM FEED (FF)</dt>
-   <!--<dt>U+000D CARRIAGE RETURN (CR)</dt>-->
-   <dt>U+0020 SPACE</dt>
-   <dd>Stay in the <span>after DOCTYPE public identifier state</span>.</dd>
-
-   <dt>U+0022 QUOTATION MARK (&quot;)</dt>
-   <dd>Set the DOCTYPE token's system identifier to the empty string
-   (not missing), then switch to the <span>DOCTYPE system identifier
-   (double-quoted) state</span>.</dd>
-
-   <dt>U+0027 APOSTROPHE (')</dt>
-   <dd>Set the DOCTYPE token's system identifier to the empty string
-   (not missing), then switch to the <span>DOCTYPE system identifier
-   (single-quoted) state</span>.</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd>Emit the current DOCTYPE token. Switch to the <span>data
-   state</span>.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Set the DOCTYPE token's
-   <i>force-quirks flag</i> to <i>on</i>. Emit that DOCTYPE token.
-   Reconsume the EOF character in the <span>data state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd><span>Parse error</span>. Set the DOCTYPE token's
-   <i>force-quirks flag</i> to <i>on</i>. Switch to the <span>bogus
-   DOCTYPE state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>Before DOCTYPE system identifier state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0009 CHARACTER TABULATION</dt>
-   <dt>U+000A LINE FEED (LF)</dt>
-   <dt>U+000C FORM FEED (FF)</dt>
-   <!--<dt>U+000D CARRIAGE RETURN (CR)</dt>-->
-   <dt>U+0020 SPACE</dt>
-   <dd>Stay in the <span>before DOCTYPE system identifier state</span>.</dd>
-
-   <dt>U+0022 QUOTATION MARK (&quot;)</dt>
-   <dd>Set the DOCTYPE token's system identifier to the empty string
-   (not missing), then switch to the <span>DOCTYPE system identifier
-   (double-quoted) state</span>.</dd>
-
-   <dt>U+0027 APOSTROPHE (')</dt>
-   <dd>Set the DOCTYPE token's system identifier to the empty string
-   (not missing), then switch to the <span>DOCTYPE system identifier
-   (single-quoted) state</span>.</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd><span>Parse error</span>. Set the DOCTYPE token's
-   <i>force-quirks flag</i> to <i>on</i>. Emit that DOCTYPE
-   token. Switch to the <span>data state</span>.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Set the DOCTYPE token's
-   <i>force-quirks flag</i> to <i>on</i>. Emit that DOCTYPE token.
-   Reconsume the EOF character in the <span>data state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd><span>Parse error</span>. Set the DOCTYPE token's
-   <i>force-quirks flag</i> to <i>on</i>. Switch to the <span>bogus
-   DOCTYPE state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>DOCTYPE system identifier (double-quoted) state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0022 QUOTATION MARK (&quot;)</dt>
-   <dd>Switch to the <span>after DOCTYPE system identifier state</span>.</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd><span>Parse error</span>. Set the DOCTYPE token's
-   <i>force-quirks flag</i> to <i>on</i>. Emit that DOCTYPE
-   token. Switch to the <span>data state</span>.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Set the DOCTYPE token's
-   <i>force-quirks flag</i> to <i>on</i>. Emit that DOCTYPE token.
-   Reconsume the EOF character in the <span>data state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd>Append the <span>current input character</span> to the current DOCTYPE
-   token's system identifier. Stay in the <span>DOCTYPE system
-   identifier (double-quoted) state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>DOCTYPE system identifier (single-quoted) state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0027 APOSTROPHE (')</dt>
-   <dd>Switch to the <span>after DOCTYPE system identifier state</span>.</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd><span>Parse error</span>. Set the DOCTYPE token's
-   <i>force-quirks flag</i> to <i>on</i>. Emit that DOCTYPE
-   token. Switch to the <span>data state</span>.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Set the DOCTYPE token's
-   <i>force-quirks flag</i> to <i>on</i>. Emit that DOCTYPE token.
-   Reconsume the EOF character in the <span>data state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd>Append the <span>current input character</span> to the current DOCTYPE
-   token's system identifier. Stay in the <span>DOCTYPE system
-   identifier (single-quoted) state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>After DOCTYPE system identifier state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+0009 CHARACTER TABULATION</dt>
-   <dt>U+000A LINE FEED (LF)</dt>
-   <dt>U+000C FORM FEED (FF)</dt>
-   <!--<dt>U+000D CARRIAGE RETURN (CR)</dt>-->
-   <dt>U+0020 SPACE</dt>
-   <dd>Stay in the <span>after DOCTYPE system identifier state</span>.</dd>
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd>Emit the current DOCTYPE token. Switch to the <span>data
-   state</span>.</dd>
-
-   <dt>EOF</dt>
-   <dd><span>Parse error</span>. Set the DOCTYPE token's
-   <i>force-quirks flag</i> to <i>on</i>. Emit that DOCTYPE token.
-   Reconsume the EOF character in the <span>data state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd><span>Parse error</span>. Switch to the <span>bogus DOCTYPE
-   state</span>. (This does <em>not</em> set the DOCTYPE token's
-   <i>force-quirks flag</i> to <i>on</i>.)</dd>
-
-  </dl>
-
-
-  <h5><dfn>Bogus DOCTYPE state</dfn></h5>
-
-  <p>Consume the <span>next input character</span>:</p>
-
-  <dl class="switch">
-
-   <dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
-   <dd>Emit the DOCTYPE token. Switch to the <span>data
-   state</span>.</dd>
-
-   <dt>EOF</dt>
-   <dd>Emit the DOCTYPE token. Reconsume the EOF character in the
-   <span>data state</span>.</dd>
-
-   <dt>Anything else</dt>
-   <dd>Stay in the <span>bogus DOCTYPE state</span>.</dd>
-
-  </dl>
-
-
-  <h5><dfn>CDATA section state</dfn></h5>
-
-  <p><em>(This can only happen if the <span>content model
-  flag</span> is set to the PCDATA state, and is unrelated to the
-  <span>content model flag</span>'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
-  BRACKET U+003E GREATER-THAN SIGN (<code title="">]]></code>), or the
-  end of the file (EOF), whichever comes first. Emit a series of
-  character tokens consisting of all the characters consumed except
-  the matching three character sequence at the end (if one was found
-  before the end of the file).</p>
-
-  <p>Switch to the <span>data state</span>.</p>
-
-  <p>If the end of the file was reached, reconsume the EOF
-  character.</p>
-
-
-
-  <h5>Tokenizing character references</h5>
-
-  <p>This section defines how to <dfn>consume a character
-  reference</dfn>. This definition is used when parsing character
-  references <span title="character reference data state">in
-  text</span> and <span title="character reference in attribute value
-  state">in attributes</span>.</p>
-
-  <p>The behavior depends on the identity of the next character (the
-  one immediately after the U+0026 AMPERSAND character):</p>
-
-  <dl class="switch">
-
-   <dt>U+0009 CHARACTER TABULATION</dt>
-   <dt>U+000A LINE FEED (LF)</dt>
-   <dt>U+000C FORM FEED (FF)</dt>
-   <!--<dt>U+000D CARRIAGE RETURN (CR)</dt>-->
-   <dt>U+0020 SPACE</dt>
-   <dt>U+003C LESS-THAN SIGN</dt>
-   <dt>U+0026 AMPERSAND</dt>
-   <dt>EOF</dt>
-   <dt>The <dfn>additional allowed character</dfn>, if there is one</dt>
-
-   <dd>Not a character reference. No characters are consumed, and
-   nothing is returned. (This is not an error, either.)</dd>
-
-
-   <dt>U+0023 NUMBER SIGN (#)</dt>
-
-   <dd>
-
-    <p>Consume the U+0023 NUMBER SIGN.</p>
-
-    <p>The behavior further depends on the character after the U+0023
-    NUMBER SIGN:</p>
-
-    <dl class="switch">
-
-     <dt>U+0078 LATIN SMALL LETTER X</dt>
-     <dt>U+0058 LATIN CAPITAL LETTER X</dt>
-
-     <dd>
-
-      <p>Consume the X.</p>
-
-      <p>Follow the steps below, but using the range of characters
-      U+0030 DIGIT ZERO through to U+0039 DIGIT NINE, U+0061 LATIN
-      SMALL LETTER A through to U+0066 LATIN SMALL LETTER F, and
-      U+0041 LATIN CAPITAL LETTER A, through to U+0046 LATIN CAPITAL
-      LETTER F (in other words, 0-9, A-F, a-f).</p>
-
-      <p>When it comes to interpreting the number, interpret it as a
-      hexadecimal number.</p>
-
-     </dd>
-
-
-     <dt>Anything else</dt>
-
-     <dd>
-
-      <p>Follow the steps below, but using the range of characters
-      U+0030 DIGIT ZERO through to U+0039 DIGIT NINE (i.e. just
-      0-9).</p>
-
-      <p>When it comes to interpreting the number, interpret it as a
-      decimal number.</p>
-
-     </dd>
-
-    </dl>
-
-    <p>Consume as many characters as match the range of characters
-    given above.</p>
-
-    <p>If no characters match the range, then don't consume any
-    characters (and unconsume the U+0023 NUMBER SIGN character and, if
-    appropriate, the X character). This is a <span>parse
-    error</span>; nothing is returned.</p>
-
-    <p>Otherwise, if the next character is a U+003B SEMICOLON, consume
-    that too. If it isn't, there is a <span>parse
-    error</span>.</p>
-
-    <p>If one or more characters match the range, then take them all
-    and interpret the string of characters as a number (either
-    hexadecimal or decimal as appropriate).</p>
-
-    <p>If that number is one of the numbers in the first column of the
-    following table, then this is a <span>parse error</span>. Find the
-    row with that number in the first column, and return a character
-    token for the Unicode character given in the second column of that
-    row.</p>
-
-    <table>
-     <thead>
-      <tr><th>Number <th colspan=2>Unicode character
-     <tbody>
-      <tr><td>0x0D <td>U+000A <td>LINE FEED (LF)
-      <tr><td>0x80 <td>U+20AC <td>EURO SIGN ('&#x20AC;')
-      <tr><td>0x81 <td>U+FFFD <td>REPLACEMENT CHARACTER
-      <tr><td>0x82 <td>U+201A <td>SINGLE LOW-9 QUOTATION MARK ('&#x201A;')
-      <tr><td>0x83 <td>U+0192 <td>LATIN SMALL LETTER F WITH HOOK ('&#x0192;')
-      <tr><td>0x84 <td>U+201E <td>DOUBLE LOW-9 QUOTATION MARK ('&#x201E;')
-      <tr><td>0x85 <td>U+2026 <td>HORIZONTAL ELLIPSIS ('&#x2026;')
-      <tr><td>0x86 <td>U+2020 <td>DAGGER ('&#x2020;')
-      <tr><td>0x87 <td>U+2021 <td>DOUBLE DAGGER ('&#x2021;')
-      <tr><td>0x88 <td>U+02C6 <td>MODIFIER LETTER CIRCUMFLEX ACCENT ('&#x02C6;')
-      <tr><td>0x89 <td>U+2030 <td>PER MILLE SIGN ('&#x2030;')
-      <tr><td>0x8A <td>U+0160 <td>LATIN CAPITAL LETTER S WITH CARON ('&#x0160;')
-      <tr><td>0x8B <td>U+2039 <td>SINGLE LEFT-POINTING ANGLE QUOTATION MARK ('&#x2039;')
-      <tr><td>0x8C <td>U+0152 <td>LATIN CAPITAL LIGATURE OE ('&#x0152;')
-      <tr><td>0x8D <td>U+FFFD <td>REPLACEMENT CHARACTER
-      <tr><td>0x8E <td>U+017D <td>LATIN CAPITAL LETTER Z WITH CARON ('&#x017D;')
-      <tr><td>0x8F <td>U+FFFD <td>REPLACEMENT CHARACTER
-      <tr><td>0x90 <td>U+FFFD <td>REPLACEMENT CHARACTER
-      <tr><td>0x91 <td>U+2018 <td>LEFT SINGLE QUOTATION MARK ('&#x2018;')
-      <tr><td>0x92 <td>U+2019 <td>RIGHT SINGLE QUOTATION MARK ('&#x2019;')
-      <tr><td>0x93 <td>U+201C <td>LEFT DOUBLE QUOTATION MARK ('&#x201C;')
-      <tr><td>0x94 <td>U+201D <td>RIGHT DOUBLE QUOTATION MARK ('&#x201D;')
-      <tr><td>0x95 <td>U+2022 <td>BULLET ('&#x2022;')
-      <tr><td>0x96 <td>U+2013 <td>EN DASH ('&#x2013;')
-      <tr><td>0x97 <td>U+2014 <td>EM DASH ('&#x2014;')
-      <tr><td>0x98 <td>U+02DC <td>SMALL TILDE ('&#x02DC;')
-      <tr><td>0x99 <td>U+2122 <td>TRADE MARK SIGN ('&#x2122;')
-      <tr><td>0x9A <td>U+0161 <td>LATIN SMALL LETTER S WITH CARON ('&#x0161;')
-      <tr><td>0x9B <td>U+203A <td>SINGLE RIGHT-POINTING ANGLE QUOTATION MARK ('&#x203A;')
-      <tr><td>0x9C <td>U+0153 <td>LATIN SMALL LIGATURE OE ('&#x0153;')
-      <tr><td>0x9D <td>U+FFFD <td>REPLACEMENT CHARACTER
-      <tr><td>0x9E <td>U+017E <td>LATIN SMALL LETTER Z WITH CARON ('&#x017E;')
-      <tr><td>0x9F <td>U+0178 <td>LATIN CAPITAL LETTER Y WITH DIAERESIS ('&#x0178;')
-    </table>
-
-    <!-- this is the same as the equivalent list in the input stream
-    section, except it has 0x0000 included in the first range. -->
-    <p>Otherwise, if the number is in the range 0x0000 to 0x0008, <!--
-    HT, LF allowed --> <!-- U+000B is in the next list --> <!-- FF, CR
-    allowed --> 0x000E to 0x001F, <!-- ASCII allowed --> 0x007F <!--to
-    0x0084, (0x0085 NEL not allowed), 0x0086--> to 0x009F, 0xD800 to
-    0xDFFF<!-- surrogates not allowed -->, 0xFDD0 to 0xFDEF, or is one
-    of 0x000B, 0xFFFE, 0xFFFF, 0x1FFFE, 0x1FFFF, 0x2FFFE, 0x2FFFF,
-    0x3FFFE, 0x3FFFF, 0x4FFFE, 0x4FFFF, 0x5FFFE, 0x5FFFF, 0x6FFFE,
-    0x6FFFF, 0x7FFFE, 0x7FFFF, 0x8FFFE, 0x8FFFF, 0x9FFFE, 0x9FFFF,
-    0xAFFFE, 0xAFFFF, 0xBFFFE, 0xBFFFF, 0xCFFFE, 0xCFFFF, 0xDFFFE,
-    0xDFFFF, 0xEFFFE, 0xEFFFF, 0xFFFFE, 0xFFFFF, 0x10FFFE, or
-    0x10FFFF, or is higher than 0x10FFFF, then this is a <span>parse
-    error</span>; return a character token for the U+FFFD REPLACEMENT
-    CHARACTER character instead.</p>
-
-    <p>Otherwise, return a character token for the Unicode character
-    whose code point is that number.</p>
-
-   </dd>
-
-
-   <dt>Anything else</dt>
-
-   <dd>
-
-    <p>Consume the maximum number of characters possible, with the
-    consumed characters matching one of the identifiers in the first
-    column of the <span>named character references</span> table (in a
-    <span>case-sensitive</span> manner).</p>
-
-    <p>If no match can be made, then this is a <span>parse
-    error</span>. No characters are consumed, and nothing is
-    returned.</p>
-
-    <p>If the last character matched is not a U+003B SEMICOLON (<code
-    title="">;</code>), there is a <span>parse error</span>.</p>
-
-    <p>If the character reference is being consumed <span
-    title="character reference in attribute value state">as part of an
-    attribute</span>, and the last character matched is not a U+003B
-    SEMICOLON (<code title="">;</code>), and the next character is in
-    the range U+0030 DIGIT ZERO to U+0039 DIGIT NINE, U+0041 LATIN
-    CAPITAL LETTER A to U+005A LATIN CAPITAL LETTER Z, or U+0061 LATIN
-    SMALL LETTER A to U+007A LATIN SMALL LETTER Z, then, for
-    historical reasons, all the characters that were matched after the
-    U+0026 AMPERSAND (&amp;) must be unconsumed, and nothing is
-    returned.</p>
-
-    <p>Otherwise, return a character token for the character
-    corresponding to the character reference name (as given by the
-    second column of the <span>named character references</span>
-    table).</p>
-
-    <div class="example">
-
-     <p>If the markup contains <code title="">I'm &amp;notit; I tell
-     you</code>, the character reference is parsed as "not", as in,
-     <code title="">I'm &not;it; I tell you</code>. But if the markup
-     was <code title="">I'm &amp;notin; I tell you</code>, the
-     character reference would be parsed as "notin;", resulting in
-     <code title="">I'm &notin; I tell you</code>.</p>
-
-    </div>
-
-   </dd>
-
-  </dl>
-
-
-
-  <h4><dfn>Tree construction</dfn></h4>
-
-  <p>The input to the tree construction stage is a sequence of tokens
-  from the <span>tokenization</span> stage. The tree construction
-  stage is associated with a DOM <code>Document</code> object when a
-  parser is created. The "output" of this stage consists of
-  dynamically modifying or extending that document's DOM tree.</p>
-
-  <p>This specification does not define when an interactive user agent
-  has to render the <code>Document</code> so that it is available to
-  the user, or when it has to begin accepting user input.</p>
-
-  <p>As each token is emitted from the tokeniser, the user agent must
-  process the token according to the rules given in the section
-  corresponding to the current <span>insertion mode</span>.</p>
-
-  <p>When the steps below require the UA to <dfn>insert a
-  character</dfn> into a node, if that node has a child immediately
-  before where the character is to be inserted, and that child is a
-  <code>Text</code> node, and that <code>Text</code> node was the last
-  node that the parser inserted into the document, then the character
-  must be appended to that <code>Text</code> node; otherwise, a new
-  <code>Text</code> node whose data is just that character must be
-  inserted in the appropriate place.</p>
-
-  <p id="mutation-during-parsing">DOM mutation events must not fire
-  for changes caused by the UA parsing the document. (Conceptually,
-  the parser is not mutating the DOM, it is constructing it.) This
-  includes the parsing of any content inserted using <code
-  title="dom-document-write">document.write()</code> and <code
-  title="dom-document-writeln">document.writeln()</code> calls. <a
-  href="#refsDOM3EVENTS">[DOM3EVENTS]</a></p>
-
-  <p class="note">Not all of the tag names mentioned below are
-  conformant tag names in this specification; many are included to
-  handle legacy content. They still form part of the algorithm that
-  implementations are required to implement to claim conformance.</p>
-
-  <p class="note">The algorithm described below places no limit on the
-  depth of the DOM tree generated, or on the length of tag names,
-  attribute names, attribute values, text nodes, etc. While
-  implementors are encouraged to avoid arbitrary limits, it is
-  recognized that <a href="#hardwareLimitations">practical
-  concerns</a> will likely force user agents to impose nesting
-  depths.</p>
-
-
-  <h5>Creating and inserting elements</h5>
-
-  <p>When the steps below require the UA to <dfn title="create an
-  element for the token">create an element for a token</dfn> in a
-  particular namespace, the UA must create a node implementing the
-  interface appropriate for the element type corresponding to the tag
-  name of the token in the given namespace (as given in the
-  specification that defines that element, e.g. for an <code>a</code>
-  element in the <span>HTML namespace</span>, this specification
-  defines it to be the <code>HTMLAnchorElement</code> interface), with
-  the tag name being the name of that element, with the node being in
-  the given namespace, and with the attributes on the node being those
-  given in the given token.</p>
-
-  <p>The interface appropriate for an element in the <span>HTML
-  namespace</span> that is not defined in this specification is
-  <code>HTMLElement</code>. The interface appropriate for an element
-  in another namespace that is not defined by that namespace's
-  specification is <code>Element</code>.</p>
-
-  <p>When a <span title="category-reset">resettable</span> element is
-  created in this manner, its <span
-  title="concept-form-reset-control">reset algorithm</span> must be
-  invoked once the attributes are set. (This initializes the element's
-  <span title="concept-fe-value">value</span> and <span
-  title="concept-fe-checked">checkedness</span> based on the element's
-  attributes.)</p>
-
-  <hr>
-
-  <p>When the steps below require the UA to <dfn>insert an HTML
-  element</dfn> for a token, the UA must first <span>create an element
-  for the token</span> in the <span>HTML namespace</span>, and then
-  append this node to the <span>current node</span>, and push it onto
-  the <span>stack of open elements</span> so that it is the new
-  <span>current node</span>.</p>
-
-  <p>The steps below may also require that the UA insert an HTML
-  element in a particular place, in which case the UA must follow the
-  same steps except that it must insert or append the new node in the
-  location specified instead of appending it to the <span>current
-  node</span>. (This happens in particular during the parsing of
-  tables with invalid content.)</p>
-
-  <p>If an element created by the <span>insert an HTML element</span>
-  algorithm is a <span>form-associated element</span>, and the
-  <span><code title="">form</code> element pointer</span> is not null,
-  and the newly created element doesn't have a <code
-  title="attr-fae-form">form</code> attribute, the user agent must
-  <span title="concept-form-association">associate</span> the newly
-  created element with the <code>form</code> element pointed to by the
-  <span><code title="">form</code> element pointer</span> before
-  inserting it wherever it is to be inserted.</p>
-
-  <hr>
-
-  <p>When the steps below require the UA to <dfn>insert a foreign
-  element</dfn> for a token, the UA must first <span>create an element
-  for the token</span> in the given namespace, and then append this
-  node to the <span>current node</span>, and push it onto the
-  <span>stack of open elements</span> so that it is the new
-  <span>current node</span>. If the newly created element has an <code
-  title="">xmlns</code> attribute in the <span>XMLNS namespace</span>
-  whose value is not exactly the same as the element's namespace, that
-  is a <span>parse error</span>. Similarly, if the newly created
-  element has an <code title="">xmlns:xlink</code> attribute in the
-  <span>XMLNS namespace</span> whose value is not the <span>XLink
-  Namespace</span>, that is a <span>parse error</span>.</p>
-
-  <p>When the steps below require the user agent to <dfn>adjust MathML
-  attributes</dfn> for a token, then, if the token has an attribute
-  named <code title="">definitionurl</code>, change its name to <code
-  title="">definitionURL</code> (note the case difference).</p>
-
-  <p>When the steps below require the user agent to <dfn>adjust SVG
-  attributes</dfn> for a token, then, for each attribute on the token
-  whose attribute name is one of the ones in the first column of the
-  following table, change the attribute's name to the name given in
-  the corresponding cell in the second column. (This fixes the case of
-  SVG attributes that are not all lowercase.)</p>
-
-  <table>
-   <thead>
-    <tr> <th> Attribute name on token <th> Attribute name on element
-   <tbody>
-    <tr> <td> <code title="">attributename</code> <td> <code title="">attributeName</code>
-    <tr> <td> <code title="">attributetype</code> <td> <code title="">attributeType</code>
-    <tr> <td> <code title="">basefrequency</code> <td> <code title="">baseFrequency</code>
-    <tr> <td> <code title="">baseprofile</code> <td> <code title="">baseProfile</code>
-    <tr> <td> <code title="">calcmode</code> <td> <code title="">calcMode</code>
-    <tr> <td> <code title="">clippathunits</code> <td> <code title="">clipPathUnits</code>
-    <tr> <td> <code title="">contentscripttype</code> <td> <code title="">contentScriptType</code>
-    <tr> <td> <code title="">contentstyletype</code> <td> <code title="">contentStyleType</code>
-    <tr> <td> <code title="">diffuseconstant</code> <td> <code title="">diffuseConstant</code>
-    <tr> <td> <code title="">edgemode</code> <td> <code title="">edgeMode</code>
-    <tr> <td> <code title="">externalresourcesrequired</code> <td> <code title="">externalResourcesRequired</code>
-    <tr> <td> <code title="">filterres</code> <td> <code title="">filterRes</code>
-    <tr> <td> <code title="">filterunits</code> <td> <code title="">filterUnits</code>
-    <tr> <td> <code title="">glyphref</code> <td> <code title="">glyphRef</code>
-    <tr> <td> <code title="">gradienttransform</code> <td> <code title="">gradientTransform</code>
-    <tr> <td> <code title="">gradientunits</code> <td> <code title="">gradientUnits</code>
-    <tr> <td> <code title="">kernelmatrix</code> <td> <code title="">kernelMatrix</code>
-    <tr> <td> <code title="">kernelunitlength</code> <td> <code title="">kernelUnitLength</code>
-    <tr> <td> <code title="">keypoints</code> <td> <code title="">keyPoints</code>
-    <tr> <td> <code title="">keysplines</code> <td> <code title="">keySplines</code>
-    <tr> <td> <code title="">keytimes</code> <td> <code title="">keyTimes</code>
-    <tr> <td> <code title="">lengthadjust</code> <td> <code title="">lengthAdjust</code>
-    <tr> <td> <code title="">limitingconeangle</code> <td> <code title="">limitingConeAngle</code>
-    <tr> <td> <code title="">markerheight</code> <td> <code title="">markerHeight</code>
-    <tr> <td> <code title="">markerunits</code> <td> <code title="">markerUnits</code>
-    <tr> <td> <code title="">markerwidth</code> <td> <code title="">markerWidth</code>
-    <tr> <td> <code title="">maskcontentunits</code> <td> <code title="">maskContentUnits</code>
-    <tr> <td> <code title="">maskunits</code> <td> <code title="">maskUnits</code>
-    <tr> <td> <code title="">numoctaves</code> <td> <code title="">numOctaves</code>
-    <tr> <td> <code title="">pathlength</code> <td> <code title="">pathLength</code>
-    <tr> <td> <code title="">patterncontentunits</code> <td> <code title="">patternContentUnits</code>
-    <tr> <td> <code title="">patterntransform</code> <td> <code title="">patternTransform</code>
-    <tr> <td> <code title="">patternunits</code> <td> <code title="">patternUnits</code>
-    <tr> <td> <code title="">pointsatx</code> <td> <code title="">pointsAtX</code>
-    <tr> <td> <code title="">pointsaty</code> <td> <code title="">pointsAtY</code>
-    <tr> <td> <code title="">pointsatz</code> <td> <code title="">pointsAtZ</code>
-    <tr> <td> <code title="">preservealpha</code> <td> <code title="">preserveAlpha</code>
-    <tr> <td> <code title="">preserveaspectratio</code> <td> <code title="">preserveAspectRatio</code>
-    <tr> <td> <code title="">primitiveunits</code> <td> <code title="">primitiveUnits</code>
-    <tr> <td> <code title="">refx</code> <td> <code title="">refX</code>
-    <tr> <td> <code title="">refy</code> <td> <code title="">refY</code>
-    <tr> <td> <code title="">repeatcount</code> <td> <code title="">repeatCount</code>
-    <tr> <td> <code title="">repeatdur</code> <td> <code title="">repeatDur</code>
-    <tr> <td> <code title="">requiredextensions</code> <td> <code title="">requiredExtensions</code>
-    <tr> <td> <code title="">requiredfeatures</code> <td> <code title="">requiredFeatures</code>
-    <tr> <td> <code title="">specularconstant</code> <td> <code title="">specularConstant</code>
-    <tr> <td> <code title="">specularexponent</code> <td> <code title="">specularExponent</code>
-    <tr> <td> <code title="">spreadmethod</code> <td> <code title="">spreadMethod</code>
-    <tr> <td> <code title="">startoffset</code> <td> <code title="">startOffset</code>
-    <tr> <td> <code title="">stddeviation</code> <td> <code title="">stdDeviation</code>
-    <tr> <td> <code title="">stitchtiles</code> <td> <code title="">stitchTiles</code>
-    <tr> <td> <code title="">surfacescale</code> <td> <code title="">surfaceScale</code>
-    <tr> <td> <code title="">systemlanguage</code> <td> <code title="">systemLanguage</code>
-    <tr> <td> <code title="">tablevalues</code> <td> <code title="">tableValues</code>
-    <tr> <td> <code title="">targetx</code> <td> <code title="">targetX</code>
-    <tr> <td> <code title="">targety</code> <td> <code title="">targetY</code>
-    <tr> <td> <code title="">textlength</code> <td> <code title="">textLength</code>
-    <tr> <td> <code title="">viewbox</code> <td> <code title="">viewBox</code>
-    <tr> <td> <code title="">viewtarget</code> <td> <code title="">viewTarget</code>
-    <tr> <td> <code title="">xchannelselector</code> <td> <code title="">xChannelSelector</code>
-    <tr> <td> <code title="">ychannelselector</code> <td> <code title="">yChannelSelector</code>
-    <tr> <td> <code title="">zoomandpan</code> <td> <code title="">zoomAndPan</code>
-  </table>
-
-  <p>When the steps below require the user agent to <dfn>adjust
-  foreign attributes</dfn> for a token, then, if any of the attributes
-  on the token match the strings given in the first column of the
-  following table, let the attribute be a namespaced attribute, with
-  the prefix being the string given in the corresponding cell in the
-  second column, the local name being the string given in the
-  corresponding cell in the third column, and the namespace being the
-  namespace given in the corresponding cell in the fourth
-  column. (This fixes the use of namespaced attributes, in particular
-  <code title="">xml:lang</code>.)</p>
-
-  <table>
-   <thead>
-    <tr> <th> Attribute name <th> Prefix <th> Local name <th> Namespace
-   <tbody>
-    <tr> <td> <code title="">xlink:actuate</code> <td> <code title="">xlink</code> <td> <code title="">actuate</code> <td> <span>XLink namespace</span>
-    <tr> <td> <code title="">xlink:arcrole</code> <td> <code title="">xlink</code> <td> <code title="">arcrole</code> <td> <span>XLink namespace</span>
-    <tr> <td> <code title="">xlink:href</code> <td> <code title="">xlink</code> <td> <code title="">href</code> <td> <span>XLink namespace</span>
-    <tr> <td> <code title="">xlink:role</code> <td> <code title="">xlink</code> <td> <code title="">role</code> <td> <span>XLink namespace</span>
-    <tr> <td> <code title="">xlink:show</code> <td> <code title="">xlink</code> <td> <code title="">show</code> <td> <span>XLink namespace</span>
-    <tr> <td> <code title="">xlink:title</code> <td> <code title="">xlink</code> <td> <code title="">title</code> <td> <span>XLink namespace</span>
-    <tr> <td> <code title="">xlink:type</code> <td> <code title="">xlink</code> <td> <code title="">type</code> <td> <span>XLink namespace</span>
-    <tr> <td> <code title="">xml:base</code> <td> <code title="">xml</code> <td> <code title="">base</code> <td> <span>XML namespace</span> <!-- attr-xml-base -->
-    <tr> <td> <code title="">xml:lang</code> <td> <code title="">xml</code> <td> <code title="">lang</code> <td> <span>XML namespace</span>
-    <tr> <td> <code title="">xml:space</code> <td> <code title="">xml</code> <td> <code title="">space</code> <td> <span>XML namespace</span>
-    <tr> <td> <code title="">xmlns</code> <td> (none) <td> <code title="">xmlns</code> <td> <span>XMLNS namespace</span>
-    <tr> <td> <code title="">xmlns:xlink</code> <td> <code title="">xmlns</code> <td> <code title="">xlink</code> <td> <span>XMLNS namespace</span>
-  </table>
-
-  <hr>
-
-  <p>The <dfn>generic CDATA element parsing algorithm</dfn> and the
-  <dfn>generic RCDATA element parsing algorithm</dfn> consist of the
-  following steps. These algorithms are always invoked in response to
-  a start tag token.</p>
-
-  <ol>
-
-   <li><p><span>Insert an HTML element</span> for the token.</p></li>
-
-   <li><p>If the algorithm that was invoked is the <span>generic CDATA
-   element parsing algorithm</span>, switch the tokeniser's
-   <span>content model flag</span> to the CDATA state; otherwise the
-   algorithm invoked was the <span>generic RCDATA element parsing
-   algorithm</span>, switch the tokeniser's <span>content model
-   flag</span> to the RCDATA state.</p></li>
-
-   <li><p>Let the <span>original insertion mode</span> be the current
-   <span>insertion mode</span>.</p>
-
-   <li><p>Then, switch the <span>insertion mode</span> to "<span
-   title="insertion mode: in CDATA/RCDATA">in
-   CDATA/RCDATA</span>".</p></li>
-
-  </ol>
-
-
-
-  <h5>Closing elements that have implied end tags</h5>
-
-  <p>When the steps below require the UA to <dfn>generate implied end
-  tags</dfn>, then, while the <span>current node</span> is a
-  <code>dd</code> element, a <code>dt</code> element, an
-  <code>li</code> element, an <code>option</code> element, an
-  <code>optgroup</code> element, a <code>p</code> element, an
-  <code>rp</code> element, or an <code>rt</code> element, the UA must
-  pop the <span>current node</span> off the <span>stack of open
-  elements</span>.</p>
-
-  <p>If a step requires the UA to generate implied end tags but lists
-  an element to exclude from the process, then the UA must perform the
-  above steps as if that element was not in the above list.</p>
-
-
-  <h5>Foster parenting</h5>
-
-  <p>Foster parenting happens when content is misnested in tables.</p>
-
-  <p>When a node <var title="">node</var> is to be <dfn title="foster
-  parent">foster parented</dfn>, the node <var title="">node</var>
-  must be inserted into the <i>foster parent element</i>, and the
-  <span>current table</span> must be marked as
-  <dfn>tainted</dfn>. (Once the <span>current table</span> has been
-  <span>tainted</span>, whitespace characters are inserted into the
-  <i>foster parent element</i> instead of the <span>current
-  node</span>.)</p>
-
-  <p>The <dfn>foster parent element</dfn> is the parent element of the
-  last <code>table</code> element in the <span>stack of open
-  elements</span>, if there is a <code>table</code> element and it has
-  such a parent element. If there is no <code>table</code> element in
-  the <span>stack of open elements</span> (<span>fragment
-  case</span>), then the <i>foster parent element</i> is the first
-  element in the <span>stack of open elements</span> (the
-  <code>html</code> element). Otherwise, if there is a
-  <code>table</code> element in the <span>stack of open
-  elements</span>, but the last <code>table</code> element in the
-  <span>stack of open elements</span> has no parent, or its parent
-  node is not an element, then the <i>foster parent element</i> is
-  the element before the last <code>table</code> element in the
-  <span>stack of open elements</span>.</p>
-
-  <p>If the <i>foster parent element</i> is the parent element of the
-  last <code>table</code> element in the <span>stack of open
-  elements</span>, then <var title="">node</var> must be inserted
-  immediately <em>before</em> the last <code>table</code> element in
-  the <span>stack of open elements</span> in the <i>foster parent
-  element</i>; otherwise, <var title="">node</var> must be
-  <em>appended</em> to the <i>foster parent element</i>.</p>
-
-
-
-  <h5>The "<dfn title="insertion mode: initial">initial</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: initial">initial</span>", tokens must be handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>A character token that is one of U+0009 CHARACTER
-   TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
-   <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
-   <dd>
-    <p>Ignore the token.</p>
-   </dd>
-
-   <dt>A comment token</dt>
-   <dd>
-    <p>Append a <code>Comment</code> node to the <code>Document</code>
-    object with the <code title="">data</code> attribute set to the
-    data given in the comment token.</p>
-   </dd>
-
-   <dt>A DOCTYPE token</dt>
-   <dd>
-
-    <p>If the DOCTYPE token's <code title="">name</code> is not a
-    <span>case-sensitive</span> match for the string "<code
-    title="">html</code>", or if the token's public identifier is not
-    missing, or if the token's system identifier is neither missing
-    nor a <span>case-sensitive</span> match for the string
-    "<code>about:legacy-compat</code>", then there is a <span>parse
-    error</span> (this is the <dfn>DOCTYPE parse
-    error</dfn>). Conformance checkers may, instead of reporting this
-    error, switch to a conformance checking mode for another language
-    (e.g. based on the DOCTYPE token a conformance checker could
-    recognize that the document is an HTML4-era document, and defer to
-    an HTML4 conformance checker.)</p>
-
-    <p>Append a <code>DocumentType</code> node to the
-    <code>Document</code> node, with the <code title="">name</code>
-    attribute set to the name given in the DOCTYPE token, or the empty
-    string if the name was missing; the <code title="">publicId</code>
-    attribute set to the public identifier given in the DOCTYPE token,
-    or the empty string if the public identifier was missing; the
-    <code title="">systemId</code> attribute set to the system
-    identifier given in the DOCTYPE token, or the empty string if the
-    system identifier was missing; and the other attributes specific
-    to <code>DocumentType</code> objects set to null and empty lists
-    as appropriate. Associate the <code>DocumentType</code> node with
-    the <code>Document</code> object so that it is returned as the
-    value of the <code title="">doctype</code> attribute of the
-    <code>Document</code> object.</p>
-
-    <p id="quirks-mode-doctypes">Then, if the DOCTYPE
-    token matches one of the conditions in the following list, then
-    set the document to <span>quirks mode</span>:</p>
-
-    <ul class="brief">
-     <li> The <i>force-quirks flag</i> is set to <i>on</i>. </li>
-     <li> The name is set to anything other than "<code title="">HTML</code>". </li>
-     <li> The public identifier starts with: "<code title="">+//Silmaril//dtd html Pro v0r11 19970101//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//AdvaSoft Ltd//DTD HTML 3.0 asWedit + extensions//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//AS//DTD HTML 3.0 asWedit + extensions//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 2.0 Level 1//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 2.0 Level 2//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 2.0 Strict Level 1//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 2.0 Strict Level 2//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 2.0 Strict//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 2.0//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 2.1E//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 3.0//<!--EN--></code>" </li>
-   <!--<li> The public identifier is set to: "<code title="">-//IETF//DTD HTML 3.0//EN//</code>" </li>-->
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 3.2 Final//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 3.2//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 3//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML Level 0//<!--EN--></code>" </li>
-   <!--<li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Level 0//EN//2.0</code>" </li>-->
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML Level 1//<!--EN--></code>" </li>
-   <!--<li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Level 1//EN//2.0</code>" </li>-->
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML Level 2//<!--EN--></code>" </li>
-   <!--<li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Level 2//EN//2.0</code>" </li>-->
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML Level 3//<!--EN--></code>" </li>
-   <!--<li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Level 3//EN//3.0</code>" </li>-->
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML Strict Level 0//<!--EN--></code>" </li>
-   <!--<li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict Level 0//EN//2.0</code>" </li>-->
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML Strict Level 1//<!--EN--></code>" </li>
-   <!--<li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict Level 1//EN//2.0</code>" </li>-->
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML Strict Level 2//<!--EN--></code>" </li>
-   <!--<li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict Level 2//EN//2.0</code>" </li>-->
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML Strict Level 3//<!--EN--></code>" </li>
-   <!--<li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict Level 3//EN//3.0</code>" </li>-->
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML Strict//<!--EN--></code>" </li>
-   <!--<li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict//EN//2.0</code>" </li>-->
-   <!--<li> The public identifier is set to: "<code title="">-//IETF//DTD HTML Strict//EN//3.0</code>" </li>-->
-     <li> The public identifier starts with: "<code title="">-//IETF//DTD HTML//<!--EN--></code>" </li>
-   <!--<li> The public identifier is set to: "<code title="">-//IETF//DTD HTML//EN//2.0</code>" </li>-->
-   <!--<li> The public identifier is set to: "<code title="">-//IETF//DTD HTML//EN//3.0</code>" </li>-->
-     <li> The public identifier starts with: "<code title="">-//Metrius//DTD Metrius Presentational//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//Microsoft//DTD Internet Explorer 2.0 HTML Strict//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//Microsoft//DTD Internet Explorer 2.0 HTML//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//Microsoft//DTD Internet Explorer 2.0 Tables//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//Microsoft//DTD Internet Explorer 3.0 HTML Strict//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//Microsoft//DTD Internet Explorer 3.0 HTML//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//Microsoft//DTD Internet Explorer 3.0 Tables//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//Netscape Comm. Corp.//DTD HTML//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//Netscape Comm. Corp.//DTD Strict HTML//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//O'Reilly and Associates//DTD HTML 2.0//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//O'Reilly and Associates//DTD HTML Extended 1.0//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//O'Reilly and Associates//DTD HTML Extended Relaxed 1.0//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//SoftQuad Software//DTD HoTMetaL PRO 6.0::19990601::extensions to HTML 4.0//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//SoftQuad//DTD HoTMetaL PRO 4.0::19971010::extensions to HTML 4.0//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//Spyglass//DTD HTML 2.0 Extended//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//SQ//DTD HTML 2.0 HoTMetaL + extensions//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//Sun Microsystems Corp.//DTD HotJava HTML//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//Sun Microsystems Corp.//DTD HotJava Strict HTML//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//W3C//DTD HTML 3 1995-03-24//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//W3C//DTD HTML 3.2 Draft//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//W3C//DTD HTML 3.2 Final//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//W3C//DTD HTML 3.2//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//W3C//DTD HTML 3.2S Draft//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//W3C//DTD HTML 4.0 Frameset//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//W3C//DTD HTML 4.0 Transitional//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//W3C//DTD HTML Experimental 19960712//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//W3C//DTD HTML Experimental 970421//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//W3C//DTD W3 HTML//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//W3O//DTD W3 HTML 3.0//<!--EN--></code>" </li>
-   <!--<li> The public identifier is set to: "<code title="">-//W3O//DTD W3 HTML 3.0//EN//</code>" </li>-->
-     <li> The public identifier is set to: "<code title="">-//W3O//DTD W3 HTML Strict 3.0//EN//</code>" </li>
-     <li> The public identifier starts with: "<code title="">-//WebTechs//DTD Mozilla HTML 2.0//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//WebTechs//DTD Mozilla HTML//<!--EN--></code>" </li>
-     <li> The public identifier is set to: "<code title="">-/W3C/DTD HTML 4.0 Transitional/EN</code>" </li>
-     <li> The public identifier is set to: "<code title="">HTML</code>" </li>
-     <li> The system identifier is set to: "<code title="">http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd</code>" </li>
-     <li> The system identifier is missing and the public identifier starts with: "<code title="">-//W3C//DTD HTML 4.01 Frameset//<!--EN--></code>" </li>
-     <li> The system identifier is missing and the public identifier starts with: "<code title="">-//W3C//DTD HTML 4.01 Transitional//<!--EN--></code>" </li>
-    </ul>
-
-    <p>Otherwise, if the DOCTYPE
-    token matches one of the conditions in the following list, then
-    set the document to <span>limited quirks mode</span>:</p>
-
-    <ul class="brief">
-     <li> The public identifier starts with: "<code title="">-//W3C//DTD XHTML 1.0 Frameset//<!--EN--></code>" </li>
-     <li> The public identifier starts with: "<code title="">-//W3C//DTD XHTML 1.0 Transitional//<!--EN--></code>" </li>
-     <li> The system identifier is not missing and the public identifier starts with: "<code title="">-//W3C//DTD HTML 4.01 Frameset//<!--EN--></code>" </li>
-     <li> The system identifier is not missing and the public identifier starts with: "<code title="">-//W3C//DTD HTML 4.01 Transitional//<!--EN--></code>" </li>
-    </ul>
-
-    <p>The name, system identifier, and public identifier strings must
-    be compared to the values given in the lists above in an
-    <span>ASCII case-insensitive</span> manner. A system identifier
-    whose value is the empty string is not considered missing for the
-    purposes of the conditions above.</p>
-
-    <p>Then, switch the <span>insertion mode</span> to "<span
-    title="insertion mode: before html">before html</span>".</p>
-
-   </dd>
-
-   <dt>Anything else</dt>
-   <dd>
-
-    <p><span>Parse error</span>.</p>
-
-    <p>Set the document to <span>quirks mode</span>.</p>
-
-    <p>Switch the <span>insertion mode</span> to "<span
-    title="insertion mode: before html">before html</span>", then
-    reprocess the current token.</p>
-
-   </dd>
-
-  </dl>
-
-
-  <h5>The "<dfn title="insertion mode: before html">before html</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: before html">before html</span>", tokens must be handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>A DOCTYPE token</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>A comment token</dt>
-   <dd>
-    <p>Append a <code>Comment</code> node to the <code>Document</code>
-    object with the <code title="">data</code> attribute set to the
-    data given in the comment token.</p>
-   </dd>
-
-   <dt>A character token that is one of U+0009 CHARACTER
-   TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
-   <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
-   <dd>
-    <p>Ignore the token.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "html"</dt>
-   <dd>
-
-    <p><span>Create an element for the token</span> in the <span>HTML
-    namespace</span>. Append it to the <code>Document</code>
-    object. Put this element in the <span>stack of open
-    elements</span>.</p>
-
-    <p id="parser-appcache">If the <code>Document</code> is being
-    loaded as part of <span title="navigate">navigation</span> of a
-    <span>browsing context</span>, then: if the newly created element
-    has a <code title="attr-html-manifest">manifest</code> attribute,
-    then <span title="resolve a url">resolve</span> the value of that
-    attribute to an <span>absolute URL</span>, relative to the newly
-    created element, and if that is successful, run the <span
-    title="concept-appcache-init">application cache selection
-    algorithm</span> with the resulting <span>absolute URL</span>;
-    otherwise, if there is no such attribute or resolving it fails,
-    run the <span title="concept-appcache-init">application cache
-    selection algorithm</span> with no manifest. The algorithm must be
-    passed the <code>Document</code> object.</p>
-
-    <p>Switch the <span>insertion mode</span> to "<span
-    title="insertion mode: before head">before head</span>".</p>
-
-   </dd>
-
-   <dt>Anything else</dt>
-   <dd>
-
-    <p>Create an <code>html</code> element. Append it to the
-    <code>Document</code> object. Put this element in the <span>stack
-    of open elements</span>.</p>
-
-    <p>If the <code>Document</code> is being loaded as part of <span
-    title="navigate">navigation</span> of a <span>browsing
-    context</span>, then: run the <span
-    title="concept-appcache-init">application cache selection
-    algorithm</span> with no manifest, passing it the
-    <code>Document</code> object.</p>
-
-    <p>Switch the <span>insertion mode</span> to "<span
-    title="insertion mode: before head">before head</span>", then
-    reprocess the current token.</p>
-
-    <p class="XXX">Should probably make end tags be ignored, so
-    that "&lt;/head>&lt;!-- -->&lt;html>" puts the comment before the
-    root node (or should we?)</p>
-
-   </dd>
-
-  </dl>
-
-  <p>The root element can end up being removed from the
-  <code>Document</code> object, e.g. by scripts; nothing in particular
-  happens in such cases, content continues being appended to the nodes
-  as described in the next section.</p>
-
-
-  <h5>The "<dfn title="insertion mode: before head">before head</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: before head">before head</span>", tokens must be handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>A character token that is one of U+0009 CHARACTER
-   TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
-   <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
-   <dd>
-    <p>Ignore the token.</p> <!-- :-( -->
-   </dd>
-
-   <dt>A comment token</dt>
-   <dd>
-    <p>Append a <code>Comment</code> node to the <span>current
-    node</span> with the <code title="">data</code> attribute set to
-    the data given in the comment token.</p>
-   </dd>
-
-   <dt>A DOCTYPE token</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "html"</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in body">in body</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "head"</dt>
-   <dd>
-
-    <p><span>Insert an HTML element</span> for the token.</p>
-
-    <p>Set the <span><code title="">head</code> element pointer</span>
-    to the newly created <code>head</code> element.</p>
-
-    <p>Switch the <span>insertion mode</span> to "<span
-    title="insertion mode: in head">in head</span>".</p>
-
-   </dd>
-
-   <dt>An end tag whose tag name is one of: "head", "body", "html", "br"</dt>
-   <dd>
-
-    <p>Act as if a start tag token with the tag name "head" and no
-    attributes had been seen, then reprocess the current token.</p>
-
-   </dd>
-
-   <dt>Any other end tag</dt>
-   <dd>
-
-    <p><span>Parse error</span>. Ignore the token.</p>
-
-   </dd>
-
-   <dt>Anything else</dt>
-   <dd>
-
-    <p>Act as if a start tag token with the tag name "head" and no
-    attributes had been seen, then reprocess the current
-    token.</p>
-
-    <p class="note">This will result in an empty <code>head</code>
-    element being generated, with the current token being
-    reprocessed in the "<span title="insertion mode: after
-    head">after head</span>" <span>insertion mode</span>.</p>
-
-   </dd>
-
-  </dl>
-
-
-  <h5 id="parsing-main-inhead">The "<dfn title="insertion mode: in head">in head</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: in head">in head</span>", tokens must be handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>A character token that is one of U+0009 CHARACTER
-   TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
-   <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
-   <dd>
-    <p><span title="insert a character">Insert the character</span> into
-    the <span>current node</span>.</p>
-   </dd>
-
-   <dt>A comment token</dt>
-   <dd>
-    <p>Append a <code>Comment</code> node to the <span>current
-    node</span> with the <code title="">data</code> attribute set to
-    the data given in the comment token.</p>
-   </dd>
-
-   <dt>A DOCTYPE token</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "html"</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in body">in body</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is one of: "base", "command",
-   "link"</dt>
-   <dd>
-
-    <p><span>Insert an HTML element</span> for the token. Immediately
-    pop the <span>current node</span> off the <span>stack of open
-    elements</span>.</p>
-
-    <p><span title="acknowledge self-closing flag">Acknowledge the
-    token's <i>self-closing flag</i></span>, if it is set.</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "meta"</dt>
-   <dd>
-
-    <p><span>Insert an HTML element</span> for the token. Immediately
-    pop the <span>current node</span> off the <span>stack of open
-    elements</span>.</p>
-
-    <p><span title="acknowledge self-closing flag">Acknowledge the
-    token's <i>self-closing flag</i></span>, if it is set.</p>
-
-    <p id="meta-charset-during-parse">If the element has a <code
-    title="attr-meta-charset">charset</code> attribute, and its
-    value is a supported encoding, and the <span
-    title="concept-encoding-confidence">confidence</span> is
-    currently <i>tentative</i>, then <span>change the
-    encoding</span> to the encoding given by the value of the
-    <code title="attr-meta-charset">charset</code> attribute.</p>
-
-    <p>Otherwise, if the element has a <code
-    title="attr-meta-charset">content</code> attribute, and
-    applying the <span>algorithm for extracting an encoding from a
-    Content-Type</span> to its value returns a supported encoding
-    <var title="">encoding</var>, and the <span
-    title="concept-encoding-confidence">confidence</span> is
-    currently <i>tentative</i>, then <span>change the
-    encoding</span> to the encoding <var
-    title="">encoding</var>.</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "title"</dt>
-   <dd>
-    <p>Follow the <span>generic RCDATA element parsing algorithm</span>.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "noscript", if the <span>scripting flag</span> is enabled</dt>
-   <dt>A start tag whose tag name is one of: "noframes", "style"</dt>
-   <dd>
-    <p>Follow the <span>generic CDATA element parsing algorithm</span>.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "noscript", if the <span>scripting flag</span> is disabled</dt>
-   <dd>
-
-    <p><span>Insert an HTML element</span> for the token.</p>
-
-    <p>Switch the <span>insertion mode</span> to "<span
-    title="insertion mode: in head noscript">in head
-    noscript</span>".</p>
-
-   </dd>
-
-   <dt id="scriptTag">A start tag whose tag name is "script"</dt>
-   <dd>
-
-    <ol>
-
-     <li><p><span>Create an element for the token</span> in the
-     <span>HTML namespace</span>.</p></li>
-
-     <li>
-
-      <p>Mark the element as being <span>"parser-inserted"</span>.</p>
-
-      <p class="note">This ensures that, if the script is external,
-      any <code title="dom-document-write">document.write()</code>
-      calls in the script will execute in-line, instead of blowing the
-      document away, as would happen in most other cases. It also
-      prevents the script from executing until the end tag is
-      seen.</p>
-
-     </li>
-
-     <li><p>If the parser was originally created for the <span>HTML
-     fragment parsing algorithm</span>, then mark the
-     <code>script</code> element as <span>"already
-     executed"</span>. (<span>fragment case</span>)</p></li>
-
-     <li><p>Append the new element to the <span>current node</span>
-     and push it onto the <span>stack of open
-     elements</span>.</p></li>
-
-     <li><p>Switch the tokeniser's <span>content model flag</span> to
-     the CDATA state.</p></li>
-
-     <li><p>Let the <span>original insertion mode</span> be the current
-     <span>insertion mode</span>.</p>
-
-     <li><p>Switch the <span>insertion mode</span> to "<span
-     title="insertion mode: in CDATA/RCDATA">in
-     CDATA/RCDATA</span>".</p></li>
-
-    </ol>
-
-   </dd>
-
-   <dt>An end tag whose tag name is "head"</dt>
-   <dd>
-
-    <p>Pop the <span>current node</span> (which will be the
-    <code>head</code> element) off the <span>stack of open
-    elements</span>.</p>
-
-    <p>Switch the <span>insertion mode</span> to "<span
-    title="insertion mode: after head">after head</span>".</p>
-
-   </dd>
-
-   <dt>An end tag whose tag name is one of: "body", "html", "br"</dt>
-   <dd>
-    <p>Act as described in the "anything else" entry below.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "head"</dt>
-   <dt>Any other end tag</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>Anything else</dt>
-   <dd>
-
-    <!-- can't get here with an EOF and a fragment case -->
-
-    <p>Act as if an end tag token with the tag name "head" had
-    been seen, and reprocess the current token.</p>
-
-    <p class="XXX">In certain UAs, <a
-    href="https://bugzilla.mozilla.org/attachment.cgi?id=180157&amp;action=view">some
-    elements</a> don't trigger the "in body" mode straight away,
-    but instead get put into the head. Do we want to copy
-    that?</p>
-
-   </dd>
-
-  </dl>
-
-
-  <h5 id="parsing-main-inheadnoscript">The "<dfn title="insertion mode: in head noscript">in head noscript</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: in head noscript">in head noscript</span>", tokens must be handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>A DOCTYPE token</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "html"</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in body">in body</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-   <dt>An end tag whose tag name is "noscript"</dt>
-   <dd>
-
-    <p>Pop the <span>current node</span> (which will be a
-    <code>noscript</code> element) from the <span>stack of open
-    elements</span>; the new <span>current node</span> will be a
-    <code>head</code> element.</p>
-
-    <p>Switch the <span>insertion mode</span> to "<span
-    title="insertion mode: in head">in head</span>".</p>
-
-   </dd>
-
-   <dt>A character token that is one of U+0009 CHARACTER
-   TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
-   <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
-   <dt>A comment token</dt>
-   <dt>A start tag whose tag name is one of: "link", "meta", "noframes", "style"</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in head">in head</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-   <dt>An end tag whose tag name is "br"</dt>
-   <dd>
-    <p>Act as described in the "anything else" entry below.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is one of: "head", "noscript"</dt>
-   <dt>Any other end tag</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>Anything else</dt>
-   <dd>
-
-    <!-- can't get here with an EOF and a fragment case -->
-
-    <p><span>Parse error</span>. Act as if an end tag with the tag
-    name "noscript" had been seen and reprocess the current
-    token.</p>
-
-   </dd>
-
-  </dl>
-
-
-  <h5>The "<dfn title="insertion mode: after head">after head</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: after head">after head</span>", tokens must be handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>A character token that is one of U+0009 CHARACTER
-   TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
-   <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
-   <dd>
-    <p><span title="insert a character">Insert the character</span> into
-    the <span>current node</span>.</p>
-   </dd>
-
-   <dt>A comment token</dt>
-   <dd>
-    <p>Append a <code>Comment</code> node to the <span>current
-    node</span> with the <code title="">data</code> attribute set to
-    the data given in the comment token.</p>
-   </dd>
-
-   <dt>A DOCTYPE token</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "html"</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in body">in body</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "body"</dt>
-   <dd>
-
-    <p><span>Insert an HTML element</span> for the token.</p>
-
-    <p>Switch the <span>insertion mode</span> to "<span
-    title="insertion mode: in body">in body</span>".</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "frameset"</dt>
-   <dd>
-
-    <p><span>Insert an HTML element</span> for the token.</p>
-
-    <p>Switch the <span>insertion mode</span> to "<span
-    title="insertion mode: in frameset">in frameset</span>".</p>
-
-   </dd>
-
-   <dt>A start tag token whose tag name is one of: "base", "link",
-   "meta", "noframes", "script", "style", "title"</dt>
-   <dd>
-
-    <p><span>Parse error</span>.</p>
-
-    <p>Push the node pointed to by the <span><code
-    title="">head</code> element pointer</span> onto the
-    <span>stack of open elements</span>.</p>
-
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in head">in head</span>" <span>insertion
-    mode</span>.</p>
-
-    <p>Remove the node pointed to by the <span><code
-    title="">head</code> element pointer</span> from the <span>stack
-    of open elements</span>.</p>
-
-   </dd>
-
-   <dt>An end tag whose tag name is one of: "body", "html", "br"</dt>
-   <dd>
-    <p>Act as described in the "anything else" entry below.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "head"</dt>
-   <dt>Any other end tag</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>Anything else</dt>
-   <dd>
-    <p>Act as if a start tag token with the tag name "body" and no
-    attributes had been seen, and then reprocess the current
-    token.</p>
-   </dd>
-
-  </dl>
-
-
-  <h5 id="parsing-main-inbody">The "<dfn title="insertion mode: in body">in body</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: in body">in body</span>", tokens must be handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>A character token</dt>
-   <dd>
-
-    <p><span>Reconstruct the active formatting elements</span>, if
-    any.</p>
-
-    <p><span title="insert a character">Insert the token's
-    character</span> into the <span>current node</span>.</p>
-
-    <p>If the token is not one of U+0009 CHARACTER TABULATION, U+000A
-    LINE FEED (LF), U+000C FORM FEED (FF), <!--U+000D CARRIAGE RETURN
-    (CR),--> or U+0020 SPACE, then set the <span>frameset-ok
-    flag</span> to "not ok".</p>
-
-   </dd>
-
-   <dt>A comment token</dt>
-   <dd>
-    <p>Append a <code>Comment</code> node to the <span>current
-    node</span> with the <code title="">data</code> attribute set to
-    the data given in the comment token.</p>
-   </dd>
-
-   <dt>A DOCTYPE token</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "html"</dt>
-   <dd>
-    <p><span>Parse error</span>. For each attribute on the token,
-    check to see if the attribute is already present on the top
-    element of the <span>stack of open elements</span>. If it is not,
-    add the attribute and its corresponding value to that element.</p>
-   </dd>
-
-   <dt>A start tag token whose tag name is one of: "base", "command",
-   "link", "meta", "noframes", "script", "style", "title"</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in head">in head</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "body"</dt>
-   <dd>
-
-    <p><span>Parse error</span>.</p>
-
-    <p>If the second element on the <span>stack of open
-    elements</span> is not a <code>body</code> element, or, if the
-    <span>stack of open elements</span> has only one node on it,
-    then ignore the token. (<span>fragment case</span>)</p>
-
-    <p>Otherwise, for each attribute on the token, check to see if
-    the attribute is already present on the <code>body</code>
-    element (the second element) on the <span>stack of open
-    elements</span>. If it is not, add the attribute and its
-    corresponding value to that element.</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "frameset"</dt>
-   <dd>
-
-    <p><span>Parse error</span>.</p>
-
-    <p>If the second element on the <span>stack of open
-    elements</span> is not a <code>body</code> element, or, if the
-    <span>stack of open elements</span> has only one node on it,
-    then ignore the token. (<span>fragment case</span>)</p>
-
-    <p>If the <span>frameset-ok flag</span> is set to "not ok", ignore
-    the token.</p>
-
-    <p>Otherwise, run the following steps:</p>
-
-    <ol>
-
-     <li><p>Remove the second element on the <span>stack of open
-     elements</span> from its parent node, if it has one.</p></li>
-
-     <li><p>Pop all the nodes from the bottom of the <span>stack of
-     open elements</span>, from the <span>current node</span> up to
-     the root <code>html</code> element.</p>
-
-     <li><p><span>Insert an HTML element</span> for the
-     token.</p></li>
-
-     <li><p>Switch the <span>insertion mode</span> to "<span
-     title="insertion mode: in frameset">in frameset</span>".</p>
-
-    </ol>
-
-   </dd>
-
-   <dt>An end-of-file token</dt>
-   <dd>
-
-    <p>If there is a node in the <span>stack of open elements</span>
-    that is not either a <code>dd</code> element, a <code>dt</code>
-    element, an <code>li</code> element, a <code>p</code> element, a
-    <code>tbody</code> element, a <code>td</code> element, a
-    <code>tfoot</code> element, a <code>th</code> element, a
-    <code>thead</code> element, a <code>tr</code> element, the
-    <code>body</code> element, or the <code>html</code> element, then
-    this is a <span>parse error</span>.</p> <!-- (some of those are
-    fragment cases) -->
-
-    <p><span>Stop parsing</span>.</p>
-
-   </dd>
-
-   <dt>An end tag whose tag name is "body"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> does not <span
-    title="has an element in scope">have a <code>body</code> element
-    in scope</span>, this is a <span>parse error</span>; ignore the
-    token.</p>
-
-    <!-- if we get here, the insertion mode here is forcibly "in
-    body". -->
-
-    <p>Otherwise, if there is a node in the <span>stack of open
-    elements</span> that is not either a <code>dd</code> element, a
-    <code>dt</code> element, an <code>li</code> element, an
-    <code>optgroup</code> element, an <code>option</code> element, a
-    <code>p</code> element, an <code>rp</code> element, an
-    <code>rt</code> element, a <code>tbody</code> element, a
-    <code>td</code> element, a <code>tfoot</code> element, a
-    <code>th</code> element, a <code>thead</code> element, a
-    <code>tr</code> element, the <code>body</code> element, or the
-    <code>html</code> element, then this is a <span>parse
-    error</span>.</p> <!-- (some of those are fragment cases, e.g. for
-    <tbody> you'd have hit the first paragraph since the <body>
-    wouldn't be in scope, unless it was a fragment case) -->
-
-    <p>Switch the <span>insertion mode</span> to "<span
-    title="insertion mode: after body">after body</span>".</p>
-
-   </dd>
-
-   <dt>An end tag whose tag name is "html"</dt>
-   <dd>
-
-    <p>Act as if an end tag with tag name "body" had been seen,
-    then, if that token wasn't ignored, reprocess the current
-    token.</p>
-
-    <p class="note">The fake end tag token here can only be
-    ignored in the <span>fragment case</span>.</p>
-
-   </dd>
-
-   <!-- start tags for non-phrasing flow content elements -->
-
-   <!-- the normal ones -->
-   <dt>A start tag whose tag name is one of: "address", "article",
-   "aside", "blockquote", "center", "datagrid", "details", "dialog",
-   "dir", "div", "dl", "fieldset", "figure", "footer", "header",
-   "menu", "nav", "ol", "p", "section", "ul"</dt>
-   <dd>
-
-    <!-- As of May 2008 this doesn't match any browser exactly, but is
-    as close to what IE does as I can get without doing the non-tree
-    DOM nonsense, and thus should actually afford better compatibility
-    when implemented by the other browsers. -->
-
-    <p>If the <span>stack of open elements</span> <span title="has
-    an element in scope">has a <code>p</code> element in
-    scope</span>, then act as if an end tag with the tag name
-    "p" had been seen.</p>
-
-    <p><span>Insert an HTML element</span> for the token.</p>
-
-   </dd>
-
-   <!-- as normal, but close h1-h6 if it's the current node -->
-   <dt>A start tag whose tag name is one of: "h1", "h2", "h3", "h4",
-   "h5", "h6"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> <span title="has
-    an element in scope">has a <code>p</code> element in
-    scope</span>, then act as if an end tag with the tag name
-    "p" had been seen.</p>
-
-    <p>If the <span>current node</span> is an element whose tag name
-    is one of "h1", "h2", "h3", "h4", "h5", or "h6", then this is a
-    <span>parse error</span>; pop the <span>current node</span> off
-    the <span>stack of open elements</span>.</p>
-    <!-- See https://bugs.webkit.org/show_bug.cgi?id=12646 -->
-
-    <p><span>Insert an HTML element</span> for the token.</p>
-
-   </dd>
-
-   <!-- as normal, but drops leading newline -->
-   <dt>A start tag whose tag name is one of: "pre", "listing"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> <span title="has
-    an element in scope">has a <code>p</code> element in
-    scope</span>, then act as if an end tag with the tag name
-    "p" had been seen.</p>
-
-    <p><span>Insert an HTML element</span> for the token.</p>
-
-    <p>If the next token is a U+000A LINE FEED (LF) character
-    token, then ignore that token and move on to the next
-    one. (Newlines at the start of <code>pre</code> blocks are
-    ignored as an authoring convenience.)</p>
-
-    <p>Set the <span>frameset-ok flag</span> to "not ok".</p>
-
-   </dd>
-
-   <!-- as normal, but interacts with the form element pointer -->
-   <dt>A start tag whose tag name is "form"</dt>
-   <dd>
-
-    <p>If the <span><code title="form">form</code> element
-    pointer</span> is not null, then this is a <span>parse
-    error</span>; ignore the token.</p>
-
-    <p>Otherwise:</p>
-
-    <p>If the <span>stack of open elements</span> <span title="has
-    an element in scope">has a <code>p</code> element in
-    scope</span>, then act as if an end tag with the tag name
-    "p" had been seen.</p>
-
-    <p><span>Insert an HTML element</span> for the token, and set the
-    <span><code title="form">form</code> element pointer</span> to
-    point to the element created.</p>
-
-   </dd>
-
-   <!-- as normal, but imply </li> when there's another <li> open in weird cases -->
-   <dt>A start tag whose tag name is "li"</dt>
-   <dd>
-
-    <p>Run the following algorithm:</p>
-
-    <ol>
-
-     <li><p>Set the <span>frameset-ok flag</span> to "not ok".</p></li>
-
-     <li><p>Initialize <var title="">node</var> to be the <span>current
-     node</span> (the bottommost node of the stack).</p></li>
-
-     <li><p>If <var title="">node</var> is an <code>li</code> element,
-     then act as if an end tag with the tag name "li" had
-     been seen, then jump to the last step.</p></li>
-
-     <li><p>If <var title="">node</var> is not in the
-     <span>formatting</span> category, and is not in the
-     <span>phrasing</span> category, and is not an
-     <code>address</code>, <code>div</code>, or <code>p</code>
-     element, then jump to the last step.</p></li> <!-- an element
-     <foo> is in this list if the following markup:
-
-         <!DOCTYPE html><body><ol><li><foo><li>
-
-     ...results in the second <li> not being (in any way) a descendant
-     of the first <li>, or if <foo> is a formatting element that gets
-     reopened later. -->
-
-     <li><p>Otherwise, set <var title="">node</var> to the previous
-     entry in the <span>stack of open elements</span> and return to
-     step 2.</p></li>
-
-     <li>
-
-      <p>This is the last step.</p>
-
-      <p>If the <span>stack of open elements</span> <span title="has
-      an element in scope">has a <code>p</code> element in
-      scope</span>, then act as if an end tag with the tag name
-      "p" had been seen.</p>
-
-      <p>Finally, <span>insert an HTML element</span> for the
-      token.</p>
-
-     </li>
-
-    </ol>
-
-   </dd>
-
-   <!-- as normal, but imply </dt> or </dd> when there's another <dt> or <dd> open in weird cases  -->
-   <dt>A start tag whose tag name is one of: "dd", "dt"</dt>
-   <dd>
-
-    <p>Run the following algorithm:</p>
-
-    <ol>
-
-     <li><p>Set the <span>frameset-ok flag</span> to "not ok".</p></li>
-
-     <li><p>Initialize <var title="">node</var> to be the <span>current
-     node</span> (the bottommost node of the stack).</p></li>
-
-     <li><p>If <var title="">node</var> is a <code>dd</code> or
-     <code>dt</code> element, then act as if an end tag with the same
-     tag name as <var title="">node</var> had been seen, then jump to
-     the last step.</p></li>
-
-     <li><p>If <var title="">node</var> is not in the
-     <span>formatting</span> category, and is not in the
-     <span>phrasing</span> category, and is not an
-     <code>address</code>, <code>div</code>, or <code>p</code>
-     element, then jump to the last step.</p></li> <!-- an element
-     <foo> is in this list if the following markup:
-
-         <!DOCTYPE html><body><dl><dt><foo><dt>
-
-     ...results in the second <dt> not being (in any way) a descendant
-     of the first <dt>, or if <foo> is a formatting element that gets
-     reopened later. -->
-
-     <li><p>Otherwise, set <var title="">node</var> to the previous
-     entry in the <span>stack of open elements</span> and return to
-     step 2.</p></li>
-
-     <li>
-
-      <p>This is the last step.</p>
-
-      <p>If the <span>stack of open elements</span> <span title="has
-      an element in scope">has a <code>p</code> element in
-      scope</span>, then act as if an end tag with the tag name
-      "p" had been seen.</p>
-
-      <p>Finally, <span>insert an HTML element</span> for the
-      token.</p>
-
-     </li>
-
-    </ol>
-
-   </dd>
-
-   <!-- same as normal, but effectively ends parsing -->
-   <dt>A start tag whose tag name is "plaintext"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> <span title="has
-    an element in scope">has a <code>p</code> element in
-    scope</span>, then act as if an end tag with the tag name
-    "p" had been seen.</p>
-
-    <p><span>Insert an HTML element</span> for the token.</p>
-
-    <p>Switch the <span>content model flag</span> 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 <span>content model flag</span>
-    out of the PLAINTEXT state.</p>
-
-   </dd>
-
-   <!-- end tags for non-phrasing flow content elements -->
-
-   <!-- the normal ones -->
-   <dt>An end tag whose tag name is one of: "address", "article",
-   "aside", "blockquote", "center", "datagrid", "details", "dialog",
-   "dir", "div", "dl", "fieldset", "figure", "footer", "header",
-   "listing", "menu", "nav", "ol", "pre", "section", "ul"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> does not <span
-    title="has an element in scope">have an element in scope</span>
-    with the same tag name as that of the token, then this is a
-    <span>parse error</span>; ignore the token.</p>
-
-    <p>Otherwise, run these steps:</p>
-
-    <ol>
-
-     <li><p><span>Generate implied end tags</span>.</p></li>
-
-     <li><p>If the <span>current node</span> is not an element with
-     the same tag name as that of the token, then this is a
-     <span>parse error</span>.</p></li>
-
-     <li><p>Pop elements from the <span>stack of open elements</span>
-     until an element with the same tag name as the token has been
-     popped from the stack.</p></li>
-
-    </ol>
-
-   </dd>
-
-   <!-- removes the form element pointer instead of the matching node -->
-   <dt>An end tag whose tag name is "form"</dt>
-   <dd>
-
-    <p>Let <var title="">node</var> be the element that the
-    <span><code title="">form</code> element pointer</span> is set
-    to.</p>
-
-    <p>Set the <span><code title="">form</code> element pointer</span>
-    to null.</p>
-
-    <p>If <var title="">node</var> is null or the <span>stack of open
-    elements</span> does not <span title="has an element in
-    scope">have <var title="">node</var> in scope</span>, then this is
-    a <span>parse error</span>; ignore the token.</p>
-
-    <p>Otherwise, run these steps:</p>
-
-    <ol>
-
-     <li><p><span>Generate implied end tags</span>.</p></li>
-
-     <li><p>If the <span>current node</span> is not <var
-     title="">node</var>, then this is a <span>parse
-     error</span>.</p></li>
-
-     <li><p>Remove <var title="">node</var> from the <span>stack of
-     open elements</span>.</p></li>
-
-    </ol>
-
-   </dd>
-
-   <!-- as normal, except </p> implies <p> if there's no <p> in scope, and needs care as the elements have optional tags -->
-   <dt>An end tag whose tag name is "p"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> does not <span
-    title="has an element in scope">have an element in scope</span>
-    with the same tag name as that of the token, then this is a
-    <span>parse error</span>; act as if a start tag with the tag name
-    "p" had been seen, then reprocess the current token.</p>
-
-    <p>Otherwise, run these steps:</p>
-
-    <ol>
-
-     <li><p><span>Generate implied end tags</span>, except
-     for elements with the same tag name as the token.</p></li>
-
-     <li><p>If the <span>current node</span> is not an element with
-     the same tag name as that of the token, then this is a
-     <span>parse error</span>.</p></li>
-
-     <li><p>Pop elements from the <span>stack of open elements</span>
-     until an element with the same tag name as the token has been
-     popped from the stack.</p></li>
-
-    </ol>
-
-   </dd>
-
-   <!-- as normal, but needs care as the elements have optional tags -->
-   <dt>An end tag whose tag name is one of: "dd", "dt", "li"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> does not <span
-    title="has an element in scope">have an element in scope</span>
-    with the same tag name as that of the token, then this is a
-    <span>parse error</span>; ignore the token.</p>
-
-    <p>Otherwise, run these steps:</p>
-
-    <ol>
-
-     <li><p><span>Generate implied end tags</span>, except
-     for elements with the same tag name as the token.</p></li>
-
-     <li><p>If the <span>current node</span> is not an element with
-     the same tag name as that of the token, then this is a
-     <span>parse error</span>.</p></li>
-
-     <li><p>Pop elements from the <span>stack of open elements</span>
-     until an element with the same tag name as the token has been
-     popped from the stack.</p></li>
-
-    </ol>
-
-   </dd>
-
-   <!-- as normal, except acts as a closer for any of the h1-h6 elements -->
-   <dt>An end tag whose tag name is one of: "h1", "h2", "h3", "h4", "h5", "h6"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> does not <span
-    title="has an element in scope">have an element in scope</span>
-    whose tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6",
-    then this is a <span>parse error</span>; ignore the token. <!--
-    XXX quirk: Act as if a start tag with the tag name given in the
-    token had been seen, then reprocess the current token. --></p>
-
-    <p>Otherwise, run these steps:</p>
-
-    <ol>
-
-     <li><p><span>Generate implied end tags</span>.</p></li>
-
-     <li><p>If the <span>current node</span> is not an element with
-     the same tag name as that of the token, then this is a
-     <span>parse error</span>.</p></li>
-
-     <li><p>Pop elements from the <span>stack of open elements</span>
-     until an element whose tag name is one of "h1", "h2", "h3", "h4",
-     "h5", or "h6" has been popped from the stack.</p></li>
-
-    </ol>
-
-   </dd>
-
-   <dt>An end tag whose tag name is "sarcasm"</dt>
-   <dd>
-    <p>Take a deep breath, then act as described in the "any other end
-    tag" entry below.</p>
-   </dd>
-
-   <!-- ADOPTION AGENCY ELEMENTS
-        Mozilla-only: bdo blink del ins sub sup q
-        Safari-only: code dfn kbd nobr samp var wbr
-        Both: a b big em font i s small strike strong tt u -->
-
-   <dt>A start tag whose tag name is "a"</dt>
-   <dd>
-
-    <p>If the <span>list of active formatting elements</span>
-    contains an element whose tag name is "a" between the end of
-    the list and the last marker on the list (or the start of the
-    list if there is no marker on the list), then this is a
-    <span>parse error</span>; act as if an end tag with the tag
-    name "a" had been seen, then remove that element from the
-    <span>list of active formatting elements</span> and the
-    <span>stack of open elements</span> if the end tag didn't
-    already remove it (it might not have if the element is not
-    <span title="has an element in table scope">in table
-    scope</span>).</p>
-
-    <p class="example">In the non-conforming stream
-    <code>&lt;a&nbsp;href="a">a&lt;table>&lt;a&nbsp;href="b">b&lt;/table>x</code>,
-    the first <code>a</code> element would be closed upon seeing
-    the second one, and the "x" character would be inside a link
-    to "b", not to "a". This is despite the fact that the outer
-    <code>a</code> element is not in table scope (meaning that a
-    regular <code>&lt;/a></code> end tag at the start of the table
-    wouldn't close the outer <code>a</code> element).</p>
-
-    <p><span>Reconstruct the active formatting elements</span>, if
-    any.</p>
-
-    <p><span>Insert an HTML element</span> for the token. Add that
-    element to the <span>list of active formatting
-    elements</span>.</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is one of: "b", "big", "code", "em",
-   "font", "i", "s", "small", "strike", "strong", "tt", "u"</dt>
-   <dd>
-
-    <p><span>Reconstruct the active formatting elements</span>, if
-    any.</p>
-
-    <p><span>Insert an HTML element</span> for the token. Add that
-    element to the <span>list of active formatting
-    elements</span>.</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "nobr"</dt>
-   <dd>
-
-    <p><span>Reconstruct the active formatting elements</span>, if
-    any.</p>
-
-    <p>If the <span>stack of open elements</span> <span title="has an
-    element in scope">has a <code>nobr</code> element in scope</span>,
-    then this is a <span>parse error</span>; act as if an end tag with
-    the tag name "nobr" had been seen, then once again
-    <span>reconstruct the active formatting elements</span>, if
-    any.</p>
-
-    <p><span>Insert an HTML element</span> for the token. Add that
-    element to the <span>list of active formatting
-    elements</span>.</p>
-
-   </dd>
-
-   <dt id="adoptionAgency">An end tag whose tag name is one of: "a",
-   "b", "big", "code", "em", "font", "i", "nobr", "s", "small",
-   "strike", "strong", "tt", "u"</dt>
-   <dd>
-
-    <p>Follow these steps:</p>
-
-    <ol>
-
-     <li>
-
-      <p>Let the <var title="">formatting element</var> be the
-      last element in the <span>list of active formatting
-      elements</span> that:</p>
-
-      <ul>
-
-       <li>is between the end of the list and the last scope
-       marker in the list, if any, or the start of the list
-       otherwise, and</li>
-
-       <li>has the same tag name as the token.</li>
-
-      </ul>
-
-      <p>If there is no such node, or, if that node is also in the
-      <span>stack of open elements</span> but the element is not <span
-      title="has an element in scope">in scope</span>, then this is a
-      <span>parse error</span>; ignore the token, and abort these
-      steps.</p>
-
-      <p>Otherwise, if there is such a node, but that node is not
-      in the <span>stack of open elements</span>, then this is a
-      <span>parse error</span>; remove the element from the list,
-      and abort these steps.</p>
-
-      <p>Otherwise, there is a <var title="">formatting
-      element</var> and that element is in <span title="stack of
-      open elements">the stack</span> and is <span title="has an
-      element in scope">in scope</span>. If the element is not the
-      <span>current node</span>, this is a <span>parse
-      error</span>. In any case, proceed with the algorithm as
-      written in the following steps.</p>
-
-     </li>
-
-     <li><p>Let the <var title="">furthest block</var> be the
-     topmost node in the <span>stack of open elements</span> that
-     is lower in the stack than the <var title="">formatting
-     element</var>, and is not an element in the
-     <span>phrasing</span> or <span>formatting</span>
-     categories. There might not be one.</p></li>
-
-     <li><p>If there is no <var title="">furthest block</var>,
-     then the UA must skip the subsequent steps and instead just
-     pop all the nodes from the bottom of the <span>stack of open
-     elements</span>, from the <span>current node</span> up to and
-     including the <var title="">formatting element</var>, and
-     remove the <var title="">formatting element</var> from the
-     <span>list of active formatting elements</span>.</p></li>
-
-     <li><p>Let the <var title="">common ancestor</var> be the element
-     immediately above the <var title="">formatting element</var> in the
-     <span>stack of open elements</span>.</p></li>
-
-     <li><p>Let a bookmark note the position of the <var
-     title="">formatting element</var> in the <span>list of active
-     formatting elements</span> relative to the elements on either
-     side of it in the list.</p></li>
-
-     <li>
-
-      <p>Let <var title="">node</var> and <var title="">last node</var> be the
-      <var title="">furthest block</var>. Follow these steps:</p>
-
-      <ol>
-
-       <li>Let <var title="">node</var> be the element immediately
-       above <var title="">node</var> in the <span>stack of open
-       elements</span>.</li>
-
-       <li>If <var title="">node</var> is not in the <span>list of
-       active formatting elements</span>, then remove <var
-       title="">node</var> from the <span>stack of open
-       elements</span> and then go back to step 1.</li>
-
-       <li>Otherwise, if <var title="">node</var> is the <var
-       title="">formatting element</var>, then go to the next step
-       in the overall algorithm.</li>
-
-       <li>Otherwise, if <var title="">last node</var> is the <var
-       title="">furthest block</var>, then move the aforementioned
-       bookmark to be immediately after the <var
-       title="">node</var> in the <span>list of active formatting
-       elements</span>.</li>
-
-       <li>Perform a shallow
-       clone of <var title="">node</var>, replace the entry for
-       <var title="">node</var> in the <span>list of active formatting
-       elements</span> with an entry for the clone, replace the
-       entry for <var title="">node</var> in the <span>stack of open
-       elements</span> with an entry for the clone, and let
-       <var title="">node</var> be the clone.</li>
-
-       <li>Insert <var title="">last node</var> into <var
-       title="">node</var>, first removing it from its previous
-       parent node if any.</li>
-
-       <li>Let <var title="">last node</var> be <var title="">node</var>.</li>
-
-       <li>Return to step 1 of this inner set of steps.</li>
-
-      </ol>
-
-     </li>
-
-     <li>
-
-      <p>If the <var title="">common ancestor</var> node is a
-      <code>table</code>, <code>tbody</code>, <code>tfoot</code>,
-      <code>thead</code>, or <code>tr</code> element, then,
-      <span>foster parent</span> whatever <var title="">last
-      node</var> ended up being in the previous step, first removing
-      it from its previous parent node if any.</p>
-
-      <p>Otherwise, append whatever <var title="">last node</var>
-      ended up being in the previous step to the <var title="">common
-      ancestor</var> node, first removing it from its previous parent
-      node if any.</p>
-
-     </li>
-
-     <li><p>Perform a shallow clone of the <var title="">formatting
-     element</var>.</p></li>
-
-     <li><p>Take all of the child nodes of the <var title="">furthest
-     block</var> and append them to the clone created in the last
-     step.</p></li>
-
-     <li><p>Append that clone to the <var title="">furthest
-     block</var>.</p></li>
-
-     <li><p>Remove the <var title="">formatting element</var> from the
-     <span>list of active formatting elements</span>, and insert
-     the clone into the <span>list of active formatting
-     elements</span> at the position of the aforementioned
-     bookmark.</p></li>
-
-     <li><p>Remove the <var title="">formatting element</var> from the
-     <span>stack of open elements</span>, and insert the clone into
-     the <span>stack of open elements</span> immediately below the
-     position of the <var title="">furthest block</var> in that
-     stack.</p></li>
-
-     <li><p>Jump back to step 1 in this series of steps.</p></li>
-
-    </ol>
-
-    <p class="note">The way these steps are defined, only elements
-    in the <span>formatting</span> category ever get cloned by
-    this algorithm.</p>
-
-<!--XXX
-    <div class="example">
-     <p class="XXX">Need an example.</p>
-    </div>
--->
-
-    <p class="note">Because of the way this algorithm causes elements to
-    change parents, it has been dubbed the "adoption agency algorithm"
-    (in contrast with other possibly algorithms for dealing with
-    misnested content, which included the "incest algorithm", the
-    "secret affair algorithm", and the "Heisenberg algorithm").</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "button"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> <span title="has
-    an element in scope">has a <code>button</code> element in
-    scope</span>, then this is a <span>parse error</span>;
-    act as if an end tag with the tag name "button" had been seen,
-    then reprocess the token.</p>
-
-    <p>Otherwise:</p>
-
-    <p><span>Reconstruct the active formatting elements</span>, if
-    any.</p>
-
-    <p><span>Insert an HTML element</span> for the token.</p>
-
-    <p>Insert a marker at the end of the <span>list of active
-    formatting elements</span>.</p>
-
-    <p>Set the <span>frameset-ok flag</span> to "not ok".</p>
-
-   </dd>
-
-   <dt>A start tag token whose tag name is one of: "applet",
-   "marquee", "object"</dt>
-   <dd>
-
-    <p><span>Reconstruct the active formatting elements</span>, if
-    any.</p>
-
-    <p><span>Insert an HTML element</span> for the token.</p>
-
-    <p>Insert a marker at the end of the <span>list of active
-    formatting elements</span>.</p>
-
-    <p>Set the <span>frameset-ok flag</span> to "not ok".</p>
-
-   </dd>
-
-   <dt>An end tag token whose tag name is one of: "applet", "button",
-   "marquee", "object"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> does not <span
-    title="has an element in scope">have an element in scope</span>
-    with the same tag name as that of the token, then this is a
-    <span>parse error</span>; ignore the token.</p>
-
-    <p>Otherwise, run these steps:</p>
-
-    <ol>
-
-     <li><p><span>Generate implied end tags</span>.</p></li>
-
-     <li><p>If the <span>current node</span> is not an element with
-     the same tag name as that of the token, then this is a
-     <span>parse error</span>.</p></li>
-
-     <li><p>Pop elements from the <span>stack of open elements</span>
-     until an element with the same tag name as the token has been
-     popped from the stack.</p></li>
-
-     <li><span>Clear the list of active formatting elements up to the
-     last marker</span>.</li>
-
-    </ol>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "table"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> <span title="has
-    an element in scope">has a <code>p</code> element in
-    scope</span>, then act as if an end tag with the tag name
-    "p" had been seen.</p> <!-- XXX quirks: don't do this -->
-
-    <p><span>Insert an HTML element</span> for the token.</p>
-
-    <p>Set the <span>frameset-ok flag</span> to "not ok".</p>
-
-    <p>Switch the <span>insertion mode</span> to "<span
-    title="insertion mode: in table">in table</span>".</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is one of: "area", "basefont",
-   "bgsound", "br", "embed", "img", "input", "spacer", "wbr"</dt>
-   <dd>
-
-    <p><span>Reconstruct the active formatting elements</span>, if
-    any.</p>
-
-    <p><span>Insert an HTML element</span> for the token. Immediately
-    pop the <span>current node</span> off the <span>stack of open
-    elements</span>.</p>
-
-    <p><span title="acknowledge self-closing flag">Acknowledge the
-    token's <i>self-closing flag</i></span>, if it is set.</p>
-
-    <p>Set the <span>frameset-ok flag</span> to "not ok".</p> <!--
-    shouldn't really do it for <area>, <basefont>, <bgsound>, and
-    <spacer> -->
-
-   </dd>
-
-   <dt>A start tag whose tag name is one of: "param", "source"</dt>
-   <dd>
-
-    <p><span>Insert an HTML element</span> for the token. Immediately
-    pop the <span>current node</span> off the <span>stack of open
-    elements</span>.</p>
-
-    <p><span title="acknowledge self-closing flag">Acknowledge the
-    token's <i>self-closing flag</i></span>, if it is set.</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "hr"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> <span title="has
-    an element in scope">has a <code>p</code> element in
-    scope</span>, then act as if an end tag with the tag name
-    "p" had been seen.</p> <!-- XXX quirks: don't do this -->
-
-    <p><span>Insert an HTML element</span> for the token. Immediately
-    pop the <span>current node</span> off the <span>stack of open
-    elements</span>.</p>
-
-    <p><span title="acknowledge self-closing flag">Acknowledge the
-    token's <i>self-closing flag</i></span>, if it is set.</p>
-
-    <p>Set the <span>frameset-ok flag</span> to "not ok".</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "image"</dt>
-   <dd>
-    <p><span>Parse error</span>. Change the token's tag name
-    to "img" and reprocess it. (Don't ask.)</p> <!-- As of
-    2005-12, studies showed that around 0.2% of pages used the
-    <image> element. -->
-   </dd>
-
-   <dt id="isindex">A start tag whose tag name is "isindex"</dt>
-   <dd>
-
-    <p><span>Parse error</span>.</p>
-
-    <p>If the <span><code title="">form</code> element
-    pointer</span> is not null, then ignore the token.</p>
-
-    <p>Otherwise:</p>
-
-    <p><span title="acknowledge self-closing flag">Acknowledge the
-    token's <i>self-closing flag</i></span>, if it is set.</p> <!--
-    purely to reduce the number of errors (we don't care if they
-    included the /, they're not supposed to be including the tag at
-    all! -->
-
-    <p>Act as if a start tag token with the tag name "form" had been seen.</p>
-
-    <p>If the token has an attribute called "action", set the
-    <code title="attr-form-action">action</code> attribute on the
-    resulting <code>form</code> element to the value of the
-    "action" attribute of the token.</p>
-
-    <p>Act as if a start tag token with the tag name "hr" had been
-    seen.</p>
-
-    <p>Act as if a start tag token with the tag name "p" had been
-    seen.</p>
-
-    <p>Act as if a start tag token with the tag name "label" had been
-    seen.</p>
-
-    <p>Act as if a stream of character tokens had been seen (see below
-    for what they should say).</p>
-
-    <p>Act as if a start tag token with the tag name "input" had been
-    seen, with all the attributes from the "isindex" token except
-    "name", "action", and "prompt". Set the <code
-    title="attr-fe-name">name</code> attribute of the resulting
-    <code>input</code> element to the value "<code
-    title="">isindex</code>".</p>
-
-    <p>Act as if a stream of character tokens had been seen (see
-    below for what they should say).</p>
-
-    <p>Act as if an end tag token with the tag name "label" had been
-    seen.</p>
-
-    <p>Act as if an end tag token with the tag name "p" had been
-    seen.</p>
-
-    <p>Act as if a start tag token with the tag name "hr" had been
-    seen.</p>
-
-    <p>Act as if an end tag token with the tag name "form" had been
-    seen.</p>
-
-    <p>If the token has an attribute with the name "prompt", then the
-    first stream of characters must be the same string as given in
-    that attribute, and the second stream of characters must be
-    empty. Otherwise, the two streams of character tokens together
-    should, together with the <code>input</code> element, express the
-    equivalent of "This is a searchable index. Insert your search
-    keywords here: (input field)" in the user's preferred
-    language.</p>
-
-   </dd>
-
-<!-- XXX keygen support; don't forget form element pointer!
-     Search for 'keygen' elsewhere in the spec when doing this.
-
-   <dt>A start tag whose tag name is "keygen"</dt>
-   <dd>
-    ...
-   </dd>
--->
-
-   <dt>A start tag whose tag name is "textarea"</dt>
-   <dd>
-
-    <ol>
-
-     <li><p><span>Insert an HTML element</span> for the
-     token.</p></li>
-
-     <li><p>If the next token is a U+000A LINE FEED (LF) character
-     token, then ignore that token and move on to the next
-     one. (Newlines at the start of <code>textarea</code> elements are
-     ignored as an authoring convenience.)</p></li>
-
-     <li><p>Switch the tokeniser's <span>content model flag</span> to
-     the RCDATA state.</p></li>
-
-     <li><p>Let the <span>original insertion mode</span> be the
-     current <span>insertion mode</span>.</p>
-
-     <li><p>Set the <span>frameset-ok flag</span> to "not
-     ok".</p></li>
-
-     <li><p>Switch the <span>insertion mode</span> to "<span
-     title="insertion mode: in CDATA/RCDATA">in
-     CDATA/RCDATA</span>".</p></li>
-
-    </ol>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "xmp"</dt>
-   <dd>
-
-    <p><span>Reconstruct the active formatting elements</span>, if
-    any.</p>
-
-    <p>Set the <span>frameset-ok flag</span> to "not ok".</p>
-
-    <p>Follow the <span>generic CDATA element parsing algorithm</span>.</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "iframe"</dt>
-   <dd>
-
-    <p>Set the <span>frameset-ok flag</span> to "not ok".</p>
-
-    <p>Follow the <span>generic CDATA element parsing algorithm</span>.</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "noembed"</dt>
-   <dt>A start tag whose tag name is "noscript", if the <span>scripting flag</span> is enabled</dt>
-   <dd>
-
-    <p>Follow the <span>generic CDATA element parsing algorithm</span>.</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "select"</dt>
-   <dd>
-
-    <p><span>Reconstruct the active formatting elements</span>, if
-    any.</p>
-
-    <p><span>Insert an HTML element</span> for the token.</p>
-
-    <p>Set the <span>frameset-ok flag</span> to "not ok".</p>
-
-    <p>If the <span>insertion mode</span> is one of <span
-    title="insertion mode: in table">in table</span>", "<span
-    title="insertion mode: in caption">in caption</span>", "<span
-    title="insertion mode: in column group">in column group</span>",
-    "<span title="insertion mode: in table body">in table
-    body</span>", "<span title="insertion mode: in row">in
-    row</span>", or "<span title="insertion mode: in cell">in
-    cell</span>", then switch the <span>insertion mode</span> to
-    "<span title="insertion mode: in select in table">in select in
-    table</span>". Otherwise, switch the <span>insertion mode</span>
-    to "<span title="insertion mode: in select">in select</span>".</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is one of: "optgroup", "option"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> <span title="has an
-    element in scope">has an <code>option</code> element in
-    scope</span>, then act as if an end tag with the tag name "option"
-    had been seen.</p>
-
-    <p><span>Reconstruct the active formatting elements</span>, if
-    any.</p>
-
-    <p><span>Insert an HTML element</span> for the token.</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is one of: "rp", "rt"</dt>
-   <dd>
-
-    <!-- the parsing rules for ruby really don't match IE much at all,
-         but in practice the markup used is very simple and so strict
-         compatibility with IE isn't required. For example, as defined
-         here we get very, very different behaviour than IE for
-         pathological cases like:
-
-           <ruby><ol><li><p>a<rt>b
-           <ruby>a<rt>b<p>c
-
-         But in practice most ruby markup falls into these cases:
-
-           <ruby>a<rt>b</ruby>
-           <ruby>a<rp>b<rt>c<rp>d</ruby>
-           <ruby>a<rt>b</rt></ruby>
-           <ruby>a<rp>b</rp><rt>c</rt><rp>d</rp></ruby>
-
-    -->
-
-    <p>If the <span>stack of open elements</span> <span title="has an
-    element in scope">has a <code>ruby</code> element in scope</span>,
-    then <span>generate implied end tags</span>. If the <span>current
-    node</span> is not then a <code>ruby</code> element, this is a
-    <span>parse error</span>; pop all the nodes from the <span>current
-    node</span> up to the node immediately before the bottommost
-    <code>ruby</code> element on the <span>stack of open
-    elements</span>.</p>
-
-    <p><span>Insert an HTML element</span> for the token.</p>
-
-   </dd>
-
-   <dt>An end tag whose tag name is "br"</dt>
-   <dd>
-    <p><span>Parse error</span>. Act as if a start tag token with
-    the tag name "br" had been seen. Ignore the end tag token.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "math"</dt>
-   <dd>
-
-    <p><span>Reconstruct the active formatting elements</span>, if
-    any.</p>
-
-    <p><span>Adjust MathML attributes</span> for the token. (This
-    fixes the case of MathML attributes that are not all
-    lowercase.)</p>
-
-    <p><span>Adjust foreign attributes</span> for the token. (This
-    fixes the use of namespaced attributes, in particular XLink.)</p>
-
-    <p><span>Insert a foreign element</span> for the token, in the
-    <span>MathML namespace</span>.</p>
-
-    <p>If the token has its <i>self-closing flag</i> set, pop the
-    <span>current node</span> off the <span>stack of open
-    elements</span> and <span title="acknowledge self-closing
-    flag">acknowledge the token's <i>self-closing flag</i></span>.</p>
-
-    <p>Otherwise, let the <span>secondary insertion mode</span> be the
-    current <span>insertion mode</span>, and then switch the
-    <span>insertion mode</span> to "<span title="insertion mode: in
-    foreign content">in foreign content</span>".</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "svg"</dt>
-   <dd>
-
-    <p><span>Reconstruct the active formatting elements</span>, if
-    any.</p>
-
-    <p><span>Adjust SVG attributes</span> for the token. (This fixes
-    the case of SVG attributes that are not all lowercase.)</p>
-
-    <p><span>Adjust foreign attributes</span> for the token. (This
-    fixes the use of namespaced attributes, in particular XLink in
-    SVG.)</p>
-
-    <p><span>Insert a foreign element</span> for the token, in the
-    <span>SVG namespace</span>.</p>
-
-    <p>If the token has its <i>self-closing flag</i> set, pop the
-    <span>current node</span> off the <span>stack of open
-    elements</span> and <span title="acknowledge self-closing
-    flag">acknowledge the token's <i>self-closing flag</i></span>.</p>
-
-    <p>Otherwise, let the <span>secondary insertion mode</span> be the
-    current <span>insertion mode</span>, and then switch the
-    <span>insertion mode</span> to "<span title="insertion mode: in
-    foreign content">in foreign content</span>".</p>
-
-   </dd>
-
-   <dt>A start <!--or end--> tag whose tag name is one of: "caption",
-   "col", "colgroup", "frame", "head", "tbody", "td", "tfoot", "th",
-   "thead", "tr"</dt>
-   <!--<dt>An end tag whose tag name is one of: "area", "base",
-   "basefont", "bgsound", "command", "embed", "hr", "iframe", "image",
-   "img", "input", "isindex", "link", "meta", "noembed", "noframes",
-   "param", "script", "select", "source", "spacer", "style", "table",
-   "textarea", "title", "wbr"</dt>--> <!-- add keygen if we add the
-   start tag -->
-   <!--<dt>An end tag whose tag name is "noscript", if the
-   <span>scripting flag</span> is enabled</dt>-->
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-    <!-- end tags are commented out because since they can never end
-    up on the stack anyway, the default end tag clause will
-    automatically handle them. we don't want to have text in the spec
-    that is just an optimisation, as that detracts from the spec
-    itself -->
-   </dd>
-
-   <dt>Any other start tag</dt>
-   <dd>
-
-    <p><span>Reconstruct the active formatting elements</span>, if
-    any.</p>
-
-    <p><span>Insert an HTML element</span> for the token.</p>
-
-    <p class="note">This element will be a <span>phrasing</span>
-    element.</p>
-
-   </dd>
-
-   <dt>Any other end tag</dt>
-   <dd>
-
-    <p>Run the following steps:</p>
-
-    <ol>
-
-     <li><p>Initialize <var title="">node</var> to be the <span>current
-     node</span> (the bottommost node of the stack).</p></li>
-
-     <li><p>If <var title="">node</var> has the same tag name as
-     the end tag token, then:</p>
-
-      <ol>
-
-       <li><p><span>Generate implied end tags</span>.</p></li>
-
-       <li><p>If the tag name of the end tag token does not match
-       the tag name of the <span>current node</span>, this is a
-       <span>parse error</span>.</p></li>
-
-       <li><p>Pop all the nodes from the <span>current node</span> up
-       to <var title="">node</var>, including <var
-       title="">node</var>, then stop these steps.</p></li>
-
-      </ol>
-
-     </li>
-
-     <li><p>Otherwise, if <var title="">node</var> is in neither the
-     <span>formatting</span> category nor the <span>phrasing</span>
-     category, then this is a <span>parse error</span>; ignore the
-     token, and abort these steps.</p></li>
-
-     <li><p>Set <var title="">node</var> to the previous entry in the
-     <span>stack of open elements</span>.</p></li>
-
-     <li><p>Return to step 2.</p></li>
-
-    </ol>
-
-   </dd>
-
-  </dl>
-
-
-
-  <h5 id="parsing-main-incdata">The "<dfn title="insertion mode: in CDATA/RCDATA">in CDATA/RCDATA</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: in CDATA/RCDATA">in CDATA/RCDATA</span>", tokens must be
-  handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>A character token</dt>
-   <dd>
-
-    <p><span title="insert a character">Insert the token's
-    character</span> into the <span>current node</span>.</p>
-
-   </dd>
-
-   <dt>An end-of-file token</dt>
-   <dd>
-
-    <!-- can't be the fragment case -->
-    <p><span>Parse error</span>.</p>
-
-    <p>If the <span>current node</span> is a <code>script</code>
-    element, mark the <code>script</code> element as <span>"already
-    executed"</span>.</p>
-
-    <p>Pop the <span>current node</span> off the <span>stack of open
-    elements</span>.</p>
-
-    <p>Switch the <span>insertion mode</span> to the <span>original
-    insertion mode</span> and reprocess the current token.</p>
-
-   </dd>
-
-   <dt>An end tag whose tag name is "script"</dt>
-   <dd>
-
-    <p>Let <var title="">script</var> be the <span>current node</span>
-    (which will be a <code>script</code> element).</p>
-
-    <p>Pop the <span>current node</span> off the <span>stack of open
-    elements</span>.</p>
-
-    <p>Switch the <span>insertion mode</span> to the <span>original
-    insertion mode</span>.</p>
-
-    <p>Let the <var title="">old insertion point</var> have the
-    same value as the current <span>insertion point</span>. Let
-    the <span>insertion point</span> be just before the <span>next
-    input character</span>.</p>
-
-    <p>Increment the parser's <span>script nesting level</span> by
-    one.</p>
-
-    <p><span title="running a script">Run</span> the <var
-    title="">script</var>. This might cause some script to execute,
-    which might cause <span title="dom-document-write">new characters
-    to be inserted into the tokeniser</span>, and might cause the
-    tokeniser to output more tokens, resulting in a <a
-    href="#nestedParsing">reentrant invocation of the parser</a>.</p>
-
-    <p>Decrement the parser's <span>script nesting level</span> by
-    one. If the parser's <span>script nesting level</span> is zero,
-    then set the <span>parser pause flag</span> to false.</p>
-
-    <p>Let the <span>insertion point</span> have the value of the <var
-    title="">old insertion point</var>. (In other words, restore the
-    <span>insertion point</span> to its previous value. This value
-    might be the "undefined" value.)</p>
-
-    <p id="scriptTagParserResumes">At this stage, if there is a
-    <span>pending external script</span>, then:</p>
-
-    <dl class="switch">
-
-     <dt>If the tree construction stage is <a
-     href="#nestedParsing">being called reentrantly</a>, say from a
-     call to <code
-     title="dom-document-write">document.write()</code>:</dt>
-
-     <dd><p>Set the <span>parser pause flag</span> to true, and abort
-     the processing of any nested invocations of the tokeniser,
-     yielding control back to the caller. (Tokenization will resume
-     when the caller returns to the "outer" tree construction
-     stage.)</p></dd>
-
-
-     <dt>Otherwise:</dt>
-
-     <dd>
-
-      <p>Follow these steps:</p>
-
-      <ol>
-
-       <li><p>Let <var title="">the script</var> be the <span>pending
-       external script</span>. There is no longer a <span>pending
-       external script</span>.</p></li>
-
-       <li><p><span>Pause</span> until the script has <span>completed
-       loading</span>.</p></li>
-
-       <li><p>Let the <span>insertion point</span> be just before the
-       <span>next input character</span>.</p></li>
-
-       <li><p><span title="executing a script block">Execute the
-       script</span>.</p></li>
-
-       <li><p>Let the <span>insertion point</span> be undefined
-       again.</p></li>
-
-       <li><p>If there is once again a <span>pending external
-       script</span>, then repeat these steps from step 1.</p></li>
-
-      </ol>
-
-     </dd>
-
-    </dl>
-
-   </dd>
-
-   <dt>Any other end tag</dt>
-   <dd>
-
-    <p>Pop the <span>current node</span> off the <span>stack of open
-    elements</span>.</p>
-
-    <p>Switch the <span>insertion mode</span> to the <span>original
-    insertion mode</span>.</p>
-
-   </dd>
-
-  </dl>
-
-
-  <h5 id="parsing-main-intable">The "<dfn title="insertion mode: in table">in table</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: in table">in table</span>", tokens must be handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>A character token that is one of U+0009 CHARACTER
-   TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
-   <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
-   <dd>
-
-    <p>If the <span>current table</span> is <span>tainted</span>, then
-    act as described in the "anything else" entry below.</p>
-
-    <p>Otherwise, <span title="insert a character">insert the
-    character</span> into the <span>current node</span>.</p>
-
-   </dd>
-
-   <dt>A comment token</dt>
-   <dd>
-    <p>Append a <code>Comment</code> node to the <span>current
-    node</span> with the <code title="">data</code> attribute set to
-    the data given in the comment token.</p>
-   </dd>
-
-   <dt>A DOCTYPE token</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "caption"</dt>
-   <dd>
-
-    <p><span>Clear the stack back to a table context</span>. (See
-    below.)</p>
-
-    <p>Insert a marker at the end of the <span>list of active
-    formatting elements</span>.</p>
-
-    <p><span>Insert an HTML element</span> for the token, then
-    switch the <span>insertion mode</span> to "<span
-    title="insertion mode: in caption">in caption</span>".</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "colgroup"</dt>
-   <dd>
-
-    <p><span>Clear the stack back to a table context</span>. (See
-    below.)</p>
-
-    <p><span>Insert an HTML element</span> for the token, then
-    switch the <span>insertion mode</span> to "<span
-    title="insertion mode: in column group">in column
-    group</span>".</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "col"</dt>
-   <dd>
-    <p>Act as if a start tag token with the tag name "colgroup"
-    had been seen, then reprocess the current token.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is one of: "tbody", "tfoot", "thead"</dt>
-   <dd>
-
-    <p><span>Clear the stack back to a table context</span>. (See
-    below.)</p>
-
-    <p><span>Insert an HTML element</span> for the token, then
-    switch the <span>insertion mode</span> to "<span
-    title="insertion mode: in table body">in table
-    body</span>".</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is one of: "td", "th", "tr"</dt>
-   <dd>
-    <p>Act as if a start tag token with the tag name "tbody" had
-    been seen, then reprocess the current token.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "table"</dt>
-   <dd>
-
-    <p><span>Parse error</span>. Act as if an end tag token with
-    the tag name "table" had been seen, then, if that token wasn't
-    ignored, reprocess the current token.</p>
-
-    <p class="note">The fake end tag token here can only be
-    ignored in the <span>fragment case</span>.</p>
-
-   </dd>
-
-   <dt>An end tag whose tag name is "table"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> does not <span
-    title="has an element in table scope">have an element in table
-    scope</span> with the same tag name as the token, this is a
-    <span>parse error</span>. Ignore the token. (<span>fragment
-    case</span>)</p>
-
-    <p>Otherwise:</p>
-
-    <p>Pop elements from this stack until a <code>table</code>
-    element has been popped from the stack.</p>
-
-    <p><span>Reset the insertion mode appropriately</span>.</p>
-
-   </dd>
-
-   <dt>An end tag whose tag name is one of: "body", "caption",
-   "col", "colgroup", "html", "tbody", "td", "tfoot", "th",
-   "thead", "tr"</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is one of: "style", "script"</dt>
-   <dd>
-
-    <p>If the <span>current table</span> is <span>tainted</span> then
-    act as described in the "anything else" entry below.</p>
-
-    <p>Otherwise, process the token <span>using the rules for</span>
-    the "<span title="insertion mode: in head">in
-    head</span>" <span>insertion mode</span>.</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "input"</dt>
-   <dd>
-
-    <p>If the token does not have an attribute with the name "type",
-    or if it does, but that attribute's value is not an <span>ASCII
-    case-insensitive</span> match for the string "<code
-    title="">hidden</code>", or, if the <span>current table</span> is
-    <span>tainted</span>, then: act as described in the "anything
-    else" entry below.</p>
-
-    <p>Otherwise:</p>
-
-    <p><span>Parse error</span>.</p>
-
-    <p><span>Insert an HTML element</span> for the token.</p>
-
-    <p>Pop that <code>input</code> element off the <span>stack of
-    open elements</span>.</p>
-
-   </dd>
-
-   <dt>An end-of-file token</dt>
-   <dd>
-
-    <p>If the <span>current node</span> is not the root
-    <code>html</code> element, then this is a <span>parse
-    error</span>.</p>
-
-    <p class="note">It can only be the <span>current node</span> in
-    the <span>fragment case</span>.</p>
-
-    <p><span>Stop parsing</span>.</p>
-
-   </dd>
-
-   <dt>Anything else</dt>
-   <dd>
-
-    <p><span>Parse error</span>. Process the token <span>using the
-    rules for</span> the "<span title="insertion mode: in body">in
-    body</span>" <span>insertion mode</span>, except that if the
-    <span>current node</span> is a <code>table</code>,
-    <code>tbody</code>, <code>tfoot</code>, <code>thead</code>, or
-    <code>tr</code> element, then, whenever a node would be inserted
-    into the <span>current node</span>, it must instead be <span
-    title="foster parent">foster parented</span>.</p>
-
-   </dd>
-
-  </dl>
-
-  <p>When the steps above require the UA to <dfn>clear the stack
-  back to a table context</dfn>, it means that the UA must, while
-  the <span>current node</span> is not a <code>table</code>
-  element or an <code>html</code> element, pop elements from the
-  <span>stack of open elements</span>.</p>
-
-  <p class="note">The <span>current node</span> being an
-  <code>html</code> element after this process is a <span>fragment
-  case</span>.</p>
-
-
-  <h5 id="parsing-main-incaption">The "<dfn title="insertion mode: in caption">in caption</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: in caption">in caption</span>", tokens must be handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>An end tag whose tag name is "caption"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> does not <span
-    title="has an element in table scope">have an element in table
-    scope</span> with the same tag name as the token, this is a
-    <span>parse error</span>. Ignore the token. (<span>fragment
-    case</span>)</p>
-
-    <p>Otherwise:</p>
-
-    <p><span>Generate implied end tags</span>.</p>
-
-    <p>Now, if the <span>current node</span> is not a
-    <code>caption</code> element, then this is a <span>parse
-    error</span>.</p>
-
-    <p>Pop elements from this stack until a <code>caption</code>
-    element has been popped from the stack.</p>
-
-    <p><span>Clear the list of active formatting elements up to
-    the last marker</span>.</p>
-
-    <p>Switch the <span>insertion mode</span> to "<span
-    title="insertion mode: in table">in table</span>".</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is one of: "caption", "col",
-   "colgroup", "tbody", "td", "tfoot", "th", "thead", "tr"</dt>
-   <dt>An end tag whose tag name is "table"</dt>
-   <dd>
-
-    <p><span>Parse error</span>. Act as if an end tag with the tag
-    name "caption" had been seen, then, if that token wasn't
-    ignored, reprocess the current token.</p>
-
-    <p class="note">The fake end tag token here can only be
-    ignored in the <span>fragment case</span>.</p>
-
-   </dd>
-
-   <dt>An end tag whose tag name is one of: "body", "col",
-   "colgroup", "html", "tbody", "td", "tfoot", "th", "thead",
-   "tr"</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>Anything else</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in body">in body</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-  </dl>
-
-
-  <h5 id="parsing-main-incolgroup">The "<dfn title="insertion mode: in column group">in column group</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: in column group">in column group</span>", tokens must be handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>A character token that is one of U+0009 CHARACTER
-   TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
-   <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
-   <dd>
-    <p><span title="insert a character">Insert the character</span> into
-    the <span>current node</span>.</p>
-   </dd>
-
-   <dt>A comment token</dt>
-   <dd>
-    <p>Append a <code>Comment</code> node to the <span>current
-    node</span> with the <code title="">data</code> attribute set to
-    the data given in the comment token.</p>
-   </dd>
-
-   <dt>A DOCTYPE token</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "html"</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in body">in body</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "col"</dt>
-   <dd>
-
-    <p><span>Insert an HTML element</span> for the token. Immediately
-    pop the <span>current node</span> off the <span>stack of open
-    elements</span>.</p>
-
-    <p><span title="acknowledge self-closing flag">Acknowledge the
-    token's <i>self-closing flag</i></span>, if it is set.</p>
-
-   </dd>
-
-   <dt>An end tag whose tag name is "colgroup"</dt>
-   <dd>
-
-    <p>If the <span>current node</span> is the root
-    <code>html</code> element, then this is a <span>parse
-    error</span>; ignore the token. (<span>fragment
-    case</span>)</p>
-
-    <p>Otherwise, pop the <span>current node</span> (which will be
-    a <code>colgroup</code> element) from the <span>stack of open
-    elements</span>. Switch the <span>insertion mode</span> to
-    "<span title="insertion mode: in table">in table</span>".</p>
-
-   </dd>
-
-   <dt>An end tag whose tag name is "col"</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>An end-of-file token</dt>
-   <dd>
-
-    <p>If the <span>current node</span> is the root <code>html</code>
-    element, then <span>stop parsing</span>. (<span>fragment
-    case</span>)</p>
-
-    <p>Otherwise, act as described in the "anything else" entry
-    below.</p>
-
-   </dd>
-
-   <dt>Anything else</dt>
-   <dd>
-
-    <p>Act as if an end tag with the tag name "colgroup" had been
-    seen, and then, if that token wasn't ignored, reprocess the
-    current token.</p>
-
-    <p class="note">The fake end tag token here can only be
-    ignored in the <span>fragment case</span>.</p>
-
-   </dd>
-
-  </dl>
-
-
-  <h5 id="parsing-main-intbody">The "<dfn title="insertion mode: in table body">in table body</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: in table body">in table body</span>", tokens must be handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>A start tag whose tag name is "tr"</dt>
-   <dd>
-
-    <p><span>Clear the stack back to a table body
-    context</span>. (See below.)</p>
-
-    <p><span>Insert an HTML element</span> for the token, then switch
-    the <span>insertion mode</span> to "<span title="insertion mode:
-    in row">in row</span>".</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is one of: "th", "td"</dt>
-   <dd>
-    <p><span>Parse error</span>. Act as if a start tag with
-    the tag name "tr" had been seen, then reprocess the current
-    token.</p>
-   </dd>
-
-   <dt>An end tag whose tag name is one of: "tbody", "tfoot",
-   "thead"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> does not <span
-    title="has an element in table scope">have an element in table
-    scope</span> with the same tag name as the token, this is a
-    <span>parse error</span>. Ignore the token.</p>
-
-    <p>Otherwise:</p>
-
-    <p><span>Clear the stack back to a table body
-    context</span>. (See below.)</p>
-
-    <p>Pop the <span>current node</span> from the <span>stack of
-    open elements</span>. Switch the <span>insertion mode</span>
-    to "<span title="insertion mode: in table">in table</span>".</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is one of: "caption", "col",
-   "colgroup", "tbody", "tfoot", "thead"</dt>
-   <dt>An end tag whose tag name is "table"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> does not <span
-    title="has an element in table scope">have a
-    <code>tbody</code>, <code>thead</code>, or <code>tfoot</code>
-    element in table scope</span>, this is a <span>parse
-    error</span>. Ignore the token. (<span>fragment
-    case</span>)</p>
-
-    <p>Otherwise:</p>
-
-    <p><span>Clear the stack back to a table body
-    context</span>. (See below.)</p>
-
-    <p>Act as if an end tag with the same tag name as the
-    <span>current node</span> ("tbody", "tfoot", or "thead") had
-    been seen, then reprocess the current token.</p>
-
-   </dd>
-
-   <dt>An end tag whose tag name is one of: "body", "caption",
-   "col", "colgroup", "html", "td", "th", "tr"</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>Anything else</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in table">in table</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-  </dl>
-
-  <p>When the steps above require the UA to <dfn>clear the stack
-  back to a table body context</dfn>, it means that the UA must,
-  while the <span>current node</span> is not a <code>tbody</code>,
-  <code>tfoot</code>, <code>thead</code>, or <code>html</code>
-  element, pop elements from the <span>stack of open
-  elements</span>.</p>
-
-  <p class="note">The <span>current node</span> being an
-  <code>html</code> element after this process is a <span>fragment
-  case</span>.</p>
-
-
-  <h5 id="parsing-main-intr">The "<dfn title="insertion mode: in row">in row</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: in row">in row</span>", tokens must be handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>A start tag whose tag name is one of: "th", "td"</dt>
-   <dd>
-
-    <p><span>Clear the stack back to a table row
-    context</span>. (See below.)</p>
-
-    <p><span>Insert an HTML element</span> for the token, then switch
-    the <span>insertion mode</span> to "<span title="insertion mode:
-    in cell">in cell</span>".</p>
-
-    <p>Insert a marker at the end of the <span>list of active
-    formatting elements</span>.</p>
-
-   </dd>
-
-   <dt>An end tag whose tag name is "tr"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> does not <span
-    title="has an element in table scope">have an element in table
-    scope</span> with the same tag name as the token, this is a
-    <span>parse error</span>. Ignore the token. (<span>fragment
-    case</span>)</p>
-
-    <p>Otherwise:</p>
-
-    <p><span>Clear the stack back to a table row
-    context</span>. (See below.)</p>
-
-    <p>Pop the <span>current node</span> (which will be a
-    <code>tr</code> element) from the <span>stack of open
-    elements</span>. Switch the <span>insertion mode</span> to
-    "<span title="insertion mode: in table body">in table
-    body</span>".</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is one of: "caption", "col",
-   "colgroup", "tbody", "tfoot", "thead", "tr"</dt>
-   <dt>An end tag whose tag name is "table"</dt>
-   <dd>
-
-    <p>Act as if an end tag with the tag name "tr" had been seen,
-    then, if that token wasn't ignored, reprocess the current
-    token.</p>
-
-    <p class="note">The fake end tag token here can only be
-    ignored in the <span>fragment case</span>.</p>
-
-   </dd>
-
-   <dt>An end tag whose tag name is one of: "tbody", "tfoot",
-   "thead"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> does not <span
-    title="has an element in table scope">have an element in table
-    scope</span> with the same tag name as the token, this is a
-    <span>parse error</span>. Ignore the token.</p>
-
-    <p>Otherwise, act as if an end tag with the tag name "tr" had
-    been seen, then reprocess the current token.</p>
-
-   </dd>
-
-   <dt>An end tag whose tag name is one of: "body", "caption",
-   "col", "colgroup", "html", "td", "th"</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>Anything else</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in table">in table</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-  </dl>
-
-  <p>When the steps above require the UA to <dfn>clear the stack
-  back to a table row context</dfn>, it means that the UA must,
-  while the <span>current node</span> is not a <code>tr</code>
-  element or an <code>html</code> element, pop elements from the
-  <span>stack of open elements</span>.</p>
-
-  <p class="note">The <span>current node</span> being an
-  <code>html</code> element after this process is a <span>fragment
-  case</span>.</p>
-
-
-  <h5 id="parsing-main-intd">The "<dfn title="insertion mode: in cell">in cell</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: in cell">in cell</span>", tokens must be handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>An end tag whose tag name is one of: "td", "th"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> does not <span
-    title="has an element in table scope">have an element in table
-    scope</span> with the same tag name as that of the token, then
-    this is a <span>parse error</span> and the token must be
-    ignored.</p>
-
-    <p>Otherwise:</p>
-
-    <p><span>Generate implied end tags</span>.</p>
-
-    <p>Now, if the <span>current node</span> is not an element
-    with the same tag name as the token, then this is a
-    <span>parse error</span>.</p>
-
-    <p>Pop elements from this stack until an element with the same
-    tag name as the token has been popped from the stack.</p>
-
-    <p><span>Clear the list of active formatting elements up to
-    the last marker</span>.</p>
-
-    <p>Switch the <span>insertion mode</span> to "<span
-    title="insertion mode: in row">in row</span>". (The
-    <span>current node</span> will be a <code>tr</code> element at
-    this point.)</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is one of: "caption", "col",
-   "colgroup", "tbody", "td", "tfoot", "th", "thead", "tr"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> does
-    <em>not</em> <span title="has an element in table scope">have
-    a <code>td</code> or <code>th</code> element in table
-    scope</span>, then this is a <span>parse error</span>; ignore
-    the token. (<span>fragment case</span>)</p>
-
-    <p>Otherwise, <span>close the cell</span> (see below) and
-    reprocess the current token.</p>
-
-   </dd>
-
-   <dt>An end tag whose tag name is one of: "body", "caption",
-   "col", "colgroup", "html"</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>An end tag whose tag name is one of: "table", "tbody",
-   "tfoot", "thead", "tr"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> does not <span
-    title="has an element in table scope">have an element in table
-    scope</span> with the same tag name as that of the token
-    (which can only happen for "tbody", "tfoot" and "thead", or,
-    in the <span>fragment case</span>), then this is a <span>parse
-    error</span> and the token must be ignored.</p>
-
-    <p>Otherwise, <span>close the cell</span> (see below) and
-    reprocess the current token.</p>
-
-   </dd>
-
-   <dt>Anything else</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in body">in body</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-  </dl>
-
-  <p>Where the steps above say to <dfn>close the cell</dfn>, they
-  mean to run the following algorithm:</p>
-
-  <ol>
-
-   <li><p>If the <span>stack of open elements</span> <span
-   title="has an element in table scope">has a <code>td</code>
-   element in table scope</span>, then act as if an end tag token
-   with the tag name "td" had been seen.</p></li>
-
-   <li><p>Otherwise, the <span>stack of open elements</span> will
-   <span title="has an element in table scope">have a
-   <code>th</code> element in table scope</span>; act as if an end
-   tag token with the tag name "th" had been seen.</p></li>
-
-  </ol>
-
-  <p class="note">The <span>stack of open elements</span> cannot
-  have both a <code>td</code> and a <code>th</code> element <span
-  title="has an element in table scope">in table scope</span> at
-  the same time, nor can it have neither when the <span>insertion
-  mode</span> is "<span title="insertion mode: in cell">in
-  cell</span>".</p>
-
-
-  <h5 id="parsing-main-inselect">The "<dfn title="insertion mode: in select">in select</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: in select">in select</span>", tokens must be handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>A character token</dt>
-   <dd>
-    <p><span title="insert a character">Insert the token's
-    character</span> into the <span>current node</span>.</p>
-   </dd>
-
-   <dt>A comment token</dt>
-   <dd>
-    <p>Append a <code>Comment</code> node to the <span>current
-    node</span> with the <code title="">data</code> attribute set to
-    the data given in the comment token.</p>
-   </dd>
-
-   <dt>A DOCTYPE token</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "html"</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in body">in body</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "option"</dt>
-   <dd>
-
-    <p>If the <span>current node</span> is an <code>option</code>
-    element, act as if an end tag with the tag name "option" had
-    been seen.</p>
-
-    <p><span>Insert an HTML element</span> for the token.</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "optgroup"</dt>
-   <dd>
-
-    <p>If the <span>current node</span> is an <code>option</code>
-    element, act as if an end tag with the tag name "option" had
-    been seen.</p>
-
-    <p>If the <span>current node</span> is an
-    <code>optgroup</code> element, act as if an end tag with the
-    tag name "optgroup" had been seen.</p>
-
-    <p><span>Insert an HTML element</span> for the token.</p>
-
-   </dd>
-
-   <dt>An end tag whose tag name is "optgroup"</dt>
-   <dd>
-
-    <p>First, if the <span>current node</span> is an
-    <code>option</code> element, and the node immediately before
-    it in the <span>stack of open elements</span> is an
-    <code>optgroup</code> element, then act as if an end tag with
-    the tag name "option" had been seen.</p>
-
-    <p>If the <span>current node</span> is an
-    <code>optgroup</code> element, then pop that node from the
-    <span>stack of open elements</span>. Otherwise, this is a
-    <span>parse error</span>; ignore the token.</p>
-
-   </dd>
-
-   <dt>An end tag whose tag name is "option"</dt>
-   <dd>
-
-    <p>If the <span>current node</span> is an <code>option</code>
-    element, then pop that node from the <span>stack of open
-    elements</span>. Otherwise, this is a <span>parse
-    error</span>; ignore the token.</p>
-
-   </dd>
-
-   <dt>An end tag whose tag name is "select"</dt>
-   <dd>
-
-    <p>If the <span>stack of open elements</span> does not <span
-    title="has an element in table scope">have an element in table
-    scope</span> with the same tag name as the token, this is a
-    <span>parse error</span>. Ignore the token. (<span>fragment
-    case</span>)</p>
-
-    <p>Otherwise:</p>
-
-    <p>Pop elements from the <span>stack of open elements</span>
-    until a <code>select</code> element has been popped from the
-    stack.</p>
-
-    <p><span>Reset the insertion mode appropriately</span>.</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "select"</dt>
-   <dd>
-
-    <p><span>Parse error</span>. Act as if the token had been
-    an end tag with the tag name "select" instead.</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is one of: "input", "textarea"</dt>
-   <dd>
-    <p><span>Parse error</span>. Act as if an end tag with the tag
-    name "select" had been seen, and reprocess the token.</p>
-   </dd>
-
-   <dt>A start tag token whose tag name is "script"</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in head">in head</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-   <dt>An end-of-file token</dt>
-   <dd>
-
-    <p>If the <span>current node</span> is not the root
-    <code>html</code> element, then this is a <span>parse
-    error</span>.</p>
-
-    <p class="note">It can only be the <span>current node</span> in
-    the <span>fragment case</span>.</p>
-
-    <p><span>Stop parsing</span>.</p>
-
-   </dd>
-
-   <dt>Anything else</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-  </dl>
-
-
-  <h5 id="parsing-main-inselectintable">The "<dfn title="insertion mode: in select in table">in select in table</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: in select in table">in select in table</span>", tokens must be handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>A start tag whose tag name is one of: "caption", "table",
-   "tbody", "tfoot", "thead", "tr", "td", "th"</dt>
-   <dd>
-    <p><span>Parse error</span>. Act as if an end tag with the tag
-    name "select" had been seen, and reprocess the token.</p>
-   </dd>
-
-   <dt>An end tag whose tag name is one of: "caption", "table",
-   "tbody", "tfoot", "thead", "tr", "td", "th"</dt>
-   <dd>
-
-    <p><span>Parse error</span>.</p>
-
-    <p>If the <span>stack of open elements</span> <span>has an
-    element in table scope</span> with the same tag name as that
-    of the token, then act as if an end tag with the tag name
-    "select" had been seen, and reprocess the token. Otherwise,
-    ignore the token.</p>
-
-   </dd>
-
-   <dt>Anything else</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in select">in select</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-  </dl>
-
-
-  <h5 id="parsing-main-inforeign">The "<dfn title="insertion mode: in foreign content">in foreign content</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: in foreign content">in foreign content</span>", tokens must be
-  handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>A character token</dt>
-   <dd>
-    <p><span title="insert a character">Insert the token's
-    character</span> into the <span>current node</span>.</p>
-   </dd>
-
-   <dt>A comment token</dt>
-   <dd>
-    <p>Append a <code>Comment</code> node to the <span>current
-    node</span> with the <code title="">data</code> attribute set to
-    the data given in the comment token.</p>
-   </dd>
-
-   <dt>A DOCTYPE token</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>An end tag whose tag name is "script", if the <span>current node</span> is a <code title="">script</code> element in the <span>SVG namespace</span>.</dt>
-   <dd>
-
-    <p>Pop the <span>current node</span> off the <span>stack of open
-    elements</span>.</p>
-
-    <p>Let the <var title="">old insertion point</var> have the
-    same value as the current <span>insertion point</span>. Let
-    the <span>insertion point</span> be just before the <span>next
-    input character</span>.</p>
-
-    <p>Increment the parser's <span>script nesting level</span> by
-    one. Set the <span>parser pause flag</span> to true.</p>
-
-    <p><a
-    href="http://www.w3.org/TR/SVGMobile12/script.html#ScriptContentProcessing">Process
-    the <code title="">script</code> element</a> according to the SVG
-    rules. <a href="#refsSVG">[SVG]</a></p>
-
-    <p class="note">Even if this causes <span
-    title="dom-document-write">new characters to be inserted into the
-    tokeniser</span>, the parser will not be executed reentrantly,
-    since the <span>parser pause flag</span> is true.</p>
-
-    <p>Decrement the parser's <span>script nesting level</span> by
-    one. If the parser's <span>script nesting level</span> is zero,
-    then set the <span>parser pause flag</span> to false.</p>
-
-    <p>Let the <span>insertion point</span> have the value of the <var
-    title="">old insertion point</var>. (In other words, restore the
-    <span>insertion point</span> to its previous value. This value
-    might be the "undefined" value.)</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is neither "mglyph" nor "malignmark", if the <span>current node</span> is an <code title="">mi</code> element in the <span>MathML namespace</span>.</dt>
-   <dt>A start tag whose tag name is neither "mglyph" nor "malignmark", if the <span>current node</span> is an <code title="">mo</code> element in the <span>MathML namespace</span>.</dt>
-   <dt>A start tag whose tag name is neither "mglyph" nor "malignmark", if the <span>current node</span> is an <code title="">mn</code> element in the <span>MathML namespace</span>.</dt>
-   <dt>A start tag whose tag name is neither "mglyph" nor "malignmark", if the <span>current node</span> is an <code title="">ms</code> element in the <span>MathML namespace</span>.</dt>
-   <dt>A start tag whose tag name is neither "mglyph" nor "malignmark", if the <span>current node</span> is an <code title="">mtext</code> element in the <span>MathML namespace</span>.</dt>
-   <dt>A start tag whose tag name is "svg", if the <span>current node</span> is an <code title="">annotation-xml</code> element in the <span>MathML namespace</span>.</dt>
-   <dt>A start tag, if the <span>current node</span> is a <code title="">foreignObject</code> element in the <span>SVG namespace</span>.</dt>
-   <dt>A start tag, if the <span>current node</span> is a <code title="">desc</code> element in the <span>SVG namespace</span>.</dt>
-   <dt>A start tag, if the <span>current node</span> is a <code title="">title</code> element in the <span>SVG namespace</span>.</dt>
-   <dt>A start tag, if the <span>current node</span> is an element in the <span>HTML namespace</span>.</dt>
-   <dt>An end tag</dt>
-   <dd>
-
-    <p>Process the token <span>using the rules for</span> the
-    <span>secondary insertion mode</span>.</p>
-
-    <p>If, after doing so, the <span>insertion mode</span> is still
-    "<span title="insertion mode: in foreign content">in foreign
-    content</span>", but there is no element in scope that has a
-    namespace other than the <span>HTML namespace</span><!-- XXX this
-    isn't well-defined; it means check to see if the bottom-most HTML
-    element on the stack is in scope -->, switch the <span>insertion
-    mode</span> to the <span>secondary insertion mode</span>.</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is one of: <!--"a",--> "b", "big",
-   "blockquote", "body"<!--by inspection-->, "br", "center", "code",
-   "dd", "div", "dl", "dt"<!-- so that dd and dt can be handled
-   uniformly throughout the parser -->, "em", "embed", "h1", "h2",
-   "h3", "h4"<!--for completeness-->, "h5", "h6"<!--for
-   completeness-->, "head"<!--by inspection-->, "hr", "i", "img",
-   "li", "listing"<!-- so that pre and listing can be handled
-   uniformly throughout the parser -->, "menu", "meta", "nobr",
-   "ol"<!-- so that dl, ul, and ol can be handled uniformly throughout
-   the parser -->, "p", "pre", "ruby", "s", <!--"script",--> "small",
-   "span", "strong", "strike"<!-- so that s and strike can be handled
-   uniformly throughout the parser -->, <!--"style",--> "sub", "sup",
-   "table"<!--by inspection-->, "tt", "u", "ul", "var"</dt>
-   <!-- this list was determined empirically by studying over
-   6,000,000,000 pages that were specifically not XML pages -->
-   <dt>A start tag whose tag name is "font", if the token has
-   any attributes named "color", "face", or "size"</dt>
-   <!-- the attributes here are required so that SVG <font> will go
-   through as SVG but legacy <font>s won't -->
-   <dt>An end-of-file token</dt>
-   <dd>
-
-    <p><span>Parse error</span>.</p>
-
-    <p>Pop elements from the <span>stack of open elements</span> until
-    the <span>current node</span> is in the <span>HTML
-    namespace</span>.</p>
-
-    <p>Switch the <span>insertion mode</span> to the <span>secondary
-    insertion mode</span>, and reprocess the token.</p>
-
-   </dd>
-
-   <dt>Any other start tag</dt>
-   <dd>
-
-    <p>If the <span>current node</span> is an element in the
-    <span>MathML namespace</span>, <span>adjust MathML
-    attributes</span> for the token. (This fixes the case of MathML
-    attributes that are not all lowercase.)</p>
-
-    <p>If the <span>current node</span> is an element in the <span>SVG
-    namespace</span>, and the token's tag name is one of the ones in
-    the first column of the following table, change the tag name to
-    the name given in the corresponding cell in the second
-    column. (This fixes the case of SVG elements that are not all
-    lowercase.)</p>
-
-    <table>
-     <thead>
-      <tr> <th> Tag name <th> Element name
-     <tbody>
-      <tr> <td> <code title="">altglyph</code> <td> <code title="">altGlyph</code>
-      <tr> <td> <code title="">altglyphdef</code> <td> <code title="">altGlyphDef</code>
-      <tr> <td> <code title="">altglyphitem</code> <td> <code title="">altGlyphItem</code>
-      <tr> <td> <code title="">animatecolor</code> <td> <code title="">animateColor</code>
-      <tr> <td> <code title="">animatemotion</code> <td> <code title="">animateMotion</code>
-      <tr> <td> <code title="">animatetransform</code> <td> <code title="">animateTransform</code>
-      <tr> <td> <code title="">clippath</code> <td> <code title="">clipPath</code>
-      <tr> <td> <code title="">feblend</code> <td> <code title="">feBlend</code>
-      <tr> <td> <code title="">fecolormatrix</code> <td> <code title="">feColorMatrix</code>
-      <tr> <td> <code title="">fecomponenttransfer</code> <td> <code title="">feComponentTransfer</code>
-      <tr> <td> <code title="">fecomposite</code> <td> <code title="">feComposite</code>
-      <tr> <td> <code title="">feconvolvematrix</code> <td> <code title="">feConvolveMatrix</code>
-      <tr> <td> <code title="">fediffuselighting</code> <td> <code title="">feDiffuseLighting</code>
-      <tr> <td> <code title="">fedisplacementmap</code> <td> <code title="">feDisplacementMap</code>
-      <tr> <td> <code title="">fedistantlight</code> <td> <code title="">feDistantLight</code>
-      <tr> <td> <code title="">feflood</code> <td> <code title="">feFlood</code>
-      <tr> <td> <code title="">fefunca</code> <td> <code title="">feFuncA</code>
-      <tr> <td> <code title="">fefuncb</code> <td> <code title="">feFuncB</code>
-      <tr> <td> <code title="">fefuncg</code> <td> <code title="">feFuncG</code>
-      <tr> <td> <code title="">fefuncr</code> <td> <code title="">feFuncR</code>
-      <tr> <td> <code title="">fegaussianblur</code> <td> <code title="">feGaussianBlur</code>
-      <tr> <td> <code title="">feimage</code> <td> <code title="">feImage</code>
-      <tr> <td> <code title="">femerge</code> <td> <code title="">feMerge</code>
-      <tr> <td> <code title="">femergenode</code> <td> <code title="">feMergeNode</code>
-      <tr> <td> <code title="">femorphology</code> <td> <code title="">feMorphology</code>
-      <tr> <td> <code title="">feoffset</code> <td> <code title="">feOffset</code>
-      <tr> <td> <code title="">fepointlight</code> <td> <code title="">fePointLight</code>
-      <tr> <td> <code title="">fespecularlighting</code> <td> <code title="">feSpecularLighting</code>
-      <tr> <td> <code title="">fespotlight</code> <td> <code title="">feSpotLight</code>
-      <tr> <td> <code title="">fetile</code> <td> <code title="">feTile</code>
-      <tr> <td> <code title="">feturbulence</code> <td> <code title="">feTurbulence</code>
-      <tr> <td> <code title="">foreignobject</code> <td> <code title="">foreignObject</code>
-      <tr> <td> <code title="">glyphref</code> <td> <code title="">glyphRef</code>
-      <tr> <td> <code title="">lineargradient</code> <td> <code title="">linearGradient</code>
-      <tr> <td> <code title="">radialgradient</code> <td> <code title="">radialGradient</code>
-      <!--<tr> <td> <code title="">solidcolor</code> <td> <code title="">solidColor</code> (SVG 1.2)-->
-      <tr> <td> <code title="">textpath</code> <td> <code title="">textPath</code>
-    </table>
-
-    <p>If the <span>current node</span> is an element in the <span>SVG
-    namespace</span>, <span>adjust SVG attributes</span> for the
-    token.  (This fixes the case of SVG attributes that are not all
-    lowercase.)</p>
-
-    <p><span>Adjust foreign attributes</span> for the token.  (This
-    fixes the use of namespaced attributes, in particular XLink in
-    SVG.)</p>
-
-    <p><span>Insert a foreign element</span> for the token, in the
-    same namespace as the <span>current node</span>.</p>
-
-    <p>If the token has its <i>self-closing flag</i> set, pop the
-    <span>current node</span> off the <span>stack of open
-    elements</span> and <span title="acknowledge self-closing
-    flag">acknowledge the token's <i>self-closing flag</i></span>.</p>
-
-   </dd>
-
-  </dl>
-
-
-  <h5 id="parsing-main-afterbody">The "<dfn title="insertion mode: after body">after body</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: after body">after body</span>", tokens must be handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>A character token that is one of U+0009 CHARACTER
-   TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
-   <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in body">in body</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-   <dt>A comment token</dt>
-   <dd>
-    <p>Append a <code>Comment</code> node to the first element in
-    the <span>stack of open elements</span> (the <code>html</code>
-    element), with the <code title="">data</code> attribute set to
-    the data given in the comment token.</p>
-   </dd>
-
-   <dt>A DOCTYPE token</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "html"</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in body">in body</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-   <dt>An end tag whose tag name is "html"</dt>
-   <dd>
-
-    <p>If the parser was originally created as part of the <span>HTML
-    fragment parsing algorithm</span>, this is a <span>parse
-    error</span>; ignore the token.  (<span>fragment case</span>)</p>
-
-    <p>Otherwise, switch the <span>insertion mode</span> to "<span
-    title="insertion mode: after after body">after after
-    body</span>".</p>
-
-   </dd>
-
-   <dt>An end-of-file token</dt>
-   <dd>
-    <p><span>Stop parsing</span>.</p>
-   </dd>
-
-   <dt>Anything else</dt>
-   <dd>
-
-    <p><span>Parse error</span>. Switch the <span>insertion
-    mode</span> to "<span title="insertion mode: in body">in
-    body</span>" and reprocess the token.</p>
-
-   </dd>
-
-  </dl>
-
-
-  <h5 id="parsing-main-inframeset">The "<dfn title="insertion mode: in frameset">in frameset</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: in frameset">in frameset</span>", tokens must be handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>A character token that is one of U+0009 CHARACTER
-   TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
-   <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
-   <dd>
-    <p><span title="insert a character">Insert the character</span> into
-    the <span>current node</span>.</p>
-   </dd>
-
-   <dt>A comment token</dt>
-   <dd>
-    <p>Append a <code>Comment</code> node to the <span>current
-    node</span> with the <code title="">data</code> attribute set to
-    the data given in the comment token.</p>
-   </dd>
-
-   <dt>A DOCTYPE token</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "html"</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in body">in body</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "frameset"</dt>
-   <dd>
-    <p><span>Insert an HTML element</span> for the token.</p>
-   </dd>
-
-   <dt>An end tag whose tag name is "frameset"</dt>
-   <dd>
-
-    <p>If the <span>current node</span> is the root
-    <code>html</code> element, then this is a <span>parse
-    error</span>; ignore the token. (<span>fragment
-    case</span>)</p>
-
-    <p>Otherwise, pop the <span>current node</span> from the
-    <span>stack of open elements</span>.</p>
-
-    <p>If the parser was <em>not</em> originally created as part
-    of the <span>HTML fragment parsing algorithm</span>
-    (<span>fragment case</span>), and the <span>current
-    node</span> is no longer a <code>frameset</code> element, then
-    switch the <span>insertion mode</span> to "<span
-    title="insertion mode: after frameset">after
-    frameset</span>".</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "frame"</dt>
-   <dd>
-
-    <p><span>Insert an HTML element</span> for the token.
-    Immediately pop the <span>current node</span> off the
-    <span>stack of open elements</span>.</p>
-
-    <p><span title="acknowledge self-closing flag">Acknowledge the
-    token's <i>self-closing flag</i></span>, if it is set.</p>
-
-   </dd>
-
-   <dt>A start tag whose tag name is "noframes"</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in head">in head</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-   <dt>An end-of-file token</dt>
-   <dd>
-
-    <p>If the <span>current node</span> is not the root
-    <code>html</code> element, then this is a <span>parse
-    error</span>.</p>
-
-    <p class="note">It can only be the <span>current node</span> in
-    the <span>fragment case</span>.</p>
-
-    <p><span>Stop parsing</span>.</p>
-
-   </dd>
-
-   <dt>Anything else</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-  </dl>
-
-
-  <h5 id="parsing-main-afterframeset">The "<dfn title="insertion mode: after frameset">after frameset</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: after frameset">after frameset</span>", tokens must be handled as follows:</p>
-
-  <!-- due to rules in the "in frameset" mode, this can't be entered in the fragment case -->
-  <dl class="switch">
-
-   <dt>A character token that is one of U+0009 CHARACTER
-   TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
-   <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
-   <dd>
-    <p><span title="insert a character">Insert the character</span> into
-    the <span>current node</span>.</p>
-   </dd>
-
-   <dt>A comment token</dt>
-   <dd>
-    <p>Append a <code>Comment</code> node to the <span>current
-    node</span> with the <code title="">data</code> attribute set to
-    the data given in the comment token.</p>
-   </dd>
-
-   <dt>A DOCTYPE token</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "html"</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in body">in body</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-   <dt>An end tag whose tag name is "html"</dt>
-   <dd>
-    <p>Switch the <span>insertion mode</span> to "<span
-    title="insertion mode: after after frameset">after after
-    frameset</span>".</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "noframes"</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in head">in head</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-   <dt>An end-of-file token</dt>
-   <dd>
-    <p><span>Stop parsing</span>.</p>
-   </dd>
-
-   <dt>Anything else</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-  </dl>
-
-  <p class="XXX">This doesn't handle UAs that don't support
-  frames, or that do support frames but want to show the NOFRAMES
-  content. Supporting the former is easy; supporting the latter is
-  harder.</p>
-
-
-  <h5>The "<dfn title="insertion mode: after after body">after after body</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: after after body">after after body</span>", tokens must be handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>A comment token</dt>
-   <dd>
-    <p>Append a <code>Comment</code> node to the <code>Document</code>
-    object with the <code title="">data</code> attribute set to the
-    data given in the comment token.</p>
-   </dd>
-
-   <dt>A DOCTYPE token</dt>
-   <dt>A character token that is one of U+0009 CHARACTER
-   TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
-   <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
-   <dt>A start tag whose tag name is "html"</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in body">in body</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-   <dt>An end-of-file token</dt>
-   <dd>
-    <p><span>Stop parsing</span>.</p>
-   </dd>
-
-   <dt>Anything else</dt>
-   <dd>
-    <p><span>Parse error</span>. Switch the <span>insertion mode</span>
-    to "<span title="insertion mode: in body">in body</span>" and
-    reprocess the token.</p>
-   </dd>
-
-  </dl>
-
-
-  <h5>The "<dfn title="insertion mode: after after frameset">after after frameset</dfn>" insertion mode</h5>
-
-  <p>When the <span>insertion mode</span> is "<span title="insertion
-  mode: after after frameset">after after frameset</span>", tokens must be handled as follows:</p>
-
-  <dl class="switch">
-
-   <dt>A comment token</dt>
-   <dd>
-    <p>Append a <code>Comment</code> node to the <code>Document</code>
-    object with the <code title="">data</code> attribute set to the
-    data given in the comment token.</p>
-   </dd>
-
-   <dt>A DOCTYPE token</dt>
-   <dt>A character token that is one of U+0009 CHARACTER
-   TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
-   <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
-   <dt>A start tag whose tag name is "html"</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in body">in body</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-   <dt>An end-of-file token</dt>
-   <dd>
-    <p><span>Stop parsing</span>.</p>
-   </dd>
-
-   <dt>A start tag whose tag name is "noframes"</dt>
-   <dd>
-    <p>Process the token <span>using the rules for</span> the "<span
-    title="insertion mode: in head">in head</span>" <span>insertion
-    mode</span>.</p>
-   </dd>
-
-   <dt>Anything else</dt>
-   <dd>
-    <p><span>Parse error</span>. Ignore the token.</p>
-   </dd>
-
-  </dl>
-
-
-  <h4>The end</h4>
-
-  <p>Once the user agent <dfn title="stop parsing">stops parsing</dfn>
-  the document, the user agent must follow the steps in this
-  section.</p>
-
-  <p>First, the <span>current document readiness</span> must be set to
-  "interactive".</p>
-
-  <p>Then, the rules for <span>when a script completes loading</span>
-  start applying (script execution is no longer managed by the
-  parser).</p>
-
-  <p>If any of the scripts in the <span>list of scripts that will
-  execute as soon as possible</span> have <span>completed
-  loading</span>, or if the <span>list of scripts that will execute
-  asynchronously</span> is not empty and the first script in that list
-  has <span>completed loading</span>, then the user agent must act as
-  if those scripts just completed loading, following the rules given
-  for that in the <code>script</code> element definition.</p>
-
-  <p>Then, if the <span>list of scripts that will execute when the
-  document has finished parsing</span> is not empty, and the first
-  item in this list has already <span>completed loading</span>, then
-  the user agent must act as if that script just finished loading.</p>
-
-  <p>By this point, there will be no scripts that have loaded but have
-  not yet been executed.</p>
-
-  <p>The user agent must then <span>fire a simple event</span> called
-  <code title="event-DOMContentLoaded">DOMContentLoaded</code> at the
-  <code>Document</code>.</p>
-
-  <p>Once everything that <dfn title="delay the load event">delays the
-  load event</dfn> has completed, the user agent must run the
-  following steps:</p>
-
-  <ol>
-
-   <li><span>Queue a task</span> to set the <span>current document
-   readiness</span> to "complete".</li>
-
-   <li>If the <code>Document</code> is in a <span>browsing
-   context</span>, then <span>queue a task</span> to <span title="fire
-   a load event">fire a <code title="event-load">load</code>
-   event</span> at the <code>Document</code>'s <code>Window</code>
-   object.</li>
-
-   <li>If the <code>Document</code> has a <span>pending state
-   object</span>, then <span>queue a task</span> to fire a <code
-   title="event-popstate">popstate</code> event in no namespace on the
-   <code>Document</code>'s <code>Window</code> object using the
-   <code>PopStateEvent</code> interface, with the <code
-   title="dom-PopStateEvent-state">state</code> attribute set to the
-   current value of the <span>pending state object</span>. This event
-   must bubble but not be cancelable and has no default action.</li>
-
-  </ol>
-
-  <p>The <span>task source</span> for these tasks is the <span>DOM
-  manipulation task source</span>.</p>
-
-  <!-- XXX make sure things "delay the load event" -->
-
-  <p class="XXX">delaying the load event for things like image
-  loads allows for intranet port scans (even without
-  javascript!). Should we really encode that into the spec?</p>
-
-
-<!--XXX need to handle
-http://lxr.mozilla.org/mozilla/source/parser/htmlparser/src/CNavDTD.cpp#2354
-2354           // Don't open transient styles if it makes the stack deep, bug 58917.
--->
-
-<!--XXX
-http://lxr.mozilla.org/mozilla/source/parser/htmlparser/src/nsHTMLTokenizer.cpp#749
--->
-
-<!--
-see also  CTextToken::ConsumeCharacterData()  for CDATA parsing?
-
-1212                      1  Here's a tricky case from bug 22596:  <h5><li><h5>
-1213                         How do we know that the 2nd <h5> should close the <LI> rather than nest inside the <LI>?
-1214                         (Afterall, the <h5> is a legal child of the <LI>).
-1215               
-1216                         The way you know is that there is no root between the two, so the <h5> binds more
-1217                         tightly to the 1st <h5> than to the <LI>.
-1218                      2.  Also, bug 6148 shows this case: <SPAN><DIV><SPAN>
-1219                         From this case we learned not to execute this logic if the parent is a block.
-1220                     
-1221                      3. Fix for 26583
-1222                         Ex. <A href=foo.html><B>foo<A href-bar.html>bar</A></B></A>  <- A legal HTML
-1223                         In the above example clicking on "foo" or "bar" should link to
-1224                         foo.html or bar.html respectively. That is, the inner <A> should be informed
-1225                         about the presence of an open <A> above <B>..so that the inner <A> can close out
-1226                         the outer <A>. The following code does it for us.
-1227                      
-1228                      4. Fix for 27865 [ similer to 22596 ]. Ex: <DL><DD><LI>one<DD><LI>two
- - http://lxr.mozilla.org/mozilla/source/parser/htmlparser/src/CNavDTD.cpp#1211
-
-815             // Here's a problem.  If theTag is legal in here, we don't move it
-816             // out.  So if we're moving stuff out of here, the parent of theTag
-817             // gets closed at this point.  But some things are legal
-818             // _everywhere_ and hence would effectively close out misplaced
-819             // content in tables.  This is undesirable, so treat them as
-820             // illegal here so they'll be shipped out with their parents and
-821             // siblings.  See bug 40855 for an explanation (that bug was for
-822             // comments, but the same issues arise with whitespace, newlines,
-823             // noscript, etc).  Script is special, though.  Shipping it out
-824             // breaks document.write stuff.  See bug 243064.
- - http://lxr.mozilla.org/mozilla/source/parser/htmlparser/src/CNavDTD.cpp#825
-
-
-1326     /**************************************************************************************
-1327      *
-1328      * Now a little code to deal with bug #49687 (crash when layout stack gets too deep)
-1329      * I've also opened this up to any container (not just inlines): re bug 55095
-1330      * Improved to handle bug 55980 (infinite loop caused when DEPTH is exceeded and
-1331      * </P> is encountered by itself (<P>) is continuously produced.
-1332      *
-1333      **************************************************************************************/
-
-1912               // Oh boy!! we found a "stray" tag. Nav4.x and IE introduce line break in
-1913               // such cases. So, let's simulate that effect for compatibility.
-1914               // Ex. <html><body>Hello</P>There</body></html>
-http://lxr.mozilla.org/mozilla/source/parser/htmlparser/src/CNavDTD.cpp#1912
-
-http://lxr.mozilla.org/seamonkey/search?string=nested
-/parser/htmlparser/src/CNavDTD.cpp, line 791 - * 2. <CENTER><DL><DT><A><CENTER> allow nested <CENTER>
-/parser/htmlparser/src/CNavDTD.cpp, line 792 - * 3. <TABLE><TR><TD><TABLE>... allow nested <TABLE>
-/parser/htmlparser/src/CNavDTD.cpp, line 2562 - // Discard nested forms - bug 72639
-/parser/htmlparser/src/nsElementTable.cpp, line 1453 - * 2. <CENTER><DL><DT><A><CENTER> allow nested <CENTER>
-/parser/htmlparser/src/nsElementTable.cpp, line 1454 - * 3. <TABLE><TR><TD><TABLE>... allow nested <TABLE>
-/parser/htmlparser/src/nsElementTable.cpp, line 1901 - // Ex: <H1><LI><H1><LI>. Inner LI has the potential of getting nested
--->
-
-
-  <h4>Coercing an HTML DOM into an infoset</h4>
-
-  <p>When an application uses an <span>HTML parser</span> in
-  conjunction with an XML pipeline, it is possible that the
-  constructed DOM is not compatible with the XML tool chain in certain
-  subtle ways. For example, an XML toolchain might not be able to
-  represent attributes with the name <code title="">xmlns</code>,
-  since they conflict with the Namespaces in XML syntax. There is also
-  some data that the <span>HTML parser</span> generates that isn't
-  included in the DOM itself. This section specifies some rules for
-  handling these issues.</p>
-
-  <p>If the XML API being used doesn't support DOCTYPEs, the tool may
-  drop DOCTYPEs altogether.</p>
-
-  <p>If the XML API doesn't support attributes in no namespace that
-  are named "<code title="">xmlns</code>", attributes whose names
-  start with "<code title="">xmlns:</code>", or attributes in the
-  <span>XMLNS namespace</span>, then the tool may drop such
-  attributes.</p>
-
-  <p>The tool may annotate the output with any namespace declarations
-  required for proper operation.</p>
-
-  <p>If the XML API being used restricts the allowable characters in
-  the local names of elements and attributes, then the tool may map
-  all element and attribute local names that the API wouldn't support
-  to a set of names that <em>are</em> allowed, by replacing any
-  character that isn't supported with the uppercase letter U and the
-  six digits of the character's Unicode codepoint when expressed in
-  hexadecimal, using digits 0-9 and capital letters A-F as the
-  symbols, in increasing numeric order.</p>
-
-  <p class="example">For example, the element name <code
-  title="">foo&lt;bar</code>, which can be output by the <span>HTML
-  parser</span>, though it is neither a legal HTML element name nor a
-  well-formed XML element name, would be converted into <code
-  title="">fooU00003Cbar</code>, which <em>is</em> a well-formed XML
-  element name (though it's still not legal in HTML by any means).</p>
-
-  <p class="example">As another example, consider the attribute
-  <code>xlink:href</code>. Used on a MathML element, it becomes, after
-  being <span title="adjust foreign attributes">adjusted</span>, an
-  attribute with a prefix "<code title="">xlink</code>" and a local
-  name "<code title="">href</code>". However, used on an HTML element,
-  it becomes an attribute with no prefix and the local name "<code
-  title="">xlink:href</code>", which is not a valid NCName, and thus
-  might not be accepted by an XML API. It could thus get converted,
-  becoming "<code title="">xlinkU00003Ahref</code>".</p>
-
-  <p class="note">The resulting names from this conversion
-  conveniently can't clash with any attribute generated by the
-  <span>HTML parser</span>, since those are all either lowercase or
-  those listed in the <span>adjust foreign attributes</span>
-  algorithm's table.</p>
-
-  <p>If the XML API restricts comments from having two consecutive
-  U+002D HYPHEN-MINUS characters (--), the tool may insert a single
-  U+0020 SPACE character between any such offending characters.</p>
-
-  <p>If the XML API restricts comments from ending in a
-  U+002D HYPHEN-MINUS character (-), the tool may insert a single
-  U+0020 SPACE character at the end of such comments.</p>
-
-  <p>If the XML API restricts allowed characters in character data,
-  the tool may replace any U+000C FORM FEED (FF) character with a
-  U+0020 SPACE character, and any other literal non-XML character with
-  a U+FFFD REPLACEMENT CHARACTER.</p>
-
-  <p>If the tool has no way to convey out-of-band information, then
-  the tool may drop the following information:</p>
-
-  <ul>
-
-   <li>Whether the document is set to <i>no quirks mode</i>,
-   <i>limited quirks mode</i>, or <i>quirks mode</i></li>
-
-   <li>The association between form controls and forms that aren't
-   their nearest <code>form</code> element ancestor (use of the
-   <span><code>form</code> element pointer</span> in the parser)</li>
-
-  </ul>
-
-  <p class="note">The mutations allowed by this section apply
-  <em>after</em> the <span>HTML parser</span>'s rules have been
-  applied. For example, a <code title="">&lt;a::></code> start tag
-  will be closed by a <code title="">&lt;/a::></code> end tag, and
-  never by a <code title="">&lt;/aU00003AU00003A></code> end tag, even
-  if the user agent is using the rules above to then generate an
-  actual element in the DOM with the name <code
-  title="">aU00003AU00003A</code> for that start tag.</p>
-
-
-
-  <h3>Namespaces</h3>
-
-  <p>The <dfn>HTML namespace</dfn> is: <code>http://www.w3.org/1999/xhtml</code></p>
-
-  <p>The <dfn>MathML namespace</dfn> is: <code>http://www.w3.org/1998/Math/MathML</code></p>
-
-  <p>The <dfn>SVG namespace</dfn> is: <code>http://www.w3.org/2000/svg</code></p>
-
-  <p>The <dfn>XLink namespace</dfn> is: <code>http://www.w3.org/1999/xlink</code></p>
-
-  <p>The <dfn>XML namespace</dfn> is: <code>http://www.w3.org/XML/1998/namespace</code></p>
-
-  <p>The <dfn>XMLNS namespace</dfn> is: <code>http://www.w3.org/2000/xmlns/</code></p>
-
-  <hr>
-
-  <p>Data mining tools and other user agents that perform operations
-  on <code title="">text/html</code> content without running scripts,
-  evaluating CSS or XPath expressions, or otherwise exposing the
-  resulting DOM to arbitrary content, may "support namespaces" by just
-  asserting that their DOM node analogues are in certain namespaces,
-  without actually exposing the above strings.</p>
-
-
-
-
-  <h3>Serializing HTML fragments</h3>
-
-  <p>The following steps form the <dfn>HTML fragment serialization
-  algorithm</dfn>. The algorithm takes as input a DOM
-  <code>Element</code> or <code>Document</code>, referred to as <var
-  title="">the node</var>, and either returns a string or raises an
-  exception.</p>
-
-  <p class="note">This algorithm serializes the <em>children</em> of
-  the node being serialized, not the node itself.</p>
-
-  <ol>
-
-   <li><p>Let <var title="">s</var> be a string, and initialize it to
-   the empty string.</p></li>
-
-   <li>
-
-    <p>For each child node of <var title="">the node</var>, in
-    <span>tree order</span>, run the following steps:
-
-    <ol>
-
-     <li><p>Let <var title="">current node</var> be the child node
-     being processed.</p></li>
-
-     <li>
-
-      <p>Append the appropriate string from the following list to
-      <var title="">s</var>:</p>
-
-      <dl class="switch">
-
-       <dt>If <var title="">current node</var> is an <code title="">Element</code></dt>
-
-       <dd>
-
-        <p>Append a U+003C LESS-THAN SIGN (<code title="">&lt;</code>)
-        character, followed by the element's tag name. (For nodes
-        created by the <span>HTML parser</span> or <code
-        title="">Document.createElement()</code>, the tag name will be
-        lowercase.)</p>
-
-        <p>For each attribute that the element has, append a U+0020
-        SPACE character, the attribute's name (which, for attributes
-        set by the <span>HTML parser</span> or by <code
-        title="">Element.setAttributeNode()</code> or <code
-        title="">Element.setAttribute()</code>, will be lowercase), a
-        U+003D EQUALS SIGN (<code title="">=</code>) character, a
-        U+0022 QUOTATION MARK (<code title="">&quot;</code>)
-        character, the attribute's value, <span title="escaping a
-        string">escaped as described below</span> in <i>attribute
-        mode</i>, and a second U+0022 QUOTATION MARK (<code
-        title="">&quot;</code>) character.</p>
-
-        <p>While the exact order of attributes is UA-defined, and may
-        depend on factors such as the order that the attributes were
-        given in the original markup, the sort order must be stable,
-        such that consecutive invocations of this algorithm serialize an
-        element's attributes in the same order.</p>
-
-        <p>Append a U+003E GREATER-THAN SIGN (<code title="">&gt;</code>)
-        character.</p>
-
-        <p>If <var title="">current node</var> is an
-        <code>area</code>, <code>base</code>, <code>basefont</code>,
-        <code>bgsound</code>, <code>br</code>, <code>col</code>,
-        <code>embed</code>, <code>frame</code>, <code>hr</code>,
-        <code>img</code>, <code>input</code>, <code>link</code>,
-        <code>meta</code>, <code>param</code>, <code>spacer</code>, or
-        <code>wbr</code> element, then continue on to the next child
-        node at this point.</p> <!-- also, i guess: image, isindex,
-        and keygen, but we don't list those because we don't consider
-        those "elements", more "macros", and thus we should never
-        serialize them -->
-
-        <p>If <var title="">current node</var> is a <code>pre</code>,
-        <code>textarea</code>, or <code>listing</code> element, append
-        a U+000A LINE FEED (LF) character.</p>
-
-        <p>Append the value of running the <span>HTML fragment
-        serialization algorithm</span> on the <var title="">current
-        node</var> element (thus recursing into this algorithm for
-        that element), followed by a U+003C LESS-THAN SIGN (<code
-        title="">&lt;</code>) character, a U+002F SOLIDUS (<code
-        title="">/</code>) character, the element's tag name again,
-        and finally a U+003E GREATER-THAN SIGN (<code
-        title="">&gt;</code>) character.</p>
-
-       </dd>
-
-
-       <dt>If <var title="">current node</var> is a <code
-       title="">Text</code> or <code title="">CDATASection</code>
-       node</dt>
-
-       <dd>
-
-        <p>If one of the ancestors of <var title="">current node</var>
-        is a <code>style</code>, <code>script</code>,
-        <code>xmp</code>, <code>iframe</code>, <code>noembed</code>,
-        <code>noframes</code>, <code>noscript</code>, or
-        <code>plaintext</code> element, then append the value of <var
-        title="">current node</var>'s <code title="">data</code> DOM
-        attribute literally.</p> <!-- note about noscript: we're
-        assuming here that scripting is enabled. If this algorithm is
-        used with scripting disabled, this won't work right. XXX This
-        might affect calling innerHTML on nodes in a document that is
-        being designMode'd -->
-
-        <p>Otherwise, append the value of <var title="">current
-        node</var>'s <code title="">data</code> DOM attribute, <span
-        title="escaping a string">escaped as described
-        below</span>.</p>
-
-       </dd>
-
-
-       <dt>If <var title="">current node</var> is a <code
-       title="">Comment</code></dt>
-
-       <dd>
-
-        <p>Append the literal string <code>&lt;!--</code> (U+003C
-        LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS,
-        U+002D HYPHEN-MINUS), followed by the value of <var
-        title="">current node</var>'s <code title="">data</code> DOM
-        attribute, followed by the literal string <code>--&gt;</code>
-        (U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS, U+003E GREATER-THAN
-        SIGN).</p>
-
-       </dd>
-
-
-       <dt>If <var title="">current node</var> is a <code
-       title="">ProcessingInstruction</code></dt>
-
-       <dd>
-
-        <p>Append the literal string <code>&lt;?</code> (U+003C
-        LESS-THAN SIGN, U+003F QUESTION MARK), followed by the value
-        of <var title="">current node</var>'s <code
-        title="">target</code> DOM attribute, followed by a single
-        U+0020 SPACE character, followed by the value of <var
-        title="">current node</var>'s <code title="">data</code> DOM
-        attribute, followed by a single U+003E GREATER-THAN SIGN
-        character ('>').</p>
-
-       </dd>
-
-
-       <dt>If <var title="">current node</var> is a <code title="">DocumentType</code></dt>
-
-       <dd>
-
-        <p>Append the literal string <code>&lt;!DOCTYPE</code> (U+003C
-        LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+0044 LATIN CAPITAL
-        LETTER D, U+004F LATIN CAPITAL LETTER O, U+0043 LATIN CAPITAL
-        LETTER C, U+0054 LATIN CAPITAL LETTER T, U+0059 LATIN CAPITAL
-        LETTER Y, U+0050 LATIN CAPITAL LETTER P, U+0045 LATIN CAPITAL
-        LETTER E), followed by a space (U+0020 SPACE), followed by the
-        value of <var title="">current node</var>'s <code
-        title="">name</code> DOM attribute, followed by the literal
-        string <code>&gt;</code> (U+003E GREATER-THAN SIGN).</p>
-
-       </dd>
-
-
-      </dl>
-
-      <p>Other node types (e.g. <code title="">Attr</code>) cannot
-      occur as children of elements. If, despite this, they somehow do
-      occur, this algorithm must raise an
-      <code>INVALID_STATE_ERR</code> exception.</p>
-
-     </li>
-
-    </ol>
-
-   </li>
-
-   <li><p>The result of the algorithm is the string <var
-   title="">s</var>.</p></li>
-
-  </ol>
-
-  <p><dfn id="escapingString">Escaping a string</dfn> (for the
-  purposes of the algorithm above) consists of replacing any
-  occurrences of the "<code title="">&amp;</code>" character by the
-  string "<code title="">&amp;amp;</code>", any occurrences of the
-  U+00A0 NO-BREAK SPACE character by the string "<code
-  title="">&amp;nbsp;</code>", and, if the algorithm was invoked in
-  the <i>attribute mode</i>, any occurrences of the "<code
-  title="">&quot;</code>" character by the string "<code
-  title="">&amp;quot;</code>", or if it was not, any occurrences of
-  the "<code title="">&lt;</code>" character by the string "<code
-  title="">&amp;lt;</code>", any occurrences of the "<code
-  title="">&gt;</code>" character by the string "<code
-  title="">&amp;gt;</code>".</p>
-
-  <p class="note">Entity reference nodes are <a
-  href="#entity-references">assumed to be expanded</a> by the user
-  agent, and are therefore not covered in the algorithm above.</p>
-
-  <p class="note">It is possible that the output of this algorithm, if
-  parsed with an <span>HTML parser</span>, will not return the
-  original tree structure. For instance, if a <code>textarea</code>
-  element to which a <code title="">Comment</code> node has been
-  appended is serialized and the output is then reparsed, the comment
-  will end up being displayed in the text field. Similarly, if, as a
-  result of DOM manipulation, an element contains a comment that
-  contains the literal string "<code title="">--&gt;</code>", then
-  when the result of serializing the element is parsed, the comment
-  will be truncated at that point and the rest of the comment will be
-  interpreted as markup. More examples would be making a
-  <code>script</code> element contain a text node with the text string
-  "<code>&lt;/script></code>", or having a <code>p</code> element that
-  contains a <code>ul</code> element (as the <code>ul</code> element's
-  <span title="syntax-start-tag">start tag</span> would imply the end
-  tag for the <code>p</code>).</p>
-
-
-  <h3>Parsing HTML fragments</h3>
-
-  <p>The following steps form the <dfn>HTML fragment parsing
-  algorithm</dfn>. The algorithm optionally takes as input an
-  <code>Element</code> node, referred to as the <var
-  title="">context</var> element, which gives the context for the
-  parser, as well as <var title="">input</var>, a string to parse, and
-  returns a list of zero or more nodes.</p>
-
-  <p class="note">Parts marked <dfn>fragment case</dfn> in algorithms
-  in the parser section are parts that only occur if the parser was
-  created for the purposes of this algorithm (and with a <var
-  title="">context</var> element). The algorithms have been annotated
-  with such markings for informational purposes only; such markings
-  have no normative weight. If it is possible for a condition
-  described as a <span>fragment case</span> to occur even when the
-  parser wasn't created for the purposes of handling this algorithm,
-  then that is an error in the specification.</p>
-
-  <ol>
-
-   <li>
-
-    <p>Create a new <code>Document</code> node, and mark it as being
-    an <span title="HTML documents">HTML document</span>.</p>
-
-   </li>
-
-   <li>
-
-    <p>If there is a <var title="">context</var> element, and the
-    <code>Document</code> of the <var title="">context</var> element
-    is in <span>quirks mode</span>, then let the <code>Document</code>
-    be in <span>quirks mode</span>. Otherwise, if there is a <var
-    title="">context</var> element, and the <code>Document</code> of
-    the <var title="">context</var> element is in <span>limited quirks
-    mode</span>, then let the <code>Document</code> be in
-    <span>limited quirks mode</span>. Otherwise, leave the
-    <code>Document</code> in <span>no quirks mode</span>.</p>
-
-   </li>
-
-   <li>
-
-    <p>Create a new <span>HTML parser</span>, and associate it with
-    the just created <code>Document</code> node.</p>
-
-   </li>
-
-   <li>
-
-    <p>If there is a <var title="">context</var> element, run these
-    substeps:</p>
-
-    <ol>
-
-     <li>
-
-      <p>Set the <span>HTML parser</span>'s <span>tokenization</span>
-      stage's <span>content model flag</span> according to the <var
-      title="">context</var> element, as follows:</p>
-
-      <dl class="switch">
-
-       <dt>If it is a <code>title</code> or <code>textarea</code>
-       element</dt>
-
-       <dd>Set the <span>content model flag</span> to
-       the RCDATA state.</dd>
-
-
-       <dt>If it is a <code>style</code>, <code>script</code>,
-       <code>xmp</code>, <code>iframe</code>, <code>noembed</code>, or
-       <code>noframes</code> element</dt>
-
-       <dd>Set the <span>content model flag</span> to
-       the CDATA state.</dd>
-
-
-       <dt>If it is a <code>noscript</code> element</dt>
-
-       <dd>If the <span>scripting flag</span> is enabled, set the
-       <span>content model flag</span> to the CDATA
-       state. Otherwise, set the <span>content model flag</span> to the
-       PCDATA state.</dd>
-
-
-       <dt>If it is a <code>plaintext</code> element</dt>
-
-       <dd>Set the <span>content model flag</span> to
-       PLAINTEXT.</dd>
-
-
-       <dt>Otherwise</dt>
-
-       <dd>Leave the <span>content model flag</span> in the PCDATA
-       state.</dd>
-
-      </dl>
-
-     </li>
-
-     <li>
-
-      <p>Let <var title="">root</var> be a new <code>html</code> element
-      with no attributes.</p>
-
-     </li>
-
-     <li>
-
-      <p>Append the element <var title="">root</var> to the
-      <code>Document</code> node created above.</p>
-
-     </li>
-
-     <li>
-
-      <p>Set up the parser's <span>stack of open elements</span> so that
-      it contains just the single element <var title="">root</var>.</p>
-
-     </li>
-
-     <li>
-
-      <p><span title="reset the insertion mode appropriately">Reset the
-      parser's insertion mode appropriately</span>.</p>
-
-      <p class="note">The parser will reference the <var
-      title="">context</var> element as part of that algorithm.</p>
-
-     </li>
-
-     <li>
-
-      <p>Set the parser's <span><code>form</code> element pointer</span>
-      to the nearest node to the <var title="">context</var> element
-      that is a <code>form</code> element (going straight up the
-      ancestor chain, and including the element itself, if it is a
-      <code>form</code> element), or, if there is no such
-      <code>form</code> element, to null.</p>
-
-     </li>
-
-    </ol>
-
-   </li>
-
-   <li>
-
-    <p>Place into the <span>input stream</span> for the <span>HTML
-    parser</span> just created the <var title="">input</var>. The
-    encoding <span
-    title="concept-encoding-confidence">confidence</span> is
-    <i>irrelevant</i>.</p>
-
-   </li>
-
-   <li>
-
-    <p>Start the parser and let it run until it has consumed all the
-    characters just inserted into the input stream.</p>
-
-   </li>
-
-   <li>
-
-    <p>If there is a <var title="">context</var> element, return the
-    child nodes of <var title="">root</var>, in <span>tree
-    order</span>.</p>
-
-    <p>Otherwise, return the children of the <code>Document</code>
-    object, in <span>tree order</span>.</p>
-
-   </li>
-
-  </ol>
-
-  </div>
-
-
-
-  <h3><dfn>Named character references</dfn></h3>
-
-  <p>This table lists the character reference names that are supported
-  by HTML, and the code points to which they refer. It is referenced
-  by the previous sections.</p>
-
-  <div class="tall-and-narrow">
-   <table>
-    <thead>
-     <tr> <th> Name </th> <th> Character </th> </tr>
-    </thead>
-<!--CHARACTER-REFERENCES-->
-   </table>
-  <!--
-   If we want to add character references, Almorca suggests:
-   > I would add &sub1; (character U+2081), &sub2;
-   > (character U+2082) and &sub3; (character U+2083). They
-   > would are the equivalent to &sup1;, &sup2;, and &sup3;.
-   See also: http://www.w3.org/2003/entities/
-  -->
-  </div>
-
-
-
   <h2><dfn>The XHTML syntax</dfn></h2>
 
   <p class="note">This section only describes the rules for XML
   resources. Rules for <code title="">text/html</code> resources are
   discussed in the section above entitled "<span>The HTML
   syntax</span>".</p>
 
 
@@ -73583,17 +65595,17 @@ interface <dfn>TimeoutHandler</dfn> {
   McCathieNevile, Chris Pearce, Christian Biesinger, Christian
   Johansen, Christian Schmidt, Chriswa, Cole Robison, Colin Fine,
   Collin Jackson, Daniel Barclay, Daniel Brumbaugh Keeney, Daniel
   Glazman, Daniel Peng, Daniel Sp&aring;ng, Daniel Steinberg, Danny
   Sullivan, Darin Adler, Darin Fisher, Dave Camp, Dave Singer, Dave
   Townsend<!-- Mossop on moz irc -->, David Baron, David Bloom, David
   Carlisle, David Flanagan, David H&aring;s&auml;ther, David Hyatt,
   David Smith, David Woolley, Dean Edridge, Debi Orton, Derek
-  Featherstone, DeWitt Clinton, Dimitri Glazkov, dolphinling, Doron
+  Featherstone, DeWitt Clinton, Dimitri Glazkov, Dmitry Turin, dolphinling, Doron
   Rosenberg, Doug Kramer, Drew Wilson, Edward O'Connor, Edward
   Z. Yang, Eira Monstad, Elliotte Harold, Eric Carlson, Eric Law, Erik
   Arvidsson, Evan Martin, Evan Prodromou, fantasai, Felix Sasaki,
   Franck 'Shift' Qu&eacute;lain, Garrett Smith, Geoffrey Garen,
   Geoffrey Sneddon, George Lund, Greg Houston, H&aring;kon Wium Lie,
   Hans S. T&oslash;mmerhalt, Henri Sivonen, Henrik Lied, Henry Mason,
   Hugh Winkler, Ignacio Javier, Ivo Emanuel Gon&ccedil;alves, J. King,
   Jacques Distler, James Craig, James Graham, James Justin Harrell,