[html5] r5298 - [giowt] (2) Coalesce text nodes even if they're not parser-inserted. Fixing http [...]

whatwg at whatwg.org whatwg at whatwg.org
Mon Aug 16 13:38:25 PDT 2010


Author: ianh
Date: 2010-08-16 13:38:23 -0700 (Mon, 16 Aug 2010)
New Revision: 5298

Modified:
   complete.html
   index
   source
Log:
[giowt] (2) Coalesce text nodes even if they're not parser-inserted.
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=10221

Modified: complete.html
===================================================================
--- complete.html	2010-08-16 20:26:03 UTC (rev 5297)
+++ complete.html	2010-08-16 20:38:23 UTC (rev 5298)
@@ -81594,11 +81594,10 @@
   <p>When the steps below require the UA to <dfn id=insert-a-character>insert a
   character</dfn> into a node, if that node has a child immediately
   before where the character is to be inserted, and that child is a
-  <code><a href=#text>Text</a></code> node, and that <code><a href=#text>Text</a></code> node was the last
-  node that the parser inserted into the document, then the character
-  must be appended to that <code><a href=#text>Text</a></code> node; otherwise, a new
-  <code><a href=#text>Text</a></code> node whose data is just that character must be
-  inserted in the appropriate place.</p>
+  <code><a href=#text>Text</a></code> node, then the character must be appended to that
+  <code><a href=#text>Text</a></code> node; otherwise, a new <code><a href=#text>Text</a></code> node
+  whose data is just that character must be inserted in the
+  appropriate place.</p>
 
   <div class=example>
 
@@ -81611,24 +81610,24 @@
 var script = document.getElementsByTagName('script')[0];
 document.body.removeChild(script);
 </script>B</pre>
-      <td>Two adjacent text nodes in the document, containing "A" and "B".
+      <td>One text node in the document, containing "AB".
      <tr><td><pre>A<script>
 var text = document.createTextNode('B');
 document.body.appendChild(text);
 </script>C</pre>
-      <td>Four text nodes; "A" before the script, the script's contents, "B" after the script, and then, immediately after that, "C".
+      <td>Three text nodes; "A" before the script, the script's contents, and "BC" after the script (the parser appends to the text node created by the script).
      <tr><td><pre>A<script>
 var text = document.getElementsByTagName('script')[0].firstChild;
 text.data = 'B';
 document.body.appendChild(text);
