[html5] r7409 - [giow] (0) Fix some errors in the algorithm. Fixing https://www.w3.org/Bugs/Publ [...]

whatwg at whatwg.org whatwg at whatwg.org
Wed Sep 26 11:08:08 PDT 2012


Author: ianh
Date: 2012-09-26 11:08:06 -0700 (Wed, 26 Sep 2012)
New Revision: 7409

Modified:
   complete.html
   index
   source
Log:
[giow] (0) Fix some errors in the algorithm.
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=18337
Affected topics: DOM APIs

Modified: complete.html
===================================================================
--- complete.html	2012-09-26 03:47:23 UTC (rev 7408)
+++ complete.html	2012-09-26 18:08:06 UTC (rev 7409)
@@ -56985,13 +56985,17 @@
    attribute.</li>
 
    <li><p>If <var title="">start</var> is less than <var title="">end</var>, delete the sequence of characters starting with
-   the character at the <var title="">selection start</var>th position
-   (in logical order) and ending with the character at the <span title="">(<var title="">selection end</var>-1)</span>th
+   the character at the <var title="">start</var>th position
+   (in logical order) and ending with the character at the <span title="">(<var title="">end</var>-1)</span>th
    position.</li>
 
    <li><p>Insert the value of the first argument into the text of the
    value of the text field, immediately before the <var title="">start</var>th character.</li>
 
+   <li><p>Let <var title="">new length</var> be the length of the value of the first argument.</li>
+
+   <li><p>Let <var title="">new end</var> be the sum of <var title="">start</var> and <var title="">new length</var>.</li>
+
    <li>
 
     <p>Run the appropriate set of substeps from the following
@@ -57003,7 +57007,7 @@
 
       <p>Let <var title="">selection start</var> be <var title="">start</var>.</p>
 
-      <p>Let <var title="">selection end</var> be <var title="">end</var>.</p>
+      <p>Let <var title="">selection end</var> be <var title="">new end</var>.</p>
 
      </dd>
 
@@ -57019,7 +57023,7 @@
 
      <dd>
 
-      <p>Let <var title="">selection start</var> and <var title="">selection end</var> be <var title="">end</var>.</p>
+      <p>Let <var title="">selection start</var> and <var title="">selection end</var> be <var title="">new end</var>.</p>
 
      </dd>
 
@@ -57029,9 +57033,6 @@
 
       <ol><li><p>Let <var title="">old length</var> be <var title="">end</var> minus <var title="">start</var>.</p>
 
-       <li><p>Let <var title="">new length</var> be the length of the
-       value of the first argument (the newly inserted text).</p>
-
        <li><p>Let <var title="">delta</var> be <var title="">new
        length</var> minus <var title="">old length</var>.</p>
 
@@ -57053,7 +57054,7 @@
         <p>If <var title="">selection end</var> is greater than <var title="">end</var>, then increment it by <var title="">delta</var> in the same way.</p>
 
         <p>Otherwise: if <var title="">selection end</var> is greater
