[html5] r3382 - [cgt] (2) Change how space characters are handled in tables. Removes 'taint' con [...]

whatwg at whatwg.org whatwg at whatwg.org
Thu Jul 9 17:35:44 PDT 2009


Author: ianh
Date: 2009-07-09 17:35:42 -0700 (Thu, 09 Jul 2009)
New Revision: 3382

Modified:
   index
   source
Log:
[cgt] (2) Change how space characters are handled in tables. Removes 'taint' concept, but adds an insertion mode (that I expect nobody will really implement that way, since the best way to code this is to have string tokens, not character tokens).

Modified: index
===================================================================
--- index	2009-07-08 19:42:09 UTC (rev 3381)
+++ index	2009-07-10 00:35:42 UTC (rev 3382)
@@ -67,7 +67,7 @@
   <div class=head>
    <p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
    <h1>HTML 5</h1>
-   <h2 class="no-num no-toc" id=draft-standard-—-date:-01-jan-1901>Draft Standard — 8 July 2009</h2>
+   <h2 class="no-num no-toc" id=draft-standard-—-date:-01-jan-1901>Draft Standard — 10 July 2009</h2>
    <p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
    <p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
    <!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
@@ -930,19 +930,20 @@
        <li><a href=#parsing-main-inbody><span class=secno>9.2.5.10 </span>The "in body" insertion mode</a></li>
        <li><a href=#parsing-main-incdata><span class=secno>9.2.5.11 </span>The "in CDATA/RCDATA" insertion mode</a></li>
        <li><a href=#parsing-main-intable><span class=secno>9.2.5.12 </span>The "in table" insertion mode</a></li>
-       <li><a href=#parsing-main-incaption><span class=secno>9.2.5.13 </span>The "in caption" insertion mode</a></li>
-       <li><a href=#parsing-main-incolgroup><span class=secno>9.2.5.14 </span>The "in column group" insertion mode</a></li>
-       <li><a href=#parsing-main-intbody><span class=secno>9.2.5.15 </span>The "in table body" insertion mode</a></li>
-       <li><a href=#parsing-main-intr><span class=secno>9.2.5.16 </span>The "in row" insertion mode</a></li>
-       <li><a href=#parsing-main-intd><span class=secno>9.2.5.17 </span>The "in cell" insertion mode</a></li>
-       <li><a href=#parsing-main-inselect><span class=secno>9.2.5.18 </span>The "in select" insertion mode</a></li>
-       <li><a href=#parsing-main-inselectintable><span class=secno>9.2.5.19 </span>The "in select in table" insertion mode</a></li>
-       <li><a href=#parsing-main-inforeign><span class=secno>9.2.5.20 </span>The "in foreign content" insertion mode</a></li>
-       <li><a href=#parsing-main-afterbody><span class=secno>9.2.5.21 </span>The "after body" insertion mode</a></li>
-       <li><a href=#parsing-main-inframeset><span class=secno>9.2.5.22 </span>The "in frameset" insertion mode</a></li>
-       <li><a href=#parsing-main-afterframeset><span class=secno>9.2.5.23 </span>The "after frameset" insertion mode</a></li>
-       <li><a href=#the-after-after-body-insertion-mode><span class=secno>9.2.5.24 </span>The "after after body" insertion mode</a></li>
-       <li><a href=#the-after-after-frameset-insertion-mode><span class=secno>9.2.5.25 </span>The "after after frameset" insertion mode</a></ol></li>
+       <li><a href=#parsing-main-intabletext><span class=secno>9.2.5.13 </span>The "in table text" insertion mode</a></li>
+       <li><a href=#parsing-main-incaption><span class=secno>9.2.5.14 </span>The "in caption" insertion mode</a></li>
+       <li><a href=#parsing-main-incolgroup><span class=secno>9.2.5.15 </span>The "in column group" insertion mode</a></li>
+       <li><a href=#parsing-main-intbody><span class=secno>9.2.5.16 </span>The "in table body" insertion mode</a></li>
+       <li><a href=#parsing-main-intr><span class=secno>9.2.5.17 </span>The "in row" insertion mode</a></li>
+       <li><a href=#parsing-main-intd><span class=secno>9.2.5.18 </span>The "in cell" insertion mode</a></li>
+       <li><a href=#parsing-main-inselect><span class=secno>9.2.5.19 </span>The "in select" insertion mode</a></li>
+       <li><a href=#parsing-main-inselectintable><span class=secno>9.2.5.20 </span>The "in select in table" insertion mode</a></li>
+       <li><a href=#parsing-main-inforeign><span class=secno>9.2.5.21 </span>The "in foreign content" insertion mode</a></li>
+       <li><a href=#parsing-main-afterbody><span class=secno>9.2.5.22 </span>The "after body" insertion mode</a></li>
+       <li><a href=#parsing-main-inframeset><span class=secno>9.2.5.23 </span>The "in frameset" insertion mode</a></li>
+       <li><a href=#parsing-main-afterframeset><span class=secno>9.2.5.24 </span>The "after frameset" insertion mode</a></li>
+       <li><a href=#the-after-after-body-insertion-mode><span class=secno>9.2.5.25 </span>The "after after body" insertion mode</a></li>
+       <li><a href=#the-after-after-frameset-insertion-mode><span class=secno>9.2.5.26 </span>The "after after frameset" insertion mode</a></ol></li>
      <li><a href=#the-end><span class=secno>9.2.6 </span>The end</a></li>
      <li><a href=#coercing-an-html-dom-into-an-infoset><span class=secno>9.2.7 </span>Coercing an HTML DOM into an infoset</a></li>
      <li><a href=#an-introduction-to-error-handling-in-the-parser><span class=secno>9.2.8 </span>An introduction to error handling in the parser</a>