-</script>B</pre>
-      <td>Two adjacent text nodes in the document, containing "A" and "BB".
-     <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" (space-B-space-B) respectively. (This is caused by <a href=#foster-parent title="foster parent">foster parenting</a>.)
+</script>C</pre>
+      <td>Two adjacent text nodes in the document, containing "A" and "BC".
+     <tr><td><pre>A<table>B<tr>C</tr>D</table></pre>
+      <td>One text node before the table, containing "ABCD". (This is caused by <a href=#foster-parent title="foster parent">foster parenting</a>.)
+     <tr><td><pre>A<table><tr> B</tr> C</table></pre>
+      <td>One text node before the table, containing "A B C" (A-space-B-space-C). (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.)
+      <td>One text node before the table, containing "A BC" (A-space-B-C), 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

Modified: index
===================================================================
--- index	2010-08-16 20:26:03 UTC (rev 5297)
+++ index	2010-08-16 20:38:23 UTC (rev 5298)
@@ -74696,11 +74696,10 @@
   <p>When the steps below require the UA to <dfn id=insert-a-character>insert a
   character</dfn> into a node, if that node has a child immediately
   before where the character is to be inserted, and that child is a
-  <code><a href=#text>Text</a></code> node, and that <code><a href=#text>Text</a></code> node was the last
-  node that the parser inserted into the document, then the character
-  must be appended to that <code><a href=#text>Text</a></code> node; otherwise, a new
-  <code><a href=#text>Text</a></code> node whose data is just that character must be
-  inserted in the appropriate place.</p>
+  <code><a href=#text>Text</a></code> node, then the character must be appended to that
+  <code><a href=#text>Text</a></code> node; otherwise, a new <code><a href=#text>Text</a></code> node
+  whose data is just that character must be inserted in the
+  appropriate place.</p>
 
   <div class=example>
 
@@ -74713,24 +74712,24 @@
 var script = document.getElementsByTagName('script')[0];
 document.body.removeChild(script);
 </script>B</pre>
-      <td>Two adjacent text nodes in the document, containing "A" and "B".
+      <td>One text node in the document, containing "AB".
      <tr><td><pre>A<script>
 var text = document.createTextNode('B');
 document.body.appendChild(text);
 </script>C</pre>
-      <td>Four text nodes; "A" before the script, the script's contents, "B" after the script, and then, immediately after that, "C".
+      <td>Three text nodes; "A" before the script, the script's contents, and "BC" after the script (the parser appends to the text node created by the script).
      <tr><td><pre>A<script>
 var text = document.getElementsByTagName('script')[0].firstChild;
 text.data = 'B';
 document.body.appendChild(text);
-</script>B</pre>
-      <td>Two adjacent text nodes in the document, containing "A" and "BB".
-     <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" (space-B-space-B) respectively. (This is caused by <a href=#foster-parent title="foster parent">foster parenting</a>.)
+</script>C</pre>
+      <td>Two adjacent text nodes in the document, containing "A" and "BC".
+     <tr><td><pre>A<table>B<tr>C</tr>D</table></pre>
+      <td>One text node before the table, containing "ABCD". (This is caused by <a href=#foster-parent title="foster parent">foster parenting</a>.)
+     <tr><td><pre>A<table><tr> B</tr> C</table></pre>
+      <td>One text node before the table, containing "A B C" (A-space-B-space-C). (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.)
+      <td>One text node before the table, containing "A BC" (A-space-B-C), 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

Modified: source
===================================================================
--- source	2010-08-16 20:26:03 UTC (rev 5297)
+++ source	2010-08-16 20:38:23 UTC (rev 5298)
@@ -93195,11 +93195,10 @@
   <p>When the steps below require the UA to <dfn>insert a
   character</dfn> into a node, if that node has a child immediately
   before where the character is to be inserted, and that child is a
-  <code>Text</code> node, and that <code>Text</code> node was the last
-  node that the parser inserted into the document, then the character
-  must be appended to that <code>Text</code> node; otherwise, a new
-  <code>Text</code> node whose data is just that character must be
-  inserted in the appropriate place.</p>
+  <code>Text</code> node, then the character must be appended to that
+  <code>Text</code> node; otherwise, a new <code>Text</code> node
+  whose data is just that character must be inserted in the
+  appropriate place.</p>
 
   <div class="example">
 
@@ -93217,29 +93216,29 @@
 var script = document.getElementsByTagName('script')[0];
 document.body.removeChild(script);
 </script>B</pre>
-      <td>Two adjacent text nodes in the document, containing "A" and "B".
+      <td>One text node in the document, containing "AB".
      <tr>
       <td><pre>A<script>
 var text = document.createTextNode('B');
 document.body.appendChild(text);
 </script>C</pre>
-      <td>Four text nodes; "A" before the script, the script's contents, "B" after the script, and then, immediately after that, "C".
+      <td>Three text nodes; "A" before the script, the script's contents, and "BC" after the script (the parser appends to the text node created by the script).
      <tr>
       <td><pre>A<script>
 var text = document.getElementsByTagName('script')[0].firstChild;
 text.data = 'B';
 document.body.appendChild(text);
-</script>B</pre>
-      <td>Two adjacent text nodes in the document, containing "A" and "BB".
+</script>C</pre>
+      <td>Two adjacent text nodes in the document, containing "A" and "BC".
      <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 <span title="foster parent">foster parenting</span>.)
+      <td><pre>A<table>B<tr>C</tr>D</table></pre>
+      <td>One text node before the table, containing "ABCD". (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" (space-B-space-B) respectively. (This is caused by <span title="foster parent">foster parenting</span>.)
+      <td><pre>A<table><tr> B</tr> C</table></pre>
+      <td>One text node before the table, containing "A B C" (A-space-B-space-C). (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.)
+      <td>One text node before the table, containing "A BC" (A-space-B-C), 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>




More information about the Commit-Watchers mailing list