Use new WebIDL "code unit" definition
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Fri, 19 Aug 2011 13:59:01 -0600
changeset 547 918239adce79
parent 546 34d2c60c8a42
child 548 450adf2829b3
Use new WebIDL "code unit" definition

The ES term "element" is quite confusing. Thanks to heycam:

http://www.w3.org/Bugs/Public/show_bug.cgi?id=13676#c5
editing.html
preprocess
source.html
--- a/editing.html	Fri Aug 19 13:56:59 2011 -0600
+++ b/editing.html	Fri Aug 19 13:59:01 2011 -0600
@@ -3298,7 +3298,7 @@
     <var title="">lower bound</var>.
 
     <li>If <var title="">pixel size</var> is less than <var title="">average</var>, return the
-    one-<a href=http://es5.github.com/#x8.4>element</a> string consisting of the digit <var title="">returned size</var>.
+    one-<a href=http://dev.w3.org/2006/webapi/WebIDL/#dfn-code-unit>code unit</a> string consisting of the digit <var title="">returned size</var>.
 
     <li>Add one to <var title="">returned size</var>.
   </ol>
@@ -5147,7 +5147,7 @@
   <li>While <var title="">n</var> is greater than three, append <var title="">repeated pair</var>
   to <var title="">buffer</var> and subtract two from <var title="">n</var>.
 
-  <li>If <var title="">n</var> is three, append a three-<a href=http://es5.github.com/#x8.4>element</a> string to
+  <li>If <var title="">n</var> is three, append a three-<a href=http://dev.w3.org/2006/webapi/WebIDL/#dfn-code-unit>code unit</a> string to
   <var title="">buffer</var> depending on <var title="">non-breaking start</var> and
   <var title="">non-breaking end</var>:
 
@@ -5165,7 +5165,7 @@
     <dd>U+00A0 U+0020 U+00A0
   </dl>
 
-  <li>Otherwise, append a two-<a href=http://es5.github.com/#x8.4>element</a> string to <var title="">buffer</var> depending
+  <li>Otherwise, append a two-<a href=http://dev.w3.org/2006/webapi/WebIDL/#dfn-code-unit>code unit</a> string to <var title="">buffer</var> depending
   on <var title="">non-breaking start</var> and <var title="">non-breaking end</var>:
 
   <dl class=switch>
@@ -5217,7 +5217,7 @@
     <li>Otherwise, if <var title="">start node</var> is a <code class=external data-anolis-spec=domcore><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#text>Text</a></code> node and its
     <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-tree-parent title=concept-tree-parent>parent</a>'s <a href=http://dev.w3.org/csswg/cssom/#resolved-value>resolved value</a> for "white-space" is neither "pre" nor "pre-wrap"
     and <var title="">start offset</var> is not zero and the (<var title="">start offset</var>
-    &minus; 1)st <a href=http://es5.github.com/#x8.4>element</a> of <var title="">start node</var>'s <code class=external data-anolis-spec=domcore title=dom-CharacterData-data><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-characterdata-data>data</a></code> is a space
+    &minus; 1)st <a href=http://dev.w3.org/2006/webapi/WebIDL/#dfn-code-unit>code unit</a> of <var title="">start node</var>'s <code class=external data-anolis-spec=domcore title=dom-CharacterData-data><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-characterdata-data>data</a></code> is a space
     (0x0020) or non-breaking space (0x00A0), subtract one from <var title="">start
     offset</var>.
 
@@ -5255,17 +5255,17 @@
     <li>Otherwise, if <var title="">end node</var> is a <code class=external data-anolis-spec=domcore><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#text>Text</a></code> node and its
     <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-tree-parent title=concept-tree-parent>parent</a>'s <a href=http://dev.w3.org/csswg/cssom/#resolved-value>resolved value</a> for "white-space" is neither "pre" nor "pre-wrap"
     and <var title="">end offset</var> is not <var title="">end node</var>'s <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-node-length title=concept-node-length>length</a> and the
-    <var title="">end offset</var>th <a href=http://es5.github.com/#x8.4>element</a> of <var title="">end node</var>'s <code class=external data-anolis-spec=domcore title=dom-CharacterData-data><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-characterdata-data>data</a></code> is a
+    <var title="">end offset</var>th <a href=http://dev.w3.org/2006/webapi/WebIDL/#dfn-code-unit>code unit</a> of <var title="">end node</var>'s <code class=external data-anolis-spec=domcore title=dom-CharacterData-data><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-characterdata-data>data</a></code> is a
     space (0x0020) or non-breaking space (0x00A0):
 
     <ol>
       <li>If <var title="">follows space</var> is true and the <var title="">end offset</var>th
-      <a href=http://es5.github.com/#x8.4>element</a> of <var title="">end node</var>'s <code class=external data-anolis-spec=domcore title=dom-CharacterData-data><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-characterdata-data>data</a></code> is a space (0x0020), call
+      <a href=http://dev.w3.org/2006/webapi/WebIDL/#dfn-code-unit>code unit</a> of <var title="">end node</var>'s <code class=external data-anolis-spec=domcore title=dom-CharacterData-data><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-characterdata-data>data</a></code> is a space (0x0020), call
       <code class=external data-anolis-spec=domcore title=dom-CharacterData-deleteData><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-characterdata-deletedata>deleteData(<var title="">end offset</var>, 1)</a></code> on <var title="">end node</var>, then
       continue this loop from the beginning.
 
       <li>Set <var title="">follows space</var> to true if the <var title="">end offset</var>th
