hixie: Change the 'reset the insertion mode appropriately' algorithm to handle tables in foreign content inside tables. (whatwg r4290)

hixie: Change the 'reset the insertion mode appropriately' algorithm to
handle tables in foreign content inside tables. (whatwg r4290)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.3425&r2=1.3426&f=h
http://html5.org/tools/web-apps-tracker?from=4289&to=4290

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.3425
retrieving revision 1.3426
diff -u -d -r1.3425 -r1.3426
--- Overview.html 23 Oct 2009 05:12:36 -0000 1.3425
+++ Overview.html 23 Oct 2009 05:37:40 -0000 1.3426
@@ -54994,72 +54994,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>
-
-   <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>
+   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 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
@@ -55067,20 +55064,28 @@
    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>

Received on Friday, 23 October 2009 05:38:32 UTC