@@ -59089,7 +59090,7 @@
   "<a href=#the-before-head-insertion-mode title="insertion mode: before head">before head</a>",
   "<a href=#parsing-main-inhead title="insertion mode: in head">in head</a>", "<a href=#parsing-main-inheadnoscript title="insertion mode: in head noscript">in head noscript</a>",
   "<a href=#the-after-head-insertion-mode title="insertion mode: after head">after head</a>", "<a href=#parsing-main-inbody title="insertion mode: in body">in body</a>", "<a href=#parsing-main-incdata title="insertion mode: in CDATA/RCDATA">in CDATA/RCDATA</a>",
-  "<a href=#parsing-main-intable title="insertion mode: in table">in table</a>", "<a href=#parsing-main-incaption title="insertion mode: in caption">in caption</a>", "<a href=#parsing-main-incolgroup title="insertion mode: in column group">in column group</a>",
+  "<a href=#parsing-main-intable title="insertion mode: in table">in table</a>", "<a href=#parsing-main-intabletext title="insertion mode: in table text">in table text</a>", "<a href=#parsing-main-incaption title="insertion mode: in caption">in caption</a>", "<a href=#parsing-main-incolgroup title="insertion mode: in column group">in column group</a>",
   "<a href=#parsing-main-intbody title="insertion mode: in table body">in table body</a>",
   "<a href=#parsing-main-intr title="insertion mode: in row">in row</a>", "<a href=#parsing-main-intd title="insertion mode: in cell">in cell</a>", "<a href=#parsing-main-inselect title="insertion mode: in select">in select</a>", "<a href=#parsing-main-inselectintable title="insertion mode: in select in table">in select in
   table</a>", "<a href=#parsing-main-inforeign title="insertion mode: in foreign content">in
@@ -59105,8 +59106,7 @@
 
   <p>Seven of these modes, namely "<a href=#parsing-main-inhead title="insertion mode: in
   head">in head</a>", "<a href=#parsing-main-inbody title="insertion mode: in body">in
-  body</a>", "<a href=#parsing-main-incdata title="insertion mode: in CDATA/RCDATA">in
-  CDATA/RCDATA</a>", "<a href=#parsing-main-intable title="insertion mode: in table">in
+  body</a>", "<a href=#parsing-main-intable title="insertion mode: in table">in
   table</a>", "<a href=#parsing-main-intbody title="insertion mode: in table body">in table
   body</a>", "<a href=#parsing-main-intr title="insertion mode: in row">in row</a>",
   "<a href=#parsing-main-intd title="insertion mode: in cell">in cell</a>", and "<a href=#parsing-main-inselect title="insertion mode: in select">in select</a>", are special, in
@@ -59120,10 +59120,9 @@
   to a new value.</p>
 
   <p>When the insertion mode is switched to "<a href=#parsing-main-incdata title="insertion
-  mode: in CDATA/RCDATA">in CDATA/RCDATA</a>", the <dfn id=original-insertion-mode>original
-  insertion mode</dfn> is also set. This is the insertion mode to
-  which the tree construction stage will return when the corresponding
-  end tag is parsed.</p>
+  mode: in CDATA/RCDATA">in CDATA/RCDATA</a>" or "<a href=#parsing-main-intabletext title="insertion mode: in table text">in table text</a>", the
+  <dfn id=original-insertion-mode>original insertion mode</dfn> is also set. This is the
+  insertion mode to which the tree construction stage will return.</p>
 
   <p>When the insertion mode is switched to "<a href=#parsing-main-inforeign title="insertion
   mode: in foreign content">in foreign content</a>", the