-      <a href=http://es5.github.com/#x8.4>element</a> of <var title="">end node</var>'s <code class=external data-anolis-spec=domcore title=dom-CharacterData-data><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-characterdata-data>data</a></code> is a space (0x0020), false
+      <a href=http://dev.w3.org/2006/webapi/WebIDL/#dfn-code-unit>code unit</a> of <var title="">end node</var>'s <code class=external data-anolis-spec=domcore title=dom-CharacterData-data><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-characterdata-data>data</a></code> is a space (0x0020), false
       otherwise.
 
       <li>Add one to <var title="">end offset</var>.
@@ -5303,11 +5303,11 @@
     <li>Otherwise:
 
     <ol>
-      <li>Remove the first <a href=http://es5.github.com/#x8.4>element</a> from <var title="">replacement whitespace</var>,
-      and let <var title="">element</var> be that <a href=http://es5.github.com/#x8.4>element</a>.
+      <li>Remove the first <a href=http://dev.w3.org/2006/webapi/WebIDL/#dfn-code-unit>code unit</a> from <var title="">replacement whitespace</var>,
+      and let <var title="">element</var> be that <a href=http://dev.w3.org/2006/webapi/WebIDL/#dfn-code-unit>code unit</a>.
 
       <li>If <var title="">element</var> is not the same as the <var title="">start
-      offset</var>th <a href=http://es5.github.com/#x8.4>element</a> of <var title="">start node</var>'s <code class=external data-anolis-spec=domcore title=dom-CharacterData-data><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-characterdata-data>data</a></code>:
+      offset</var>th <a href=http://dev.w3.org/2006/webapi/WebIDL/#dfn-code-unit>code unit</a> of <var title="">start node</var>'s <code class=external data-anolis-spec=domcore title=dom-CharacterData-data><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-characterdata-data>data</a></code>:
 
       <ol>
         <li>
@@ -7371,7 +7371,7 @@
     </div>
 
     <p>While <var title="">end offset</var> is not <var title="">node</var>'s <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-node-length title=concept-node-length>length</a> and the
-    <var title="">end offset</var>th <a href=http://es5.github.com/#x8.4>element</a> of <var title="">node</var>'s <code class=external data-anolis-spec=domcore title=dom-CharacterData-data><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-characterdata-data>data</a></code> has
+    <var title="">end offset</var>th <a href=http://dev.w3.org/2006/webapi/WebIDL/#dfn-code-unit>code unit</a> of <var title="">node</var>'s <code class=external data-anolis-spec=domcore title=dom-CharacterData-data><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-characterdata-data>data</a></code> has
     general category M when interpreted as a Unicode code point, add one to
     <var title="">end offset</var>.
 
@@ -8429,7 +8429,7 @@
   <li>If <var title="">value</var>'s <a href=http://es5.github.com/#x15.5.5.1>length</a> is greater than one:
 
   <ol>
-    <li>For each <a href=http://es5.github.com/#x8.4>element</a> <var title="">el</var> in <var title="">value</var>, take the
+    <li>For each <a href=http://dev.w3.org/2006/webapi/WebIDL/#dfn-code-unit>code unit</a> <var title="">el</var> in <var title="">value</var>, take the
     <a href=#action>action</a> for <a href=#the-inserttext-command>the <code title="">insertText</code>
     command</a>, with <var title="">value</var> equal to <var title="">el</var>.
 
--- a/preprocess	Fri Aug 19 13:56:59 2011 -0600
+++ b/preprocess	Fri Aug 19 13:59:01 2011 -0600
@@ -26,6 +26,7 @@
     'cdlength': '<code data-anolis-spec=domcore title=dom-CharacterData-length>length</code>',
     'child': '<span data-anolis-spec=domcore title=concept-tree-child>child</span>',
     'children': '<span data-anolis-spec=domcore title=concept-tree-child>children</span>',
+    'codeunit': '<a href=http://dev.w3.org/2006/webapi/WebIDL/#dfn-code-unit>code unit</a>',
     'collapsetoend': '<code data-anolis-spec=domrange title=dom-Selection-collapseToEnd>collapseToEnd()</code>',
     'collection': '<span data-anolis-spec=domcore title=concept-collection>collection</span>',
     'contained': '<span data-anolis-spec=domrange>contained</span>',
@@ -95,7 +96,6 @@
     'span': '<code data-anolis-spec=html title="the span element">span</code>',
     'startnode': '<span data-anolis-spec=domrange title=concept-range-start>start</span> <span data-anolis-spec=domrange title=concept-boundary-point-node>node</span>',
     'startoffset': '<span data-anolis-spec=domrange title=concept-range-start>start</span> <span data-anolis-spec=domrange title=concept-boundary-point-offset>offset</span>',
