[html5] r1309 - /
whatwg at whatwg.org
whatwg at whatwg.org
Sun Mar 2 17:02:50 PST 2008
Author: ianh
Date: 2008-03-02 17:02:46 -0800 (Sun, 02 Mar 2008)
New Revision: 1309
Modified:
index
source
Log:
[e] (0) Split the insertion modes into separate sections
Modified: index
===================================================================
--- index 2008-03-03 00:43:43 UTC (rev 1308)
+++ index 2008-03-03 01:02:46 UTC (rev 1309)
@@ -1629,8 +1629,54 @@
<li><a href="#the-insertion"><span class=secno>8.2.4.3.6.
</span>The insertion mode</a>
- <li><a href="#how-to0"><span class=secno>8.2.4.3.7. </span>How to
- handle tokens in the main phase</a>
+ <li><a href="#the-before"><span class=secno>8.2.4.3.7. </span>The
+ before head insertion mode</a>
+
+ <li><a href="#parsing-main-inhead"><span class=secno>8.2.4.3.8.
+ </span>The in head insertion mode</a>
+
+ <li><a href="#parsing-main-inheadnoscript"><span
+ class=secno>8.2.4.3.9. </span>The in head noscript insertion
+ mode</a>
+
+ <li><a href="#the-after"><span class=secno>8.2.4.3.10. </span>The
+ after head insertion mode</a>
+
+ <li><a href="#parsing-main-inbody"><span class=secno>8.2.4.3.11.
+ </span>The in body insertion mode</a>
+
+ <li><a href="#parsing-main-intable"><span class=secno>8.2.4.3.12.
+ </span>The in table insertion mode</a>
+
+ <li><a href="#parsing-main-incaption"><span
+ class=secno>8.2.4.3.13. </span>The in caption insertion mode</a>
+
+ <li><a href="#parsing-main-incolgroup"><span
+ class=secno>8.2.4.3.14. </span>The in column group insertion
+ mode</a>
+
+ <li><a href="#parsing-main-intbody"><span class=secno>8.2.4.3.15.
+ </span>The in table body insertion mode</a>
+
+ <li><a href="#parsing-main-intr"><span class=secno>8.2.4.3.16.
+ </span>The in row insertion mode</a>
+
+ <li><a href="#parsing-main-intd"><span class=secno>8.2.4.3.17.
+ </span>The in cell insertion mode</a>
+
+ <li><a href="#parsing-main-inselect"><span class=secno>8.2.4.3.18.
+ </span>The in select insertion mode</a>
+
+ <li><a href="#parsing-main-afterbody"><span
+ class=secno>8.2.4.3.19. </span>The after body insertion mode</a>
+
+ <li><a href="#parsing-main-inframeset"><span
+ class=secno>8.2.4.3.20. </span>The in frameset insertion mode</a>
+
+
+ <li><a href="#parsing-main-afterframeset"><span
+ class=secno>8.2.4.3.21. </span>The after frameset insertion
+ mode</a>
</ul>
<li><a href="#the-trailing"><span class=secno>8.2.4.4. </span>The
@@ -41375,723 +41421,690 @@
</ol>
-->
- <h6 id=how-to0><span class=secno>8.2.4.3.7. </span>How to handle tokens in
- the main phase</h6>
+ <h6 id=the-before><span class=secno>8.2.4.3.7. </span>The <dfn id=before4
+ title="insertion mode: before head">before head</dfn> insertion mode</h6>
- <p>Tokens in the main phase must be handled as follows:
+ <p>Handle the token as follows:
<dl class=switch>
- <dt>Anything else
+ <dt>An end-of-file token
<dd>
- <p>Depends on the <a href="#insertion0">insertion mode</a>:</p>
+ <p><a href="#stops">Stop parsing, with prejudice.</a></p>
- <dl class=switch>
- <dt>If the <a href="#insertion0">insertion mode</a> is "<dfn id=before4
- title="insertion mode: before head">before head</dfn>"
+ <dt>A character token that is one of one of U+0009 CHARACTER TABULATION,
+ U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF),
+ <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
- <dd>
- <p>Handle the token as follows:</p>
+ <dd>
+ <p><a href="#append" title="append a character">Append the character</a>
+ to the <a href="#current4">current node</a>.</p>
- <dl class=switch>
- <dt>An end-of-file token
+ <dt>A comment token
- <dd>
- <p><a href="#stops">Stop parsing, with prejudice.</a></p>
+ <dd>
+ <p>Append a <code>Comment</code> node to the <a href="#current4">current
+ node</a> with the <code title="">data</code> attribute set to the data
+ given in the comment token.</p>
- <dt>A character token that is one of one of U+0009 CHARACTER
- TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
- FORM FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
+ <dt>A DOCTYPE token
- <dd>
- <p><a href="#append" title="append a character">Append the
- character</a> to the <a href="#current4">current node</a>.</p>
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <dt>A comment token
+ <dt>A start tag whose tag name is "html"
- <dd>
- <p>Append a <code>Comment</code> node to the <a
- href="#current4">current node</a> with the <code
- title="">data</code> attribute set to the data given in the comment
- token.</p>
+ <dd>
+ <p>Process the token as if the <a href="#insertion0">insertion mode</a>
+ had been "<a href="#in-body" title="insertion mode: in body">in
+ body</a>".</p>
- <dt>A DOCTYPE token
+ <dt>A start tag whose tag name is "head"
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <dd>
+ <p><a href="#create">Create an element for the token</a>.</p>
- <dt>A start tag whose tag name is "html"
+ <p>Set the <a href="#head-element"><code title="">head</code> element
+ pointer</a> to this new element node.</p>
- <dd>
- <p>Process the token as if the <a href="#insertion0">insertion
- mode</a> had been "<a href="#in-body" title="insertion mode: in
- body">in body</a>".</p>
+ <p>Append the new element to the <a href="#current4">current node</a> and
+ push it onto the <a href="#stack">stack of open elements</a>.</p>
- <dt>A start tag whose tag name is "head"
+ <p>Change the <a href="#insertion0">insertion mode</a> to "<a
+ href="#in-head" title="insertion mode: in head">in head</a>".</p>
- <dd>
- <p><a href="#create">Create an element for the token</a>.</p>
+ <dt>A start tag token whose tag name is one of: "base", "link", "meta",
+ "script", "style", "title"
- <p>Set the <a href="#head-element"><code title="">head</code> element
- pointer</a> to this new element node.</p>
+ <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>Append the new element to the <a href="#current4">current node</a>
- and push it onto the <a href="#stack">stack of open elements</a>.</p>
+ <p class=note>This will result in a <code><a href="#head">head</a></code>
+ element being generated, and with the current token being reprocessed in
+ the "<a href="#in-head" title="insertion mode: in head">in head</a>" <a
+ href="#insertion0">insertion mode</a>.</p>
- <p>Change the <a href="#insertion0">insertion mode</a> to "<a
- href="#in-head" title="insertion mode: in head">in head</a>".</p>
+ <dt>An end tag whose tag name is one of: "head", "body", "html", "p", "br"
- <dt>A start tag token whose tag name is one of: "base", "link",
- "meta", "script", "style", "title"
+ <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>
- <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>
+ <dt>Any other end tag
- <p class=note>This will result in a <code><a
- href="#head">head</a></code> element being generated, and with the
- current token being reprocessed in the "<a href="#in-head"
- title="insertion mode: in head">in head</a>" <a
- href="#insertion0">insertion mode</a>.</p>
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <dt>An end tag whose tag name is one of: "head", "body", "html", "p",
- "br"
+ <p class=big-issue>Do we really want to ignore end tags here?</p>
- <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>
+ <dt>A character token that is <em>not</em> one of U+0009 CHARACTER
+ TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM
+ FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
- <dt>Any other end tag
+ <dt>Any other start tag token
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <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=big-issue>Do we really want to ignore end tags here?</p>
+ <p class=note>This will result in an empty <code><a
+ href="#head">head</a></code> element being generated, with the current
+ token being reprocessed in the "<a href="#after4" title="insertion mode:
+ after head">after head</a>" <a href="#insertion0">insertion mode</a>.</p>
+ </dl>
- <dt>A character token that is <em>not</em> one of U+0009 CHARACTER
- TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
- FORM FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
+ <h6 id=parsing-main-inhead><span class=secno>8.2.4.3.8. </span>The <dfn
+ id=in-head title="insertion mode: in head">in head</dfn> insertion mode</h6>
- <dt>Any other start tag token
+ <p>Handle the token as follows.
- <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>
+ <dl class=switch>
+ <dt>An end-of-file token
- <p class=note>This will result in an empty <code><a
- href="#head">head</a></code> element being generated, with the
- current token being reprocessed in the "<a href="#after4"
- title="insertion mode: after head">after head</a>" <a
- href="#insertion0">insertion mode</a>.</p>
- </dl>
+ <dd>
+ <p><a href="#stops">Stop parsing, with prejudice.</a></p>
- <dt id=parsing-main-inhead>If the <a href="#insertion0">insertion
- mode</a> is "<dfn id=in-head title="insertion mode: in head">in
- head</dfn>"
+ <dt>A character token that is one of one of U+0009 CHARACTER TABULATION,
+ U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF),
+ <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
- <dd>
- <p>Handle the token as follows.</p>
+ <dd>
+ <p><a href="#append" title="append a character">Append the character</a>
+ to the <a href="#current4">current node</a>.</p>
- <dl class=switch>
- <dt>An end-of-file token
+ <dt>A comment token
- <dd>
- <p><a href="#stops">Stop parsing, with prejudice.</a></p>
+ <dd>
+ <p>Append a <code>Comment</code> node to the <a href="#current4">current
+ node</a> with the <code title="">data</code> attribute set to the data
+ given in the comment token.</p>
- <dt>A character token that is one of one of U+0009 CHARACTER
- TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
- FORM FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
+ <dt>A DOCTYPE token
- <dd>
- <p><a href="#append" title="append a character">Append the
- character</a> to the <a href="#current4">current node</a>.</p>
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <dt>A comment token
+ <dt>A start tag whose tag name is "html"
- <dd>
- <p>Append a <code>Comment</code> node to the <a
- href="#current4">current node</a> with the <code
- title="">data</code> attribute set to the data given in the comment
- token.</p>
+ <dd>
+ <p>Process the token as if the <a href="#insertion0">insertion mode</a>
+ had been "<a href="#in-body" title="insertion mode: in body">in
+ body</a>".</p>
- <dt>A DOCTYPE token
+ <dt>A start tag whose tag name is one of: "base", "link"
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <dd>
+ <p><a href="#insert" title="insert an html element">Insert an HTML
+ element</a> for the token.</p>
- <dt>A start tag whose tag name is "html"
+ <dt>A start tag whose tag name is "meta"
- <dd>
- <p>Process the token as if the <a href="#insertion0">insertion
- mode</a> had been "<a href="#in-body" title="insertion mode: in
- body">in body</a>".</p>
+ <dd>
+ <p><a href="#insert" title="insert an html element">Insert an HTML
+ element</a> for the token.</p>
- <dt>A start tag whose tag name is one of: "base", "link"
+ <p id=meta-charset-during-parse>If the element has a <code
+ title=attr-meta-charset><a href="#charset0">charset</a></code>
+ attribute, and its value is a supported encoding, and the <a
+ href="#confidence" title=concept-encoding-confidence>confidence</a> is
+ currently <i>tentative</i>, then <a href="#change">change the
+ encoding</a> to the encoding given by the value of the <code
+ title=attr-meta-charset><a href="#charset0">charset</a></code>
+ attribute.</p>
- <dd>
- <p><a href="#insert" title="insert an html element">Insert an HTML
- element</a> for the token.</p>
+ <p>Otherwise, if the element has a <code title=attr-meta-charset><a
+ href="#charset0">content</a></code> attribute, and applying the <a
+ href="#algorithm3">algorithm for extracting an encoding from a
+ Content-Type</a> to its value returns a supported encoding <var
+ title="">encoding</var>, and the <a href="#confidence"
+ title=concept-encoding-confidence>confidence</a> is currently
+ <i>tentative</i>, then <a href="#change">change the encoding</a> to the
+ encoding <var title="">encoding</var>.</p>
- <dt>A start tag whose tag name is "meta"
+ <dt>A start tag whose tag name is "title"
- <dd>
- <p><a href="#insert" title="insert an html element">Insert an HTML
- element</a> for the token.</p>
+ <dd>
+ <p>Follow the <a href="#generic0">generic RCDATA parsing algorithm</a>,
+ with the <a href="#head-element"><code>head</code> element pointer</a>
+ as the <var title="">context node</var>, unless that's null, in which
+ case use the <a href="#current4">current node</a> (<span>fragment
+ cose</span>).</p>
- <p id=meta-charset-during-parse>If the element has a <code
- title=attr-meta-charset><a href="#charset0">charset</a></code>
- attribute, and its value is a supported encoding, and the <a
- href="#confidence" title=concept-encoding-confidence>confidence</a>
- is currently <i>tentative</i>, then <a href="#change">change the
- encoding</a> to the encoding given by the value of the <code
- title=attr-meta-charset><a href="#charset0">charset</a></code>
- attribute.</p>
+ <dt>A start tag whose tag name is "noscript", if <a
+ href="#scripting2">scripting is enabled</a>:
- <p>Otherwise, if the element has a <code title=attr-meta-charset><a
- href="#charset0">content</a></code> attribute, and applying the <a
- href="#algorithm3">algorithm for extracting an encoding from a
- Content-Type</a> to its value returns a supported encoding <var
- title="">encoding</var>, and the <a href="#confidence"
- title=concept-encoding-confidence>confidence</a> is currently
- <i>tentative</i>, then <a href="#change">change the encoding</a> to
- the encoding <var title="">encoding</var>.</p>
+ <dt>A start tag whose tag name is "style"
- <dt>A start tag whose tag name is "title"
+ <dd>
+ <p>Follow the <a href="#generic">generic CDATA parsing algorithm</a>,
+ with the <a href="#current4">current node</a> as the <var
+ title="">context node</var>.</p>
- <dd>
- <p>Follow the <a href="#generic0">generic RCDATA parsing
- algorithm</a>, with the <a href="#head-element"><code>head</code>
- element pointer</a> as the <var title="">context node</var>, unless
- that's null, in which case use the <a href="#current4">current
- node</a> (<span>fragment cose</span>).</p>
+ <dt>A start tag whose tag name is "noscript", if <a
+ href="#scripting1">scripting is disabled</a>:
- <dt>A start tag whose tag name is "noscript", if <a
- href="#scripting2">scripting is enabled</a>:
+ <dd>
+ <p><a href="#insert" title="insert an HTML element">Insert a
+ <code>noscript</code> element</a> for the token.</p>
- <dt>A start tag whose tag name is "style"
+ <p>Change the <a href="#insertion0">insertion mode</a> to "<a
+ href="#in-head0" title="insertion mode: in head noscript">in head
+ noscript</a>".</p>
- <dd>
- <p>Follow the <a href="#generic">generic CDATA parsing algorithm</a>,
- with the <a href="#current4">current node</a> as the <var
- title="">context node</var>.</p>
+ <dt id=scriptTag>A start tag whose tag name is "script"
- <dt>A start tag whose tag name is "noscript", if <a
- href="#scripting1">scripting is disabled</a>:
+ <dd>
+ <p><a href="#create">Create an element for the token</a>.</p>
- <dd>
- <p><a href="#insert" title="insert an HTML element">Insert a
- <code>noscript</code> element</a> for the token.</p>
+ <p>Mark the element as being <a
+ href="#parser-inserted">"parser-inserted"</a>. This ensures that, if the
+ script is external, any <code title=dom-document-write-HTML><a
+ href="#document.write...">document.write()</a></code> calls in the
+ script will execute in-line, instead of blowing the document away, as
+ would happen in most other cases.</p>
- <p>Change the <a href="#insertion0">insertion mode</a> to "<a
- href="#in-head0" title="insertion mode: in head noscript">in head
- noscript</a>".</p>
+ <p>Switch the tokeniser's <a href="#content2">content model flag</a> to
+ the CDATA state.</p>
- <dt id=scriptTag>A start tag whose tag name is "script"
+ <p>Then, collect all the character tokens that the tokeniser returns
+ until it returns a token that is not a character token, or until it
+ stops tokenising.</p>
- <dd>
- <p><a href="#create">Create an element for the token</a>.</p>
+ <p>If this process resulted in a collection of character tokens, append a
+ single <code>Text</code> node to the <code><a
+ href="#script0">script</a></code> element node whose contents is the
+ concatenation of all those tokens' characters.</p>
- <p>Mark the element as being <a
- href="#parser-inserted">"parser-inserted"</a>. This ensures that, if
- the script is external, any <code title=dom-document-write-HTML><a
- href="#document.write...">document.write()</a></code> calls in the
- script will execute in-line, instead of blowing the document away,
- as would happen in most other cases.</p>
+ <p>The tokeniser's <a href="#content2">content model flag</a> will have
+ switched back to the PCDATA state.</p>
- <p>Switch the tokeniser's <a href="#content2">content model flag</a>
- to the CDATA state.</p>
+ <p>If the next token is not an end tag token with the tag name "script",
+ then this is a <a href="#parse0">parse error</a>; mark the <code><a
+ href="#script0">script</a></code> element as <a href="#already">"already
+ executed"</a>. Otherwise, the token is the <code><a
+ href="#script0">script</a></code> element's end tag, so ignore it.</p>
- <p>Then, collect all the character tokens that the tokeniser returns
- until it returns a token that is not a character token, or until it
- stops tokenising.</p>
+ <p>If the parser was originally created for the <a
+ href="#html-fragment0">HTML fragment parsing algorithm</a>, then mark
+ the <code><a href="#script0">script</a></code> element as <a
+ href="#already">"already executed"</a>, and skip the rest of the
+ processing described for this token (including the part below where "<a
+ href="#the-script" title="the script that will execute as soon as the
+ parser resumes">scripts that will execute as soon as the parser
+ resumes</a>" are executed). (<a href="#fragment">fragment case</a>)</p>
- <p>If this process resulted in a collection of character tokens,
- append a single <code>Text</code> node to the <code><a
- href="#script0">script</a></code> element node whose contents is the
- concatenation of all those tokens' characters.</p>
+ <p class=note>Marking the <code><a href="#script0">script</a></code>
+ element as "already executed" prevents it from executing when it is
+ inserted into the document a few paragraphs below. Thus, scripts missing
+ their end tags and scripts that were inserted using <code
+ title=dom-innerHTML-HTML><a href="#innerhtml0">innerHTML</a></code>
+ aren't executed.</p>
- <p>The tokeniser's <a href="#content2">content model flag</a> will
- have switched back to the PCDATA state.</p>
+ <p>Let the <var title="">old insertion point</var> have the same value as
+ the current <a href="#insertion">insertion point</a>. Let the <a
+ href="#insertion">insertion point</a> be just before the <a
+ href="#next-input">next input character</a>.</p>
- <p>If the next token is not an end tag token with the tag name
- "script", then this is a <a href="#parse0">parse error</a>; mark the
- <code><a href="#script0">script</a></code> element as <a
- href="#already">"already executed"</a>. Otherwise, the token is the
- <code><a href="#script0">script</a></code> element's end tag, so
- ignore it.</p>
+ <p>Append the new element to the <a href="#current4">current node</a>. <a
+ href="#running0" title="running a script">Special processing occurs when
+ a <code>script</code> element is inserted into a document</a> that might
+ cause some script to execute, which might cause <a
+ href="#document.write..." title=dom-document-write-HTML>new characters
+ to be inserted into the tokeniser</a>.</p>
- <p>If the parser was originally created for the <a
- href="#html-fragment0">HTML fragment parsing algorithm</a>, then
- mark the <code><a href="#script0">script</a></code> element as <a
- href="#already">"already executed"</a>, and skip the rest of the
- processing described for this token (including the part below where
- "<a href="#the-script" title="the script that will execute as soon
- as the parser resumes">scripts that will execute as soon as the
- parser resumes</a>" are executed). (<a href="#fragment">fragment
- case</a>)</p>
+ <p>Let the <a href="#insertion">insertion point</a> have the value of the
+ <var title="">old insertion point</var>. (In other words, restore the <a
+ href="#insertion">insertion point</a> to the value it had before the
+ previous paragraph. This value might be the "undefined" value.)</p>
- <p class=note>Marking the <code><a href="#script0">script</a></code>
- element as "already executed" prevents it from executing when it is
- inserted into the document a few paragraphs below. Thus, scripts
- missing their end tags and scripts that were inserted using <code
- title=dom-innerHTML-HTML><a href="#innerhtml0">innerHTML</a></code>
- aren't executed.</p>
+ <p id=scriptTagParserResumes>At this stage, if there is <a
+ href="#the-script" title="the script that will execute as soon as the
+ parser resumes">a script that will execute as soon as the parser
+ resumes</a>, then:</p>
- <p>Let the <var title="">old insertion point</var> have the same
- value as the current <a href="#insertion">insertion point</a>. Let
- the <a href="#insertion">insertion point</a> be just before the <a
- href="#next-input">next input character</a>.</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-HTML><a
+ href="#document.write...">document.write()</a></code>:
- <p>Append the new element to the <a href="#current4">current
- node</a>. <a href="#running0" title="running a script">Special
- processing occurs when a <code>script</code> element is inserted
- into a document</a> that might cause some script to execute, which
- might cause <a href="#document.write..."
- title=dom-document-write-HTML>new characters to be inserted into the
- tokeniser</a>.</p>
+ <dd>
+ <p>Abort the processing of any nested invokations of the tokeniser,
+ yielding control back to the caller. (Tokenisation will resume when
+ the caller returns to the "outer" tree construction stage.)
- <p>Let the <a href="#insertion">insertion point</a> have the value of
- the <var title="">old insertion point</var>. (In other words,
- restore the <a href="#insertion">insertion point</a> to the value it
- had before the previous paragraph. This value might be the
- "undefined" value.)</p>
+ <dt>Otherwise:
- <p id=scriptTagParserResumes>At this stage, if there is <a
- href="#the-script" title="the script that will execute as soon as
- the parser resumes">a script that will execute as soon as the parser
- resumes</a>, then:</p>
+ <dd>
+ <p>Follow these steps:</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-HTML><a
- href="#document.write...">document.write()</a></code>:
+ <ol>
+ <li>
+ <p>Let <var title="">the script</var> be <a href="#the-script">the
+ script that will execute as soon as the parser resumes</a>. There is
+ no longer <a href="#the-script" title="the script that will execute
+ as soon as the parser resumes">a script that will execute as soon as
+ the parser resumes</a>.
- <dd>
- <p>Abort the processing of any nested invokations of the tokeniser,
- yielding control back to the caller. (Tokenisation will resume
- when the caller returns to the "outer" tree construction stage.)
+ <li>
+ <p><a href="#pause">Pause</a> until the script has <span>completed
+ loading</span><!-- XXX xref -->.
- <dt>Otherwise:
+ <li>
+ <p>Let the <a href="#insertion">insertion point</a> be just before
+ the <a href="#next-input">next input character</a>.
- <dd>
- <p>Follow these steps:</p>
+ <li>
+ <p><a href="#executing0" title="executing a script block">Execute the
+ script</a>.
- <ol>
- <li>
- <p>Let <var title="">the script</var> be <a
- href="#the-script">the script that will execute as soon as the
- parser resumes</a>. There is no longer <a href="#the-script"
- title="the script that will execute as soon as the parser
- resumes">a script that will execute as soon as the parser
- resumes</a>.
+ <li>
+ <p>Let the <a href="#insertion">insertion point</a> be undefined
+ again.
- <li>
- <p><a href="#pause">Pause</a> until the script has
- <span>completed loading</span><!-- XXX xref -->.
+ <li>
+ <p>If there is once again <a href="#the-script" title="the script
+ that will execute as soon as the parser resumes">a script that will
+ execute as soon as the parser resumes</a>, then repeat these steps
+ from step 1.
+ </ol>
+ </dl>
- <li>
- <p>Let the <a href="#insertion">insertion point</a> be just
- before the <a href="#next-input">next input character</a>.
+ <dt>An end tag whose tag name is "head"
- <li>
- <p><a href="#executing0" title="executing a script block">Execute
- the script</a>.
+ <dd>
+ <p>Pop the <a href="#current4">current node</a> (which will be the
+ <code><a href="#head">head</a></code> element) off the <a
+ href="#stack">stack of open elements</a>.</p>
- <li>
- <p>Let the <a href="#insertion">insertion point</a> be undefined
- again.
+ <p>Change the <a href="#insertion0">insertion mode</a> to "<a
+ href="#after4" title="insertion mode: after head">after head</a>".</p>
- <li>
- <p>If there is once again <a href="#the-script" title="the script
- that will execute as soon as the parser resumes">a script that
- will execute as soon as the parser resumes</a>, then repeat
- these steps from step 1.
- </ol>
- </dl>
+ <dt>An end tag whose tag name is one of: "body", "html", "p", "br"
- <dt>An end tag whose tag name is "head"
+ <dd>
+ <p>Act as described in the "anything else" entry below.</p>
- <dd>
- <p>Pop the <a href="#current4">current node</a> (which will be the
- <code><a href="#head">head</a></code> element) off the <a
- href="#stack">stack of open elements</a>.</p>
+ <dt>A start tag whose tag name is "head"
- <p>Change the <a href="#insertion0">insertion mode</a> to "<a
- href="#after4" title="insertion mode: after head">after head</a>".</p>
+ <dt>Any other end tag
- <dt>An end tag whose tag name is one of: "body", "html", "p", "br"
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <dd>
- <p>Act as described in the "anything else" entry below.</p>
+ <dt>Anything else
- <dt>A start tag whose tag name is "head"
+ <dd>
+ <p>Act as if an end tag token with the tag name "head" had been seen, and
+ reprocess the current token.</p>
- <dt>Any other end tag
+ <p class=big-issue>In certain UAs, <a
+ href="https://bugzilla.mozilla.org/attachment.cgi?id=180157&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>
+ </dl>
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <h6 id=parsing-main-inheadnoscript><span class=secno>8.2.4.3.9. </span>The
+ <dfn id=in-head0 title="insertion mode: in head noscript">in head
+ noscript</dfn> insertion mode</h6>
- <dt>Anything else
+ <p>Handle the token as follows.
- <dd>
- <p>Act as if an end tag token with the tag name "head" had been seen,
- and reprocess the current token.</p>
+ <dl class=switch>
+ <dt>An end-of-file token
- <p class=big-issue>In certain UAs, <a
- href="https://bugzilla.mozilla.org/attachment.cgi?id=180157&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>
- </dl>
+ <dd>
+ <p><a href="#stops">Stop parsing, with prejudice.</a></p>
- <dt id=parsing-main-inheadnoscript>If the <a
- href="#insertion0">insertion mode</a> is "<dfn id=in-head0
- title="insertion mode: in head noscript">in head noscript</dfn>"
+ <dt>A DOCTYPE token
- <dd>
- <dl class=switch>
- <dt>An end-of-file token
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <dd>
- <p><a href="#stops">Stop parsing, with prejudice.</a></p>
+ <dt>A start tag whose tag name is "html"
- <dt>A DOCTYPE token
+ <dd>
+ <p>Process the token as if the <a href="#insertion0">insertion mode</a>
+ had been "<a href="#in-body" title="insertion mode: in body">in
+ body</a>".</p>
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <dt>An end tag whose tag name is "noscript"
- <dt>A start tag whose tag name is "html"
+ <dd>
+ <p>Pop the <a href="#current4">current node</a> (which will be a <code><a
+ href="#noscript">noscript</a></code> element) from the <a
+ href="#stack">stack of open elements</a>; the new <a
+ href="#current4">current node</a> will be a <code><a
+ href="#head">head</a></code> element.</p>
- <dd>
- <p>Process the token as if the <a href="#insertion0">insertion
- mode</a> had been "<a href="#in-body" title="insertion mode: in
- body">in body</a>".</p>
+ <p>Switch the <a href="#insertion0">insertion mode</a> to "<a
+ href="#in-head" title="insertion mode: in head">in head</a>".</p>
- <dt>An end tag whose tag name is "noscript"
+ <dt>A character token that is one of one of U+0009 CHARACTER TABULATION,
+ U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF),
+ <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
- <dd>
- <p>Pop the <a href="#current4">current node</a> (which will be a
- <code><a href="#noscript">noscript</a></code> element) from the <a
- href="#stack">stack of open elements</a>; the new <a
- href="#current4">current node</a> will be a <code><a
- href="#head">head</a></code> element.</p>
+ <dt>A comment token
- <p>Switch the <a href="#insertion0">insertion mode</a> to "<a
- href="#in-head" title="insertion mode: in head">in head</a>".</p>
+ <dt>A start tag whose tag name is one of: "link", "meta", "style"
- <dt>A character token that is one of one of U+0009 CHARACTER
- TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
- FORM FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
+ <dd>
+ <p>Process the token as if the <a href="#insertion0">insertion mode</a>
+ had been "<a href="#in-head" title="insertion mode: in head">in
+ head</a>".</p>
- <dt>A comment token
+ <dt>An end tag whose tag name is one of: "p", "br"
- <dt>A start tag whose tag name is one of: "link", "meta", "style"
+ <dd>
+ <p>Act as described in the "anything else" entry below.</p>
- <dd>
- <p>Process the token as if the <a href="#insertion0">insertion
- mode</a> had been "<a href="#in-head" title="insertion mode: in
- head">in head</a>".</p>
+ <dt>A start tag whose tag name is one of: "head", "noscript"
- <dt>An end tag whose tag name is one of: "p", "br"
+ <dt>Any other end tag
- <dd>
- <p>Act as described in the "anything else" entry below.</p>
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <dt>A start tag whose tag name is one of: "head", "noscript"
+ <dt>Anything else
- <dt>Any other end tag
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Act as if an end tag with the tag
+ name "noscript" had been seen and reprocess the current token.</p>
+ </dl>
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <h6 id=the-after><span class=secno>8.2.4.3.10. </span>The <dfn id=after4
+ title="insertion mode: after head">after head</dfn> insertion mode</h6>
- <dt>Anything else
+ <p>Handle the token as follows:
- <dd>
- <p><a href="#parse0">Parse error</a>. Act as if an end tag with the
- tag name "noscript" had been seen and reprocess the current token.</p>
- </dl>
+ <dl class=switch>
+ <dt>An end-of-file token
- <dt>If the <a href="#insertion0">insertion mode</a> is "<dfn id=after4
- title="insertion mode: after head">after head</dfn>"
+ <dd>
+ <p><a href="#stops">Stop parsing, with prejudice.</a></p>
- <dd>
- <p>Handle the token as follows:</p>
+ <dt>A character token that is one of one of U+0009 CHARACTER TABULATION,
+ U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF),
+ <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
- <dl class=switch>
- <dt>An end-of-file token
+ <dd>
+ <p><a href="#append" title="append a character">Append the character</a>
+ to the <a href="#current4">current node</a>.</p>
- <dd>
- <p><a href="#stops">Stop parsing, with prejudice.</a></p>
+ <dt>A comment token
- <dt>A character token that is one of one of U+0009 CHARACTER
- TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
- FORM FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
+ <dd>
+ <p>Append a <code>Comment</code> node to the <a href="#current4">current
+ node</a> with the <code title="">data</code> attribute set to the data
+ given in the comment token.</p>
- <dd>
- <p><a href="#append" title="append a character">Append the
- character</a> to the <a href="#current4">current node</a>.</p>
+ <dt>A DOCTYPE token
- <dt>A comment token
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <dd>
- <p>Append a <code>Comment</code> node to the <a
- href="#current4">current node</a> with the <code
- title="">data</code> attribute set to the data given in the comment
- token.</p>
+ <dt>A start tag whose tag name is "html"
- <dt>A DOCTYPE token
+ <dd>
+ <p>Process the token as if the <a href="#insertion0">insertion mode</a>
+ had been "<a href="#in-body" title="insertion mode: in body">in
+ body</a>".</p>
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <dt>A start tag whose tag name is "body"
- <dt>A start tag whose tag name is "html"
+ <dd>
+ <p><a href="#insert" title="insert an HTML element">Insert a
+ <code>body</code> element</a> for the token.</p>
- <dd>
- <p>Process the token as if the <a href="#insertion0">insertion
- mode</a> had been "<a href="#in-body" title="insertion mode: in
- body">in body</a>".</p>
+ <p>Change the <a href="#insertion0">insertion mode</a> to "<a
+ href="#in-body" title="insertion mode: in body">in body</a>".</p>
- <dt>A start tag whose tag name is "body"
+ <dt>A start tag whose tag name is "frameset"
- <dd>
- <p><a href="#insert" title="insert an HTML element">Insert a
- <code>body</code> element</a> for the token.</p>
+ <dd>
+ <p><a href="#insert" title="insert an HTML element">Insert a
+ <code>frameset</code> element</a> for the token.</p>
- <p>Change the <a href="#insertion0">insertion mode</a> to "<a
- href="#in-body" title="insertion mode: in body">in body</a>".</p>
+ <p>Change the <a href="#insertion0">insertion mode</a> to "<a
+ href="#in-frameset" title="insertion mode: in frameset">in
+ frameset</a>".</p>
- <dt>A start tag whose tag name is "frameset"
+ <dt>A start tag token whose tag name is one of: "base", "link", "meta",
+ "script", "style", "title"
- <dd>
- <p><a href="#insert" title="insert an HTML element">Insert a
- <code>frameset</code> element</a> for the token.</p>
+ <dd>
+ <p><a href="#parse0">Parse error</a>.</p>
- <p>Change the <a href="#insertion0">insertion mode</a> to "<a
- href="#in-frameset" title="insertion mode: in frameset">in
- frameset</a>".</p>
+ <p>Push the node pointed to by the <a href="#head-element"><code
+ title="">head</code> element pointer</a> onto the <a href="#stack">stack
+ of open elements</a>.</p>
- <dt>A start tag token whose tag name is one of: "base", "link",
- "meta", "script", "style", "title"
+ <p>Process the token as if the <a href="#insertion0">insertion mode</a>
+ had been "<a href="#in-head" title="insertion mode: in head">in
+ head</a>".</p>
- <dd>
- <p><a href="#parse0">Parse error</a>.</p>
+ <p>Pop the <a href="#current4">current node</a> (which will be the node
+ pointed to by the <a href="#head-element"><code title="">head</code>
+ element pointer</a>) off the <a href="#stack">stack of open
+ elements</a>.</p>
- <p>Push the node pointed to by the <a href="#head-element"><code
- title="">head</code> element pointer</a> onto the <a
- href="#stack">stack of open elements</a>.</p>
+ <dt>Anything else
- <p>Process the token as if the <a href="#insertion0">insertion
- mode</a> had been "<a href="#in-head" title="insertion mode: in
- head">in head</a>".</p>
+ <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>
+ </dl>
- <p>Pop the <a href="#current4">current node</a> (which will be the
- node pointed to by the <a href="#head-element"><code
- title="">head</code> element pointer</a>) off the <a
- href="#stack">stack of open elements</a>.</p>
+ <h6 id=parsing-main-inbody><span class=secno>8.2.4.3.11. </span>The <dfn
+ id=in-body title="insertion mode: in body">in body</dfn> insertion mode</h6>
- <dt>Anything else
+ <p>Handle the token as follows:
- <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>
- </dl>
+ <dl class=switch>
+ <dt>An end-of-file token
- <dt id=parsing-main-inbody>If the <a href="#insertion0">insertion
- mode</a> is "<dfn id=in-body title="insertion mode: in body">in
- body</dfn>"
+ <dd>
+ <p><a href="#stops">Stop parsing, with prejudice.</a></p>
- <dd>
- <p>Handle the token as follows:</p>
+ <dt>A character token
- <dl class=switch>
- <dt>An end-of-file token
+ <dd>
+ <p><a href="#reconstruct">Reconstruct the active formatting elements</a>,
+ if any.</p>
- <dd>
- <p><a href="#stops">Stop parsing, with prejudice.</a></p>
+ <p><a href="#append" title="append a character">Append the token's
+ character</a> to the <a href="#current4">current node</a>.</p>
- <dt>A character token
+ <dt>A comment token
- <dd>
- <p><a href="#reconstruct">Reconstruct the active formatting
- elements</a>, if any.</p>
+ <dd>
+ <p>Append a <code>Comment</code> node to the <a href="#current4">current
+ node</a> with the <code title="">data</code> attribute set to the data
+ given in the comment token.</p>
- <p><a href="#append" title="append a character">Append the token's
- character</a> to the <a href="#current4">current node</a>.</p>
+ <dt>A DOCTYPE token
- <dt>A comment token
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <dd>
- <p>Append a <code>Comment</code> node to the <a
- href="#current4">current node</a> with the <code
- title="">data</code> attribute set to the data given in the comment
- token.</p>
+ <dt>A start tag whose tag name is "html"
- <dt>A DOCTYPE token
+ <dd>
+ <p>If this start tag token was not the first start tag token, then it is
+ a <a href="#parse0">parse error</a>.</p>
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <p>For each attribute on the token, check to see if the attribute is
+ already present on the top element of the <a href="#stack">stack of open
+ elements</a>. If it is not, add the attribute and its corresponding
+ value to that element.</p>
- <dt>A start tag whose tag name is "html"
+ <dt>A start tag token whose tag name is one of: "base", "link", "meta",
+ "script", "style"
- <dd>
- <p>If this start tag token was not the first start tag token, then it
- is a <a href="#parse0">parse error</a>.</p>
+ <dd>
+ <p>Process the token as if the <a href="#insertion0">insertion mode</a>
+ had been "<a href="#in-head" title="insertion mode: in head">in
+ head</a>".</p>
- <p>For each attribute on the token, check to see if the attribute is
- already present on the top element of the <a href="#stack">stack of
- open elements</a>. If it is not, add the attribute and its
- corresponding value to that element.</p>
+ <dt>A start tag whose tag name is "title"
- <dt>A start tag token whose tag name is one of: "base", "link",
- "meta", "script", "style"
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Process the token as if the <a
+ href="#insertion0">insertion mode</a> had been "<a href="#in-head"
+ title="insertion mode: in head">in head</a>".</p>
- <dd>
- <p>Process the token as if the <a href="#insertion0">insertion
- mode</a> had been "<a href="#in-head" title="insertion mode: in
- head">in head</a>".</p>
+ <dt>A start tag whose tag name is "body"
- <dt>A start tag whose tag name is "title"
+ <dd>
+ <p><a href="#parse0">Parse error</a>.</p>
- <dd>
- <p><a href="#parse0">Parse error</a>. Process the token as if the <a
- href="#insertion0">insertion mode</a> had been "<a href="#in-head"
- title="insertion mode: in head">in head</a>".</p>
+ <p>If the second element on the <a href="#stack">stack of open
+ elements</a> is not a <code><a href="#body0">body</a></code> element,
+ or, if the <a href="#stack">stack of open elements</a> has only one node
+ on it, then ignore the token. (<a href="#fragment">fragment case</a>)</p>
- <dt>A start tag whose tag name is "body"
+ <p>Otherwise, for each attribute on the token, check to see if the
+ attribute is already present on the <code><a
+ href="#body0">body</a></code> element (the second element) on the <a
+ href="#stack">stack of open elements</a>. If it is not, add the
+ attribute and its corresponding value to that element.</p>
- <dd>
- <p><a href="#parse0">Parse error</a>.</p>
+ <dt>An end tag whose tag name is "body"
- <p>If the second element on the <a href="#stack">stack of open
- elements</a> is not a <code><a href="#body0">body</a></code>
- element, or, if the <a href="#stack">stack of open elements</a> has
- only one node on it, then ignore the token. (<a
- href="#fragment">fragment case</a>)</p>
+ <dd>
+ <p>If the second element in the <a href="#stack">stack of open
+ elements</a> is not a <code><a href="#body0">body</a></code> element,
+ this is a <a href="#parse0">parse error</a>. Ignore the token. (<a
+ href="#fragment">fragment case</a>)</p>
- <p>Otherwise, for each attribute on the token, check to see if the
- attribute is already present on the <code><a
- href="#body0">body</a></code> element (the second element) on the <a
- href="#stack">stack of open elements</a>. If it is not, add the
- attribute and its corresponding value to that element.</p>
+ <p>Otherwise, if there is a node in the <a href="#stack">stack of open
+ elements</a> that is not either a <code><a href="#dd">dd</a></code>
+ element, a <code><a href="#dt">dt</a></code> element, an <code><a
+ href="#li">li</a></code> element, a <code><a href="#p">p</a></code>
+ element, a <code><a href="#tbody">tbody</a></code> element, a <code><a
+ href="#td">td</a></code> element, a <code><a
+ href="#tfoot0">tfoot</a></code> element, a <code><a
+ href="#th">th</a></code> element, a <code><a
+ href="#thead0">thead</a></code> element, a <code><a
+ href="#tr">tr</a></code> element, the <code><a
+ href="#body0">body</a></code> element, or the <code><a
+ href="#html">html</a></code> element, then this is a <a
+ href="#parse0">parse error</a>.
- <dt>An end tag whose tag name is "body"
+ <p>Change the <a href="#insertion0">insertion mode</a> to "<a
+ href="#after5" title="insertion mode: after body">after body</a>".</p>
- <dd>
- <p>If the second element in the <a href="#stack">stack of open
- elements</a> is not a <code><a href="#body0">body</a></code>
- element, this is a <a href="#parse0">parse error</a>. Ignore the
- token. (<a href="#fragment">fragment case</a>)</p>
+ <dt>An end tag whose tag name is "html"
- <p>Otherwise, if there is a node in the <a href="#stack">stack of
- open elements</a> that is not either a <code><a
- href="#dd">dd</a></code> element, a <code><a
- href="#dt">dt</a></code> element, an <code><a
- href="#li">li</a></code> element, a <code><a href="#p">p</a></code>
- element, a <code><a href="#tbody">tbody</a></code> element, a
- <code><a href="#td">td</a></code> element, a <code><a
- href="#tfoot0">tfoot</a></code> element, a <code><a
- href="#th">th</a></code> element, a <code><a
- href="#thead0">thead</a></code> element, a <code><a
- href="#tr">tr</a></code> element, the <code><a
- href="#body0">body</a></code> element, or the <code><a
- href="#html">html</a></code> element, then this is a <a
- href="#parse0">parse error</a>.
+ <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>Change the <a href="#insertion0">insertion mode</a> to "<a
- href="#after5" title="insertion mode: after body">after body</a>".</p>
+ <p class=note>The fake end tag token here can only be ignored in the <a
+ href="#fragment">fragment case</a>.</p>
- <dt>An end tag whose tag name is "html"
+ <dt>A start tag whose tag name is one of: "address", "blockquote",
+ "center", "dir", "div", "dl", "fieldset", "listing", "menu", "ol", "p",
+ "ul"
- <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>
+ <dd>
+ <p class=big-issue>This doesn't match browsers.</p>
+ <!-- XXX <p><i><p>: http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%3Cp%3E%3Ci%3E%3Cp%3E%3C%2Fp%3E%3C%2Fi%3E%3C%2Fp%3E -->
+ <!-- XXX <p><i><div><p>: http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%3Cp%3E%3Ci%3E%3Cdiv%3E%3Cp%3E%3C%2Fp%3E%3C%2Fdiv%3E%3C%2Fi%3E%3C%2Fp%3E -->
+
+ <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
+ title="has an element in scope">has a <code>p</code> element in
+ scope</a>, then act as if an end tag with the tag name <code><a
+ href="#p">p</a></code> had been seen.</p>
- <p class=note>The fake end tag token here can only be ignored in the
- <a href="#fragment">fragment case</a>.</p>
+ <p><a href="#insert" title="insert an html element">Insert an HTML
+ element</a> for the token.</p>
- <dt>A start tag whose tag name is one of: "address", "blockquote",
- "center", "dir", "div", "dl", "fieldset", "listing", "menu", "ol",
- "p", "ul"
+ <dt>A start tag whose tag name is "pre"
- <dd>
- <p class=big-issue>This doesn't match browsers.</p>
- <!-- XXX <p><i><p>: http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%3Cp%3E%3Ci%3E%3Cp%3E%3C%2Fp%3E%3C%2Fi%3E%3C%2Fp%3E -->
- <!-- XXX <p><i><div><p>: http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%3Cp%3E%3Ci%3E%3Cdiv%3E%3Cp%3E%3C%2Fp%3E%3C%2Fdiv%3E%3C%2Fi%3E%3C%2Fp%3E -->
-
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an" title="has an element in scope">has a <code>p</code>
- element in scope</a>, then act as if an end tag with the tag name
- <code><a href="#p">p</a></code> had been seen.</p>
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
+ title="has an element in scope">has a <code>p</code> element in
+ scope</a>, then act as if an end tag with the tag name <code><a
+ href="#p">p</a></code> had been seen.</p>
- <p><a href="#insert" title="insert an html element">Insert an HTML
- element</a> for the token.</p>
+ <p><a href="#insert" title="insert an html element">Insert an HTML
+ element</a> for the token.</p>
- <dt>A start tag whose tag name is "pre"
+ <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><a href="#pre">pre</a></code> blocks are ignored as an authoring
+ convenience.)</p>
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an" title="has an element in scope">has a <code>p</code>
- element in scope</a>, then act as if an end tag with the tag name
- <code><a href="#p">p</a></code> had been seen.</p>
+ <dt>A start tag whose tag name is "form"
- <p><a href="#insert" title="insert an html element">Insert an HTML
- element</a> for the token.</p>
+ <dd>
+ <p>If the <a href="#form-element"><code title=form>form</code> element
+ pointer</a> is not null, ignore the token with a <a href="#parse0">parse
+ error</a>.</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><a href="#pre">pre</a></code> blocks are ignored as
- an authoring convenience.)</p>
+ <p>Otherwise:</p>
- <dt>A start tag whose tag name is "form"
+ <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
+ title="has an element in scope">has a <code>p</code> element in
+ scope</a>, then act as if an end tag with the tag name <code><a
+ href="#p">p</a></code> had been seen.</p>
- <dd>
- <p>If the <a href="#form-element"><code title=form>form</code>
- element pointer</a> is not null, ignore the token with a <a
- href="#parse0">parse error</a>.</p>
+ <p><a href="#insert" title="insert an html Element">Insert an HTML
+ element</a> for the token, and set the <code title=form>form</code>
+ element pointer to point to the element created.</p>
- <p>Otherwise:</p>
+ <dt>A start tag whose tag name is "li"
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an" title="has an element in scope">has a <code>p</code>
- element in scope</a>, then act as if an end tag with the tag name
- <code><a href="#p">p</a></code> had been seen.</p>
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
+ title="has an element in scope">has a <code>p</code> element in
+ scope</a>, then act as if an end tag with the tag name <code><a
+ href="#p">p</a></code> had been seen.</p>
- <p><a href="#insert" title="insert an html Element">Insert an HTML
- element</a> for the token, and set the <code title=form>form</code>
- element pointer to point to the element created.</p>
+ <p>Run the following algorithm:</p>
- <dt>A start tag whose tag name is "li"
+ <ol>
+ <li>
+ <p>Initialise <var title="">node</var> to be the <a
+ href="#current4">current node</a> (the bottommost node of the stack).
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an" title="has an element in scope">has a <code>p</code>
- element in scope</a>, then act as if an end tag with the tag name
- <code><a href="#p">p</a></code> had been seen.</p>
+ <li>
+ <p>If <var title="">node</var> is an <code><a href="#li">li</a></code>
+ element, then pop all the nodes from the <a href="#current4">current
+ node</a> up to <var title="">node</var>, including <var
+ title="">node</var>, then stop this algorithm. If more than one node
+ is popped, then this is a <a href="#parse0">parse error</a>.
- <p>Run the following algorithm:</p>
-
- <ol>
- <li>
- <p>Initialise <var title="">node</var> to be the <a
- href="#current4">current node</a> (the bottommost node of the
- stack).
-
- <li>
- <p>If <var title="">node</var> is an <code><a
- href="#li">li</a></code> element, then pop all the nodes from the
- <a href="#current4">current node</a> up to <var
- title="">node</var>, including <var title="">node</var>, then stop
- this algorithm. If more than one node is popped, then this is a <a
- href="#parse0">parse error</a>.
-
- <li>
- <p>If <var title="">node</var> is not in the <a
- href="#formatting">formatting</a> category, and is not in the <a
- href="#phrasing1">phrasing</a> category, and is not an <code><a
- href="#address">address</a></code> or <code><a
- href="#div">div</a></code> element, then stop this algorithm.
- </li>
- <!-- an element <foo> is in this
+ <li>
+ <p>If <var title="">node</var> is not in the <a
+ href="#formatting">formatting</a> category, and is not in the <a
+ href="#phrasing1">phrasing</a> category, and is not an <code><a
+ href="#address">address</a></code> or <code><a
+ href="#div">div</a></code> element, then stop this algorithm.
+ </li>
+ <!-- an element <foo> is in this
list if the following markup:
<!DOCTYPE html><body><ol><li><foo><li>
@@ -42100,48 +42113,45 @@
descendant of the first <li>, or if <foo> is a formatting
element that gets reopened later. -->
- <li>
- <p>Otherwise, set <var title="">node</var> to the previous entry in
- the <a href="#stack">stack of open elements</a> and return to step
- 2.
- </ol>
+ <li>
+ <p>Otherwise, set <var title="">node</var> to the previous entry in the
+ <a href="#stack">stack of open elements</a> and return to step 2.
+ </ol>
- <p>Finally, <a href="#insert" title="insert an html element">insert
- an <code>li</code> element</a>.</p>
+ <p>Finally, <a href="#insert" title="insert an html element">insert an
+ <code>li</code> element</a>.</p>
- <dt>A start tag whose tag name is one of: "dd", "dt"
+ <dt>A start tag whose tag name is one of: "dd", "dt"
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an" title="has an element in scope">has a <code>p</code>
- element in scope</a>, then act as if an end tag with the tag name
- <code><a href="#p">p</a></code> had been seen.</p>
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
+ title="has an element in scope">has a <code>p</code> element in
+ scope</a>, then act as if an end tag with the tag name <code><a
+ href="#p">p</a></code> had been seen.</p>
- <p>Run the following algorithm:</p>
+ <p>Run the following algorithm:</p>
- <ol>
- <li>
- <p>Initialise <var title="">node</var> to be the <a
- href="#current4">current node</a> (the bottommost node of the
- stack).
+ <ol>
+ <li>
+ <p>Initialise <var title="">node</var> to be the <a
+ href="#current4">current node</a> (the bottommost node of the stack).
- <li>
- <p>If <var title="">node</var> is a <code><a
- href="#dd">dd</a></code> or <code><a href="#dt">dt</a></code>
- element, then pop all the nodes from the <a
- href="#current4">current node</a> up to <var title="">node</var>,
- including <var title="">node</var>, then stop this algorithm. If
- more than one node is popped, then this is a <a
- href="#parse0">parse error</a>.
+ <li>
+ <p>If <var title="">node</var> is a <code><a href="#dd">dd</a></code>
+ or <code><a href="#dt">dt</a></code> element, then pop all the nodes
+ from the <a href="#current4">current node</a> up to <var
+ title="">node</var>, including <var title="">node</var>, then stop
+ this algorithm. If more than one node is popped, then this is a <a
+ href="#parse0">parse error</a>.
- <li>
- <p>If <var title="">node</var> is not in the <a
- href="#formatting">formatting</a> category, and is not in the <a
- href="#phrasing1">phrasing</a> category, and is not an <code><a
- href="#address">address</a></code> or <code><a
- href="#div">div</a></code> element, then stop this algorithm.
- </li>
- <!-- an element <foo> is in this
+ <li>
+ <p>If <var title="">node</var> is not in the <a
+ href="#formatting">formatting</a> category, and is not in the <a
+ href="#phrasing1">phrasing</a> category, and is not an <code><a
+ href="#address">address</a></code> or <code><a
+ href="#div">div</a></code> element, then stop this algorithm.
+ </li>
+ <!-- an element <foo> is in this
list if the following markup:
<!DOCTYPE html><body><ol><dt><foo><dt>
@@ -42150,127 +42160,123 @@
descendant of the first <li>, or if <foo> is a formatting
element that gets reopened later. -->
- <li>
- <p>Otherwise, set <var title="">node</var> to the previous entry in
- the <a href="#stack">stack of open elements</a> and return to step
- 2.
- </ol>
+ <li>
+ <p>Otherwise, set <var title="">node</var> to the previous entry in the
+ <a href="#stack">stack of open elements</a> and return to step 2.
+ </ol>
- <p>Finally, <a href="#insert" title="insert an html element">insert
- an HTML element</a> with the same tag name as the token's.</p>
+ <p>Finally, <a href="#insert" title="insert an html element">insert an
+ HTML element</a> with the same tag name as the token's.</p>
- <dt>A start tag whose tag name is "plaintext"
+ <dt>A start tag whose tag name is "plaintext"
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an" title="has an element in scope">has a <code>p</code>
- element in scope</a>, then act as if an end tag with the tag name
- <code><a href="#p">p</a></code> had been seen.</p>
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
+ title="has an element in scope">has a <code>p</code> element in
+ scope</a>, then act as if an end tag with the tag name <code><a
+ href="#p">p</a></code> had been seen.</p>
- <p><a href="#insert" title="insert an html element">Insert an HTML
- element</a> for the token.</p>
+ <p><a href="#insert" title="insert an html element">Insert an HTML
+ element</a> for the token.</p>
- <p>Switch the <a href="#content2">content model flag</a> to the
- PLAINTEXT state.</p>
+ <p>Switch the <a href="#content2">content model flag</a> to the PLAINTEXT
+ state.</p>
- <p class=note>Once a start tag with the tag name "plaintext" has been
- seen, that will be the last token ever seen other than character
- tokens (and the end-of-file token), because there is no way to
- switch the <a href="#content2">content model flag</a> out of the
- PLAINTEXT state.</p>
+ <p class=note>Once a start tag with the tag name "plaintext" has been
+ seen, that will be the last token ever seen other than character tokens
+ (and the end-of-file token), because there is no way to switch the <a
+ href="#content2">content model flag</a> out of the PLAINTEXT state.</p>
- <dt>An end tag whose tag name is one of: "address", "blockquote",
- "center", "dir", "div", "dl", "fieldset", "listing", "menu", "ol",
- "pre", "ul"
+ <dt>An end tag whose tag name is one of: "address", "blockquote",
+ "center", "dir", "div", "dl", "fieldset", "listing", "menu", "ol", "pre",
+ "ul"
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an">has an element in scope</a> with the same tag name
- as that of the token, then <a href="#generate">generate implied end
- tags</a>.</p>
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> <a
+ href="#have-an">has an element in scope</a> with the same tag name as
+ that of the token, then <a href="#generate">generate implied end
+ tags</a>.</p>
- <p>Now, if the <a href="#current4">current node</a> is not an element
- with the same tag name as that of the token, then this is a <a
- href="#parse0">parse error</a>.</p>
+ <p>Now, if the <a href="#current4">current node</a> is not an element
+ with the same tag name as that of the token, then this is a <a
+ href="#parse0">parse error</a>.</p>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an">has an element in scope</a> with the same tag name
- as that of the token, then pop elements from this stack until an
- element with that tag name has been popped from the stack.</p>
- <!-- XXX quirk (except for in certain cases?):
+ <p>If the <a href="#stack">stack of open elements</a> <a
+ href="#have-an">has an element in scope</a> with the same tag name as
+ that of the token, then pop elements from this stack until an element
+ with that tag name has been popped from the stack.</p>
+ <!-- XXX quirk (except for in certain cases?):
<p>Otherwise, act as if a start tag with the tag name given in
the token had been seen, then reprocess the current token.</p>
-->
-
+
- <dt>An end tag whose tag name is "form"
+ <dt>An end tag whose tag name is "form"
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an">has an element in scope</a> with the same tag name
- as that of the token, then <a href="#generate">generate implied end
- tags</a>.</p>
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> <a
+ href="#have-an">has an element in scope</a> with the same tag name as
+ that of the token, then <a href="#generate">generate implied end
+ tags</a>.</p>
- <p>Now, if the <a href="#current4">current node</a> is not an element
- with the same tag name as that of the token, then this is a <a
- href="#parse0">parse error</a>.</p>
+ <p>Now, if the <a href="#current4">current node</a> is not an element
+ with the same tag name as that of the token, then this is a <a
+ href="#parse0">parse error</a>.</p>
- <p>Otherwise, if the <a href="#current4">current node</a> is an
- element with the same tag name as that of the token pop that element
- from the stack.</p>
+ <p>Otherwise, if the <a href="#current4">current node</a> is an element
+ with the same tag name as that of the token pop that element from the
+ stack.</p>
- <p>In any case, set the <a href="#form-element"><code
- title="">form</code> element pointer</a> to null.</p>
+ <p>In any case, set the <a href="#form-element"><code
+ title="">form</code> element pointer</a> to null.</p>
- <dt>An end tag whose tag name is "p"
+ <dt>An end tag whose tag name is "p"
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an" title="has an element in scope">has a <code>p</code>
- element in scope</a>, then <a href="#generate">generate implied end
- tags</a>, except for <code><a href="#p">p</a></code> elements.</p>
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
+ title="has an element in scope">has a <code>p</code> element in
+ scope</a>, then <a href="#generate">generate implied end tags</a>,
+ except for <code><a href="#p">p</a></code> elements.</p>
- <p>If the <a href="#current4">current node</a> is not a <code><a
- href="#p">p</a></code> element, then this is a <a
- href="#parse0">parse error</a>.</p>
+ <p>If the <a href="#current4">current node</a> is not a <code><a
+ href="#p">p</a></code> element, then this is a <a href="#parse0">parse
+ error</a>.</p>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an" title="has an element in scope">has a <code>p</code>
- element in scope</a>, then pop elements from this stack until the
- stack no longer <a href="#have-an" title="has an element in
- scope">has a <code>p</code> element in scope</a>.</p>
+ <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
+ title="has an element in scope">has a <code>p</code> element in
+ scope</a>, then pop elements from this stack until the stack no longer
+ <a href="#have-an" title="has an element in scope">has a <code>p</code>
+ element in scope</a>.</p>
- <p>Otherwise, act as if a start tag with the tag name <code><a
- href="#p">p</a></code> had been seen, then reprocess the current
- token.</p>
+ <p>Otherwise, act as if a start tag with the tag name <code><a
+ href="#p">p</a></code> had been seen, then reprocess the current token.</p>
- <dt>An end tag whose tag name is one of: "dd", "dt", "li"
+ <dt>An end tag whose tag name is one of: "dd", "dt", "li"
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an">has an element in scope</a> whose tag name matches
- the tag name of the token, then <a href="#generate">generate implied
- end tags</a>, except for elements with the same tag name as the
- token.</p>
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> <a
+ href="#have-an">has an element in scope</a> whose tag name matches the
+ tag name of the token, then <a href="#generate">generate implied end
+ tags</a>, except for elements with the same tag name as the token.</p>
- <p>If the <a href="#current4">current node</a> is not an element with
- the same tag name as the token, then this is a <a
- href="#parse0">parse error</a>.</p>
+ <p>If the <a href="#current4">current node</a> is not an element with the
+ same tag name as the token, then this is a <a href="#parse0">parse
+ error</a>.</p>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an">has an element in scope</a> whose tag name matches
- the tag name of the token, then pop elements from this stack until
- an element with that tag name has been popped from the stack.</p>
+ <p>If the <a href="#stack">stack of open elements</a> <a
+ href="#have-an">has an element in scope</a> whose tag name matches the
+ tag name of the token, then pop elements from this stack until an
+ element with that tag name has been popped from the stack.</p>
- <dt>A start tag whose tag name is one of: "h1", "h2", "h3", "h4",
- "h5", "h6"
+ <dt>A start tag whose tag name is one of: "h1", "h2", "h3", "h4", "h5",
+ "h6"
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an" title="has an element in scope">has a <code>p</code>
- element in scope</a>, then act as if an end tag with the tag name
- <code><a href="#p">p</a></code> had been seen.</p>
- <!-- Removed for compatibility with IE7, though all other
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
+ title="has an element in scope">has a <code>p</code> element in
+ scope</a>, then act as if an end tag with the tag name <code><a
+ href="#p">p</a></code> had been seen.</p>
+ <!-- Removed for compatibility with IE7, though all other
browsers do it this way. If you do put this back, make
sure to handle <h1><a><h2>, as in Webkit bug 12646.
http://bugs.webkit.org/show_bug.cgi?id=12646
@@ -42281,448 +42287,435 @@
stack until an element with one of those tag names has been
popped from the stack.</p>
-->
-
- <p><a href="#insert" title="insert an html element">Insert an HTML
- element</a> for the token.</p>
+
+ <p><a href="#insert" title="insert an html element">Insert an HTML
+ element</a> for the token.</p>
- <dt>An end tag whose tag name is one of: "h1", "h2", "h3", "h4", "h5",
- "h6"
+ <dt>An end tag whose tag name is one of: "h1", "h2", "h3", "h4", "h5",
+ "h6"
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an" title="has an element in scope">has in scope</a> an
- element whose tag name is one of "h1", "h2", "h3", "h4", "h5", or
- "h6", then <a href="#generate">generate implied end tags</a>.</p>
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
+ title="has an element in scope">has in scope</a> an element whose tag
+ name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then <a
+ href="#generate">generate implied end tags</a>.</p>
- <p>Now, if the <a href="#current4">current node</a> is not an element
- with the same tag name as that of the token, then this is a <a
- href="#parse0">parse error</a>.</p>
+ <p>Now, if the <a href="#current4">current node</a> is not an element
+ with the same tag name as that of the token, then this is a <a
+ href="#parse0">parse error</a>.</p>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an" title="has an element in scope">has in scope</a> an
- element whose tag name is one of "h1", "h2", "h3", "h4", "h5", or
- "h6", then pop elements from the stack until an element with one of
- those tag names has been popped from the stack.</p>
- <!-- XXX quirk:
+ <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
+ title="has an element in scope">has in scope</a> an element whose tag
+ name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then pop elements
+ from the stack until an element with one of those tag names has been
+ popped from the stack.</p>
+ <!-- XXX quirk:
<p>Otherwise, act as if a start tag with the tag name given in
the token had been seen, then reprocess the current token.</p>
-->
- </dd>
- <!-- ADOPTION AGENCY ELEMENTS
+ </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>A start tag whose tag name is "a"
- <dd>
- <p>If the <a href="#list-of4">list of active formatting elements</a>
- 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 <a
- href="#parse0">parse error</a>; act as if an end tag with the tag
- name "a" had been seen, then remove that element from the <a
- href="#list-of4">list of active formatting elements</a> and the <a
- href="#stack">stack of open elements</a> if the end tag didn't
- already remove it (it might not have if the element is not <a
- href="#have-an0" title="has an element in table scope">in table
- scope</a>).</p>
+ <dd>
+ <p>If the <a href="#list-of4">list of active formatting elements</a>
+ 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 <a href="#parse0">parse error</a>;
+ act as if an end tag with the tag name "a" had been seen, then remove
+ that element from the <a href="#list-of4">list of active formatting
+ elements</a> and the <a href="#stack">stack of open elements</a> if the
+ end tag didn't already remove it (it might not have if the element is
+ not <a href="#have-an0" title="has an element in table scope">in table
+ scope</a>).</p>
- <p class=example>In the non-conforming stream
- <code><a href="a">a<table><a href="b">b</table>x</code>,
- the first <code><a href="#a">a</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 href="#a">a</a></code> element is not in table scope
- (meaning that a regular <code></a></code> end tag at the start of
- the table wouldn't close the outer <code><a href="#a">a</a></code>
- element).</p>
+ <p class=example>In the non-conforming stream
+ <code><a href="a">a<table><a href="b">b</table>x</code>,
+ the first <code><a href="#a">a</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
+ href="#a">a</a></code> element is not in table scope (meaning that a
+ regular <code></a></code> end tag at the start of the table wouldn't
+ close the outer <code><a href="#a">a</a></code> element).</p>
- <p><a href="#reconstruct">Reconstruct the active formatting
- elements</a>, if any.</p>
+ <p><a href="#reconstruct">Reconstruct the active formatting elements</a>,
+ if any.</p>
- <p><a href="#insert" title="insert an html element">Insert an HTML
- element</a> for the token. Add that element to the <a
- href="#list-of4">list of active formatting elements</a>.</p>
+ <p><a href="#insert" title="insert an html element">Insert an HTML
+ element</a> for the token. Add that element to the <a
+ href="#list-of4">list of active formatting elements</a>.</p>
- <dt>A start tag whose tag name is one of: "b", "big", "em", "font",
- "i", "s", "small", "strike", "strong", "tt", "u"
+ <dt>A start tag whose tag name is one of: "b", "big", "em", "font", "i",
+ "s", "small", "strike", "strong", "tt", "u"
- <dd>
- <p><a href="#reconstruct">Reconstruct the active formatting
- elements</a>, if any.</p>
+ <dd>
+ <p><a href="#reconstruct">Reconstruct the active formatting elements</a>,
+ if any.</p>
- <p><a href="#insert" title="insert an html element">Insert an HTML
- element</a> for the token. Add that element to the <a
- href="#list-of4">list of active formatting elements</a>.</p>
+ <p><a href="#insert" title="insert an html element">Insert an HTML
+ element</a> for the token. Add that element to the <a
+ href="#list-of4">list of active formatting elements</a>.</p>
- <dt>A start tag whose tag name is "nobr"
+ <dt>A start tag whose tag name is "nobr"
- <dd>
- <p><a href="#reconstruct">Reconstruct the active formatting
- elements</a>, if any.</p>
+ <dd>
+ <p><a href="#reconstruct">Reconstruct the active formatting elements</a>,
+ if any.</p>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an" title="has an element in scope">has a
- <code>nobr</code> element in scope</a>, then this is a <a
- href="#parse0">parse error</a>. Act as if an end tag with the tag
- name <code>nobr</code> had been seen, then once again <a
- href="#reconstruct">reconstruct the active formatting elements</a>,
- if any.</p>
+ <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
+ title="has an element in scope">has a <code>nobr</code> element in
+ scope</a>, then this is a <a href="#parse0">parse error</a>. Act as if
+ an end tag with the tag name <code>nobr</code> had been seen, then once
+ again <a href="#reconstruct">reconstruct the active formatting
+ elements</a>, if any.</p>
- <p><a href="#insert" title="insert an html element">Insert an HTML
- element</a> for the token. Add that element to the <a
- href="#list-of4">list of active formatting elements</a>.</p>
+ <p><a href="#insert" title="insert an html element">Insert an HTML
+ element</a> for the token. Add that element to the <a
+ href="#list-of4">list of active formatting elements</a>.</p>
- <dt id=adoptionAgency>An end tag whose tag name is one of: "a", "b",
- "big", "em", "font", "i", "nobr", "s", "small", "strike", "strong",
- "tt", "u"
+ <dt id=adoptionAgency>An end tag whose tag name is one of: "a", "b",
+ "big", "em", "font", "i", "nobr", "s", "small", "strike", "strong", "tt",
+ "u"
- <dd>
- <p>Follow these steps:</p>
+ <dd>
+ <p>Follow these steps:</p>
- <ol>
- <li>
- <p>Let the <var title="">formatting element</var> be the last
- element in the <a href="#list-of4">list of active formatting
- elements</a> that:</p>
+ <ol>
+ <li>
+ <p>Let the <var title="">formatting element</var> be the last element
+ in the <a href="#list-of4">list of active formatting elements</a>
+ 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
+ <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>has the same tag name as the token.
- </ul>
+ <li>has the same tag name as the token.
+ </ul>
- <p>If there is no such node, or, if that node is also in the <a
- href="#stack">stack of open elements</a> but the element is not <a
- href="#have-an" title="has an element in scope">in scope</a>, then
- this is a <a href="#parse0">parse error</a>. Abort these steps.
- The token is ignored.</p>
+ <p>If there is no such node, or, if that node is also in the <a
+ href="#stack">stack of open elements</a> but the element is not <a
+ href="#have-an" title="has an element in scope">in scope</a>, then
+ this is a <a href="#parse0">parse error</a>. Abort these steps. The
+ token is ignored.</p>
- <p>Otherwise, if there is such a node, but that node is not in the
- <a href="#stack">stack of open elements</a>, then this is a <a
- href="#parse0">parse error</a>; remove the element from the list,
- and abort these steps.</p>
+ <p>Otherwise, if there is such a node, but that node is not in the <a
+ href="#stack">stack of open elements</a>, then this is a <a
+ href="#parse0">parse error</a>; 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 <a href="#stack" title="stack of open
- elements">the stack</a> and is <a href="#have-an" title="has an
- element in scope">in scope</a>. If the element is not the <a
- href="#current4">current node</a>, this is a <a
- href="#parse0">parse error</a>. In any case, proceed with the
- algorithm as written in the following steps.</p>
+ <p>Otherwise, there is a <var title="">formatting element</var> and
+ that element is in <a href="#stack" title="stack of open elements">the
+ stack</a> and is <a href="#have-an" title="has an element in scope">in
+ scope</a>. If the element is not the <a href="#current4">current
+ node</a>, this is a <a href="#parse0">parse error</a>. In any case,
+ proceed with the algorithm as written in the following steps.</p>
- <li>
- <p>Let the <var title="">furthest block</var> be the topmost node
- in the <a href="#stack">stack of open elements</a> that is lower
- in the stack than the <var title="">formatting element</var>, and
- is not an element in the <a href="#phrasing1">phrasing</a> or <a
- href="#formatting">formatting</a> categories. There might not be
- one.
+ <li>
+ <p>Let the <var title="">furthest block</var> be the topmost node in
+ the <a href="#stack">stack of open elements</a> that is lower in the
+ stack than the <var title="">formatting element</var>, and is not an
+ element in the <a href="#phrasing1">phrasing</a> or <a
+ href="#formatting">formatting</a> categories. There might not be one.
- <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 <a href="#stack">stack of open
- elements</a>, from the <a href="#current4">current node</a> up to
- and including the <var title="">formatting element</var>, and
- remove the <var title="">formatting element</var> from the <a
- href="#list-of4">list of active formatting elements</a>.
+ <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 <a href="#stack">stack of open elements</a>, from the <a
+ href="#current4">current node</a> up to and including the <var
+ title="">formatting element</var>, and remove the <var
+ title="">formatting element</var> from the <a href="#list-of4">list of
+ active formatting elements</a>.
- <li>
- <p>Let the <var title="">common ancestor</var> be the element
- immediately above the <var title="">formatting element</var> in
- the <a href="#stack">stack of open elements</a>.
+ <li>
+ <p>Let the <var title="">common ancestor</var> be the element
+ immediately above the <var title="">formatting element</var> in the <a
+ href="#stack">stack of open elements</a>.
- <li>
- <p>If the <var title="">furthest block</var> has a parent node,
- then remove the <var title="">furthest block</var> from its parent
- node.
+ <li>
+ <p>If the <var title="">furthest block</var> has a parent node, then
+ remove the <var title="">furthest block</var> from its parent node.
- <li>
- <p>Let a bookmark note the position of the <var title="">formatting
- element</var> in the <a href="#list-of4">list of active formatting
- elements</a> relative to the elements on either side of it in the
- list.
+ <li>
+ <p>Let a bookmark note the position of the <var title="">formatting
+ element</var> in the <a href="#list-of4">list of active formatting
+ elements</a> relative to the elements on either side of it in the
+ list.
- <li>
- <p>Let <var title="">node</var> and <var title="">last node</var>
- be the <var title="">furthest block</var>. Follow these steps:</p>
+ <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 prior
- to <var title="">node</var> in the <a href="#stack">stack of open
- elements</a>.
+ <ol>
+ <li>Let <var title="">node</var> be the element immediately prior to
+ <var title="">node</var> in the <a href="#stack">stack of open
+ elements</a>.
- <li>If <var title="">node</var> is not in the <a
- href="#list-of4">list of active formatting elements</a>, then
- remove <var title="">node</var> from the <a href="#stack">stack
- of open elements</a> and then go back to step 1.
+ <li>If <var title="">node</var> is not in the <a href="#list-of4">list
+ of active formatting elements</a>, then remove <var
+ title="">node</var> from the <a href="#stack">stack of open
+ elements</a> and then go back to step 1.
- <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>Otherwise, if <var title="">node</var> is the <var
+ title="">formatting element</var>, then go to the next step in the
+ overall algorithm.
- <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 <a href="#list-of4">list of active formatting elements</a>.
+ <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 <a
+ href="#list-of4">list of active formatting elements</a>.
- <li>If <var title="">node</var> has any children, perform a
- shallow clone of <var title="">node</var>, replace the entry for
- <var title="">node</var> in the <a href="#list-of4">list of
- active formatting elements</a> with an entry for the clone,
- replace the entry for <var title="">node</var> in the <a
- href="#stack">stack of open elements</a> with an entry for the
- clone, and let <var title="">node</var> be the clone.
+ <li>If <var title="">node</var> has any children, perform a shallow
+ clone of <var title="">node</var>, replace the entry for <var
+ title="">node</var> in the <a href="#list-of4">list of active
+ formatting elements</a> with an entry for the clone, replace the
+ entry for <var title="">node</var> in the <a href="#stack">stack of
+ open elements</a> with an entry for the clone, and let <var
+ title="">node</var> be the clone.
- <li>Insert <var title="">last node</var> into <var
- title="">node</var>, first removing it from its previous parent
- node if any.
+ <li>Insert <var title="">last node</var> into <var
+ title="">node</var>, first removing it from its previous parent node
+ if any.
- <li>Let <var title="">last node</var> be <var title="">node</var>.
+ <li>Let <var title="">last node</var> be <var title="">node</var>.
- <li>Return to step 1 of this inner set of steps.
- </ol>
+ <li>Return to step 1 of this inner set of steps.
+ </ol>
- <li>
- <p>Insert whatever <var title="">last node</var> ended up being in
- the previous step into the <var title="">common ancestor</var>
- node, first removing it from its previous parent node if any.
+ <li>
+ <p>Insert whatever <var title="">last node</var> ended up being in the
+ previous step into the <var title="">common ancestor</var> node, first
+ removing it from its previous parent node if any.
- <li>
- <p>Perform a shallow clone of the <var title="">formatting
- element</var>.
+ <li>
+ <p>Perform a shallow clone of the <var title="">formatting
+ element</var>.
- <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.
+ <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.
- <li>
- <p>Append that clone to the <var title="">furthest block</var>.
+ <li>
+ <p>Append that clone to the <var title="">furthest block</var>.
- <li>
- <p>Remove the <var title="">formatting element</var> from the <a
- href="#list-of4">list of active formatting elements</a>, and
- insert the clone into the <a href="#list-of4">list of active
- formatting elements</a> at the position of the aforementioned
- bookmark.
+ <li>
+ <p>Remove the <var title="">formatting element</var> from the <a
+ href="#list-of4">list of active formatting elements</a>, and insert
+ the clone into the <a href="#list-of4">list of active formatting
+ elements</a> at the position of the aforementioned bookmark.
- <li>
- <p>Remove the <var title="">formatting element</var> from the <a
- href="#stack">stack of open elements</a>, and insert the clone
- into the <a href="#stack">stack of open elements</a> immediately
- after (i.e. in a more deeply nested position than) the position of
- the <var title="">furthest block</var> in that stack.
+ <li>
+ <p>Remove the <var title="">formatting element</var> from the <a
+ href="#stack">stack of open elements</a>, and insert the clone into
+ the <a href="#stack">stack of open elements</a> immediately after
+ (i.e. in a more deeply nested position than) the position of the <var
+ title="">furthest block</var> in that stack.
- <li>
- <p>Jump back to step 1 in this series of steps.
- </ol>
+ <li>
+ <p>Jump back to step 1 in this series of steps.
+ </ol>
- <p class=note>The way these steps are defined, only elements in the
- <a href="#formatting">formatting</a> category ever get cloned by
- this algorithm.</p>
- <!--XXX
+ <p class=note>The way these steps are defined, only elements in the <a
+ href="#formatting">formatting</a> category ever get cloned by this
+ algorithm.</p>
+ <!--XXX
<div class="example">
<p class="big-issue">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>
+
+ <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>
- <dt>A start tag whose tag name is "button"
+ <dt>A start tag whose tag name is "button"
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an" title="has an element in scope">has a
- <code>button</code> element in scope</a>, then this is a <a
- href="#parse0">parse error</a>; act as if an end tag with the tag
- name "button" had been seen, then reprocess the token.</p>
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
+ title="has an element in scope">has a <code>button</code> element in
+ scope</a>, then this is a <a href="#parse0">parse error</a>; act as if
+ an end tag with the tag name "button" had been seen, then reprocess the
+ token.</p>
- <p>Otherwise:</p>
+ <p>Otherwise:</p>
- <p><a href="#reconstruct">Reconstruct the active formatting
- elements</a>, if any.</p>
+ <p><a href="#reconstruct">Reconstruct the active formatting elements</a>,
+ if any.</p>
- <p><a href="#insert">Insert an HTML element</a> for the token.</p>
+ <p><a href="#insert">Insert an HTML element</a> for the token.</p>
- <p>Insert a marker at the end of the <a href="#list-of4">list of
- active formatting elements</a>.</p>
+ <p>Insert a marker at the end of the <a href="#list-of4">list of active
+ formatting elements</a>.</p>
- <dt>A start tag token whose tag name is one of: "marquee", "object"
+ <dt>A start tag token whose tag name is one of: "marquee", "object"
- <dd>
- <p><a href="#reconstruct">Reconstruct the active formatting
- elements</a>, if any.</p>
+ <dd>
+ <p><a href="#reconstruct">Reconstruct the active formatting elements</a>,
+ if any.</p>
- <p><a href="#insert">Insert an HTML element</a> for the token.</p>
+ <p><a href="#insert">Insert an HTML element</a> for the token.</p>
- <p>Insert a marker at the end of the <a href="#list-of4">list of
- active formatting elements</a>.</p>
+ <p>Insert a marker at the end of the <a href="#list-of4">list of active
+ formatting elements</a>.</p>
- <dt>An end tag token whose tag name is one of: "button", "marquee",
- "object"
+ <dt>An end tag token whose tag name is one of: "button", "marquee",
+ "object"
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an" title="has an element in scope">has in scope</a> an
- element whose tag name is the same as the tag name of the token,
- then <a href="#generate">generate implied end tags</a>.</p>
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
+ title="has an element in scope">has in scope</a> an element whose tag
+ name is the same as the tag name of the token, then <a
+ href="#generate">generate implied end tags</a>.</p>
- <p>Now, if the <a href="#current4">current node</a> is not an element
- with the same tag name as the token, then this is a <a
- href="#parse0">parse error</a>.</p>
+ <p>Now, if the <a href="#current4">current node</a> is not an element
+ with the same tag name as the token, then this is a <a
+ href="#parse0">parse error</a>.</p>
- <p>Now, if the <a href="#stack">stack of open elements</a> <a
- href="#have-an">has an element in scope</a> whose tag name matches
- the tag name of the token, then pop elements from the stack until
- that element has been popped from the stack, and <a
- href="#clear0">clear the list of active formatting elements up to
- the last marker</a>.</p>
+ <p>Now, if the <a href="#stack">stack of open elements</a> <a
+ href="#have-an">has an element in scope</a> whose tag name matches the
+ tag name of the token, then pop elements from the stack until that
+ element has been popped from the stack, and <a href="#clear0">clear the
+ list of active formatting elements up to the last marker</a>.</p>
- <dt>A start tag whose tag name is "xmp"
+ <dt>A start tag whose tag name is "xmp"
- <dd>
- <p><a href="#reconstruct">Reconstruct the active formatting
- elements</a>, if any.</p>
+ <dd>
+ <p><a href="#reconstruct">Reconstruct the active formatting elements</a>,
+ if any.</p>
- <p>Follow the <a href="#generic">generic CDATA parsing algorithm</a>,
- with the <a href="#current4">current node</a> as the <var
- title="">context node</var>.</p>
+ <p>Follow the <a href="#generic">generic CDATA parsing algorithm</a>,
+ with the <a href="#current4">current node</a> as the <var
+ title="">context node</var>.</p>
- <dt>A start tag whose tag name is "table"
+ <dt>A start tag whose tag name is "table"
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an" title="has an element in scope">has a <code>p</code>
- element in scope</a>, then act as if an end tag with the tag name
- <code><a href="#p">p</a></code> had been seen.</p>
- <!-- XXX quirks: don't do this -->
- <p><a href="#insert">Insert an HTML element</a> for the token.</p>
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
+ title="has an element in scope">has a <code>p</code> element in
+ scope</a>, then act as if an end tag with the tag name <code><a
+ href="#p">p</a></code> had been seen.</p>
+ <!-- XXX quirks: don't do this -->
+ <p><a href="#insert">Insert an HTML element</a> for the token.</p>
- <p>Change the <a href="#insertion0">insertion mode</a> to "<a
- href="#in-table" title="insertion mode: in table">in table</a>".</p>
+ <p>Change the <a href="#insertion0">insertion mode</a> to "<a
+ href="#in-table" title="insertion mode: in table">in table</a>".</p>
- <dt>A start tag whose tag name is one of: "area", "basefont",
- "bgsound", "br", "embed", "img", "param", "spacer", "wbr"
+ <dt>A start tag whose tag name is one of: "area", "basefont", "bgsound",
+ "br", "embed", "img", "param", "spacer", "wbr"
- <dd>
- <p><a href="#reconstruct">Reconstruct the active formatting
- elements</a>, if any.</p>
+ <dd>
+ <p><a href="#reconstruct">Reconstruct the active formatting elements</a>,
+ if any.</p>
- <p><a href="#insert" title="insert an html element">Insert an HTML
- element</a> for the token. Immediately pop the <a
- href="#current4">current node</a> off the <a href="#stack">stack of
- open elements</a>.</p>
+ <p><a href="#insert" title="insert an html element">Insert an HTML
+ element</a> for the token. Immediately pop the <a
+ href="#current4">current node</a> off the <a href="#stack">stack of open
+ elements</a>.</p>
- <dt>A start tag whose tag name is "hr"
+ <dt>A start tag whose tag name is "hr"
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an" title="has an element in scope">has a <code>p</code>
- element in scope</a>, then act as if an end tag with the tag name
- <code><a href="#p">p</a></code> had been seen.</p>
- <!-- XXX quirks: don't do this -->
- <p><a href="#insert" title="insert an html element">Insert an HTML
- element</a> for the token. Immediately pop the <a
- href="#current4">current node</a> off the <a href="#stack">stack of
- open elements</a>.</p>
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
+ title="has an element in scope">has a <code>p</code> element in
+ scope</a>, then act as if an end tag with the tag name <code><a
+ href="#p">p</a></code> had been seen.</p>
+ <!-- XXX quirks: don't do this -->
+ <p><a href="#insert" title="insert an html element">Insert an HTML
+ element</a> for the token. Immediately pop the <a
+ href="#current4">current node</a> off the <a href="#stack">stack of open
+ elements</a>.</p>
- <dt>A start tag whose tag name is "image"
+ <dt>A start tag whose tag name is "image"
- <dd>
- <p><a href="#parse0">Parse error</a>. Change the token's tag name to
- "img" and reprocess it. (Don't ask.)</p>
- <!-- As of
+ <dd>
+ <p><a href="#parse0">Parse error</a>. 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. -->
-
+
- <dt>A start tag whose tag name is "input"
+ <dt>A start tag whose tag name is "input"
- <dd>
- <p><a href="#reconstruct">Reconstruct the active formatting
- elements</a>, if any.</p>
+ <dd>
+ <p><a href="#reconstruct">Reconstruct the active formatting elements</a>,
+ if any.</p>
- <p><a href="#insert" title="insert an html element">Insert an
- <code>input</code> element</a> for the token.</p>
+ <p><a href="#insert" title="insert an html element">Insert an
+ <code>input</code> element</a> for the token.</p>
- <p>If the <a href="#form-element"><code title="">form</code> element
- pointer</a> is not null, then <span>associate</span><!--XXX
+ <p>If the <a href="#form-element"><code title="">form</code> element
+ pointer</a> is not null, then <span>associate</span><!--XXX
xref! -->
- the <code>input</code> element with the <code>form</code> element
- pointed to by the <a href="#form-element"><code title="">form</code>
- element pointer</a>.</p>
+ the <code>input</code> element with the <code>form</code> element
+ pointed to by the <a href="#form-element"><code title="">form</code>
+ element pointer</a>.</p>
- <p>Pop that <code>input</code> element off the <a href="#stack">stack
- of open elements</a>.</p>
+ <p>Pop that <code>input</code> element off the <a href="#stack">stack of
+ open elements</a>.</p>
- <dt id=isindex>A start tag whose tag name is "isindex"
+ <dt id=isindex>A start tag whose tag name is "isindex"
- <dd>
- <p><a href="#parse0">Parse error</a>.</p>
+ <dd>
+ <p><a href="#parse0">Parse error</a>.</p>
- <p>If the <a href="#form-element"><code title="">form</code> element
- pointer</a> is not null, then ignore the token.</p>
+ <p>If the <a href="#form-element"><code title="">form</code> element
+ pointer</a> is not null, then ignore the token.</p>
- <p>Otherwise:</p>
+ <p>Otherwise:</p>
- <p>Act as if a start tag token with the tag name "form" had been
- seen.</p>
+ <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>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 "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 "p" had been seen.</p>
- <p>Act as if a start tag token with the tag name "label" had been
- seen.
+ <p>Act as if a start tag token with the tag name "label" had been seen.
- <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 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-input-name>name</code> attribute of the resulting
- <code>input</code> element to the value "<code
- title="">isindex</code>".</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-input-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 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 "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 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 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>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>
+ <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>
- <p class=big-issue> Then need to specify that if the form submission
- causes just a single form control, whose name is "isindex", to be
- submitted, then we submit just the value part, not the "isindex="
- part.</p>
- </dd>
- <!-- XXX keygen support; don't forget form element pointer!
+ <p class=big-issue> Then need to specify that if the form submission
+ causes just a single form control, whose name is "isindex", to be
+ submitted, then we submit just the value part, not the "isindex=" part.</p>
+ </dd>
+ <!-- XXX keygen support; don't forget form element pointer!
<dt>A start tag whose tag name is "keygen"</dt>
<dd>
@@ -42730,1095 +42723,1065 @@
</dd>
-->
- <dt>A start tag whose tag name is "textarea"
+ <dt>A start tag whose tag name is "textarea"
- <dd>
- <p><a href="#create">Create an element for the token</a>.</p>
+ <dd>
+ <p><a href="#create">Create an element for the token</a>.</p>
- <p>If the <a href="#form-element"><code title="">form</code> element
- pointer</a> is not null, then <span>associate</span><!--XXX
+ <p>If the <a href="#form-element"><code title="">form</code> element
+ pointer</a> is not null, then <span>associate</span><!--XXX
xref! -->
- the <code>textarea</code> element with the <code>form</code> element
- pointed to by the <a href="#form-element"><code title="">form</code>
- element pointer</a>.</p>
+ the <code>textarea</code> element with the <code>form</code> element
+ pointed to by the <a href="#form-element"><code title="">form</code>
+ element pointer</a>.</p>
- <p>Append the new element to the <a href="#current4">current
- node</a>.</p>
+ <p>Append the new element to the <a href="#current4">current node</a>.</p>
- <p>Switch the tokeniser's <a href="#content2">content model flag</a>
- to the RCDATA state.</p>
+ <p>Switch the tokeniser's <a href="#content2">content model flag</a> to
+ the RCDATA state.</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>textarea</code> elements are ignored as an authoring
- convenience.)</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>textarea</code> elements are ignored as an authoring convenience.)</p>
- <p>Then, collect all the character tokens that the tokeniser returns
- until it returns a token that is not a character token, or until it
- stops tokenising.</p>
+ <p>Then, collect all the character tokens that the tokeniser returns
+ until it returns a token that is not a character token, or until it
+ stops tokenising.</p>
- <p>If this process resulted in a collection of character tokens,
- append a single <code>Text</code> node, whose contents is the
- concatenation of all those tokens' characters, to the new element
- node.</p>
+ <p>If this process resulted in a collection of character tokens, append a
+ single <code>Text</code> node, whose contents is the concatenation of
+ all those tokens' characters, to the new element node.</p>
- <p>The tokeniser's <a href="#content2">content model flag</a> will
- have switched back to the PCDATA state.</p>
+ <p>The tokeniser's <a href="#content2">content model flag</a> will have
+ switched back to the PCDATA state.</p>
- <p>If the next token is an end tag token with the tag name
- "textarea", ignore it. Otherwise, this is a <a href="#parse0">parse
- error</a>.</p>
+ <p>If the next token is an end tag token with the tag name "textarea",
+ ignore it. Otherwise, this is a <a href="#parse0">parse error</a>.</p>
- <dt>A start tag whose tag name is one of: "iframe", "noembed",
- "noframes"
+ <dt>A start tag whose tag name is one of: "iframe", "noembed", "noframes"
- <dt>A start tag whose tag name is "noscript", if <a
- href="#scripting2">scripting is enabled</a>:
+ <dt>A start tag whose tag name is "noscript", if <a
+ href="#scripting2">scripting is enabled</a>:
- <dd>
- <p>Follow the <a href="#generic">generic CDATA parsing algorithm</a>,
- with the <a href="#current4">current node</a> as the <var
- title="">context node</var>.</p>
+ <dd>
+ <p>Follow the <a href="#generic">generic CDATA parsing algorithm</a>,
+ with the <a href="#current4">current node</a> as the <var
+ title="">context node</var>.</p>
- <dt>A start tag whose tag name is "select"
+ <dt>A start tag whose tag name is "select"
- <dd>
- <p><a href="#reconstruct">Reconstruct the active formatting
- elements</a>, if any.</p>
+ <dd>
+ <p><a href="#reconstruct">Reconstruct the active formatting elements</a>,
+ if any.</p>
- <p><a href="#insert">Insert an HTML element</a> for the token.</p>
+ <p><a href="#insert">Insert an HTML element</a> for the token.</p>
- <p>Change the <a href="#insertion0">insertion mode</a> to "<a
- href="#in-select" title="insertion mode: in select">in select</a>".</p>
+ <p>Change the <a href="#insertion0">insertion mode</a> to "<a
+ href="#in-select" title="insertion mode: in select">in select</a>".</p>
- <dt>An end tag whose tag name is "br"
+ <dt>An end tag whose tag name is "br"
- <dd>
- <p><a href="#parse0">Parse error</a>. Act as if a start tag token
- with the tag name "br" had been seen. Ignore the end tag token.</p>
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Act as if a start tag token with
+ the tag name "br" had been seen. Ignore the end tag token.</p>
- <dt>A start or end tag whose tag name is one of: "caption", "col",
- "colgroup", "frame", "frameset", "head", "option", "optgroup",
- "tbody", "td", "tfoot", "th", "thead", "tr"
+ <dt>A start or end tag whose tag name is one of: "caption", "col",
+ "colgroup", "frame", "frameset", "head", "option", "optgroup", "tbody",
+ "td", "tfoot", "th", "thead", "tr"
- <dt>An end tag whose tag name is one of: "area", "basefont",
- "bgsound", <!--XXX quirks: remove br-->"br", "embed", "hr", "iframe",
- "image", "img", "input", "isindex", "noembed", "noframes", "param",
- "select", "spacer", "table", "textarea", "wbr"</dt>
- <!-- add keygen if we add the start tag -->
+ <dt>An end tag whose tag name is one of: "area", "basefont", "bgsound",
+ <!--XXX quirks: remove br-->"br", "embed", "hr", "iframe", "image",
+ "img", "input", "isindex", "noembed", "noframes", "param", "select",
+ "spacer", "table", "textarea", "wbr"</dt>
+ <!-- add keygen if we add the start tag -->
- <dt>An end tag whose tag name is "noscript", if <a
- href="#scripting2">scripting is enabled</a>:
+ <dt>An end tag whose tag name is "noscript", if <a
+ href="#scripting2">scripting is enabled</a>:
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <dt>A start or end tag whose tag name is one of: "event-source",
- "section", "nav", "article", "aside", "header", "footer", "datagrid",
- "command"
+ <dt>A start or end tag whose tag name is one of: "event-source",
+ "section", "nav", "article", "aside", "header", "footer", "datagrid",
+ "command"
- <dd> <!-- XXXX -->
- <p class=big-issue>Work in progress!</p>
+ <dd> <!-- XXXX -->
+ <p class=big-issue>Work in progress!</p>
- <dt>A start tag token not covered by the previous entries
+ <dt>A start tag token not covered by the previous entries
- <dd>
- <p><a href="#reconstruct">Reconstruct the active formatting
- elements</a>, if any.</p>
+ <dd>
+ <p><a href="#reconstruct">Reconstruct the active formatting elements</a>,
+ if any.</p>
- <p><a href="#insert">Insert an HTML element</a> for the token.</p>
+ <p><a href="#insert">Insert an HTML element</a> for the token.</p>
- <p class=note>This element will be a <a
- href="#phrasing1">phrasing</a> element.</p>
- <!--
+ <p class=note>This element will be a <a href="#phrasing1">phrasing</a>
+ element.</p>
+ <!--
Put the following into the MathML namespace if parsed:
math, mrow, mfrac, msqrt, mroot, mstyle, merror, mpadded,
mphantom, mfenced, menclose, msub, msup, msubsup, munder,
mover, munderover, mmultiscripts, mtable, mlabeledtr, mtr,
mtd, maction
-->
-
+
- <dt>An end tag token not covered by the previous entries
+ <dt>An end tag token not covered by the previous entries
- <dd>
- <p>Run the following algorithm:</p>
+ <dd>
+ <p>Run the following algorithm:</p>
- <ol>
- <li>
- <p>Initialise <var title="">node</var> to be the <a
- href="#current4">current node</a> (the bottommost node of the
- stack).
+ <ol>
+ <li>
+ <p>Initialise <var title="">node</var> to be the <a
+ href="#current4">current node</a> (the bottommost node of the stack).
- <li>
- <p>If <var title="">node</var> has the same tag name as the end tag
- token, then:</p>
+ <li>
+ <p>If <var title="">node</var> has the same tag name as the end tag
+ token, then:</p>
- <ol>
- <li>
- <p><a href="#generate">Generate implied end tags</a>.
+ <ol>
+ <li>
+ <p><a href="#generate">Generate implied end tags</a>.
- <li>
- <p>If the tag name of the end tag token does not match the tag
- name of the <a href="#current4">current node</a>, this is a <a
- href="#parse0">parse error</a>.
+ <li>
+ <p>If the tag name of the end tag token does not match the tag name
+ of the <a href="#current4">current node</a>, this is a <a
+ href="#parse0">parse error</a>.
- <li>
- <p>Pop all the nodes from the <a href="#current4">current
- node</a> up to <var title="">node</var>, including <var
- title="">node</var>, then stop this algorithm.
- </ol>
+ <li>
+ <p>Pop all the nodes from the <a href="#current4">current node</a> up
+ to <var title="">node</var>, including <var title="">node</var>,
+ then stop this algorithm.
+ </ol>
- <li>
- <p>Otherwise, if <var title="">node</var> is in neither the <a
- href="#formatting">formatting</a> category nor the <a
- href="#phrasing1">phrasing</a> category, then this is a <a
- href="#parse0">parse error</a>. Stop this algorithm. The end tag
- token is ignored.
+ <li>
+ <p>Otherwise, if <var title="">node</var> is in neither the <a
+ href="#formatting">formatting</a> category nor the <a
+ href="#phrasing1">phrasing</a> category, then this is a <a
+ href="#parse0">parse error</a>. Stop this algorithm. The end tag token
+ is ignored.
- <li>
- <p>Set <var title="">node</var> to the previous entry in the <a
- href="#stack">stack of open elements</a>.
+ <li>
+ <p>Set <var title="">node</var> to the previous entry in the <a
+ href="#stack">stack of open elements</a>.
- <li>
- <p>Return to step 2.
- </ol>
- </dl>
+ <li>
+ <p>Return to step 2.
+ </ol>
+ </dl>
- <dt id=parsing-main-intable>If the <a href="#insertion0">insertion
- mode</a> is "<dfn id=in-table title="insertion mode: in table">in
- table</dfn>"
+ <h6 id=parsing-main-intable><span class=secno>8.2.4.3.12. </span>The <dfn
+ id=in-table title="insertion mode: in table">in table</dfn> insertion mode</h6>
- <dd>
- <dl class=switch>
- <dt>An end-of-file token
+ <dl class=switch>
+ <dt>An end-of-file token
- <dd>
- <p><a href="#stops">Stop parsing, with prejudice.</a></p>
+ <dd>
+ <p><a href="#stops">Stop parsing, with prejudice.</a></p>
- <dt>A character token that is one of one of U+0009 CHARACTER
- TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
- FORM FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
+ <dt>A character token that is one of one of U+0009 CHARACTER TABULATION,
+ U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF),
+ <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
- <dd>
- <p><a href="#append" title="append a character">Append the
- character</a> to the <a href="#current4">current node</a>.</p>
+ <dd>
+ <p><a href="#append" title="append a character">Append the character</a>
+ to the <a href="#current4">current node</a>.</p>
- <dt>A comment token
+ <dt>A comment token
- <dd>
- <p>Append a <code>Comment</code> node to the <a
- href="#current4">current node</a> with the <code
- title="">data</code> attribute set to the data given in the comment
- token.</p>
+ <dd>
+ <p>Append a <code>Comment</code> node to the <a href="#current4">current
+ node</a> with the <code title="">data</code> attribute set to the data
+ given in the comment token.</p>
- <dt>A DOCTYPE token
+ <dt>A DOCTYPE token
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <dt>A start tag whose tag name is "html"
+ <dt>A start tag whose tag name is "html"
- <dd>
- <p>Process the token as if the <a href="#insertion0">insertion
- mode</a> had been "<a href="#in-body" title="insertion mode: in
- body">in body</a>".</p>
+ <dd>
+ <p>Process the token as if the <a href="#insertion0">insertion mode</a>
+ had been "<a href="#in-body" title="insertion mode: in body">in
+ body</a>".</p>
- <dt>A start tag whose tag name is "caption"
+ <dt>A start tag whose tag name is "caption"
- <dd>
- <p><a href="#clear1">Clear the stack back to a table context</a>.
- (See below.)</p>
+ <dd>
+ <p><a href="#clear1">Clear the stack back to a table context</a>. (See
+ below.)</p>
- <p>Insert a marker at the end of the <a href="#list-of4">list of
- active formatting elements</a>.</p>
+ <p>Insert a marker at the end of the <a href="#list-of4">list of active
+ formatting elements</a>.</p>
- <p><a href="#insert">Insert an HTML element</a> for the token, then
- switch the <a href="#insertion0">insertion mode</a> to "<a
- href="#in-caption" title="insertion mode: in caption">in
- caption</a>".</p>
+ <p><a href="#insert">Insert an HTML element</a> for the token, then
+ switch the <a href="#insertion0">insertion mode</a> to "<a
+ href="#in-caption" title="insertion mode: in caption">in caption</a>".</p>
- <dt>A start tag whose tag name is "colgroup"
+ <dt>A start tag whose tag name is "colgroup"
- <dd>
- <p><a href="#clear1">Clear the stack back to a table context</a>.
- (See below.)</p>
+ <dd>
+ <p><a href="#clear1">Clear the stack back to a table context</a>. (See
+ below.)</p>
- <p><a href="#insert">Insert an HTML element</a> for the token, then
- switch the <a href="#insertion0">insertion mode</a> to "<a
- href="#in-column" title="insertion mode: in column group">in column
- group</a>".</p>
+ <p><a href="#insert">Insert an HTML element</a> for the token, then
+ switch the <a href="#insertion0">insertion mode</a> to "<a
+ href="#in-column" title="insertion mode: in column group">in column
+ group</a>".</p>
- <dt>A start tag whose tag name is "col"
+ <dt>A start tag whose tag name is "col"
- <dd>
- <p>Act as if a start tag token with the tag name "colgroup" had been
- seen, then reprocess the current token.</p>
+ <dd>
+ <p>Act as if a start tag token with the tag name "colgroup" had been
+ seen, then reprocess the current token.</p>
- <dt>A start tag whose tag name is one of: "tbody", "tfoot", "thead"
+ <dt>A start tag whose tag name is one of: "tbody", "tfoot", "thead"
- <dd>
- <p><a href="#clear1">Clear the stack back to a table context</a>.
- (See below.)</p>
+ <dd>
+ <p><a href="#clear1">Clear the stack back to a table context</a>. (See
+ below.)</p>
- <p><a href="#insert">Insert an HTML element</a> for the token, then
- switch the <a href="#insertion0">insertion mode</a> to "<a
- href="#in-table0" title="insertion mode: in table body">in table
- body</a>".</p>
+ <p><a href="#insert">Insert an HTML element</a> for the token, then
+ switch the <a href="#insertion0">insertion mode</a> to "<a
+ href="#in-table0" title="insertion mode: in table body">in table
+ body</a>".</p>
- <dt>A start tag whose tag name is one of: "td", "th", "tr"
+ <dt>A start tag whose tag name is one of: "td", "th", "tr"
- <dd>
- <p>Act as if a start tag token with the tag name "tbody" had been
- seen, then reprocess the current token.</p>
+ <dd>
+ <p>Act as if a start tag token with the tag name "tbody" had been seen,
+ then reprocess the current token.</p>
- <dt>A start tag whose tag name is "table"
+ <dt>A start tag whose tag name is "table"
- <dd>
- <p><a href="#parse0">Parse error</a>. 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>
+ <dd>
+ <p><a href="#parse0">Parse error</a>. 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
- <a href="#fragment">fragment case</a>.</p>
+ <p class=note>The fake end tag token here can only be ignored in the <a
+ href="#fragment">fragment case</a>.</p>
- <dt>An end tag whose tag name is "table"
+ <dt>An end tag whose tag name is "table"
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> does not <a
- href="#have-an0" title="has an element in table scope">have an
- element in table scope</a> with the same tag name as the token, this
- is a <a href="#parse0">parse error</a>. Ignore the token. (<a
- href="#fragment">fragment case</a>)</p>
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> does not <a
+ href="#have-an0" title="has an element in table scope">have an element
+ in table scope</a> with the same tag name as the token, this is a <a
+ href="#parse0">parse error</a>. Ignore the token. (<a
+ href="#fragment">fragment case</a>)</p>
- <p>Otherwise:</p>
+ <p>Otherwise:</p>
- <p><a href="#generate">Generate implied end tags</a>.</p>
+ <p><a href="#generate">Generate implied end tags</a>.</p>
- <p>Now, if the <a href="#current4">current node</a> is not a <code><a
- href="#table">table</a></code> element, then this is a <a
- href="#parse0">parse error</a>.</p>
+ <p>Now, if the <a href="#current4">current node</a> is not a <code><a
+ href="#table">table</a></code> element, then this is a <a
+ href="#parse0">parse error</a>.</p>
- <p>Pop elements from this stack until a <code><a
- href="#table">table</a></code> element has been popped from the
- stack.</p>
+ <p>Pop elements from this stack until a <code><a
+ href="#table">table</a></code> element has been popped from the stack.</p>
- <p><a href="#reset">Reset the insertion mode appropriately</a>.</p>
+ <p><a href="#reset">Reset the insertion mode appropriately</a>.</p>
- <dt>An end tag whose tag name is one of: "body", "caption", "col",
- "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr"
+ <dt>An end tag whose tag name is one of: "body", "caption", "col",
+ "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr"
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <dt>Anything else
+ <dt>Anything else
- <dd>
- <p><a href="#parse0">Parse error</a>. Process the token as if the <a
- href="#insertion0">insertion mode</a> was "<a href="#in-body"
- title="insertion mode: in body">in body</a>", with the following
- exception:</p>
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Process the token as if the <a
+ href="#insertion0">insertion mode</a> was "<a href="#in-body"
+ title="insertion mode: in body">in body</a>", with the following
+ exception:</p>
- <p>If the <a href="#current4">current node</a> is a <code><a
- href="#table">table</a></code>, <code><a
- href="#tbody">tbody</a></code>, <code><a
- href="#tfoot0">tfoot</a></code>, <code><a
- href="#thead0">thead</a></code>, or <code><a
- href="#tr">tr</a></code> element, then, whenever a node would be
- inserted into the <a href="#current4">current node</a>, it must
- instead be inserted into the <em><a href="#foster">foster parent
- element</a></em>.</p>
+ <p>If the <a href="#current4">current node</a> is a <code><a
+ href="#table">table</a></code>, <code><a href="#tbody">tbody</a></code>,
+ <code><a href="#tfoot0">tfoot</a></code>, <code><a
+ href="#thead0">thead</a></code>, or <code><a href="#tr">tr</a></code>
+ element, then, whenever a node would be inserted into the <a
+ href="#current4">current node</a>, it must instead be inserted into the
+ <em><a href="#foster">foster parent element</a></em>.</p>
- <p>The <dfn id=foster>foster parent element</dfn> is the parent
- element of the last <code><a href="#table">table</a></code> element
- in the <a href="#stack">stack of open elements</a>, if there is a
- <code><a href="#table">table</a></code> element and it has such a
- parent element. If there is no <code><a
- href="#table">table</a></code> element in the <a href="#stack">stack
- of open elements</a> (<a href="#fragment">fragment case</a>), then
- the <em><a href="#foster">foster parent element</a></em> is the
- first element in the <a href="#stack">stack of open elements</a>
- (the <code><a href="#html">html</a></code> element). Otherwise, if
- there is a <code><a href="#table">table</a></code> element in the <a
- href="#stack">stack of open elements</a>, but the last <code><a
- href="#table">table</a></code> element in the <a href="#stack">stack
- of open elements</a> has no parent, or its parent node is not an
- element, then the <em><a href="#foster">foster parent
- element</a></em> is the element before the last <code><a
- href="#table">table</a></code> element in the <a href="#stack">stack
- of open elements</a>.</p>
+ <p>The <dfn id=foster>foster parent element</dfn> is the parent element
+ of the last <code><a href="#table">table</a></code> element in the <a
+ href="#stack">stack of open elements</a>, if there is a <code><a
+ href="#table">table</a></code> element and it has such a parent element.
+ If there is no <code><a href="#table">table</a></code> element in the <a
+ href="#stack">stack of open elements</a> (<a href="#fragment">fragment
+ case</a>), then the <em><a href="#foster">foster parent element</a></em>
+ is the first element in the <a href="#stack">stack of open elements</a>
+ (the <code><a href="#html">html</a></code> element). Otherwise, if there
+ is a <code><a href="#table">table</a></code> element in the <a
+ href="#stack">stack of open elements</a>, but the last <code><a
+ href="#table">table</a></code> element in the <a href="#stack">stack of
+ open elements</a> has no parent, or its parent node is not an element,
+ then the <em><a href="#foster">foster parent element</a></em> is the
+ element before the last <code><a href="#table">table</a></code> element
+ in the <a href="#stack">stack of open elements</a>.</p>
- <p>If the <em><a href="#foster">foster parent element</a></em> is the
- parent element of the last <code><a href="#table">table</a></code>
- element in the <a href="#stack">stack of open elements</a>, then the
- new node must be inserted immediately <em>before</em> the last
- <code><a href="#table">table</a></code> element in the <a
- href="#stack">stack of open elements</a> in the <a
- href="#foster">foster parent element</a>; otherwise, the new node
- must be <em>appended</em> to the <a href="#foster">foster parent
- element</a>.</p>
- </dl>
+ <p>If the <em><a href="#foster">foster parent element</a></em> is the
+ parent element of the last <code><a href="#table">table</a></code>
+ element in the <a href="#stack">stack of open elements</a>, then the new
+ node must be inserted immediately <em>before</em> the last <code><a
+ href="#table">table</a></code> element in the <a href="#stack">stack of
+ open elements</a> in the <a href="#foster">foster parent element</a>;
+ otherwise, the new node must be <em>appended</em> to the <a
+ href="#foster">foster parent element</a>.</p>
+ </dl>
- <p>When the steps above require the UA to <dfn id=clear1>clear the
- stack back to a table context</dfn>, it means that the UA must, while
- the <a href="#current4">current node</a> is not a <code><a
- href="#table">table</a></code> element or an <code><a
- href="#html">html</a></code> element, pop elements from the <a
- href="#stack">stack of open elements</a>. If this causes any elements
- to be popped from the stack, then this is a <a href="#parse0">parse
- error</a>.</p>
+ <p>When the steps above require the UA to <dfn id=clear1>clear the stack
+ back to a table context</dfn>, it means that the UA must, while the <a
+ href="#current4">current node</a> is not a <code><a
+ href="#table">table</a></code> element or an <code><a
+ href="#html">html</a></code> element, pop elements from the <a
+ href="#stack">stack of open elements</a>. If this causes any elements to
+ be popped from the stack, then this is a <a href="#parse0">parse
+ error</a>.
- <p class=note>The <a href="#current4">current node</a> being an
- <code><a href="#html">html</a></code> element after this process is a
- <a href="#fragment">fragment case</a>.</p>
+ <p class=note>The <a href="#current4">current node</a> being an <code><a
+ href="#html">html</a></code> element after this process is a <a
+ href="#fragment">fragment case</a>.
- <dt id=parsing-main-incaption>If the <a href="#insertion0">insertion
- mode</a> is "<dfn id=in-caption title="insertion mode: in caption">in
- caption</dfn>"
+ <h6 id=parsing-main-incaption><span class=secno>8.2.4.3.13. </span>The <dfn
+ id=in-caption title="insertion mode: in caption">in caption</dfn>
+ insertion mode</h6>
- <dd>
- <dl class=switch>
- <dt>An end tag whose tag name is "caption"
+ <p>Handle the token as follows.
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> does not <a
- href="#have-an0" title="has an element in table scope">have an
- element in table scope</a> with the same tag name as the token, this
- is a <a href="#parse0">parse error</a>. Ignore the token. (<a
- href="#fragment">fragment case</a>)</p>
+ <dl class=switch>
+ <dt>An end tag whose tag name is "caption"
- <p>Otherwise:</p>
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> does not <a
+ href="#have-an0" title="has an element in table scope">have an element
+ in table scope</a> with the same tag name as the token, this is a <a
+ href="#parse0">parse error</a>. Ignore the token. (<a
+ href="#fragment">fragment case</a>)</p>
- <p><a href="#generate">Generate implied end tags</a>.</p>
+ <p>Otherwise:</p>
- <p>Now, if the <a href="#current4">current node</a> is not a <code><a
- href="#caption0">caption</a></code> element, then this is a <a
- href="#parse0">parse error</a>.</p>
+ <p><a href="#generate">Generate implied end tags</a>.</p>
- <p>Pop elements from this stack until a <code><a
- href="#caption0">caption</a></code> element has been popped from the
- stack.</p>
+ <p>Now, if the <a href="#current4">current node</a> is not a <code><a
+ href="#caption0">caption</a></code> element, then this is a <a
+ href="#parse0">parse error</a>.</p>
- <p><a href="#clear0">Clear the list of active formatting elements up
- to the last marker</a>.</p>
+ <p>Pop elements from this stack until a <code><a
+ href="#caption0">caption</a></code> element has been popped from the
+ stack.</p>
- <p>Switch the <a href="#insertion0">insertion mode</a> to "<a
- href="#in-table" title="insertion mode: in table">in table</a>".</p>
+ <p><a href="#clear0">Clear the list of active formatting elements up to
+ the last marker</a>.</p>
- <dt>A start tag whose tag name is one of: "caption", "col",
- "colgroup", "tbody", "td", "tfoot", "th", "thead", "tr"
+ <p>Switch the <a href="#insertion0">insertion mode</a> to "<a
+ href="#in-table" title="insertion mode: in table">in table</a>".</p>
- <dt>An end tag whose tag name is "table"
+ <dt>A start tag whose tag name is one of: "caption", "col", "colgroup",
+ "tbody", "td", "tfoot", "th", "thead", "tr"
- <dd>
- <p><a href="#parse0">Parse error</a>. 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>
+ <dt>An end tag whose tag name is "table"
- <p class=note>The fake end tag token here can only be ignored in the
- <a href="#fragment">fragment case</a>.</p>
+ <dd>
+ <p><a href="#parse0">Parse error</a>. 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>
- <dt>An end tag whose tag name is one of: "body", "col", "colgroup",
- "html", "tbody", "td", "tfoot", "th", "thead", "tr"
+ <p class=note>The fake end tag token here can only be ignored in the <a
+ href="#fragment">fragment case</a>.</p>
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <dt>An end tag whose tag name is one of: "body", "col", "colgroup",
+ "html", "tbody", "td", "tfoot", "th", "thead", "tr"
- <dt>Anything else
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <dd>
- <p>Process the token as if the <a href="#insertion0">insertion
- mode</a> was "<a href="#in-body" title="insertion mode: in body">in
- body</a>".</p>
- </dl>
+ <dt>Anything else
- <dt id=parsing-main-incolgroup>If the <a href="#insertion0">insertion
- mode</a> is "<dfn id=in-column title="insertion mode: in column
- group">in column group</dfn>"
+ <dd>
+ <p>Process the token as if the <a href="#insertion0">insertion mode</a>
+ was "<a href="#in-body" title="insertion mode: in body">in body</a>".</p>
+ </dl>
- <dd>
- <dl class=switch>
- <dt>An end-of-file token
+ <h6 id=parsing-main-incolgroup><span class=secno>8.2.4.3.14. </span>The
+ <dfn id=in-column title="insertion mode: in column group">in column
+ group</dfn> insertion mode</h6>
- <dd>
- <p><a href="#stops">Stop parsing, with prejudice.</a></p>
+ <p>Handle the token as follows.
- <dt>A character token that is one of one of U+0009 CHARACTER
- TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
- FORM FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
+ <dl class=switch>
+ <dt>An end-of-file token
- <dd>
- <p><a href="#append" title="append a character">Append the
- character</a> to the <a href="#current4">current node</a>.</p>
+ <dd>
+ <p><a href="#stops">Stop parsing, with prejudice.</a></p>
- <dt>A comment token
+ <dt>A character token that is one of one of U+0009 CHARACTER TABULATION,
+ U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF),
+ <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
- <dd>
- <p>Append a <code>Comment</code> node to the <a
- href="#current4">current node</a> with the <code
- title="">data</code> attribute set to the data given in the comment
- token.</p>
+ <dd>
+ <p><a href="#append" title="append a character">Append the character</a>
+ to the <a href="#current4">current node</a>.</p>
- <dt>A DOCTYPE token
+ <dt>A comment token
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <dd>
+ <p>Append a <code>Comment</code> node to the <a href="#current4">current
+ node</a> with the <code title="">data</code> attribute set to the data
+ given in the comment token.</p>
- <dt>A start tag whose tag name is "html"
+ <dt>A DOCTYPE token
- <dd>
- <p>Process the token as if the <a href="#insertion0">insertion
- mode</a> had been "<a href="#in-body" title="insertion mode: in
- body">in body</a>".</p>
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <dt>A start tag whose tag name is "col"
+ <dt>A start tag whose tag name is "html"
- <dd>
- <p><a href="#insert" title="insert an HTML element">Insert a
- <code>col</code> element</a> for the token. Immediately pop the <a
- href="#current4">current node</a> off the <a href="#stack">stack of
- open elements</a>.</p>
+ <dd>
+ <p>Process the token as if the <a href="#insertion0">insertion mode</a>
+ had been "<a href="#in-body" title="insertion mode: in body">in
+ body</a>".</p>
- <dt>An end tag whose tag name is "colgroup"
+ <dt>A start tag whose tag name is "col"
- <dd>
- <p>If the <a href="#current4">current node</a> is the root <code><a
- href="#html">html</a></code> element, then this is a <a
- href="#parse0">parse error</a>, ignore the token. (<a
- href="#fragment">fragment case</a>)</p>
+ <dd>
+ <p><a href="#insert" title="insert an HTML element">Insert a
+ <code>col</code> element</a> for the token. Immediately pop the <a
+ href="#current4">current node</a> off the <a href="#stack">stack of open
+ elements</a>.</p>
- <p>Otherwise, pop the <a href="#current4">current node</a> (which
- will be a <code><a href="#colgroup">colgroup</a></code> element)
- from the <a href="#stack">stack of open elements</a>. Switch the <a
- href="#insertion0">insertion mode</a> to "<a href="#in-table"
- title="insertion mode: in table">in table</a>".</p>
+ <dt>An end tag whose tag name is "colgroup"
- <dt>An end tag whose tag name is "col"
+ <dd>
+ <p>If the <a href="#current4">current node</a> is the root <code><a
+ href="#html">html</a></code> element, then this is a <a
+ href="#parse0">parse error</a>, ignore the token. (<a
+ href="#fragment">fragment case</a>)</p>
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <p>Otherwise, pop the <a href="#current4">current node</a> (which will be
+ a <code><a href="#colgroup">colgroup</a></code> element) from the <a
+ href="#stack">stack of open elements</a>. Switch the <a
+ href="#insertion0">insertion mode</a> to "<a href="#in-table"
+ title="insertion mode: in table">in table</a>".</p>
- <dt>Anything else
+ <dt>An end tag whose tag name is "col"
- <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>
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <p class=note>The fake end tag token here can only be ignored in the
- <a href="#fragment">fragment case</a>.</p>
- </dl>
+ <dt>Anything else
- <dt id=parsing-main-intbody>If the <a href="#insertion0">insertion
- mode</a> is "<dfn id=in-table0 title="insertion mode: in table body">in
- table body</dfn>"
+ <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>
- <dd>
- <dl class=switch>
- <dt>A start tag whose tag name is "tr"
+ <p class=note>The fake end tag token here can only be ignored in the <a
+ href="#fragment">fragment case</a>.</p>
+ </dl>
- <dd>
- <p><a href="#clear2">Clear the stack back to a table body
- context</a>. (See below.)</p>
+ <h6 id=parsing-main-intbody><span class=secno>8.2.4.3.15. </span>The <dfn
+ id=in-table0 title="insertion mode: in table body">in table body</dfn>
+ insertion mode</h6>
- <p><a href="#insert" title="insert an HTML element">Insert a
- <code>tr</code> element</a> for the token, then switch the <a
- href="#insertion0">insertion mode</a> to "<a href="#in-row"
- title="insertion mode: in row">in row</a>".</p>
+ <p>Handle the token as follows.
- <dt>A start tag whose tag name is one of: "th", "td"
+ <dl class=switch>
+ <dt>A start tag whose tag name is "tr"
- <dd>
- <p><a href="#parse0">Parse error</a>. Act as if a start tag with the
- tag name "tr" had been seen, then reprocess the current token.</p>
+ <dd>
+ <p><a href="#clear2">Clear the stack back to a table body context</a>.
+ (See below.)</p>
- <dt>An end tag whose tag name is one of: "tbody", "tfoot", "thead"
+ <p><a href="#insert" title="insert an HTML element">Insert a
+ <code>tr</code> element</a> for the token, then switch the <a
+ href="#insertion0">insertion mode</a> to "<a href="#in-row"
+ title="insertion mode: in row">in row</a>".</p>
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> does not <a
- href="#have-an0" title="has an element in table scope">have an
- element in table scope</a> with the same tag name as the token, this
- is a <a href="#parse0">parse error</a>. Ignore the token.</p>
+ <dt>A start tag whose tag name is one of: "th", "td"
- <p>Otherwise:</p>
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Act as if a start tag with the tag
+ name "tr" had been seen, then reprocess the current token.</p>
- <p><a href="#clear2">Clear the stack back to a table body
- context</a>. (See below.)</p>
+ <dt>An end tag whose tag name is one of: "tbody", "tfoot", "thead"
- <p>Pop the <a href="#current4">current node</a> from the <a
- href="#stack">stack of open elements</a>. Switch the <a
- href="#insertion0">insertion mode</a> to "<a href="#in-table"
- title="insertion mode: in table">in table</a>".</p>
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> does not <a
+ href="#have-an0" title="has an element in table scope">have an element
+ in table scope</a> with the same tag name as the token, this is a <a
+ href="#parse0">parse error</a>. Ignore the token.</p>
- <dt>A start tag whose tag name is one of: "caption", "col",
- "colgroup", "tbody", "tfoot", "thead"
+ <p>Otherwise:</p>
- <dt>An end tag whose tag name is "table"
+ <p><a href="#clear2">Clear the stack back to a table body context</a>.
+ (See below.)</p>
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> does not <a
- href="#have-an0" title="has an element in table scope">have a
- <code>tbody</code>, <code>thead</code>, or <code>tfoot</code>
- element in table scope</a>, this is a <a href="#parse0">parse
- error</a>. Ignore the token. (<a href="#fragment">fragment case</a>)</p>
+ <p>Pop the <a href="#current4">current node</a> from the <a
+ href="#stack">stack of open elements</a>. Switch the <a
+ href="#insertion0">insertion mode</a> to "<a href="#in-table"
+ title="insertion mode: in table">in table</a>".</p>
- <p>Otherwise:</p>
+ <dt>A start tag whose tag name is one of: "caption", "col", "colgroup",
+ "tbody", "tfoot", "thead"
- <p><a href="#clear2">Clear the stack back to a table body
- context</a>. (See below.)</p>
+ <dt>An end tag whose tag name is "table"
- <p>Act as if an end tag with the same tag name as the <a
- href="#current4">current node</a> ("tbody", "tfoot", or "thead") had
- been seen, then reprocess the current token.</p>
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> does not <a
+ href="#have-an0" title="has an element in table scope">have a
+ <code>tbody</code>, <code>thead</code>, or <code>tfoot</code> element in
+ table scope</a>, this is a <a href="#parse0">parse error</a>. Ignore the
+ token. (<a href="#fragment">fragment case</a>)</p>
- <dt>An end tag whose tag name is one of: "body", "caption", "col",
- "colgroup", "html", "td", "th", "tr"
+ <p>Otherwise:</p>
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <p><a href="#clear2">Clear the stack back to a table body context</a>.
+ (See below.)</p>
- <dt>Anything else
+ <p>Act as if an end tag with the same tag name as the <a
+ href="#current4">current node</a> ("tbody", "tfoot", or "thead") had
+ been seen, then reprocess the current token.</p>
- <dd>
- <p>Process the token as if the <a href="#insertion0">insertion
- mode</a> was "<a href="#in-table" title="insertion mode: in
- table">in table</a>".</p>
- </dl>
+ <dt>An end tag whose tag name is one of: "body", "caption", "col",
+ "colgroup", "html", "td", "th", "tr"
- <p>When the steps above require the UA to <dfn id=clear2>clear the
- stack back to a table body context</dfn>, it means that the UA must,
- while the <a href="#current4">current node</a> is not a <code><a
- href="#tbody">tbody</a></code>, <code><a
- href="#tfoot0">tfoot</a></code>, <code><a
- href="#thead0">thead</a></code>, or <code><a
- href="#html">html</a></code> element, pop elements from the <a
- href="#stack">stack of open elements</a>. If this causes any elements
- to be popped from the stack, then this is a <a href="#parse0">parse
- error</a>.</p>
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <p class=note>The <a href="#current4">current node</a> being an
- <code><a href="#html">html</a></code> element after this process is a
- <a href="#fragment">fragment case</a>.</p>
+ <dt>Anything else
- <dt id=parsing-main-intr>If the <a href="#insertion0">insertion mode</a>
- is "<dfn id=in-row title="insertion mode: in row">in row</dfn>"
+ <dd>
+ <p>Process the token as if the <a href="#insertion0">insertion mode</a>
+ was "<a href="#in-table" title="insertion mode: in table">in table</a>".</p>
+ </dl>
- <dd>
- <dl class=switch>
- <dt>A start tag whose tag name is one of: "th", "td"
+ <p>When the steps above require the UA to <dfn id=clear2>clear the stack
+ back to a table body context</dfn>, it means that the UA must, while the
+ <a href="#current4">current node</a> is not a <code><a
+ href="#tbody">tbody</a></code>, <code><a href="#tfoot0">tfoot</a></code>,
+ <code><a href="#thead0">thead</a></code>, or <code><a
+ href="#html">html</a></code> element, pop elements from the <a
+ href="#stack">stack of open elements</a>. If this causes any elements to
+ be popped from the stack, then this is a <a href="#parse0">parse
+ error</a>.
- <dd>
- <p><a href="#clear3">Clear the stack back to a table row context</a>.
- (See below.)</p>
+ <p class=note>The <a href="#current4">current node</a> being an <code><a
+ href="#html">html</a></code> element after this process is a <a
+ href="#fragment">fragment case</a>.
- <p><a href="#insert" title="insert an HTML element">Insert an HTML
- element</a> for the token, then switch the <a
- href="#insertion0">insertion mode</a> to "<a href="#in-cell"
- title="insertion mode: in cell">in cell</a>".</p>
+ <h6 id=parsing-main-intr><span class=secno>8.2.4.3.16. </span>The <dfn
+ id=in-row title="insertion mode: in row">in row</dfn> insertion mode</h6>
- <p>Insert a marker at the end of the <a href="#list-of4">list of
- active formatting elements</a>.</p>
+ <p>Handle the token as follows.
- <dt>An end tag whose tag name is "tr"
+ <dl class=switch>
+ <dt>A start tag whose tag name is one of: "th", "td"
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> does not <a
- href="#have-an0" title="has an element in table scope">have an
- element in table scope</a> with the same tag name as the token, this
- is a <a href="#parse0">parse error</a>. Ignore the token. (<a
- href="#fragment">fragment case</a>)</p>
+ <dd>
+ <p><a href="#clear3">Clear the stack back to a table row context</a>.
+ (See below.)</p>
- <p>Otherwise:</p>
+ <p><a href="#insert" title="insert an HTML element">Insert an HTML
+ element</a> for the token, then switch the <a
+ href="#insertion0">insertion mode</a> to "<a href="#in-cell"
+ title="insertion mode: in cell">in cell</a>".</p>
- <p><a href="#clear3">Clear the stack back to a table row context</a>.
- (See below.)</p>
+ <p>Insert a marker at the end of the <a href="#list-of4">list of active
+ formatting elements</a>.</p>
- <p>Pop the <a href="#current4">current node</a> (which will be a
- <code><a href="#tr">tr</a></code> element) from the <a
- href="#stack">stack of open elements</a>. Switch the <a
- href="#insertion0">insertion mode</a> to "<a href="#in-table0"
- title="insertion mode: in table body">in table body</a>".</p>
+ <dt>An end tag whose tag name is "tr"
- <dt>A start tag whose tag name is one of: "caption", "col",
- "colgroup", "tbody", "tfoot", "thead", "tr"
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> does not <a
+ href="#have-an0" title="has an element in table scope">have an element
+ in table scope</a> with the same tag name as the token, this is a <a
+ href="#parse0">parse error</a>. Ignore the token. (<a
+ href="#fragment">fragment case</a>)</p>
- <dt>An end tag whose tag name is "table"
+ <p>Otherwise:</p>
- <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><a href="#clear3">Clear the stack back to a table row context</a>.
+ (See below.)</p>
- <p class=note>The fake end tag token here can only be ignored in the
- <a href="#fragment">fragment case</a>.</p>
+ <p>Pop the <a href="#current4">current node</a> (which will be a <code><a
+ href="#tr">tr</a></code> element) from the <a href="#stack">stack of
+ open elements</a>. Switch the <a href="#insertion0">insertion mode</a>
+ to "<a href="#in-table0" title="insertion mode: in table body">in table
+ body</a>".</p>
- <dt>An end tag whose tag name is one of: "tbody", "tfoot", "thead"
+ <dt>A start tag whose tag name is one of: "caption", "col", "colgroup",
+ "tbody", "tfoot", "thead", "tr"
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> does not <a
- href="#have-an0" title="has an element in table scope">have an
- element in table scope</a> with the same tag name as the token, this
- is a <a href="#parse0">parse error</a>. Ignore the token.</p>
+ <dt>An end tag whose tag name is "table"
- <p>Otherwise, act as if an end tag with the tag name "tr" had been
- seen, then reprocess the current token.</p>
+ <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>
- <dt>An end tag whose tag name is one of: "body", "caption", "col",
- "colgroup", "html", "td", "th"
+ <p class=note>The fake end tag token here can only be ignored in the <a
+ href="#fragment">fragment case</a>.</p>
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <dt>An end tag whose tag name is one of: "tbody", "tfoot", "thead"
- <dt>Anything else
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> does not <a
+ href="#have-an0" title="has an element in table scope">have an element
+ in table scope</a> with the same tag name as the token, this is a <a
+ href="#parse0">parse error</a>. Ignore the token.</p>
- <dd>
- <p>Process the token as if the <a href="#insertion0">insertion
- mode</a> was "<a href="#in-table" title="insertion mode: in
- table">in table</a>".</p>
- </dl>
+ <p>Otherwise, act as if an end tag with the tag name "tr" had been seen,
+ then reprocess the current token.</p>
- <p>When the steps above require the UA to <dfn id=clear3>clear the
- stack back to a table row context</dfn>, it means that the UA must,
- while the <a href="#current4">current node</a> is not a <code><a
- href="#tr">tr</a></code> element or an <code><a
- href="#html">html</a></code> element, pop elements from the <a
- href="#stack">stack of open elements</a>. If this causes any elements
- to be popped from the stack, then this is a <a href="#parse0">parse
- error</a>.</p>
+ <dt>An end tag whose tag name is one of: "body", "caption", "col",
+ "colgroup", "html", "td", "th"
- <p class=note>The <a href="#current4">current node</a> being an
- <code><a href="#html">html</a></code> element after this process is a
- <a href="#fragment">fragment case</a>.</p>
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <dt id=parsing-main-intd>If the <a href="#insertion0">insertion mode</a>
- is "<dfn id=in-cell title="insertion mode: in cell">in cell</dfn>"
+ <dt>Anything else
- <dd>
- <dl class=switch>
- <dt>An end tag whose tag name is one of: "td", "th"
+ <dd>
+ <p>Process the token as if the <a href="#insertion0">insertion mode</a>
+ was "<a href="#in-table" title="insertion mode: in table">in table</a>".</p>
+ </dl>
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> does not <a
- href="#have-an0" title="has an element in table scope">have an
- element in table scope</a> with the same tag name as that of the
- token, then this is a <a href="#parse0">parse error</a> and the
- token must be ignored.</p>
+ <p>When the steps above require the UA to <dfn id=clear3>clear the stack
+ back to a table row context</dfn>, it means that the UA must, while the <a
+ href="#current4">current node</a> is not a <code><a
+ href="#tr">tr</a></code> element or an <code><a
+ href="#html">html</a></code> element, pop elements from the <a
+ href="#stack">stack of open elements</a>. If this causes any elements to
+ be popped from the stack, then this is a <a href="#parse0">parse
+ error</a>.
- <p>Otherwise:</p>
+ <p class=note>The <a href="#current4">current node</a> being an <code><a
+ href="#html">html</a></code> element after this process is a <a
+ href="#fragment">fragment case</a>.
- <p><a href="#generate">Generate implied end tags</a>, except for
- elements with the same tag name as the token.</p>
+ <h6 id=parsing-main-intd><span class=secno>8.2.4.3.17. </span>The <dfn
+ id=in-cell title="insertion mode: in cell">in cell</dfn> insertion mode</h6>
- <p>Now, if the <a href="#current4">current node</a> is not an element
- with the same tag name as the token, then this is a <a
- href="#parse0">parse error</a>.</p>
+ <p>Handle the token as follows.
- <p>Pop elements from this stack until an element with the same tag
- name as the token has been popped from the stack.</p>
+ <dl class=switch>
+ <dt>An end tag whose tag name is one of: "td", "th"
- <p><a href="#clear0">Clear the list of active formatting elements up
- to the last marker</a>.</p>
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> does not <a
+ href="#have-an0" title="has an element in table scope">have an element
+ in table scope</a> with the same tag name as that of the token, then
+ this is a <a href="#parse0">parse error</a> and the token must be
+ ignored.</p>
- <p>Switch the <a href="#insertion0">insertion mode</a> to "<a
- href="#in-row" title="insertion mode: in row">in row</a>". (The <a
- href="#current4">current node</a> will be a <code><a
- href="#tr">tr</a></code> element at this point.)</p>
+ <p>Otherwise:</p>
- <dt>A start tag whose tag name is one of: "caption", "col",
- "colgroup", "tbody", "td", "tfoot", "th", "thead", "tr"
+ <p><a href="#generate">Generate implied end tags</a>, except for elements
+ with the same tag name as the token.</p>
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> does
- <em>not</em> <a href="#have-an0" title="has an element in table
- scope">have a <code>td</code> or <code>th</code> element in table
- scope</a>, then this is a <a href="#parse0">parse error</a>; ignore
- the token. (<a href="#fragment">fragment case</a>)</p>
+ <p>Now, if the <a href="#current4">current node</a> is not an element
+ with the same tag name as the token, then this is a <a
+ href="#parse0">parse error</a>.</p>
- <p>Otherwise, <a href="#close2">close the cell</a> (see below) and
- reprocess the current token.</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>
- <dt>An end tag whose tag name is one of: "body", "caption", "col",
- "colgroup", "html"
+ <p><a href="#clear0">Clear the list of active formatting elements up to
+ the last marker</a>.</p>
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <p>Switch the <a href="#insertion0">insertion mode</a> to "<a
+ href="#in-row" title="insertion mode: in row">in row</a>". (The <a
+ href="#current4">current node</a> will be a <code><a
+ href="#tr">tr</a></code> element at this point.)</p>
- <dt>An end tag whose tag name is one of: "table", "tbody", "tfoot",
- "thead", "tr"
+ <dt>A start tag whose tag name is one of: "caption", "col", "colgroup",
+ "tbody", "td", "tfoot", "th", "thead", "tr"
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> does not <a
- href="#have-an0" title="has an element in table scope">have an
- element in table scope</a> with the same tag name as that of the
- token (which can only happen for "tbody", "tfoot" and "thead", or,
- in the <a href="#fragment">fragment case</a>), then this is a <a
- href="#parse0">parse error</a> and the token must be ignored.</p>
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> does <em>not</em>
+ <a href="#have-an0" title="has an element in table scope">have a
+ <code>td</code> or <code>th</code> element in table scope</a>, then this
+ is a <a href="#parse0">parse error</a>; ignore the token. (<a
+ href="#fragment">fragment case</a>)</p>
- <p>Otherwise, <a href="#close2">close the cell</a> (see below) and
- reprocess the current token.</p>
+ <p>Otherwise, <a href="#close2">close the cell</a> (see below) and
+ reprocess the current token.</p>
- <dt>Anything else
+ <dt>An end tag whose tag name is one of: "body", "caption", "col",
+ "colgroup", "html"
- <dd>
- <p>Process the token as if the <a href="#insertion0">insertion
- mode</a> was "<a href="#in-body" title="insertion mode: in body">in
- body</a>".</p>
- </dl>
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <p>Where the steps above say to <dfn id=close2>close the cell</dfn>,
- they mean to run the following algorithm:</p>
+ <dt>An end tag whose tag name is one of: "table", "tbody", "tfoot",
+ "thead", "tr"
- <ol>
- <li>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an0" title="has an element in table scope">has a
- <code>td</code> element in table scope</a>, then act as if an end
- tag token with the tag name "td" had been seen.
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> does not <a
+ href="#have-an0" title="has an element in table scope">have an element
+ in table scope</a> with the same tag name as that of the token (which
+ can only happen for "tbody", "tfoot" and "thead", or, in the <a
+ href="#fragment">fragment case</a>), then this is a <a
+ href="#parse0">parse error</a> and the token must be ignored.</p>
- <li>
- <p>Otherwise, the <a href="#stack">stack of open elements</a> will <a
- href="#have-an0" title="has an element in table scope">have a
- <code>th</code> element in table scope</a>; act as if an end tag
- token with the tag name "th" had been seen.
- </ol>
+ <p>Otherwise, <a href="#close2">close the cell</a> (see below) and
+ reprocess the current token.</p>
- <p class=note>The <a href="#stack">stack of open elements</a> cannot
- have both a <code><a href="#td">td</a></code> and a <code><a
- href="#th">th</a></code> element <a href="#have-an0" title="has an
- element in table scope">in table scope</a> at the same time, nor can
- it have neither when the <a href="#insertion0">insertion mode</a> is
- "<a href="#in-cell" title="insertion mode: in cell">in cell</a>".</p>
+ <dt>Anything else
- <dt id=parsing-main-inselect>If the <a href="#insertion0">insertion
- mode</a> is "<dfn id=in-select title="insertion mode: in select">in
- select</dfn>"
+ <dd>
+ <p>Process the token as if the <a href="#insertion0">insertion mode</a>
+ was "<a href="#in-body" title="insertion mode: in body">in body</a>".</p>
+ </dl>
- <dd>
- <p>Handle the token as follows:</p>
+ <p>Where the steps above say to <dfn id=close2>close the cell</dfn>, they
+ mean to run the following algorithm:
- <dl class=switch>
- <dt>An end-of-file token
+ <ol>
+ <li>
+ <p>If the <a href="#stack">stack of open elements</a> <a href="#have-an0"
+ title="has an element in table scope">has a <code>td</code> element in
+ table scope</a>, then act as if an end tag token with the tag name "td"
+ had been seen.
- <dd>
- <p><a href="#stops">Stop parsing, with prejudice.</a></p>
+ <li>
+ <p>Otherwise, the <a href="#stack">stack of open elements</a> will <a
+ href="#have-an0" title="has an element in table scope">have a
+ <code>th</code> element in table scope</a>; act as if an end tag token
+ with the tag name "th" had been seen.
+ </ol>
- <dt>A character token
+ <p class=note>The <a href="#stack">stack of open elements</a> cannot have
+ both a <code><a href="#td">td</a></code> and a <code><a
+ href="#th">th</a></code> element <a href="#have-an0" title="has an element
+ in table scope">in table scope</a> at the same time, nor can it have
+ neither when the <a href="#insertion0">insertion mode</a> is "<a
+ href="#in-cell" title="insertion mode: in cell">in cell</a>".
- <dd>
- <p><a href="#append" title="append a character">Append the token's
- character</a> to the <a href="#current4">current node</a>.</p>
+ <h6 id=parsing-main-inselect><span class=secno>8.2.4.3.18. </span>The <dfn
+ id=in-select title="insertion mode: in select">in select</dfn> insertion
+ mode</h6>
- <dt>A comment token
+ <p>Handle the token as follows:
- <dd>
- <p>Append a <code>Comment</code> node to the <a
- href="#current4">current node</a> with the <code
- title="">data</code> attribute set to the data given in the comment
- token.</p>
+ <dl class=switch>
+ <dt>An end-of-file token
- <dt>A DOCTYPE token
+ <dd>
+ <p><a href="#stops">Stop parsing, with prejudice.</a></p>
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <dt>A character token
- <dt>A start tag whose tag name is "html"
+ <dd>
+ <p><a href="#append" title="append a character">Append the token's
+ character</a> to the <a href="#current4">current node</a>.</p>
- <dd>
- <p>Process the token as if the <a href="#insertion0">insertion
- mode</a> had been "<a href="#in-body" title="insertion mode: in
- body">in body</a>".</p>
+ <dt>A comment token
- <dt>A start tag whose tag name is "option"
+ <dd>
+ <p>Append a <code>Comment</code> node to the <a href="#current4">current
+ node</a> with the <code title="">data</code> attribute set to the data
+ given in the comment token.</p>
- <dd>
- <p>If the <a href="#current4">current node</a> is an
- <code>option</code> element, act as if an end tag with the tag name
- "option" had been seen.</p>
+ <dt>A DOCTYPE token
- <p><a href="#insert">Insert an HTML element</a> for the token.</p>
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <dt>A start tag whose tag name is "optgroup"
+ <dt>A start tag whose tag name is "html"
- <dd>
- <p>If the <a href="#current4">current node</a> is an
- <code>option</code> element, act as if an end tag with the tag name
- "option" had been seen.</p>
+ <dd>
+ <p>Process the token as if the <a href="#insertion0">insertion mode</a>
+ had been "<a href="#in-body" title="insertion mode: in body">in
+ body</a>".</p>
- <p>If the <a href="#current4">current node</a> is an
- <code>optgroup</code> element, act as if an end tag with the tag
- name "optgroup" had been seen.</p>
+ <dt>A start tag whose tag name is "option"
- <p><a href="#insert">Insert an HTML element</a> for the token.</p>
+ <dd>
+ <p>If the <a href="#current4">current node</a> is an <code>option</code>
+ element, act as if an end tag with the tag name "option" had been seen.</p>
- <dt>An end tag whose tag name is "optgroup"
+ <p><a href="#insert">Insert an HTML element</a> for the token.</p>
- <dd>
- <p>First, if the <a href="#current4">current node</a> is an
- <code>option</code> element, and the node immediately before it in
- the <a href="#stack">stack of open elements</a> is an
- <code>optgroup</code> element, then act as if an end tag with the
- tag name "option" had been seen.</p>
+ <dt>A start tag whose tag name is "optgroup"
- <p>If the <a href="#current4">current node</a> is an
- <code>optgroup</code> element, then pop that node from the <a
- href="#stack">stack of open elements</a>. Otherwise, this is a <a
- href="#parse0">parse error</a>, ignore the token.</p>
+ <dd>
+ <p>If the <a href="#current4">current node</a> is an <code>option</code>
+ element, act as if an end tag with the tag name "option" had been seen.</p>
- <dt>An end tag whose tag name is "option"
+ <p>If the <a href="#current4">current node</a> is an
+ <code>optgroup</code> element, act as if an end tag with the tag name
+ "optgroup" had been seen.</p>
- <dd>
- <p>If the <a href="#current4">current node</a> is an
- <code>option</code> element, then pop that node from the <a
- href="#stack">stack of open elements</a>. Otherwise, this is a <a
- href="#parse0">parse error</a>, ignore the token.</p>
+ <p><a href="#insert">Insert an HTML element</a> for the token.</p>
- <dt>An end tag whose tag name is "select"
+ <dt>An end tag whose tag name is "optgroup"
- <dd>
- <p>If the <a href="#stack">stack of open elements</a> does not <a
- href="#have-an0" title="has an element in table scope">have an
- element in table scope</a> with the same tag name as the token, this
- is a <a href="#parse0">parse error</a>. Ignore the token. (<a
- href="#fragment">fragment case</a>)</p>
+ <dd>
+ <p>First, if the <a href="#current4">current node</a> is an
+ <code>option</code> element, and the node immediately before it in the
+ <a href="#stack">stack of open elements</a> is an <code>optgroup</code>
+ element, then act as if an end tag with the tag name "option" had been
+ seen.</p>
- <p>Otherwise:</p>
+ <p>If the <a href="#current4">current node</a> is an
+ <code>optgroup</code> element, then pop that node from the <a
+ href="#stack">stack of open elements</a>. Otherwise, this is a <a
+ href="#parse0">parse error</a>, ignore the token.</p>
- <p>Pop elements from the <a href="#stack">stack of open elements</a>
- until a <code>select</code> element has been popped from the stack.</p>
+ <dt>An end tag whose tag name is "option"
- <p><a href="#reset">Reset the insertion mode appropriately</a>.</p>
+ <dd>
+ <p>If the <a href="#current4">current node</a> is an <code>option</code>
+ element, then pop that node from the <a href="#stack">stack of open
+ elements</a>. Otherwise, this is a <a href="#parse0">parse error</a>,
+ ignore the token.</p>
- <dt>A start tag whose tag name is "select"
+ <dt>An end tag whose tag name is "select"
- <dd>
- <p><a href="#parse0">Parse error</a>. Act as if the token had been an
- end tag with the tag name "select" instead.</p>
+ <dd>
+ <p>If the <a href="#stack">stack of open elements</a> does not <a
+ href="#have-an0" title="has an element in table scope">have an element
+ in table scope</a> with the same tag name as the token, this is a <a
+ href="#parse0">parse error</a>. Ignore the token. (<a
+ href="#fragment">fragment case</a>)</p>
- <dt>An end tag whose tag name is one of: "caption", "table", "tbody",
- "tfoot", "thead", "tr", "td", "th"
+ <p>Otherwise:</p>
- <dd>
- <p><a href="#parse0">Parse error</a>.</p>
+ <p>Pop elements from the <a href="#stack">stack of open elements</a>
+ until a <code>select</code> element has been popped from the stack.</p>
- <p>If the <a href="#stack">stack of open elements</a> <a
- href="#have-an0">has an element in table scope</a> 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>
+ <p><a href="#reset">Reset the insertion mode appropriately</a>.</p>
- <dt>Anything else
+ <dt>A start tag whose tag name is "select"
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- </dl>
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Act as if the token had been an end
+ tag with the tag name "select" instead.</p>
- <dt id=parsing-main-afterbody>If the <a href="#insertion0">insertion
- mode</a> is "<dfn id=after5 title="insertion mode: after body">after
- body</dfn>"
+ <dt>An end tag whose tag name is one of: "caption", "table", "tbody",
+ "tfoot", "thead", "tr", "td", "th"
- <dd>
- <p>Handle the token as follows:</p>
+ <dd>
+ <p><a href="#parse0">Parse error</a>.</p>
- <dl class=switch>
- <dt>An end-of-file token
+ <p>If the <a href="#stack">stack of open elements</a> <a
+ href="#have-an0">has an element in table scope</a> 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>
- <p><a href="#stops">Stop parsing, with prejudice.</a></p>
+ <dt>Anything else
- <dt>A character token that is one of one of U+0009 CHARACTER
- TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
- FORM FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ </dl>
- <dd>
- <p>Process the token as it would be processed if the <a
- href="#insertion0">insertion mode</a> was "<a href="#in-body"
- title="insertion mode: in body">in body</a>".</p>
+ <h6 id=parsing-main-afterbody><span class=secno>8.2.4.3.19. </span>The <dfn
+ id=after5 title="insertion mode: after body">after body</dfn> insertion
+ mode</h6>
- <dt>A comment token
+ <p>Handle the token as follows:
- <dd>
- <p>Append a <code>Comment</code> node to the first element in the <a
- href="#stack">stack of open elements</a> (the <code><a
- href="#html">html</a></code> element), with the <code
- title="">data</code> attribute set to the data given in the comment
- token.</p>
+ <dl class=switch>
+ <dt>An end-of-file token
- <dt>A DOCTYPE token
+ <dd>
+ <p><a href="#stops">Stop parsing, with prejudice.</a></p>
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <dt>A character token that is one of one of U+0009 CHARACTER TABULATION,
+ U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF),
+ <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
- <dt>A start tag whose tag name is "html"
+ <dd>
+ <p>Process the token as it would be processed if the <a
+ href="#insertion0">insertion mode</a> was "<a href="#in-body"
+ title="insertion mode: in body">in body</a>".</p>
- <dd>
- <p>Process the token as if the <a href="#insertion0">insertion
- mode</a> had been "<a href="#in-body" title="insertion mode: in
- body">in body</a>".</p>
+ <dt>A comment token
- <dt>An end tag whose tag name is "html"
+ <dd>
+ <p>Append a <code>Comment</code> node to the first element in the <a
+ href="#stack">stack of open elements</a> (the <code><a
+ href="#html">html</a></code> element), with the <code
+ title="">data</code> attribute set to the data given in the comment
+ token.</p>
- <dd>
- <p>If the parser was originally created as part of the <a
- href="#html-fragment0">HTML fragment parsing algorithm</a>, this is
- a <a href="#parse0">parse error</a>; ignore the token. (The element
- will be an <code><a href="#html">html</a></code> element in this
- case.) (<a href="#fragment">fragment case</a>)</p>
+ <dt>A DOCTYPE token
- <p>Otherwise, switch to <a href="#the-trailing0">the trailing end
- phase</a>.</p>
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <dt>Anything else
+ <dt>A start tag whose tag name is "html"
- <dd>
- <p><a href="#parse0">Parse error</a>. Set the <a
- href="#insertion0">insertion mode</a> to "<a href="#in-body"
- title="insertion mode: in body">in body</a>" and reprocess the
- token.</p>
- </dl>
+ <dd>
+ <p>Process the token as if the <a href="#insertion0">insertion mode</a>
+ had been "<a href="#in-body" title="insertion mode: in body">in
+ body</a>".</p>
- <dt id=parsing-main-inframeset>If the <a href="#insertion0">insertion
- mode</a> is "<dfn id=in-frameset title="insertion mode: in frameset">in
- frameset</dfn>"
+ <dt>An end tag whose tag name is "html"
- <dd>
- <p>Handle the token as follows:</p>
+ <dd>
+ <p>If the parser was originally created as part of the <a
+ href="#html-fragment0">HTML fragment parsing algorithm</a>, this is a <a
+ href="#parse0">parse error</a>; ignore the token. (The element will be
+ an <code><a href="#html">html</a></code> element in this case.) (<a
+ href="#fragment">fragment case</a>)</p>
- <dl class=switch>
- <dt>An end-of-file token
+ <p>Otherwise, switch to <a href="#the-trailing0">the trailing end
+ phase</a>.</p>
- <dd>
- <p><a href="#stops">Stop parsing, with prejudice.</a></p>
+ <dt>Anything else
- <dt>A character token that is one of one of U+0009 CHARACTER
- TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
- FORM FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Set the <a
+ href="#insertion0">insertion mode</a> to "<a href="#in-body"
+ title="insertion mode: in body">in body</a>" and reprocess the token.</p>
+ </dl>
- <dd>
- <p><a href="#append" title="append a character">Append the
- character</a> to the <a href="#current4">current node</a>.</p>
+ <h6 id=parsing-main-inframeset><span class=secno>8.2.4.3.20. </span>The
+ <dfn id=in-frameset title="insertion mode: in frameset">in frameset</dfn>
+ insertion mode</h6>
- <dt>A comment token
+ <p>Handle the token as follows:
- <dd>
- <p>Append a <code>Comment</code> node to the <a
- href="#current4">current node</a> with the <code
- title="">data</code> attribute set to the data given in the comment
- token.</p>
+ <dl class=switch>
+ <dt>An end-of-file token
- <dt>A DOCTYPE token
+ <dd>
+ <p><a href="#stops">Stop parsing, with prejudice.</a></p>
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <dt>A character token that is one of one of U+0009 CHARACTER TABULATION,
+ U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF),
+ <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
- <dt>A start tag whose tag name is "html"
+ <dd>
+ <p><a href="#append" title="append a character">Append the character</a>
+ to the <a href="#current4">current node</a>.</p>
- <dd>
- <p>Process the token as if the <a href="#insertion0">insertion
- mode</a> had been "<a href="#in-body" title="insertion mode: in
- body">in body</a>".</p>
+ <dt>A comment token
- <dt>A start tag whose tag name is "frameset"
+ <dd>
+ <p>Append a <code>Comment</code> node to the <a href="#current4">current
+ node</a> with the <code title="">data</code> attribute set to the data
+ given in the comment token.</p>
- <dd>
- <p><a href="#insert" title="Insert an HTML element">Insert a
- <code>frameset</code> element</a> for the token.</p>
+ <dt>A DOCTYPE token
- <dt>An end tag whose tag name is "frameset"
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <dd>
- <p>If the <a href="#current4">current node</a> is the root <code><a
- href="#html">html</a></code> element, then this is a <a
- href="#parse0">parse error</a>; ignore the token. (<a
- href="#fragment">fragment case</a>)</p>
+ <dt>A start tag whose tag name is "html"
- <p>Otherwise, pop the <a href="#current4">current node</a> from the
- <a href="#stack">stack of open elements</a>.</p>
+ <dd>
+ <p>Process the token as if the <a href="#insertion0">insertion mode</a>
+ had been "<a href="#in-body" title="insertion mode: in body">in
+ body</a>".</p>
- <p>If the parser was <em>not</em> originally created as part of the
- <a href="#html-fragment0">HTML fragment parsing algorithm</a> (<a
- href="#fragment">fragment case</a>), and the <a
- href="#current4">current node</a> is no longer a
- <code>frameset</code> element, then change the <a
- href="#insertion0">insertion mode</a> to "<a href="#after6"
- title="insertion mode: after frameset">after frameset</a>".</p>
+ <dt>A start tag whose tag name is "frameset"
- <dt>A start tag whose tag name is "frame"
+ <dd>
+ <p><a href="#insert" title="Insert an HTML element">Insert a
+ <code>frameset</code> element</a> for the token.</p>
- <dd>
- <p><a href="#insert">Insert an HTML element</a> for the token.
- Immediately pop the <a href="#current4">current node</a> off the <a
- href="#stack">stack of open elements</a>.</p>
+ <dt>An end tag whose tag name is "frameset"
- <dt>A start tag whose tag name is "noframes"
+ <dd>
+ <p>If the <a href="#current4">current node</a> is the root <code><a
+ href="#html">html</a></code> element, then this is a <a
+ href="#parse0">parse error</a>; ignore the token. (<a
+ href="#fragment">fragment case</a>)</p>
- <dd>
- <p>Process the token as if the <a href="#insertion0">insertion
- mode</a> had been "<a href="#in-body" title="insertion mode: in
- body">in body</a>".</p>
+ <p>Otherwise, pop the <a href="#current4">current node</a> from the <a
+ href="#stack">stack of open elements</a>.</p>
- <dt>Anything else
+ <p>If the parser was <em>not</em> originally created as part of the <a
+ href="#html-fragment0">HTML fragment parsing algorithm</a> (<a
+ href="#fragment">fragment case</a>), and the <a href="#current4">current
+ node</a> is no longer a <code>frameset</code> element, then change the
+ <a href="#insertion0">insertion mode</a> to "<a href="#after6"
+ title="insertion mode: after frameset">after frameset</a>".</p>
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- </dl>
+ <dt>A start tag whose tag name is "frame"
- <dt id=parsing-main-afterframeset>If the <a href="#insertion0">insertion
- mode</a> is "<dfn id=after6 title="insertion mode: after
- frameset">after frameset</dfn>"
+ <dd>
+ <p><a href="#insert">Insert an HTML element</a> for the token.
+ Immediately pop the <a href="#current4">current node</a> off the <a
+ href="#stack">stack of open elements</a>.</p>
- <dd>
- <p>Handle the token as follows:</p>
+ <dt>A start tag whose tag name is "noframes"
- <dl class=switch>
- <dt>An end-of-file token
+ <dd>
+ <p>Process the token as if the <a href="#insertion0">insertion mode</a>
+ had been "<a href="#in-body" title="insertion mode: in body">in
+ body</a>".</p>
- <dd>
- <p><a href="#stops">Stop parsing, with prejudice.</a></p>
+ <dt>Anything else
- <dt>A character token that is one of one of U+0009 CHARACTER
- TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
- FORM FEED (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ </dl>
- <dd>
- <p><a href="#append" title="append a character">Append the
- character</a> to the <a href="#current4">current node</a>.</p>
+ <h6 id=parsing-main-afterframeset><span class=secno>8.2.4.3.21. </span>The
+ <dfn id=after6 title="insertion mode: after frameset">after frameset</dfn>
+ insertion mode</h6>
- <dt>A comment token
+ <p>Handle the token as follows:
- <dd>
- <p>Append a <code>Comment</code> node to the <a
- href="#current4">current node</a> with the <code
- title="">data</code> attribute set to the data given in the comment
- token.</p>
+ <dl class=switch>
+ <dt>An end-of-file token
- <dt>A DOCTYPE token
+ <dd>
+ <p><a href="#stops">Stop parsing, with prejudice.</a></p>
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
+ <dt>A character token that is one of one of U+0009 CHARACTER TABULATION,
+ U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF),
+ <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
- <dt>A start tag whose tag name is "html"
+ <dd>
+ <p><a href="#append" title="append a character">Append the character</a>
+ to the <a href="#current4">current node</a>.</p>
- <dd>
- <p>Process the token as if the <a href="#insertion0">insertion
- mode</a> had been "<a href="#in-body" title="insertion mode: in
- body">in body</a>".</p>
+ <dt>A comment token
- <dt>An end tag whose tag name is "html"
+ <dd>
+ <p>Append a <code>Comment</code> node to the <a href="#current4">current
+ node</a> with the <code title="">data</code> attribute set to the data
+ given in the comment token.</p>
- <dd>
- <p>Switch to <a href="#the-trailing0">the trailing end phase</a>.</p>
+ <dt>A DOCTYPE token
- <dt>A start tag whose tag name is "noframes"
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- <dd>
- <p>Process the token as if the <a href="#insertion0">insertion
- mode</a> had been "<a href="#in-body" title="insertion mode: in
- body">in body</a>".</p>
+ <dt>A start tag whose tag name is "html"
- <dt>Anything else
+ <dd>
+ <p>Process the token as if the <a href="#insertion0">insertion mode</a>
+ had been "<a href="#in-body" title="insertion mode: in body">in
+ body</a>".</p>
- <dd>
- <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
- </dl>
- </dl>
+ <dt>An end tag whose tag name is "html"
+
+ <dd>
+ <p>Switch to <a href="#the-trailing0">the trailing end phase</a>.</p>
+
+ <dt>A start tag whose tag name is "noframes"
+
+ <dd>
+ <p>Process the token as if the <a href="#insertion0">insertion mode</a>
+ had been "<a href="#in-body" title="insertion mode: in body">in
+ body</a>".</p>
+
+ <dt>Anything else
+
+ <dd>
+ <p><a href="#parse0">Parse error</a>. Ignore the token.</p>
</dl>
<p class=big-issue>This doesn't handle UAs that don't support frames, or
Modified: source
===================================================================
--- source 2008-03-03 00:43:43 UTC (rev 1308)
+++ source 2008-03-03 01:02:46 UTC (rev 1309)
@@ -38516,23 +38516,8 @@
-->
+ <h6>The <dfn title="insertion mode: before head">before head</dfn> insertion mode</h6>
- <h6>How to handle tokens in the main phase</h6>
-
- <p>Tokens in the main phase must be handled as follows:</p>
-
- <dl class="switch">
-
- <dt>Anything else</dt>
- <dd>
-
- <p>Depends on the <span>insertion mode</span>:</p>
-
- <dl class="switch">
-
- <dt>If the <span>insertion mode</span> is "<dfn title="insertion mode: before head">before head</dfn>"</dt>
- <dd>
-
<p>Handle the token as follows:</p>
<dl class="switch">
@@ -38639,12 +38624,9 @@
</dl>
- </dd>
+ <h6 id="parsing-main-inhead">The <dfn title="insertion mode: in head">in head</dfn> insertion mode</h6>
- <dt id="parsing-main-inhead">If the <span>insertion mode</span> is "<dfn title="insertion mode: in head">in head</dfn>"</dt>
- <dd>
-
<p>Handle the token as follows.</p>
<dl class="switch">
@@ -38906,11 +38888,10 @@
</dl>
- </dd>
+ <h6 id="parsing-main-inheadnoscript">The <dfn title="insertion mode: in head noscript">in head noscript</dfn> insertion mode</h6>
- <dt id="parsing-main-inheadnoscript">If the <span>insertion mode</span> is "<dfn title="insertion mode: in head noscript">in head noscript</dfn>"</dt>
- <dd>
+ <p>Handle the token as follows.</p>
<dl class="switch">
@@ -38976,12 +38957,9 @@
</dl>
- </dd>
+ <h6>The <dfn title="insertion mode: after head">after head</dfn> insertion mode</h6>
- <dt>If the <span>insertion mode</span> is "<dfn title="insertion mode: after head">after head</dfn>"</dt>
- <dd>
-
<p>Handle the token as follows:</p>
<dl class="switch">
@@ -39071,12 +39049,9 @@
</dl>
- </dd>
+ <h6 id="parsing-main-inbody">The <dfn title="insertion mode: in body">in body</dfn> insertion mode</h6>
- <dt id="parsing-main-inbody">If the <span>insertion mode</span> is "<dfn title="insertion mode: in body">in body</dfn>"</dt>
- <dd>
-
<p>Handle the token as follows:</p>
<dl class="switch">
@@ -40111,12 +40086,9 @@
</dl>
- </dd>
+ <h6 id="parsing-main-intable">The <dfn title="insertion mode: in table">in table</dfn> insertion mode</h6>
- <dt id="parsing-main-intable">If the <span>insertion mode</span> is "<dfn title="insertion mode: in table">in table</dfn>"</dt>
- <dd>
-
<dl class="switch">
<dt>An end-of-file token</dt>
@@ -40302,11 +40274,10 @@
<code>html</code> element after this process is a <span>fragment
case</span>.</p>
- </dd>
+ <h6 id="parsing-main-incaption">The <dfn title="insertion mode: in caption">in caption</dfn> insertion mode</h6>
- <dt id="parsing-main-incaption">If the <span>insertion mode</span> is "<dfn title="insertion mode: in caption">in caption</dfn>"</dt>
- <dd>
+ <p>Handle the token as follows.</p>
<dl class="switch">
@@ -40367,11 +40338,10 @@
</dl>
- </dd>
+ <h6 id="parsing-main-incolgroup">The <dfn title="insertion mode: in column group">in column group</dfn> insertion mode</h6>
- <dt id="parsing-main-incolgroup">If the <span>insertion mode</span> is "<dfn title="insertion mode: in column group">in column group</dfn>"</dt>
- <dd>
+ <p>Handle the token as follows.</p>
<dl class="switch">
@@ -40450,11 +40420,10 @@
</dl>
- </dd>
+ <h6 id="parsing-main-intbody">The <dfn title="insertion mode: in table body">in table body</dfn> insertion mode</h6>
- <dt id="parsing-main-intbody">If the <span>insertion mode</span> is "<dfn title="insertion mode: in table body">in table body</dfn>"</dt>
- <dd>
+ <p>Handle the token as follows.</p>
<dl class="switch">
@@ -40548,11 +40517,10 @@
<code>html</code> element after this process is a <span>fragment
case</span>.</p>
- </dd>
+ <h6 id="parsing-main-intr">The <dfn title="insertion mode: in row">in row</dfn> insertion mode</h6>
- <dt id="parsing-main-intr">If the <span>insertion mode</span> is "<dfn title="insertion mode: in row">in row</dfn>"</dt>
- <dd>
+ <p>Handle the token as follows.</p>
<dl class="switch">
@@ -40648,11 +40616,10 @@
<code>html</code> element after this process is a <span>fragment
case</span>.</p>
- </dd>
+ <h6 id="parsing-main-intd">The <dfn title="insertion mode: in cell">in cell</dfn> insertion mode</h6>
- <dt id="parsing-main-intd">If the <span>insertion mode</span> is "<dfn title="insertion mode: in cell">in cell</dfn>"</dt>
- <dd>
+ <p>Handle the token as follows.</p>
<dl class="switch">
@@ -40756,12 +40723,9 @@
mode</span> is "<span title="insertion mode: in cell">in
cell</span>".</p>
- </dd>
+ <h6 id="parsing-main-inselect">The <dfn title="insertion mode: in select">in select</dfn> insertion mode</h6>
- <dt id="parsing-main-inselect">If the <span>insertion mode</span> is "<dfn title="insertion mode: in select">in select</dfn>"</dt>
- <dd>
-
<p>Handle the token as follows:</p>
<dl class="switch">
@@ -40896,12 +40860,9 @@
</dl>
- </dd>
+ <h6 id="parsing-main-afterbody">The <dfn title="insertion mode: after body">after body</dfn> insertion mode</h6>
- <dt id="parsing-main-afterbody">If the <span>insertion mode</span> is "<dfn title="insertion mode: after body">after body</dfn>"</dt>
- <dd>
-
<p>Handle the token as follows:</p>
<dl class="switch">
@@ -40966,12 +40927,9 @@
</dl>
- </dd>
+ <h6 id="parsing-main-inframeset">The <dfn title="insertion mode: in frameset">in frameset</dfn> insertion mode</h6>
- <dt id="parsing-main-inframeset">If the <span>insertion mode</span> is "<dfn title="insertion mode: in frameset">in frameset</dfn>"</dt>
- <dd>
-
<p>Handle the token as follows:</p>
<dl class="switch">
@@ -41056,12 +41014,9 @@
</dl>
- </dd>
+ <h6 id="parsing-main-afterframeset">The <dfn title="insertion mode: after frameset">after frameset</dfn> insertion mode</h6>
- <dt id="parsing-main-afterframeset">If the <span>insertion mode</span> is "<dfn title="insertion mode: after frameset">after frameset</dfn>"</dt>
- <dd>
-
<p>Handle the token as follows:</p>
<dl class="switch">
@@ -41117,14 +41072,6 @@
</dl>
- </dd>
-
- </dl>
-
- </dd>
-
- </dl>
-
<p class="big-issue">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
More information about the Commit-Watchers
mailing list