@@ -60943,7 +60942,9 @@
      <tr><td><pre>A<table>B<tr>C</tr>C</table></pre>
       <td>Three adjacent text nodes before the table, containing "A", "B", and "CC" respectively. (This is caused by <a href=#foster-parent title="foster parent">foster parenting</a>.)
      <tr><td><pre>A<table><tr> B</tr> B</table></pre>
-      <td>Two adjacent text nodes before the table, containing "A" and "B B" respectively, and one text node inside the table with a single space character. (This is caused by <a href=#foster-parent title="foster parent">foster parenting</a> and <a href=#tainted title=tainted>tainting</a>.)
+      <td>Two adjacent text nodes before the table, containing "A" and " B B" (space-B-space-B) respectively. (This is caused by <a href=#foster-parent title="foster parent">foster parenting</a>.)
+     <tr><td><pre>A<table><tr> B</tr> </em>C</table></pre>
+      <td>Three adjacent text nodes before the table, containing "A", " B" (space-B), and "C" respectively, and one text node inside the table (as a child of a <code><a href=#the-tbody-element>tbody</a></code>) with a single space character. (Space characters separated from non-space characters by non-character tokens are not affected by <a href=#foster-parent title="foster parent">foster parenting</a>, even if those other tokens then get ignored.)
    </table></div>
 
   <p id=mutation-during-parsing>DOM mutation events must not fire
@@ -61167,12 +61168,7 @@
 
   <p>When a node <var title="">node</var> is to be <dfn id=foster-parent title="foster
   parent">foster parented</dfn>, the node <var title="">node</var>
-  must be inserted into the <i><a href=#foster-parent-element>foster parent element</a></i>, and the
-  <a href=#current-table>current table</a> must be marked as
-  <dfn id=tainted>tainted</dfn>. (Once the <a href=#current-table>current table</a> has been
-  <a href=#tainted>tainted</a>, <a href=#space-character title="space character">space
-  characters</a> are inserted into the <i><a href=#foster-parent-element>foster parent element</a></i>
-  instead of the <a href=#current-node>current node</a>.)</p>
+  must be inserted into the <i><a href=#foster-parent-element>foster parent element</a></i>.</p>
 
   <p>The <dfn id=foster-parent-element>foster parent element</dfn> is the parent element of the
   last <code><a href=#the-table-element>table</a></code> element in the <a href=#stack-of-open-elements>stack of open
@@ -63175,17 +63171,18 @@
   <p>When the <a href=#insertion-mode>insertion mode</a> is "<a href=#parsing-main-intable title="insertion
   mode: in table">in table</a>", tokens must be handled as follows:</p>
 
-  <dl class=switch><dt>A character token that is one of U+0009 CHARACTER
-   TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
-   <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
+  <dl class=switch><dt>A character token</dt>
    <dd>
 
-    <p>If the <a href=#current-table>current table</a> is <a href=#tainted>tainted</a>, then
-    act as described in the "anything else" entry below.</p>
+     <p>Let the <dfn id=pending-table-character-tokens><var>pending table character tokens</var></dfn>
+     be an empty list of tokens.</p>
 
-    <p>Otherwise, <a href=#insert-a-character title="insert a character">insert the
-    character</a> into the <a href=#current-node>current node</a>.</p>
+     <p>Let the <a href=#original-insertion-mode>original insertion mode</a> be the current
+     <a href=#insertion-mode>insertion mode</a>.</p>
 
+     <p>Switch the <a href=#insertion-mode>insertion mode</a> to "<a href=#parsing-main-intabletext title="insertion mode: in table text">in table text</a>" and
+     reprocess the token.</p>
+
    </dd>
 
    <dt>A comment token</dt>
@@ -63351,8 +63348,44 @@
   case</a>.</p>
 
 
-  <h5 id=parsing-main-incaption><span class=secno>9.2.5.13 </span>The "<dfn title="insertion mode: in caption">in caption</dfn>" insertion mode</h5>
 
+  <h5 id=parsing-main-intabletext><span class=secno>9.2.5.13 </span>The "<dfn title="insertion mode: in table text">in table text</dfn>" insertion mode</h5>
+
+  <p>When the <a href=#insertion-mode>insertion mode</a> is "<a href=#parsing-main-intabletext title="insertion
+  mode: in table text">in table text</a>", tokens must be handled
+  as follows:</p>
+
+  <dl class=switch><dt>A character token</dt>
+   <dd>
+
+    <p>Append the character token to the <var><a href=#pending-table-character-tokens>pending table character
+    tokens</a></var> list.</p>
+
+   </dd>
+
+
+   <dt>Anything else</dt>
+   <dd>
+
+    <p>If any of the tokens in the <var><a href=#pending-table-character-tokens>pending table character
+    tokens</a></var> list are character tokens that are not one of U+0009
+    CHARACTER TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED
+    (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE, then
+    reprocess those character tokens using the rules given in the
+    "anything else" entry in the <a href=#parsing-main-intable title="insertion mode: in
+    table">in table</a>" insertion mode.</p>
+
+    <p>Otherwise, <a href=#insert-a-character title="insert a character">insert the
+    characters</a> given by the <var><a href=#pending-table-character-tokens>pending table character
+    tokens</a></var> list into the <a href=#current-node>current node</a>.</p>
+
+    <p>Switch the <a href=#insertion-mode>insertion mode</a> to the <a href=#original-insertion-mode>original
+    insertion mode</a> and reprocess the token.</p>
+
+   </dd>
+
+  </dl><h5 id=parsing-main-incaption><span class=secno>9.2.5.14 </span>The "<dfn title="insertion mode: in caption">in caption</dfn>" insertion mode</h5>
+
   <p>When the <a href=#insertion-mode>insertion mode</a> is "<a href=#parsing-main-incaption title="insertion
   mode: in caption">in caption</a>", tokens must be handled as follows:</p>
 
@@ -63409,7 +63442,7 @@
     mode</a>.</p>
    </dd>
 
-  </dl><h5 id=parsing-main-incolgroup><span class=secno>9.2.5.14 </span>The "<dfn title="insertion mode: in column group">in column group</dfn>" insertion mode</h5>
+  </dl><h5 id=parsing-main-incolgroup><span class=secno>9.2.5.15 </span>The "<dfn title="insertion mode: in column group">in column group</dfn>" insertion mode</h5>
 
   <p>When the <a href=#insertion-mode>insertion mode</a> is "<a href=#parsing-main-incolgroup title="insertion
   mode: in column group">in column group</a>", tokens must be handled as follows:</p>
@@ -63496,7 +63529,7 @@
 
    </dd>
 
-  </dl><h5 id=parsing-main-intbody><span class=secno>9.2.5.15 </span>The "<dfn title="insertion mode: in table body">in table body</dfn>" insertion mode</h5>
+  </dl><h5 id=parsing-main-intbody><span class=secno>9.2.5.16 </span>The "<dfn title="insertion mode: in table body">in table body</dfn>" insertion mode</h5>
 
   <p>When the <a href=#insertion-mode>insertion mode</a> is "<a href=#parsing-main-intbody title="insertion
   mode: in table body">in table body</a>", tokens must be handled as follows:</p>
@@ -63585,7 +63618,7 @@
   case</a>.</p>
 
 
-  <h5 id=parsing-main-intr><span class=secno>9.2.5.16 </span>The "<dfn title="insertion mode: in row">in row</dfn>" insertion mode</h5>
+  <h5 id=parsing-main-intr><span class=secno>9.2.5.17 </span>The "<dfn title="insertion mode: in row">in row</dfn>" insertion mode</h5>
 
   <p>When the <a href=#insertion-mode>insertion mode</a> is "<a href=#parsing-main-intr title="insertion
   mode: in row">in row</a>", tokens must be handled as follows:</p>
@@ -63676,7 +63709,7 @@
   case</a>.</p>
 
 
-  <h5 id=parsing-main-intd><span class=secno>9.2.5.17 </span>The "<dfn title="insertion mode: in cell">in cell</dfn>" insertion mode</h5>
+  <h5 id=parsing-main-intd><span class=secno>9.2.5.18 </span>The "<dfn title="insertion mode: in cell">in cell</dfn>" insertion mode</h5>
 
   <p>When the <a href=#insertion-mode>insertion mode</a> is "<a href=#parsing-main-intd title="insertion
   mode: in cell">in cell</a>", tokens must be handled as follows:</p>
@@ -63770,7 +63803,7 @@
   cell</a>".</p>
 
 
-  <h5 id=parsing-main-inselect><span class=secno>9.2.5.18 </span>The "<dfn title="insertion mode: in select">in select</dfn>" insertion mode</h5>
+  <h5 id=parsing-main-inselect><span class=secno>9.2.5.19 </span>The "<dfn title="insertion mode: in select">in select</dfn>" insertion mode</h5>
 
   <p>When the <a href=#insertion-mode>insertion mode</a> is "<a href=#parsing-main-inselect title="insertion
   mode: in select">in select</a>", tokens must be handled as follows:</p>
@@ -63908,7 +63941,7 @@
     <p><a href=#parse-error>Parse error</a>. Ignore the token.</p>
    </dd>
 
-  </dl><h5 id=parsing-main-inselectintable><span class=secno>9.2.5.19 </span>The "<dfn title="insertion mode: in select in table">in select in table</dfn>" insertion mode</h5>
+  </dl><h5 id=parsing-main-inselectintable><span class=secno>9.2.5.20 </span>The "<dfn title="insertion mode: in select in table">in select in table</dfn>" insertion mode</h5>
 
   <p>When the <a href=#insertion-mode>insertion mode</a> is "<a href=#parsing-main-inselectintable title="insertion
   mode: in select in table">in select in table</a>", tokens must be handled as follows:</p>
@@ -63940,7 +63973,7 @@
     mode</a>.</p>
    </dd>
 
-  </dl><h5 id=parsing-main-inforeign><span class=secno>9.2.5.20 </span>The "<dfn title="insertion mode: in foreign content">in foreign content</dfn>" insertion mode</h5>
+  </dl><h5 id=parsing-main-inforeign><span class=secno>9.2.5.21 </span>The "<dfn title="insertion mode: in foreign content">in foreign content</dfn>" insertion mode</h5>
 
   <p>When the <a href=#insertion-mode>insertion mode</a> is "<a href=#parsing-main-inforeign title="insertion
   mode: in foreign content">in foreign content</a>", tokens must be
@@ -64134,7 +64167,7 @@
 
    </dd>
 
-  </dl><h5 id=parsing-main-afterbody><span class=secno>9.2.5.21 </span>The "<dfn title="insertion mode: after body">after body</dfn>" insertion mode</h5>
+  </dl><h5 id=parsing-main-afterbody><span class=secno>9.2.5.22 </span>The "<dfn title="insertion mode: after body">after body</dfn>" insertion mode</h5>
 
   <p>When the <a href=#insertion-mode>insertion mode</a> is "<a href=#parsing-main-afterbody title="insertion
   mode: after body">after body</a>", tokens must be handled as follows:</p>
@@ -64192,7 +64225,7 @@
 
    </dd>
 
-  </dl><h5 id=parsing-main-inframeset><span class=secno>9.2.5.22 </span>The "<dfn title="insertion mode: in frameset">in frameset</dfn>" insertion mode</h5>
+  </dl><h5 id=parsing-main-inframeset><span class=secno>9.2.5.23 </span>The "<dfn title="insertion mode: in frameset">in frameset</dfn>" insertion mode</h5>
 
   <p>When the <a href=#insertion-mode>insertion mode</a> is "<a href=#parsing-main-inframeset title="insertion
   mode: in frameset">in frameset</a>", tokens must be handled as follows:</p>
@@ -64285,7 +64318,7 @@
     <p><a href=#parse-error>Parse error</a>. Ignore the token.</p>
    </dd>
 
-  </dl><h5 id=parsing-main-afterframeset><span class=secno>9.2.5.23 </span>The "<dfn title="insertion mode: after frameset">after frameset</dfn>" insertion mode</h5>
+  </dl><h5 id=parsing-main-afterframeset><span class=secno>9.2.5.24 </span>The "<dfn title="insertion mode: after frameset">after frameset</dfn>" insertion mode</h5>
 
   <p>When the <a href=#insertion-mode>insertion mode</a> is "<a href=#parsing-main-afterframeset title="insertion
   mode: after frameset">after frameset</a>", tokens must be handled as follows:</p>
@@ -64345,7 +64378,7 @@
   harder.</p>
 
 
-  <h5 id=the-after-after-body-insertion-mode><span class=secno>9.2.5.24 </span>The "<dfn title="insertion mode: after after body">after after body</dfn>" insertion mode</h5>
+  <h5 id=the-after-after-body-insertion-mode><span class=secno>9.2.5.25 </span>The "<dfn title="insertion mode: after after body">after after body</dfn>" insertion mode</h5>
 
   <p>When the <a href=#insertion-mode>insertion mode</a> is "<a href=#the-after-after-body-insertion-mode title="insertion
   mode: after after body">after after body</a>", tokens must be handled as follows:</p>
@@ -64379,7 +64412,7 @@
     reprocess the token.</p>
    </dd>
 
-  </dl><h5 id=the-after-after-frameset-insertion-mode><span class=secno>9.2.5.25 </span>The "<dfn title="insertion mode: after after frameset">after after frameset</dfn>" insertion mode</h5>
+  </dl><h5 id=the-after-after-frameset-insertion-mode><span class=secno>9.2.5.26 </span>The "<dfn title="insertion mode: after after frameset">after after frameset</dfn>" insertion mode</h5>
 
   <p>When the <a href=#insertion-mode>insertion mode</a> is "<a href=#the-after-after-frameset-insertion-mode title="insertion
   mode: after after frameset">after after frameset</a>", tokens must be handled as follows:</p>
@@ -64750,10 +64783,9 @@
   the elements <code><a href=#the-html-element>html</a></code>, <code><a href=#the-body-element>body</a></code>,
   <code><a href=#the-table-element>table</a></code>, and <code><a href=#the-b-element>b</a></code> (in that order, despite the
   resulting DOM tree); the <a href=#list-of-active-formatting-elements>list of active formatting
-  elements</a> just has the <code><a href=#the-b-element>b</a></code> element in it; the
+  elements</a> just has the <code><a href=#the-b-element>b</a></code> element in it; and the
   <a href=#insertion-mode>insertion mode</a> is "<a href=#parsing-main-intable title="insertion mode: in
-  table">in table</a>"; and the <code><a href=#the-table-element>table</a></code> element is
-  <a href=#tainted>tainted</a>.</p>
+  table">in table</a>".</p>
 
   <p>The <code><a href=#the-tr-element>tr</a></code> start tag causes the <code><a href=#the-b-element>b</a></code> element
   to be popped off the stack and a <code><a href=#the-tbody-element>tbody</a></code> start tag to be
@@ -64768,9 +64800,8 @@
   elements <code><a href=#the-html-element>html</a></code>, <code><a href=#the-body-element>body</a></code>, <code><a href=#the-table-element>table</a></code>,
   <code><a href=#the-tbody-element>tbody</a></code>, and <code><a href=#the-tr-element>tr</a></code>; the <a href=#list-of-active-formatting-elements>list of active
   formatting elements</a> still has the <code><a href=#the-b-element>b</a></code> element in
-  it; the <a href=#insertion-mode>insertion mode</a> is "<a href=#parsing-main-intr title="insertion mode:
-  in row">in row</a>"; and the <code><a href=#the-table-element>table</a></code> element is still
-  <a href=#tainted>tainted</a>.</p>
+  it; and the <a href=#insertion-mode>insertion mode</a> is "<a href=#parsing-main-intr title="insertion
+  mode: in row">in row</a>".</p>
 
   <p>The <code><a href=#the-td-element>td</a></code> element start tag token, after putting a
   <code><a href=#the-td-element>td</a></code> element on the tree, puts a marker on the <a href=#list-of-active-formatting-elements>list
@@ -64786,33 +64817,40 @@
   elements <code><a href=#the-html-element>html</a></code>, <code><a href=#the-body-element>body</a></code>, <code><a href=#the-table-element>table</a></code>,
   and <code><a href=#the-tbody-element>tbody</a></code>; the <a href=#list-of-active-formatting-elements>list of active formatting
   elements</a> still has the <code><a href=#the-b-element>b</a></code> element in it (the
-  marker having been removed by the "td" end tag token); the
+  marker having been removed by the "td" end tag token); and the
   <a href=#insertion-mode>insertion mode</a> is "<a href=#parsing-main-intbody title="insertion mode: in
-  table body">in table body</a>"; and the <code><a href=#the-table-element>table</a></code>
-  element is still <a href=#tainted>tainted</a>.</p>
+  table body">in table body</a>".</p>
 
-  <p>Thus it is that the "bbb" character tokens are found. When <a href=#reconstruct-the-active-formatting-elements title="reconstruct the active formatting elements">the active
-  formatting elements are reconstructed</a>, a <code><a href=#the-b-element>b</a></code>
-  element is created and <a href=#foster-parent title="foster parent">foster
-  parented</a>, and then the "bbb" text node is appended to it:</p>
+  <p>Thus it is that the "bbb" character tokens are found. These
+  trigger the "<a href=#parsing-main-intabletext title="insertion mode: in table text">in table
+  text</a>" insertion mode to be used (with the <a href=#original-insertion-mode>original
+  insertion mode</a> set to "<a href=#parsing-main-intbody title="insertion mode: in table
+  body">in table body</a>"). The character tokens are collected,
+  and when the next token (the <code><a href=#the-table-element>table</a></code> element end tag) is
+  seen, they are processed as a group. Since they are not all spaces,
+  they are handled as per the "anything else" rules in the "<a href=#parsing-main-intable title="insertion mode: in table">in table</a>" insertion mode,
+  which defer to the "<a href=#parsing-main-inbody title="insertion mode: in body">in
+  body</a>" insertion mode but with <a href=#foster-parent title="foster
+  parent">foster parenting</a>.</p>
 
+  <p>When <a href=#reconstruct-the-active-formatting-elements title="reconstruct the active formatting elements">the
+  active formatting elements are reconstructed</a>, a
+  <code><a href=#the-b-element>b</a></code> element is created and <a href=#foster-parent title="foster
+  parent">foster parented</a>, and then the "bbb" text node is
+  appended to it:</p>
+
   <ul class=domTree><li class=t1><code><a href=#the-html-element>html</a></code><ul><li class=t1><code><a href=#the-head-element>head</a></code><li class=t1><code><a href=#the-body-element>body</a></code><ul><li class=t1><code><a href=#the-b-element>b</a></code><li class=t1><code><a href=#the-b-element>b</a></code><ul><li class=t3><code>#text</code>: <span title="">bbb</span></ul><li class=t1><code><a href=#the-table-element>table</a></code><ul><li class=t1><code><a href=#the-tbody-element>tbody</a></code><ul><li class=t1><code><a href=#the-tr-element>tr</a></code><ul><li class=t1><code><a href=#the-td-element>td</a></code><ul><li class=t3><code>#text</code>: <span title="">aaa</span></ul></ul></ul></ul></ul></ul></ul><p>The <a href=#stack-of-open-elements>stack of open elements</a> has on it the elements
   <code><a href=#the-html-element>html</a></code>, <code><a href=#the-body-element>body</a></code>, <code><a href=#the-table-element>table</a></code>,
   <code><a href=#the-tbody-element>tbody</a></code>, and the new <code><a href=#the-b-element>b</a></code> (again, note that
   this doesn't match the resulting tree!); the <a href=#list-of-active-formatting-elements>list of active
   formatting elements</a> has the new <code><a href=#the-b-element>b</a></code> element in it;
-  the <a href=#insertion-mode>insertion mode</a> is still "<a href=#parsing-main-intbody title="insertion
-  mode: in table body">in table body</a>"; and the
-  <code><a href=#the-table-element>table</a></code> element is still <a href=#tainted>tainted</a>.</p>
+  and the <a href=#insertion-mode>insertion mode</a> is still "<a href=#parsing-main-intbody title="insertion
+  mode: in table body">in table body</a>".</p>
 
-  <p>Had the character tokens been <a href=#space-character title="space character">space
-  characters</a> instead of "bbb", the result would have been the
-  same, but only because the table is <a href=#tainted>tainted</a>. Had the
-  <code><a href=#the-b-element>b</a></code> element's start tag been before the
-  <code><a href=#the-table-element>table</a></code> instead of after, then the table wouldn't have
-  been <a href=#tainted>tainted</a> and such <a href=#space-character title="space
-  character">space characters</a> would just be appended to the
-  <code><a href=#the-tbody-element>tbody</a></code> element.</p>
+  <p>Had the character tokens been only <a href=#space-character title="space
+  character">space characters</a> instead of "bbb", then those
+  <a href=#space-character title="space character">space characters</a> would just be
+  appended to the <code><a href=#the-tbody-element>tbody</a></code> element.</p>
 
   <p>Finally, the <code><a href=#the-table-element>table</a></code> is closed by a "table" end
   tag. This pops all the nodes from the <a href=#stack-of-open-elements>stack of open

Modified: source
===================================================================
--- source	2009-07-08 19:42:09 UTC (rev 3381)
+++ source	2009-07-10 00:35:42 UTC (rev 3382)
@@ -72671,6 +72671,7 @@
   title="insertion mode: in body">in body</span>", "<span
   title="insertion mode: in CDATA/RCDATA">in CDATA/RCDATA</span>",
   "<span title="insertion mode: in table">in table</span>", "<span
+  title="insertion mode: in table text">in table text</span>", "<span
   title="insertion mode: in caption">in caption</span>", "<span
   title="insertion mode: in column group">in column group</span>",
   "<span title="insertion mode: in table body">in table body</span>",
@@ -72692,8 +72693,7 @@
 
   <p>Seven of these modes, namely "<span title="insertion mode: in
   head">in head</span>", "<span title="insertion mode: in body">in
-  body</span>", "<span title="insertion mode: in CDATA/RCDATA">in
-  CDATA/RCDATA</span>", "<span title="insertion mode: in table">in
+  body</span>", "<span title="insertion mode: in table">in
   table</span>", "<span title="insertion mode: in table body">in table
   body</span>", "<span title="insertion mode: in row">in row</span>",
   "<span title="insertion mode: in cell">in cell</span>", and "<span
@@ -72709,10 +72709,10 @@
   to a new value.</p>
 
   <p>When the insertion mode is switched to "<span title="insertion
-  mode: in CDATA/RCDATA">in CDATA/RCDATA</span>", the <dfn>original
-  insertion mode</dfn> is also set. This is the insertion mode to
-  which the tree construction stage will return when the corresponding
-  end tag is parsed.</p>
+  mode: in CDATA/RCDATA">in CDATA/RCDATA</span>" or "<span
+  title="insertion mode: in table text">in table text</span>", the
+  <dfn>original insertion mode</dfn> is also set. This is the
+  insertion mode to which the tree construction stage will return.</p>
 
   <p>When the insertion mode is switched to "<span title="insertion
   mode: in foreign content">in foreign content</span>", the
@@ -74782,7 +74782,10 @@
       <td>Three adjacent text nodes before the table, containing "A", "B", and "CC" respectively. (This is caused by <span title="foster parent">foster parenting</span>.)
      <tr>
       <td><pre>A<table><tr> B</tr> B</table></pre>
-      <td>Two adjacent text nodes before the table, containing "A" and "B B" respectively, and one text node inside the table with a single space character. (This is caused by <span title="foster parent">foster parenting</span> and <span title="tainted">tainting</span>.)
+      <td>Two adjacent text nodes before the table, containing "A" and " B B" (space-B-space-B) respectively. (This is caused by <span title="foster parent">foster parenting</span>.)
+     <tr>
+      <td><pre>A<table><tr> B</tr> </em>C</table></pre>
+      <td>Three adjacent text nodes before the table, containing "A", " B" (space-B), and "C" respectively, and one text node inside the table (as a child of a <code>tbody</code>) with a single space character. (Space characters separated from non-space characters by non-character tokens are not affected by <span title="foster parent">foster parenting</span>, even if those other tokens then get ignored.)
    </table>
 
   </div>
@@ -75039,12 +75042,7 @@
 
   <p>When a node <var title="">node</var> is to be <dfn title="foster
   parent">foster parented</dfn>, the node <var title="">node</var>
-  must be inserted into the <i>foster parent element</i>, and the
-  <span>current table</span> must be marked as
-  <dfn>tainted</dfn>. (Once the <span>current table</span> has been
-  <span>tainted</span>, <span title="space character">space
-  characters</span> are inserted into the <i>foster parent element</i>
-  instead of the <span>current node</span>.)</p>
+  must be inserted into the <i>foster parent element</i>.</p>
 
   <p>The <dfn>foster parent element</dfn> is the parent element of the
   last <code>table</code> element in the <span>stack of open
@@ -77245,17 +77243,19 @@
 
   <dl class="switch">
 
-   <dt>A character token that is one of U+0009 CHARACTER
-   TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
-   <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
+   <dt>A character token</dt>
    <dd>
 
-    <p>If the <span>current table</span> is <span>tainted</span>, then
-    act as described in the "anything else" entry below.</p>
+     <p>Let the <dfn><var>pending table character tokens</var></dfn>
+     be an empty list of tokens.</p>
 
-    <p>Otherwise, <span title="insert a character">insert the
-    character</span> into the <span>current node</span>.</p>
+     <p>Let the <span>original insertion mode</span> be the current
+     <span>insertion mode</span>.</p>
 
+     <p>Switch the <span>insertion mode</span> to "<span
+     title="insertion mode: in table text">in table text</span>" and
+     reprocess the token.</p>
+
    </dd>
 
    <dt>A comment token</dt>
@@ -77430,6 +77430,47 @@
   case</span>.</p>
 
 
+
+  <h5 id="parsing-main-intabletext">The "<dfn title="insertion mode: in table text">in table text</dfn>" insertion mode</h5>
+
+  <p>When the <span>insertion mode</span> is "<span title="insertion
+  mode: in table text">in table text</span>", tokens must be handled
+  as follows:</p>
+
+  <dl class="switch">
+
+   <dt>A character token</dt>
+   <dd>
+
+    <p>Append the character token to the <var>pending table character
+    tokens</var> list.</p>
+
+   </dd>
+
+
+   <dt>Anything else</dt>
+   <dd>
+
+    <p>If any of the tokens in the <var>pending table character
+    tokens</var> list are character tokens that are not one of U+0009
+    CHARACTER TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED
+    (FF), <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE, then
+    reprocess those character tokens using the rules given in the
+    "anything else" entry in the <span title="insertion mode: in
+    table">in table</span>" insertion mode.</p>
+
+    <p>Otherwise, <span title="insert a character">insert the
+    characters</span> given by the <var>pending table character
+    tokens</var> list into the <span>current node</span>.</p>
+
+    <p>Switch the <span>insertion mode</span> to the <span>original
+    insertion mode</span> and reprocess the token.</p>
+
+   </dd>
+
+  </dl>
+
+
   <h5 id="parsing-main-incaption">The "<dfn title="insertion mode: in caption">in caption</dfn>" insertion mode</h5>
 
   <p>When the <span>insertion mode</span> is "<span title="insertion
@@ -78976,10 +79017,9 @@
   the elements <code>html</code>, <code>body</code>,
   <code>table</code>, and <code>b</code> (in that order, despite the
   resulting DOM tree); the <span>list of active formatting
-  elements</span> just has the <code>b</code> element in it; the
+  elements</span> just has the <code>b</code> element in it; and the
   <span>insertion mode</span> is "<span title="insertion mode: in
-  table">in table</span>"; and the <code>table</code> element is
-  <span>tainted</span>.</p>
+  table">in table</span>".</p>
 
   <p>The <code>tr</code> start tag causes the <code>b</code> element
   to be popped off the stack and a <code>tbody</code> start tag to be
@@ -78996,9 +79036,8 @@
   elements <code>html</code>, <code>body</code>, <code>table</code>,
   <code>tbody</code>, and <code>tr</code>; the <span>list of active
   formatting elements</span> still has the <code>b</code> element in
-  it; the <span>insertion mode</span> is "<span title="insertion mode:
-  in row">in row</span>"; and the <code>table</code> element is still
-  <span>tainted</span>.</p>
+  it; and the <span>insertion mode</span> is "<span title="insertion
+  mode: in row">in row</span>".</p>
 
   <p>The <code>td</code> element start tag token, after putting a
   <code>td</code> element on the tree, puts a marker on the <span>list
@@ -79019,17 +79058,29 @@
   elements <code>html</code>, <code>body</code>, <code>table</code>,
   and <code>tbody</code>; the <span>list of active formatting
   elements</span> still has the <code>b</code> element in it (the
-  marker having been removed by the "td" end tag token); the
+  marker having been removed by the "td" end tag token); and the
   <span>insertion mode</span> is "<span title="insertion mode: in
-  table body">in table body</span>"; and the <code>table</code>
-  element is still <span>tainted</span>.</p>
+  table body">in table body</span>".</p>
 
-  <p>Thus it is that the "bbb" character tokens are found. When <span
-  title="reconstruct the active formatting elements">the active
-  formatting elements are reconstructed</span>, a <code>b</code>
-  element is created and <span title="foster parent">foster
-  parented</span>, and then the "bbb" text node is appended to it:</p>
+  <p>Thus it is that the "bbb" character tokens are found. These
+  trigger the "<span title="insertion mode: in table text">in table
+  text</span>" insertion mode to be used (with the <span>original
+  insertion mode</span> set to "<span title="insertion mode: in table
+  body">in table body</span>"). The character tokens are collected,
+  and when the next token (the <code>table</code> element end tag) is
+  seen, they are processed as a group. Since they are not all spaces,
+  they are handled as per the "anything else" rules in the "<span
+  title="insertion mode: in table">in table</span>" insertion mode,
+  which defer to the "<span title="insertion mode: in body">in
+  body</span>" insertion mode but with <span title="foster
+  parent">foster parenting</span>.</p>
 
+  <p>When <span title="reconstruct the active formatting elements">the
+  active formatting elements are reconstructed</span>, a
+  <code>b</code> element is created and <span title="foster
+  parent">foster parented</span>, and then the "bbb" text node is
+  appended to it:</p>
+
   <ul class="domTree"><li class="t1"><code>html</code><ul><li class="t1"><code>head</code></li><li class="t1"><code>body</code><ul><li class="t1"><code>b</code></li><li class="t1"><code>b</code><ul><li class="t3"><code>#text</code>: <span title="">bbb</span></li></ul></li><li class="t1"><code>table</code><ul><li class="t1"><code>tbody</code><ul><li class="t1"><code>tr</code><ul><li class="t1"><code>td</code><ul><li class="t3"><code>#text</code>: <span title="">aaa</span></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul>
 
   <p>The <span>stack of open elements</span> has on it the elements
@@ -79037,18 +79088,13 @@
   <code>tbody</code>, and the new <code>b</code> (again, note that
   this doesn't match the resulting tree!); the <span>list of active
   formatting elements</span> has the new <code>b</code> element in it;
-  the <span>insertion mode</span> is still "<span title="insertion
-  mode: in table body">in table body</span>"; and the
-  <code>table</code> element is still <span>tainted</span>.</p>
+  and the <span>insertion mode</span> is still "<span title="insertion
+  mode: in table body">in table body</span>".</p>
 
-  <p>Had the character tokens been <span title="space character">space
-  characters</span> instead of "bbb", the result would have been the
-  same, but only because the table is <span>tainted</span>. Had the
-  <code>b</code> element's start tag been before the
-  <code>table</code> instead of after, then the table wouldn't have
-  been <span>tainted</span> and such <span title="space
-  character">space characters</span> would just be appended to the
-  <code>tbody</code> element.</p>
+  <p>Had the character tokens been only <span title="space
+  character">space characters</span> instead of "bbb", then those
+  <span title="space character">space characters</span> would just be
+  appended to the <code>tbody</code> element.</p>
 
   <p>Finally, the <code>table</code> is closed by a "table" end
   tag. This pops all the nodes from the <span>stack of open




More information about the Commit-Watchers mailing list