-    'strel': '<a href=http://es5.github.com/#x8.4>element</a>',
     'strike': '<code data-anolis-spec=html title="the strike element">strike</code>',
     'strlen': '<a href=http://es5.github.com/#x15.5.5.1>length</a>',
     'strong': '<code data-anolis-spec=html title="the strong element">strong</code>',
--- a/source.html	Fri Aug 19 13:56:59 2011 -0600
+++ b/source.html	Fri Aug 19 13:59:01 2011 -0600
@@ -3304,7 +3304,7 @@
     <var>lower bound</var>.
 
     <li>If <var>pixel size</var> is less than <var>average</var>, return the
-    one-[[strel]] string consisting of the digit <var>returned size</var>.
+    one-[[codeunit]] string consisting of the digit <var>returned size</var>.
 
     <li>Add one to <var>returned size</var>.
   </ol>
@@ -5181,7 +5181,7 @@
   <li>While <var>n</var> is greater than three, append <var>repeated pair</var>
   to <var>buffer</var> and subtract two from <var>n</var>.
 
-  <li>If <var>n</var> is three, append a three-[[strel]] string to
+  <li>If <var>n</var> is three, append a three-[[codeunit]] string to
   <var>buffer</var> depending on <var>non-breaking start</var> and
   <var>non-breaking end</var>:
 
@@ -5199,7 +5199,7 @@
     <dd>U+00A0 U+0020 U+00A0
   </dl>
 
-  <li>Otherwise, append a two-[[strel]] string to <var>buffer</var> depending
+  <li>Otherwise, append a two-[[codeunit]] string to <var>buffer</var> depending
   on <var>non-breaking start</var> and <var>non-breaking end</var>:
 
   <dl class=switch>
@@ -5251,7 +5251,7 @@
     <li>Otherwise, if <var>start node</var> is a [[text]] node and its
     [[parent]]'s [[resval]] for "white-space" is neither "pre" nor "pre-wrap"
     and <var>start offset</var> is not zero and the (<var>start offset</var>
-    &minus; 1)st [[strel]] of <var>start node</var>'s [[cddata]] is a space
+    &minus; 1)st [[codeunit]] of <var>start node</var>'s [[cddata]] is a space
     (0x0020) or non-breaking space (0x00A0), subtract one from <var>start
     offset</var>.
 
@@ -5289,17 +5289,17 @@
     <li>Otherwise, if <var>end node</var> is a [[text]] node and its
     [[parent]]'s [[resval]] for "white-space" is neither "pre" nor "pre-wrap"
     and <var>end offset</var> is not <var>end node</var>'s [[length]] and the
-    <var>end offset</var>th [[strel]] of <var>end node</var>'s [[cddata]] is a
+    <var>end offset</var>th [[codeunit]] of <var>end node</var>'s [[cddata]] is a
     space (0x0020) or non-breaking space (0x00A0):
 
     <ol>
       <li>If <var>follows space</var> is true and the <var>end offset</var>th
-      [[strel]] of <var>end node</var>'s [[cddata]] is a space (0x0020), call
+      [[codeunit]] of <var>end node</var>'s [[cddata]] is a space (0x0020), call
       [[deletedata|<var>end offset</var>, 1]] on <var>end node</var>, then
       continue this loop from the beginning.
 
       <li>Set <var>follows space</var> to true if the <var>end offset</var>th
-      [[strel]] of <var>end node</var>'s [[cddata]] is a space (0x0020), false
+      [[codeunit]] of <var>end node</var>'s [[cddata]] is a space (0x0020), false
       otherwise.
 
       <li>Add one to <var>end offset</var>.
@@ -5337,11 +5337,11 @@
     <li>Otherwise:
 
     <ol>
-      <li>Remove the first [[strel]] from <var>replacement whitespace</var>,
-      and let <var>element</var> be that [[strel]].
+      <li>Remove the first [[codeunit]] from <var>replacement whitespace</var>,
+      and let <var>element</var> be that [[codeunit]].
 
       <li>If <var>element</var> is not the same as the <var>start
-      offset</var>th [[strel]] of <var>start node</var>'s [[cddata]]:
+      offset</var>th [[codeunit]] of <var>start node</var>'s [[cddata]]:
 
       <ol>
         <li>
@@ -7429,7 +7429,7 @@
     </div>
 
     <p>While <var>end offset</var> is not <var>node</var>'s [[length]] and the
-    <var>end offset</var>th [[strel]] of <var>node</var>'s [[cddata]] has
+    <var>end offset</var>th [[codeunit]] of <var>node</var>'s [[cddata]] has
     general category M when interpreted as a Unicode code point, add one to
     <var>end offset</var>.
 
@@ -8495,7 +8495,7 @@
   <li>If <var>value</var>'s [[strlen]] is greater than one:
 
   <ol>
-    <li>For each [[strel]] <var>el</var> in <var>value</var>, take the
+    <li>For each [[codeunit]] <var>el</var> in <var>value</var>, take the
     <span>action</span> for <span>the <code title>insertText</code>
     command</span>, with <var>value</var> equal to <var>el</var>.