-        than <var title="">start</var>, then set it to <var title="">end</var>. (This snaps the end of the selection to
+        than <var title="">start</var>, then set it to <var title="">new end</var>. (This snaps the end of the selection to
         the end of the new text if it was in the middle of the text
         that it replaced.)</p>
 

Modified: index
===================================================================
--- index	2012-09-26 03:47:23 UTC (rev 7408)
+++ index	2012-09-26 18:08:06 UTC (rev 7409)
@@ -56985,13 +56985,17 @@
    attribute.</li>
 
    <li><p>If <var title="">start</var> is less than <var title="">end</var>, delete the sequence of characters starting with
-   the character at the <var title="">selection start</var>th position
-   (in logical order) and ending with the character at the <span title="">(<var title="">selection end</var>-1)</span>th
+   the character at the <var title="">start</var>th position
+   (in logical order) and ending with the character at the <span title="">(<var title="">end</var>-1)</span>th
    position.</li>
 
    <li><p>Insert the value of the first argument into the text of the
    value of the text field, immediately before the <var title="">start</var>th character.</li>
 
+   <li><p>Let <var title="">new length</var> be the length of the value of the first argument.</li>
+
+   <li><p>Let <var title="">new end</var> be the sum of <var title="">start</var> and <var title="">new length</var>.</li>
+
    <li>
 
     <p>Run the appropriate set of substeps from the following
@@ -57003,7 +57007,7 @@
 
       <p>Let <var title="">selection start</var> be <var title="">start</var>.</p>
 
-      <p>Let <var title="">selection end</var> be <var title="">end</var>.</p>
+      <p>Let <var title="">selection end</var> be <var title="">new end</var>.</p>
 
      </dd>
 
@@ -57019,7 +57023,7 @@
 
      <dd>
 
-      <p>Let <var title="">selection start</var> and <var title="">selection end</var> be <var title="">end</var>.</p>
+      <p>Let <var title="">selection start</var> and <var title="">selection end</var> be <var title="">new end</var>.</p>
 
      </dd>
 
@@ -57029,9 +57033,6 @@
 
       <ol><li><p>Let <var title="">old length</var> be <var title="">end</var> minus <var title="">start</var>.</p>
 
-       <li><p>Let <var title="">new length</var> be the length of the
-       value of the first argument (the newly inserted text).</p>
-
        <li><p>Let <var title="">delta</var> be <var title="">new
        length</var> minus <var title="">old length</var>.</p>
 
@@ -57053,7 +57054,7 @@
         <p>If <var title="">selection end</var> is greater than <var title="">end</var>, then increment it by <var title="">delta</var> in the same way.</p>
 
         <p>Otherwise: if <var title="">selection end</var> is greater
-        than <var title="">start</var>, then set it to <var title="">end</var>. (This snaps the end of the selection to
+        than <var title="">start</var>, then set it to <var title="">new end</var>. (This snaps the end of the selection to
         the end of the new text if it was in the middle of the text
         that it replaced.)</p>
 

Modified: source
===================================================================
--- source	2012-09-26 03:47:23 UTC (rev 7408)
+++ source	2012-09-26 18:08:06 UTC (rev 7409)
@@ -66558,15 +66558,20 @@
 
    <li><p>If <var title="">start</var> is less than <var
    title="">end</var>, delete the sequence of characters starting with
-   the character at the <var title="">selection start</var>th position
+   the character at the <var title="">start</var>th position
    (in logical order) and ending with the character at the <span
-   title="">(<var title="">selection end</var>-1)</span>th
+   title="">(<var title="">end</var>-1)</span>th
    position.</p></li>
 
    <li><p>Insert the value of the first argument into the text of the
    value of the text field, immediately before the <var
    title="">start</var>th character.</p></li>
 
+   <li><p>Let <var title="">new length</var> be the length of the value of the first argument.</p></li>
+
+   <li><p>Let <var title="">new end</var> be the sum of <var title="">start</var> and <var
+   title="">new length</var>.</p></li>
+
    <li>
 
     <p>Run the appropriate set of substeps from the following
@@ -66582,7 +66587,7 @@
       title="">start</var>.</p>
 
       <p>Let <var title="">selection end</var> be <var
-      title="">end</var>.</p>
+      title="">new end</var>.</p>
 
      </dd>
 
@@ -66600,7 +66605,7 @@
      <dd>
 
       <p>Let <var title="">selection start</var> and <var
-      title="">selection end</var> be <var title="">end</var>.</p>
+      title="">selection end</var> be <var title="">new end</var>.</p>
 
      </dd>
 
@@ -66613,9 +66618,6 @@
        <li><p>Let <var title="">old length</var> be <var
        title="">end</var> minus <var title="">start</var>.</p>
 
-       <li><p>Let <var title="">new length</var> be the length of the
-       value of the first argument (the newly inserted text).</p>
-
        <li><p>Let <var title="">delta</var> be <var title="">new
        length</var> minus <var title="">old length</var>.</p>
 
@@ -66644,7 +66646,7 @@
 
         <p>Otherwise: if <var title="">selection end</var> is greater
         than <var title="">start</var>, then set it to <var
-        title="">end</var>. (This snaps the end of the selection to
+        title="">new end</var>. (This snaps the end of the selection to
         the end of the new text if it was in the middle of the text
         that it replaced.)</p>
 




More information about the Commit-Watchers mailing list