[html5] r7768 - [cgiowt] (3) Parser change: Handle fragment case for non-HTML nodes. This _shoul [...]

whatwg at whatwg.org whatwg at whatwg.org
Mon Mar 25 15:29:51 PDT 2013


Author: ianh
Date: 2013-03-25 15:29:50 -0700 (Mon, 25 Mar 2013)
New Revision: 7768

Modified:
   complete.html
   index
   source
Log:
[cgiowt] (3) Parser change: Handle fragment case for non-HTML nodes. This _should_ have no effect on any other case, so please do let me know if this breaks any tests!
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=17924
Affected topics: HTML Syntax and Parsing

Modified: complete.html
===================================================================
--- complete.html	2013-03-22 18:17:08 UTC (rev 7767)
+++ complete.html	2013-03-25 22:29:50 UTC (rev 7768)
@@ -248,7 +248,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 22 March 2013</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 25 March 2013</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -85124,18 +85124,19 @@
 
   </ol><h5 id=the-stack-of-open-elements><span class=secno>12.2.3.2 </span>The stack of open elements</h5>
 
+<!--CLEANUP-->
   <p>Initially, the <dfn id=stack-of-open-elements>stack of open elements</dfn> is empty. The
   stack grows downwards; the topmost node on the stack is the first
   one added to the stack, and the bottommost node of the stack is the
   most recently added node in the stack (notwithstanding when the
   stack is manipulated in a random access fashion as part of <a href=#adoptionAgency>the handling for misnested tags</a>).</p>
 
-  <p>The "<a href=#the-before-html-insertion-mode title="insertion mode: before html">before
+  <p class=note>The "<a href=#the-before-html-insertion-mode title="insertion mode: before html">before
   html</a>" <a href=#insertion-mode>insertion mode</a> creates the
   <code><a href=#the-html-element>html</a></code> root element node, which is then added to the
   stack.</p>
 
-  <p>In the <a href=#fragment-case>fragment case</a>, the <a href=#stack-of-open-elements>stack of open
+  <p class=note>In the <a href=#fragment-case>fragment case</a>, the <a href=#stack-of-open-elements>stack of open
   elements</a> is initialized to contain an <code><a href=#the-html-element>html</a></code>
   element that is created as part of <a href=#html-fragment-parsing-algorithm title="html fragment
   parsing algorithm">that algorithm</a>. (The <a href=#fragment-case>fragment
@@ -85147,10 +85148,15 @@
   <a href=#stop-parsing title="stop parsing">finishes</a>.</p>
 
   <p>The <dfn id=current-node>current node</dfn> is the bottommost node in this
-  stack.</p>
+  <a href=#stack-of-open-elements>stack of open elements</a>.</p>
 
-  <p>Elements in the stack fall into the following categories:</p>
+  <p>The <dfn id=adjusted-current-node>adjusted current node</dfn> is the <i title=concept-frag-parse-context><a href=#concept-frag-parse-context>context</a></i>
+  element if the <a href=#stack-of-open-elements>stack of open elements</a> has only one element in it and the parser was
+  created by the <a href=#html-fragment-parsing-algorithm>HTML fragment parsing algorithm</a>; otherwise, the <a href=#adjusted-current-node>adjusted current
+  node</a> is the <a href=#current-node>current node</a>.</p>
 
+  <p>Elements in the <a href=#stack-of-open-elements>stack of open elements</a> fall into the following categories:</p>
+
   <dl><dt><dfn id=special>Special</dfn></dt>
    <dd><p>The following elements have varying levels of special parsing rules: HTML's
    <code><a href=#the-address-element>address</a></code>, <code><a href=#the-applet-element>applet</a></code>, <code><a href=#the-area-element>area</a></code>, <code><a href=#the-article-element>article</a></code>,
@@ -87594,6 +87600,7 @@
   the stack when you hit a limit, or something. -->
 
   <h4 id=tree-construction><span class=secno>12.2.5 </span><dfn>Tree construction</dfn></h4>
+<!--CLEANUP-->
 
   <p>The input to the tree construction stage is a sequence of tokens
   from the <a href=#tokenization>tokenization</a> stage. The tree construction
@@ -87608,13 +87615,13 @@
   <hr><p>As each token is emitted from the tokenizer, the user agent must
   follow the appropriate steps from the following list:</p>
 
-  <dl class=switch><dt>If there is no <a href=#current-node>current node</a></dt>
-   <dt>If the <a href=#current-node>current node</a> is an element in the <a href=#html-namespace-0>HTML namespace</a></dt>
-   <dt>If the <a href=#current-node>current node</a> is a <a href=#mathml-text-integration-point>MathML text integration point</a> and the token is a start tag whose tag name is neither "mglyph" nor "malignmark"</dt>
-   <dt>If the <a href=#current-node>current node</a> is a <a href=#mathml-text-integration-point>MathML text integration point</a> and the token is a character token</dt>
-   <dt>If the <a href=#current-node>current node</a> is an <code title="">annotation-xml</code> element in the <a href=#mathml-namespace>MathML namespace</a> and the token is a start tag whose tag name is "svg"</dt>
-   <dt>If the <a href=#current-node>current node</a> is an <a href=#html-integration-point>HTML integration point</a> and the token is a start tag</dt>
-   <dt>If the <a href=#current-node>current node</a> is an <a href=#html-integration-point>HTML integration point</a> and the token is a character token</dt>
+  <dl class=switch><dt>If there is no <a href=#adjusted-current-node>adjusted current node</a></dt>
+   <dt>If the <a href=#adjusted-current-node>adjusted current node</a> is an element in the <a href=#html-namespace-0>HTML namespace</a></dt>
+   <dt>If the <a href=#adjusted-current-node>adjusted current node</a> is a <a href=#mathml-text-integration-point>MathML text integration point</a> and the token is a start tag whose tag name is neither "mglyph" nor "malignmark"</dt>
+   <dt>If the <a href=#adjusted-current-node>adjusted current node</a> is a <a href=#mathml-text-integration-point>MathML text integration point</a> and the token is a character token</dt>
+   <dt>If the <a href=#adjusted-current-node>adjusted current node</a> is an <code title="">annotation-xml</code> element in the <a href=#mathml-namespace>MathML namespace</a> and the token is a start tag whose tag name is "svg"</dt>
+   <dt>If the <a href=#adjusted-current-node>adjusted current node</a> is an <a href=#html-integration-point>HTML integration point</a> and the token is a start tag</dt>
+   <dt>If the <a href=#adjusted-current-node>adjusted current node</a> is an <a href=#html-integration-point>HTML integration point</a> and the token is a character token</dt>
    <dt>If the token is an end-of-file token</dt>
 
    <dd>Process the token according to the rules given in the section
@@ -87631,7 +87638,7 @@
   if a token had been seen</dfn>, it means that the user agent is to
   follow the appropriate steps from the above list.</p>
 
-  <p>The <a href=#current-node>current node</a> is a <dfn id=mathml-text-integration-point>MathML text
+  <p>A node is a <dfn id=mathml-text-integration-point>MathML text
   integration point</dfn> if it is one of the following elements:</p>
 
   <ul class=brief><li>An <code title="">mi</code> element in the <a href=#mathml-namespace>MathML namespace</a></li>
@@ -87639,7 +87646,7 @@
    <li>An <code title="">mn</code> element in the <a href=#mathml-namespace>MathML namespace</a></li>
    <li>An <code title="">ms</code> element in the <a href=#mathml-namespace>MathML namespace</a></li>
    <li>An <code title="">mtext</code> element in the <a href=#mathml-namespace>MathML namespace</a></li>
-  </ul><p>The <a href=#current-node>current node</a> is an <dfn id=html-integration-point>HTML
+  </ul><p>A node is an <dfn id=html-integration-point>HTML
   integration point</dfn> if it is one of the following elements:</p>
 
   <ul class=brief><li>An <code title="">annotation-xml</code> element in the <a href=#mathml-namespace>MathML namespace</a> whose start tag token had an attribute with the name "encoding" whose value was an <a href=#ascii-case-insensitive>ASCII case-insensitive</a> match for the string "<code title="">text/html</code>"</li>
@@ -91109,6 +91116,7 @@
    </dd>
 
   </dl><h5 id=parsing-main-inforeign><span class=secno>12.2.5.5 </span>The rules for parsing tokens <dfn title="insertion mode: in foreign content">in foreign content</dfn></h5>
+<!--CLEANUP-->
 
   <p>When the user agent is to apply the rules for parsing tokens in foreign content, the user agent must handle the token as follows:</p>
 
@@ -91177,6 +91185,15 @@
 
     <p><a href=#parse-error>Parse error</a>.</p>
 
+    <p>If the <a href=#stack-of-open-elements>stack of open elements</a> does not <a href=#has-an-element-in-scope title="has an element in
+    scope">have an element in scope</a> that is a <a href=#mathml-text-integration-point>MathML text integration point</a>, an
+    <a href=#html-integration-point>HTML integration point</a>, or an element in the <a href=#html-namespace-0>HTML namespace</a>, or if the
+    <a href=#stack-of-open-elements>stack of open elements</a> has only one element, then process the token <a href=#using-the-rules-for>using the
+    rules for</a> the "<a href=#parsing-main-inbody title="insertion mode: in body">in body</a>" <a href=#insertion-mode>insertion
+    mode</a>. (<a href=#fragment-case>fragment case</a>)</p>
+
+    <p>Otherwise:</p>
+
     <p>Pop an element from the <a href=#stack-of-open-elements>stack of open elements</a>,
     and then keep popping more elements from the <a href=#stack-of-open-elements>stack of open
     elements</a> until the <a href=#current-node>current node</a> is a
@@ -91324,7 +91341,10 @@
      same tag name as the token, then this is a <a href=#parse-error>parse
      error</a>.</li>
 
-     <li><p><i>Loop</i>: If <var title="">node</var>'s tag name,
+     <li><p><i>Loop</i>: If <var title="">node</var> is the topmost element in the <a href=#stack-of-open-elements>stack of
+     open elements</a>, abort these steps. (<a href=#fragment-case>fragment case</a>)</li>
+
+     <li><p>If <var title="">node</var>'s tag name,
      <a href=#converted-to-ascii-lowercase>converted to ASCII lowercase</a>, is the same as the tag
      name of the token, pop elements from the <a href=#stack-of-open-elements>stack of open
      elements</a> until <var title="">node</var> has been popped

Modified: index
===================================================================
--- index	2013-03-22 18:17:08 UTC (rev 7767)
+++ index	2013-03-25 22:29:50 UTC (rev 7768)
@@ -248,7 +248,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 22 March 2013</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 25 March 2013</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -85124,18 +85124,19 @@
 
   </ol><h5 id=the-stack-of-open-elements><span class=secno>12.2.3.2 </span>The stack of open elements</h5>
 
+<!--CLEANUP-->
   <p>Initially, the <dfn id=stack-of-open-elements>stack of open elements</dfn> is empty. The
   stack grows downwards; the topmost node on the stack is the first
   one added to the stack, and the bottommost node of the stack is the
   most recently added node in the stack (notwithstanding when the
   stack is manipulated in a random access fashion as part of <a href=#adoptionAgency>the handling for misnested tags</a>).</p>
 
-  <p>The "<a href=#the-before-html-insertion-mode title="insertion mode: before html">before
+  <p class=note>The "<a href=#the-before-html-insertion-mode title="insertion mode: before html">before
   html</a>" <a href=#insertion-mode>insertion mode</a> creates the
   <code><a href=#the-html-element>html</a></code> root element node, which is then added to the
   stack.</p>
 
-  <p>In the <a href=#fragment-case>fragment case</a>, the <a href=#stack-of-open-elements>stack of open
+  <p class=note>In the <a href=#fragment-case>fragment case</a>, the <a href=#stack-of-open-elements>stack of open
   elements</a> is initialized to contain an <code><a href=#the-html-element>html</a></code>
   element that is created as part of <a href=#html-fragment-parsing-algorithm title="html fragment
   parsing algorithm">that algorithm</a>. (The <a href=#fragment-case>fragment
@@ -85147,10 +85148,15 @@
   <a href=#stop-parsing title="stop parsing">finishes</a>.</p>
 
   <p>The <dfn id=current-node>current node</dfn> is the bottommost node in this
-  stack.</p>
+  <a href=#stack-of-open-elements>stack of open elements</a>.</p>
 
-  <p>Elements in the stack fall into the following categories:</p>
+  <p>The <dfn id=adjusted-current-node>adjusted current node</dfn> is the <i title=concept-frag-parse-context><a href=#concept-frag-parse-context>context</a></i>
+  element if the <a href=#stack-of-open-elements>stack of open elements</a> has only one element in it and the parser was
+  created by the <a href=#html-fragment-parsing-algorithm>HTML fragment parsing algorithm</a>; otherwise, the <a href=#adjusted-current-node>adjusted current
+  node</a> is the <a href=#current-node>current node</a>.</p>
 
+  <p>Elements in the <a href=#stack-of-open-elements>stack of open elements</a> fall into the following categories:</p>
+
   <dl><dt><dfn id=special>Special</dfn></dt>
    <dd><p>The following elements have varying levels of special parsing rules: HTML's
    <code><a href=#the-address-element>address</a></code>, <code><a href=#the-applet-element>applet</a></code>, <code><a href=#the-area-element>area</a></code>, <code><a href=#the-article-element>article</a></code>,
@@ -87594,6 +87600,7 @@
   the stack when you hit a limit, or something. -->
 
   <h4 id=tree-construction><span class=secno>12.2.5 </span><dfn>Tree construction</dfn></h4>
+<!--CLEANUP-->
 
   <p>The input to the tree construction stage is a sequence of tokens
   from the <a href=#tokenization>tokenization</a> stage. The tree construction
@@ -87608,13 +87615,13 @@
   <hr><p>As each token is emitted from the tokenizer, the user agent must
   follow the appropriate steps from the following list:</p>
 
-  <dl class=switch><dt>If there is no <a href=#current-node>current node</a></dt>
-   <dt>If the <a href=#current-node>current node</a> is an element in the <a href=#html-namespace-0>HTML namespace</a></dt>
-   <dt>If the <a href=#current-node>current node</a> is a <a href=#mathml-text-integration-point>MathML text integration point</a> and the token is a start tag whose tag name is neither "mglyph" nor "malignmark"</dt>
-   <dt>If the <a href=#current-node>current node</a> is a <a href=#mathml-text-integration-point>MathML text integration point</a> and the token is a character token</dt>
-   <dt>If the <a href=#current-node>current node</a> is an <code title="">annotation-xml</code> element in the <a href=#mathml-namespace>MathML namespace</a> and the token is a start tag whose tag name is "svg"</dt>
-   <dt>If the <a href=#current-node>current node</a> is an <a href=#html-integration-point>HTML integration point</a> and the token is a start tag</dt>
-   <dt>If the <a href=#current-node>current node</a> is an <a href=#html-integration-point>HTML integration point</a> and the token is a character token</dt>
+  <dl class=switch><dt>If there is no <a href=#adjusted-current-node>adjusted current node</a></dt>
+   <dt>If the <a href=#adjusted-current-node>adjusted current node</a> is an element in the <a href=#html-namespace-0>HTML namespace</a></dt>
+   <dt>If the <a href=#adjusted-current-node>adjusted current node</a> is a <a href=#mathml-text-integration-point>MathML text integration point</a> and the token is a start tag whose tag name is neither "mglyph" nor "malignmark"</dt>
+   <dt>If the <a href=#adjusted-current-node>adjusted current node</a> is a <a href=#mathml-text-integration-point>MathML text integration point</a> and the token is a character token</dt>
+   <dt>If the <a href=#adjusted-current-node>adjusted current node</a> is an <code title="">annotation-xml</code> element in the <a href=#mathml-namespace>MathML namespace</a> and the token is a start tag whose tag name is "svg"</dt>
+   <dt>If the <a href=#adjusted-current-node>adjusted current node</a> is an <a href=#html-integration-point>HTML integration point</a> and the token is a start tag</dt>
+   <dt>If the <a href=#adjusted-current-node>adjusted current node</a> is an <a href=#html-integration-point>HTML integration point</a> and the token is a character token</dt>
    <dt>If the token is an end-of-file token</dt>
 
    <dd>Process the token according to the rules given in the section
@@ -87631,7 +87638,7 @@
   if a token had been seen</dfn>, it means that the user agent is to
   follow the appropriate steps from the above list.</p>
 
-  <p>The <a href=#current-node>current node</a> is a <dfn id=mathml-text-integration-point>MathML text
+  <p>A node is a <dfn id=mathml-text-integration-point>MathML text
   integration point</dfn> if it is one of the following elements:</p>
 
   <ul class=brief><li>An <code title="">mi</code> element in the <a href=#mathml-namespace>MathML namespace</a></li>
@@ -87639,7 +87646,7 @@
    <li>An <code title="">mn</code> element in the <a href=#mathml-namespace>MathML namespace</a></li>
    <li>An <code title="">ms</code> element in the <a href=#mathml-namespace>MathML namespace</a></li>
    <li>An <code title="">mtext</code> element in the <a href=#mathml-namespace>MathML namespace</a></li>
-  </ul><p>The <a href=#current-node>current node</a> is an <dfn id=html-integration-point>HTML
+  </ul><p>A node is an <dfn id=html-integration-point>HTML
   integration point</dfn> if it is one of the following elements:</p>
 
   <ul class=brief><li>An <code title="">annotation-xml</code> element in the <a href=#mathml-namespace>MathML namespace</a> whose start tag token had an attribute with the name "encoding" whose value was an <a href=#ascii-case-insensitive>ASCII case-insensitive</a> match for the string "<code title="">text/html</code>"</li>
@@ -91109,6 +91116,7 @@
    </dd>
 
   </dl><h5 id=parsing-main-inforeign><span class=secno>12.2.5.5 </span>The rules for parsing tokens <dfn title="insertion mode: in foreign content">in foreign content</dfn></h5>
+<!--CLEANUP-->
 
   <p>When the user agent is to apply the rules for parsing tokens in foreign content, the user agent must handle the token as follows:</p>
 
@@ -91177,6 +91185,15 @@
 
     <p><a href=#parse-error>Parse error</a>.</p>
 
+    <p>If the <a href=#stack-of-open-elements>stack of open elements</a> does not <a href=#has-an-element-in-scope title="has an element in
+    scope">have an element in scope</a> that is a <a href=#mathml-text-integration-point>MathML text integration point</a>, an
+    <a href=#html-integration-point>HTML integration point</a>, or an element in the <a href=#html-namespace-0>HTML namespace</a>, or if the
+    <a href=#stack-of-open-elements>stack of open elements</a> has only one element, then process the token <a href=#using-the-rules-for>using the
+    rules for</a> the "<a href=#parsing-main-inbody title="insertion mode: in body">in body</a>" <a href=#insertion-mode>insertion
+    mode</a>. (<a href=#fragment-case>fragment case</a>)</p>
+
+    <p>Otherwise:</p>
+
     <p>Pop an element from the <a href=#stack-of-open-elements>stack of open elements</a>,
     and then keep popping more elements from the <a href=#stack-of-open-elements>stack of open
     elements</a> until the <a href=#current-node>current node</a> is a
@@ -91324,7 +91341,10 @@
      same tag name as the token, then this is a <a href=#parse-error>parse
      error</a>.</li>
 
-     <li><p><i>Loop</i>: If <var title="">node</var>'s tag name,
+     <li><p><i>Loop</i>: If <var title="">node</var> is the topmost element in the <a href=#stack-of-open-elements>stack of
+     open elements</a>, abort these steps. (<a href=#fragment-case>fragment case</a>)</li>
+
+     <li><p>If <var title="">node</var>'s tag name,
      <a href=#converted-to-ascii-lowercase>converted to ASCII lowercase</a>, is the same as the tag
      name of the token, pop elements from the <a href=#stack-of-open-elements>stack of open
      elements</a> until <var title="">node</var> has been popped

Modified: source
===================================================================
--- source	2013-03-22 18:17:08 UTC (rev 7767)
+++ source	2013-03-25 22:29:50 UTC (rev 7768)
@@ -99962,6 +99962,7 @@
 
   <h5>The stack of open elements</h5>
 
+<!--CLEANUP-->
   <p>Initially, the <dfn>stack of open elements</dfn> is empty. The
   stack grows downwards; the topmost node on the stack is the first
   one added to the stack, and the bottommost node of the stack is the
@@ -99969,12 +99970,12 @@
   stack is manipulated in a random access fashion as part of <a
   href="#adoptionAgency">the handling for misnested tags</a>).</p>
 
-  <p>The "<span title="insertion mode: before html">before
+  <p class="note">The "<span title="insertion mode: before html">before
   html</span>" <span>insertion mode</span> creates the
   <code>html</code> root element node, which is then added to the
   stack.</p>
 
-  <p>In the <span>fragment case</span>, the <span>stack of open
+  <p class="note">In the <span>fragment case</span>, the <span>stack of open
   elements</span> is initialized to contain an <code>html</code>
   element that is created as part of <span title="html fragment
   parsing algorithm">that algorithm</span>. (The <span>fragment
@@ -99986,10 +99987,15 @@
   <span title="stop parsing">finishes</span>.</p>
 
   <p>The <dfn>current node</dfn> is the bottommost node in this
-  stack.</p>
+  <span>stack of open elements</span>.</p>
 
-  <p>Elements in the stack fall into the following categories:</p>
+  <p>The <dfn>adjusted current node</dfn> is the <i title="concept-frag-parse-context">context</i>
+  element if the <span>stack of open elements</span> has only one element in it and the parser was
+  created by the <span>HTML fragment parsing algorithm</span>; otherwise, the <span>adjusted current
+  node</span> is the <span>current node</span>.</p>
 
+  <p>Elements in the <span>stack of open elements</span> fall into the following categories:</p>
+
   <dl>
 
    <dt><dfn>Special</dfn></dt>
@@ -102810,6 +102816,7 @@
   the stack when you hit a limit, or something. -->
 
   <h4><dfn>Tree construction</dfn></h4>
+<!--CLEANUP-->
 
   <p>The input to the tree construction stage is a sequence of tokens
   from the <span>tokenization</span> stage. The tree construction
@@ -102828,13 +102835,13 @@
 
   <dl class="switch">
 
-   <dt>If there is no <span>current node</span></dt>
-   <dt>If the <span>current node</span> is an element in the <span>HTML namespace</span></dt>
-   <dt>If the <span>current node</span> is a <span>MathML text integration point</span> and the token is a start tag whose tag name is neither "mglyph" nor "malignmark"</dt>
-   <dt>If the <span>current node</span> is a <span>MathML text integration point</span> and the token is a character token</dt>
-   <dt>If the <span>current node</span> is an <code title="">annotation-xml</code> element in the <span>MathML namespace</span> and the token is a start tag whose tag name is "svg"</dt>
-   <dt>If the <span>current node</span> is an <span>HTML integration point</span> and the token is a start tag</dt>
-   <dt>If the <span>current node</span> is an <span>HTML integration point</span> and the token is a character token</dt>
+   <dt>If there is no <span>adjusted current node</span></dt>
+   <dt>If the <span>adjusted current node</span> is an element in the <span>HTML namespace</span></dt>
+   <dt>If the <span>adjusted current node</span> is a <span>MathML text integration point</span> and the token is a start tag whose tag name is neither "mglyph" nor "malignmark"</dt>
+   <dt>If the <span>adjusted current node</span> is a <span>MathML text integration point</span> and the token is a character token</dt>
+   <dt>If the <span>adjusted current node</span> is an <code title="">annotation-xml</code> element in the <span>MathML namespace</span> and the token is a start tag whose tag name is "svg"</dt>
+   <dt>If the <span>adjusted current node</span> is an <span>HTML integration point</span> and the token is a start tag</dt>
+   <dt>If the <span>adjusted current node</span> is an <span>HTML integration point</span> and the token is a character token</dt>
    <dt>If the token is an end-of-file token</dt>
 
    <dd>Process the token according to the rules given in the section
@@ -102853,7 +102860,7 @@
   if a token had been seen</dfn>, it means that the user agent is to
   follow the appropriate steps from the above list.</p>
 
-  <p>The <span>current node</span> is a <dfn>MathML text
+  <p>A node is a <dfn>MathML text
   integration point</dfn> if it is one of the following elements:</p>
 
   <ul class="brief">
@@ -102864,7 +102871,7 @@
    <li>An <code title="">mtext</code> element in the <span>MathML namespace</span></li>
   </ul>
 
-  <p>The <span>current node</span> is an <dfn>HTML
+  <p>A node is an <dfn>HTML
   integration point</dfn> if it is one of the following elements:</p>
 
   <ul class="brief">
@@ -106688,6 +106695,7 @@
 
 
   <h5 id="parsing-main-inforeign">The rules for parsing tokens <dfn title="insertion mode: in foreign content">in foreign content</dfn></h5>
+<!--CLEANUP-->
 
   <p>When the user agent is to apply the rules for parsing tokens in foreign content, the user agent must handle the token as follows:</p>
 
@@ -106758,6 +106766,15 @@
 
     <p><span>Parse error</span>.</p>
 
+    <p>If the <span>stack of open elements</span> does not <span title="has an element in
+    scope">have an element in scope</span> that is a <span>MathML text integration point</span>, an
+    <span>HTML integration point</span>, or an element in the <span>HTML namespace</span>, or if the
+    <span>stack of open elements</span> has only one element, then process the token <span>using the
+    rules for</span> the "<span title="insertion mode: in body">in body</span>" <span>insertion
+    mode</span>. (<span>fragment case</span>)</p>
+
+    <p>Otherwise:</p>
+
     <p>Pop an element from the <span>stack of open elements</span>,
     and then keep popping more elements from the <span>stack of open
     elements</span> until the <span>current node</span> is a
@@ -106920,7 +106937,10 @@
      same tag name as the token, then this is a <span>parse
      error</span>.</p></li>
 
-     <li><p><i>Loop</i>: If <var title="">node</var>'s tag name,
+     <li><p><i>Loop</i>: If <var title="">node</var> is the topmost element in the <span>stack of
+     open elements</span>, abort these steps. (<span>fragment case</span>)</p></li>
+
+     <li><p>If <var title="">node</var>'s tag name,
      <span>converted to ASCII lowercase</span>, is the same as the tag
      name of the token, pop elements from the <span>stack of open
      elements</span> until <var title="">node</var> has been popped




More information about the Commit-Watchers mailing list