[html5] r4290 - [cgiowt] (2) Change the 'reset the insertion mode appropriately' algorithm to ha [...]

whatwg at whatwg.org whatwg at whatwg.org
Thu Oct 22 22:50:45 PDT 2009


Author: ianh
Date: 2009-10-22 22:50:41 -0700 (Thu, 22 Oct 2009)
New Revision: 4290

Modified:
   complete.html
   index
   source
Log:
[cgiowt] (2) Change the 'reset the insertion mode appropriately' algorithm to handle tables in foreign content inside tables.
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=7992

Modified: complete.html
===================================================================
--- complete.html	2009-10-23 05:27:17 UTC (rev 4289)
+++ complete.html	2009-10-23 05:50:41 UTC (rev 4290)
@@ -70349,72 +70349,69 @@
 
   <ol><li>Let <var title="">last</var> be false.</li>
 
+   <li>Let <var title="">foreign</var> be false.</li>
+
    <li>Let <var title="">node</var> be the last node in the
    <a href=#stack-of-open-elements>stack of open elements</a>.</li>
 
-   <li>If <var title="">node</var> is the first node in the stack of
-   open elements, then set <var title="">last</var> to true and set
-   <var title="">node</var> to the <var title="">context</var>
-   element. (<a href=#fragment-case>fragment case</a>)</li>
+   <li><i>Loop</i>: If <var title="">node</var> is the first node in
+   the stack of open elements, then set <var title="">last</var> to
+   true and set <var title="">node</var> to the <var title="">context</var> element. (<a href=#fragment-case>fragment case</a>)</li>
 
    <li>If <var title="">node</var> is a <code><a href=#the-select-element>select</a></code> element,
-   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inselect title="insertion mode: in select">in select</a>" and abort these
-   steps. (<a href=#fragment-case>fragment case</a>)</li>
+   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inselect title="insertion mode: in select">in select</a>" and jump to the
+   step marked <i title="">end</i>. (<a href=#fragment-case>fragment case</a>)</li>
 
    <li>If <var title="">node</var> is a <code><a href=#the-td-element>td</a></code> or
    <code><a href=#the-th-element>th</a></code> element and <var title="">last</var> is false, then
    switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-intd title="insertion
-   mode: in cell">in cell</a>" and abort these steps.</li>
+   mode: in cell">in cell</a>" and jump to the step marked <i title="">end</i>.</li>
 
    <li>If <var title="">node</var> is a <code><a href=#the-tr-element>tr</a></code> element, then
    switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-intr title="insertion
-   mode: in row">in row</a>" and abort these steps.</li>
+   mode: in row">in row</a>" and jump to the step marked <i title="">end</i>.</li>
 
    <li>If <var title="">node</var> is a <code><a href=#the-tbody-element>tbody</a></code>,
    <code><a href=#the-thead-element>thead</a></code>, or <code><a href=#the-tfoot-element>tfoot</a></code> element, then switch the
    <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-intbody title="insertion mode: in
-   table body">in table body</a>" and abort these steps.</li>
+   table body">in table body</a>" and jump to the step marked <i title="">end</i>.</li>
 
    <li>If <var title="">node</var> is a <code><a href=#the-caption-element>caption</a></code> element,
-   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-incaption title="insertion mode: in caption">in caption</a>" and abort
-   these steps.</li>
+   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-incaption title="insertion mode: in caption">in caption</a>" and jump to
+   the step marked <i title="">end</i>.</li>
 
    <li>If <var title="">node</var> is a <code><a href=#the-colgroup-element>colgroup</a></code> element,
    then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-incolgroup title="insertion mode: in column group">in column group</a>" and
-   abort these steps. (<a href=#fragment-case>fragment case</a>)</li>
+   jump to the step marked <i title="">end</i>. (<a href=#fragment-case>fragment
+   case</a>)</li>
 
    <li>If <var title="">node</var> is a <code><a href=#the-table-element>table</a></code> element,
-   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-intable title="insertion mode: in table">in table</a>" and abort these
-   steps.</li>
+   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-intable title="insertion mode: in table">in table</a>" and jump to the
+   step marked <i title="">end</i>.</li>
 
-   <li>If <var title="">node</var> is an element from the <a href=#mathml-namespace>MathML
-   namespace</a> or the <a href=#svg-namespace>SVG namespace</a>, then switch the
-   <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inforeign title="insertion mode: in
-   foreign content">in foreign content</a>", let the
-   <a href=#secondary-insertion-mode>secondary insertion mode</a> be "<a href=#parsing-main-inbody title="insertion
-   mode: in body">in body</a>", and abort these steps.</li>
-
    <li>If <var title="">node</var> is a <code><a href=#the-head-element-0>head</a></code> element,
-   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inbody title="insertion mode: in body">in body</a>" ("<a href=#parsing-main-inbody title="insertion mode: in body">in body</a>"! <em> not "<a href=#parsing-main-inhead title="insertion mode: in head">in head</a>"</em>!) and abort
-   these steps. (<a href=#fragment-case>fragment case</a>)</li> <!-- This is only
-   here for now in case people think that the spec accidentally
-   omitted it and try to "fix" it. Note that noscript-in-head is also
-   handled this way. This is all intentional. The only thing it
-   doesn't handle is the scripting-disabled fragment parsing case for
-   a <head> element containing a <noscript> which itself contains
-   something other than a <link> or a <style> element; you'd expect
-   that to break out of the <noscript> but it doesn't. This is an edge
-   case that doesn't affect the spec, since the algorithm for fragment
-   parsing is only used for innerHTML/outerHTML/insertAdjacentHTML(),
-   where we know scripting is enabled. -->
+   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inbody title="insertion mode: in body">in body</a>" ("<a href=#parsing-main-inbody title="insertion mode: in body">in body</a>"! <em> not "<a href=#parsing-main-inhead title="insertion mode: in head">in head</a>"</em>!) and jump to
+   the step marked <i title="">end</i>. (<a href=#fragment-case>fragment
+   case</a>)</li> <!-- This is only here for now in case people
+   think that the spec accidentally omitted it and try to "fix"
+   it. Note that noscript-in-head is also handled this way. This is
+   all intentional. The only thing it doesn't handle is the
+   scripting-disabled fragment parsing case for a <head> element
+   containing a <noscript> which itself contains something other than
+   a <link> or a <style> element; you'd expect that to break out of
+   the <noscript> but it doesn't. This is an edge case that doesn't
+   affect the spec, since the algorithm for fragment parsing is only
+   used for innerHTML/outerHTML/insertAdjacentHTML(), where we know
+   scripting is enabled. -->
 
    <li>If <var title="">node</var> is a <code><a href=#the-body-element-0>body</a></code> element,
-   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inbody title="insertion mode: in body">in body</a>" and abort these
-   steps.</li>
+   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inbody title="insertion mode: in body">in body</a>" and jump to the
+   step marked <i title="">end</i>.</li>
 
    <li>If <var title="">node</var> is a <code><a href=#frameset>frameset</a></code> element,
-   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inframeset title="insertion mode: in frameset">in frameset</a>" and abort
-   these steps. (<a href=#fragment-case>fragment case</a>)</li>
+   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inframeset title="insertion mode: in frameset">in frameset</a>" and jump to
+   the step marked <i title="">end</i>. (<a href=#fragment-case>fragment
+   case</a>)</li>
 
    <li>If <var title="">node</var> is an <code><a href=#the-html-element-0>html</a></code> element,
    then <!--: if the <span><code title="">head</code> element
@@ -70422,21 +70419,29 @@
    to "<a href=#the-before-head-insertion-mode title="insertion mode: before head">before
    head</a>"<!--, otherwise, switch the <span>insertion mode</span>
    to "<span title="insertion mode: after head">after head</span>".-->
-   Then, <!-- in either case, --> abort these steps. (<a href=#fragment-case>fragment
-   case</a>)</li> <!-- if the head element pointer can ever be
-   non-null when we're going through these steps, we'll need to
-   uncomment out the commented-out bits -->
+   Then, <!-- in either case, --> jump to the step marked <i title="">end</i>. (<a href=#fragment-case>fragment case</a>)</li> <!-- if the
+   head element pointer can ever be non-null when we're going through
+   these steps, we'll need to uncomment out the commented-out bits -->
 
+   <li>If <var title="">node</var> is an element from the <a href=#mathml-namespace>MathML
+   namespace</a> or the <a href=#svg-namespace>SVG namespace</a>, then set the
+   <var title="">foreign</var> flag to true.</li>
+
    <li>If <var title="">last</var> is true, then switch the
    <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inbody title="insertion mode: in
-   body">in body</a>" and abort these steps. (<a href=#fragment-case>fragment
-   case</a>)</li>
+   body">in body</a>" and jump to the step marked <i title="">end</i>. (<a href=#fragment-case>fragment case</a>)</li>
 
    <li>Let <var title="">node</var> now be the node before <var title="">node</var> in the <a href=#stack-of-open-elements>stack of open
    elements</a>.</li>
 
-   <li>Return to step 3.</li>
+   <li>Return to the step marked <i>loop</i>.</li>
 
+   <li><i>End</i>: If <var title="">foreign</var> is true, switch the
+   <a href=#secondary-insertion-mode>secondary insertion mode</a> to whatever the
+   <a href=#insertion-mode>insertion mode</a> is set to, and switch the
+   <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inforeign title="insertion mode: in
+   foreign content">in foreign content</a>".</li>
+
   </ol><h5 id=the-stack-of-open-elements><span class=secno>11.2.3.2 </span>The stack of open elements</h5>
 
   <p>Initially, the <dfn id=stack-of-open-elements>stack of open elements</dfn> is empty. The

Modified: index
===================================================================
--- index	2009-10-23 05:27:17 UTC (rev 4289)
+++ index	2009-10-23 05:50:41 UTC (rev 4290)
@@ -61341,72 +61341,69 @@
 
   <ol><li>Let <var title="">last</var> be false.</li>
 
+   <li>Let <var title="">foreign</var> be false.</li>
+
    <li>Let <var title="">node</var> be the last node in the
    <a href=#stack-of-open-elements>stack of open elements</a>.</li>
 
-   <li>If <var title="">node</var> is the first node in the stack of
-   open elements, then set <var title="">last</var> to true and set
-   <var title="">node</var> to the <var title="">context</var>
-   element. (<a href=#fragment-case>fragment case</a>)</li>
+   <li><i>Loop</i>: If <var title="">node</var> is the first node in
+   the stack of open elements, then set <var title="">last</var> to
+   true and set <var title="">node</var> to the <var title="">context</var> element. (<a href=#fragment-case>fragment case</a>)</li>
 
    <li>If <var title="">node</var> is a <code><a href=#the-select-element>select</a></code> element,
-   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inselect title="insertion mode: in select">in select</a>" and abort these
-   steps. (<a href=#fragment-case>fragment case</a>)</li>
+   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inselect title="insertion mode: in select">in select</a>" and jump to the
+   step marked <i title="">end</i>. (<a href=#fragment-case>fragment case</a>)</li>
 
    <li>If <var title="">node</var> is a <code><a href=#the-td-element>td</a></code> or
    <code><a href=#the-th-element>th</a></code> element and <var title="">last</var> is false, then
    switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-intd title="insertion
-   mode: in cell">in cell</a>" and abort these steps.</li>
+   mode: in cell">in cell</a>" and jump to the step marked <i title="">end</i>.</li>
 
    <li>If <var title="">node</var> is a <code><a href=#the-tr-element>tr</a></code> element, then
    switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-intr title="insertion
-   mode: in row">in row</a>" and abort these steps.</li>
+   mode: in row">in row</a>" and jump to the step marked <i title="">end</i>.</li>
 
    <li>If <var title="">node</var> is a <code><a href=#the-tbody-element>tbody</a></code>,
    <code><a href=#the-thead-element>thead</a></code>, or <code><a href=#the-tfoot-element>tfoot</a></code> element, then switch the
    <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-intbody title="insertion mode: in
-   table body">in table body</a>" and abort these steps.</li>
+   table body">in table body</a>" and jump to the step marked <i title="">end</i>.</li>
 
    <li>If <var title="">node</var> is a <code><a href=#the-caption-element>caption</a></code> element,
-   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-incaption title="insertion mode: in caption">in caption</a>" and abort
-   these steps.</li>
+   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-incaption title="insertion mode: in caption">in caption</a>" and jump to
+   the step marked <i title="">end</i>.</li>
 
    <li>If <var title="">node</var> is a <code><a href=#the-colgroup-element>colgroup</a></code> element,
    then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-incolgroup title="insertion mode: in column group">in column group</a>" and
-   abort these steps. (<a href=#fragment-case>fragment case</a>)</li>
+   jump to the step marked <i title="">end</i>. (<a href=#fragment-case>fragment
+   case</a>)</li>
 
    <li>If <var title="">node</var> is a <code><a href=#the-table-element>table</a></code> element,
-   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-intable title="insertion mode: in table">in table</a>" and abort these
-   steps.</li>
+   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-intable title="insertion mode: in table">in table</a>" and jump to the
+   step marked <i title="">end</i>.</li>
 
-   <li>If <var title="">node</var> is an element from the <a href=#mathml-namespace>MathML
-   namespace</a> or the <a href=#svg-namespace>SVG namespace</a>, then switch the
-   <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inforeign title="insertion mode: in
-   foreign content">in foreign content</a>", let the
-   <a href=#secondary-insertion-mode>secondary insertion mode</a> be "<a href=#parsing-main-inbody title="insertion
-   mode: in body">in body</a>", and abort these steps.</li>
-
    <li>If <var title="">node</var> is a <code><a href=#the-head-element-0>head</a></code> element,
-   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inbody title="insertion mode: in body">in body</a>" ("<a href=#parsing-main-inbody title="insertion mode: in body">in body</a>"! <em> not "<a href=#parsing-main-inhead title="insertion mode: in head">in head</a>"</em>!) and abort
-   these steps. (<a href=#fragment-case>fragment case</a>)</li> <!-- This is only
-   here for now in case people think that the spec accidentally
-   omitted it and try to "fix" it. Note that noscript-in-head is also
-   handled this way. This is all intentional. The only thing it
-   doesn't handle is the scripting-disabled fragment parsing case for
-   a <head> element containing a <noscript> which itself contains
-   something other than a <link> or a <style> element; you'd expect
-   that to break out of the <noscript> but it doesn't. This is an edge
-   case that doesn't affect the spec, since the algorithm for fragment
-   parsing is only used for innerHTML/outerHTML/insertAdjacentHTML(),
-   where we know scripting is enabled. -->
+   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inbody title="insertion mode: in body">in body</a>" ("<a href=#parsing-main-inbody title="insertion mode: in body">in body</a>"! <em> not "<a href=#parsing-main-inhead title="insertion mode: in head">in head</a>"</em>!) and jump to
+   the step marked <i title="">end</i>. (<a href=#fragment-case>fragment
+   case</a>)</li> <!-- This is only here for now in case people
+   think that the spec accidentally omitted it and try to "fix"
+   it. Note that noscript-in-head is also handled this way. This is
+   all intentional. The only thing it doesn't handle is the
+   scripting-disabled fragment parsing case for a <head> element
+   containing a <noscript> which itself contains something other than
+   a <link> or a <style> element; you'd expect that to break out of
+   the <noscript> but it doesn't. This is an edge case that doesn't
+   affect the spec, since the algorithm for fragment parsing is only
+   used for innerHTML/outerHTML/insertAdjacentHTML(), where we know
+   scripting is enabled. -->
 
    <li>If <var title="">node</var> is a <code><a href=#the-body-element-0>body</a></code> element,
-   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inbody title="insertion mode: in body">in body</a>" and abort these
-   steps.</li>
+   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inbody title="insertion mode: in body">in body</a>" and jump to the
+   step marked <i title="">end</i>.</li>
 
    <li>If <var title="">node</var> is a <code><a href=#frameset>frameset</a></code> element,
-   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inframeset title="insertion mode: in frameset">in frameset</a>" and abort
-   these steps. (<a href=#fragment-case>fragment case</a>)</li>
+   then switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inframeset title="insertion mode: in frameset">in frameset</a>" and jump to
+   the step marked <i title="">end</i>. (<a href=#fragment-case>fragment
+   case</a>)</li>
 
    <li>If <var title="">node</var> is an <code><a href=#the-html-element-0>html</a></code> element,
    then <!--: if the <span><code title="">head</code> element
@@ -61414,21 +61411,29 @@
    to "<a href=#the-before-head-insertion-mode title="insertion mode: before head">before
    head</a>"<!--, otherwise, switch the <span>insertion mode</span>
    to "<span title="insertion mode: after head">after head</span>".-->
-   Then, <!-- in either case, --> abort these steps. (<a href=#fragment-case>fragment
-   case</a>)</li> <!-- if the head element pointer can ever be
-   non-null when we're going through these steps, we'll need to
-   uncomment out the commented-out bits -->
+   Then, <!-- in either case, --> jump to the step marked <i title="">end</i>. (<a href=#fragment-case>fragment case</a>)</li> <!-- if the
+   head element pointer can ever be non-null when we're going through
+   these steps, we'll need to uncomment out the commented-out bits -->
 
+   <li>If <var title="">node</var> is an element from the <a href=#mathml-namespace>MathML
+   namespace</a> or the <a href=#svg-namespace>SVG namespace</a>, then set the
+   <var title="">foreign</var> flag to true.</li>
+
    <li>If <var title="">last</var> is true, then switch the
    <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inbody title="insertion mode: in
-   body">in body</a>" and abort these steps. (<a href=#fragment-case>fragment
-   case</a>)</li>
+   body">in body</a>" and jump to the step marked <i title="">end</i>. (<a href=#fragment-case>fragment case</a>)</li>
 
    <li>Let <var title="">node</var> now be the node before <var title="">node</var> in the <a href=#stack-of-open-elements>stack of open
    elements</a>.</li>
 
-   <li>Return to step 3.</li>
+   <li>Return to the step marked <i>loop</i>.</li>
 
+   <li><i>End</i>: If <var title="">foreign</var> is true, switch the
+   <a href=#secondary-insertion-mode>secondary insertion mode</a> to whatever the
+   <a href=#insertion-mode>insertion mode</a> is set to, and switch the
+   <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-inforeign title="insertion mode: in
+   foreign content">in foreign content</a>".</li>
+
   </ol><h5 id=the-stack-of-open-elements><span class=secno>9.2.3.2 </span>The stack of open elements</h5>
 
   <p>Initially, the <dfn id=stack-of-open-elements>stack of open elements</dfn> is empty. The

Modified: source
===================================================================
--- source	2009-10-23 05:27:17 UTC (rev 4289)
+++ source	2009-10-23 05:50:41 UTC (rev 4290)
@@ -79186,81 +79186,82 @@
 
    <li>Let <var title="">last</var> be false.</li>
 
+   <li>Let <var title="">foreign</var> be false.</li>
+
    <li>Let <var title="">node</var> be the last node in the
    <span>stack of open elements</span>.</li>
 
-   <li>If <var title="">node</var> is the first node in the stack of
-   open elements, then set <var title="">last</var> to true and set
-   <var title="">node</var> to the <var title="">context</var>
-   element. (<span>fragment case</span>)</li>
+   <li><i>Loop</i>: If <var title="">node</var> is the first node in
+   the stack of open elements, then set <var title="">last</var> to
+   true and set <var title="">node</var> to the <var
+   title="">context</var> element. (<span>fragment case</span>)</li>
 
    <li>If <var title="">node</var> is a <code>select</code> element,
    then switch the <span>insertion mode</span> to "<span
-   title="insertion mode: in select">in select</span>" and abort these
-   steps. (<span>fragment case</span>)</li>
+   title="insertion mode: in select">in select</span>" and jump to the
+   step marked <i title="">end</i>. (<span>fragment case</span>)</li>
 
    <li>If <var title="">node</var> is a <code>td</code> or
    <code>th</code> element and <var title="">last</var> is false, then
    switch the <span>insertion mode</span> to "<span title="insertion
-   mode: in cell">in cell</span>" and abort these steps.</li>
+   mode: in cell">in cell</span>" and jump to the step marked <i
+   title="">end</i>.</li>
 
    <li>If <var title="">node</var> is a <code>tr</code> element, then
    switch the <span>insertion mode</span> to "<span title="insertion
-   mode: in row">in row</span>" and abort these steps.</li>
+   mode: in row">in row</span>" and jump to the step marked <i
+   title="">end</i>.</li>
 
    <li>If <var title="">node</var> is a <code>tbody</code>,
    <code>thead</code>, or <code>tfoot</code> element, then switch the
    <span>insertion mode</span> to "<span title="insertion mode: in
-   table body">in table body</span>" and abort these steps.</li>
+   table body">in table body</span>" and jump to the step marked <i
+   title="">end</i>.</li>
 
    <li>If <var title="">node</var> is a <code>caption</code> element,
    then switch the <span>insertion mode</span> to "<span
-   title="insertion mode: in caption">in caption</span>" and abort
-   these steps.</li>
+   title="insertion mode: in caption">in caption</span>" and jump to
+   the step marked <i title="">end</i>.</li>
 
    <li>If <var title="">node</var> is a <code>colgroup</code> element,
    then switch the <span>insertion mode</span> to "<span
    title="insertion mode: in column group">in column group</span>" and
-   abort these steps. (<span>fragment case</span>)</li>
+   jump to the step marked <i title="">end</i>. (<span>fragment
+   case</span>)</li>
 
    <li>If <var title="">node</var> is a <code>table</code> element,
    then switch the <span>insertion mode</span> to "<span
-   title="insertion mode: in table">in table</span>" and abort these
-   steps.</li>
+   title="insertion mode: in table">in table</span>" and jump to the
+   step marked <i title="">end</i>.</li>
 
-   <li>If <var title="">node</var> is an element from the <span>MathML
-   namespace</span> or the <span>SVG namespace</span>, then switch the
-   <span>insertion mode</span> to "<span title="insertion mode: in
-   foreign content">in foreign content</span>", let the
-   <span>secondary insertion mode</span> be "<span title="insertion
-   mode: in body">in body</span>", and abort these steps.</li>
-
    <li>If <var title="">node</var> is a <code>head</code> element,
    then switch the <span>insertion mode</span> to "<span
    title="insertion mode: in body">in body</span>" ("<span
    title="insertion mode: in body">in body</span>"! <em> not "<span
-   title="insertion mode: in head">in head</span>"</em>!) and abort
-   these steps. (<span>fragment case</span>)</li> <!-- This is only
-   here for now in case people think that the spec accidentally
-   omitted it and try to "fix" it. Note that noscript-in-head is also
-   handled this way. This is all intentional. The only thing it
-   doesn't handle is the scripting-disabled fragment parsing case for
-   a <head> element containing a <noscript> which itself contains
-   something other than a <link> or a <style> element; you'd expect
-   that to break out of the <noscript> but it doesn't. This is an edge
-   case that doesn't affect the spec, since the algorithm for fragment
-   parsing is only used for innerHTML/outerHTML/insertAdjacentHTML(),
-   where we know scripting is enabled. -->
+   title="insertion mode: in head">in head</span>"</em>!) and jump to
+   the step marked <i title="">end</i>. (<span>fragment
+   case</span>)</li> <!-- This is only here for now in case people
+   think that the spec accidentally omitted it and try to "fix"
+   it. Note that noscript-in-head is also handled this way. This is
+   all intentional. The only thing it doesn't handle is the
+   scripting-disabled fragment parsing case for a <head> element
+   containing a <noscript> which itself contains something other than
+   a <link> or a <style> element; you'd expect that to break out of
+   the <noscript> but it doesn't. This is an edge case that doesn't
+   affect the spec, since the algorithm for fragment parsing is only
+   used for innerHTML/outerHTML/insertAdjacentHTML(), where we know
+   scripting is enabled. -->
 
    <li>If <var title="">node</var> is a <code>body</code> element,
    then switch the <span>insertion mode</span> to "<span
-   title="insertion mode: in body">in body</span>" and abort these
-   steps.</li>
+   title="insertion mode: in body">in body</span>" and jump to the
+   step marked <i title="">end</i>.</li>
 
    <li>If <var title="">node</var> is a <code>frameset</code> element,
    then switch the <span>insertion mode</span> to "<span
-   title="insertion mode: in frameset">in frameset</span>" and abort
-   these steps. (<span>fragment case</span>)</li>
+   title="insertion mode: in frameset">in frameset</span>" and jump to
+   the step marked <i title="">end</i>. (<span>fragment
+   case</span>)</li>
 
    <li>If <var title="">node</var> is an <code>html</code> element,
    then <!--: if the <span><code title="">head</code> element
@@ -79268,22 +79269,32 @@
    to "<span title="insertion mode: before head">before
    head</span>"<!--, otherwise, switch the <span>insertion mode</span>
    to "<span title="insertion mode: after head">after head</span>".-->
-   Then, <!-- in either case, --> abort these steps. (<span>fragment
-   case</span>)</li> <!-- if the head element pointer can ever be
-   non-null when we're going through these steps, we'll need to
-   uncomment out the commented-out bits -->
+   Then, <!-- in either case, --> jump to the step marked <i
+   title="">end</i>. (<span>fragment case</span>)</li> <!-- if the
+   head element pointer can ever be non-null when we're going through
+   these steps, we'll need to uncomment out the commented-out bits -->
 
+   <li>If <var title="">node</var> is an element from the <span>MathML
+   namespace</span> or the <span>SVG namespace</span>, then set the
+   <var title="">foreign</var> flag to true.</li>
+
    <li>If <var title="">last</var> is true, then switch the
    <span>insertion mode</span> to "<span title="insertion mode: in
-   body">in body</span>" and abort these steps. (<span>fragment
-   case</span>)</li>
+   body">in body</span>" and jump to the step marked <i
+   title="">end</i>. (<span>fragment case</span>)</li>
 
    <li>Let <var title="">node</var> now be the node before <var
    title="">node</var> in the <span>stack of open
    elements</span>.</li>
 
-   <li>Return to step 3.</li>
+   <li>Return to the step marked <i>loop</i>.</li>
 
+   <li><i>End</i>: If <var title="">foreign</var> is true, switch the
+   <span>secondary insertion mode</span> to whatever the
+   <span>insertion mode</span> is set to, and switch the
+   <span>insertion mode</span> to "<span title="insertion mode: in
+   foreign content">in foreign content</span>".</li>
+
   </ol>
 
 




More information about the Commit-Watchers mailing list