Skip to content

Commit

Permalink
[e] (0) Cleanup area of last checkin; ack for last checkin
Browse files Browse the repository at this point in the history
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=18337
Affected topics: DOM APIs, HTML

git-svn-id: http://svn.whatwg.org/webapps@7410 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 26, 2012
1 parent 2df960b commit 3de820e
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 193 deletions.
95 changes: 42 additions & 53 deletions complete.html
Expand Up @@ -56953,53 +56953,44 @@ <h4 id=textFieldSelection><span class=secno>4.10.20 </span>APIs for the text fie
<a href=#user-interaction-task-source>user interaction task source</a> as the task source.</p>



<p>The <dfn id=dom-textarea/input-setrangetext title=dom-textarea/input-setRangeText><code>setRangeText(<var title="">replacement</var>, <var title="">start</var>, <var title="">end</var>, <var title="">selectMode</var>)</code></dfn>
method must run the following steps:</p>

<ol><li>

<p>If the method has only one argument, then let <var title="">start</var> and <var title="">end</var> have the values
of the <code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>
attribute and the <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>
attribute respectively.</p>
<p>If the method has only one argument, then let <var title="">start</var> and <var title="">end</var> have the values of the <code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code> attribute and the <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code> attribute respectively.</p>

<p>Otherwise, let <var title="">start</var>, <var title="">end</var> have the values of the second and third
arguments respectively.</p>
<p>Otherwise, let <var title="">start</var>, <var title="">end</var> have the values of the
second and third arguments respectively.</p>

</li>

<li><p>If <var title="">start</var> is greater than <var title="">end</var>, then throw an <code><a href=#indexsizeerror>IndexSizeError</a></code>
exception and abort these steps.</li>
<li><p>If <var title="">start</var> is greater than <var title="">end</var>, then throw an
<code><a href=#indexsizeerror>IndexSizeError</a></code> exception and abort these steps.</li>

<li><p>If either <var title="">start</var> or <var title="">end</var> are greater than the length of the value of the
text field, then set them to the length of the value of the text
<li><p>If either <var title="">start</var> or <var title="">end</var> are greater than the length
of the value of the text field, then set them to the length of the value of the text
field.</li>

<li><p>Let <var title="">selection start</var> be the current value
of the <code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>
attribute.</li>
<li><p>Let <var title="">selection start</var> be the current value of the <code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code> attribute.</li>

<li><p>Let <var title="">selection end</var> be the current value
of the <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>
attribute.</li>
<li><p>Let <var title="">selection end</var> be the current value of the <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code> 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="">start</var>th position
(in logical order) and ending with the character at the <span title="">(<var title="">end</var>-1)</span>th
<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="">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>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
list:</p>
<p>Run the appropriate set of substeps from the following list:</p>

<dl class=switch><dt>If the fourth argument's value is "<dfn id=dom-selectionmode-select title=dom-SelectionMode-select><code>select</code></dfn>"</dt>

Expand Down Expand Up @@ -57033,30 +57024,29 @@ <h4 id=textFieldSelection><span class=secno>4.10.20 </span>APIs for the text fie

<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="">delta</var> be <var title="">new
length</var> minus <var title="">old length</var>.</p>
<li><p>Let <var title="">delta</var> be <var title="">new length</var> minus <var title="">old length</var>.</p>

<li>

<p>If <var title="">selection start</var> is greater than <var title="">end</var>, then increment it by <var title="">delta</var>. (If <var title="">delta</var> is
negative, i.e. the new text is shorter than the old text, then
this will <em>decrease</em> the value of <var title="">selection start</var>.)</p>
<p>If <var title="">selection start</var> is greater than <var title="">end</var>, then
increment it by <var title="">delta</var>. (If <var title="">delta</var> is negative, i.e.
the new text is shorter than the old text, then this will <em>decrease</em> the value of
<var title="">selection start</var>.)</p>

<p>Otherwise: if <var title="">selection start</var> is
greater than <var title="">start</var>, then set it to <var title="">start</var>. (This snaps the start of the selection
to the start of the new text if it was in the middle of the
text that it replaced.)</p>
<p>Otherwise: if <var title="">selection start</var> is greater than <var title="">start</var>, then set it to <var title="">start</var>. (This snaps the start of the
selection to the start of the new text if it was in the middle of the text that it
replaced.)</p>

</li>

<li>

<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>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="">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>
<p>Otherwise: if <var title="">selection end</var> is greater 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>

</li>

Expand All @@ -57066,28 +57056,26 @@ <h4 id=textFieldSelection><span class=secno>4.10.20 </span>APIs for the text fie

<li>

<p>Set the selection of the text field to 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 position. In UAs where
there is no concept of an empty selection, this must set the
cursor to be just before the character with offset <var title="">end</var>. The direction of the selection must be set to
<i>forward</i> if the platform does not support selections with
the direction <i>none</i>, and <i>none</i> otherwise.</p>
<p>Set the selection of the text field to 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 position. In UAs
where there is no concept of an empty selection, this must set the cursor to be just before the
character with offset <var title="">end</var>. The direction of the selection must be set to
<i>forward</i> if the platform does not support selections with the direction <i>none</i>, and
<i>none</i> otherwise.</p>

</li>

<li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple
event</a> that bubbles named <code title=event-select>select</code> at the element, using the
<a href=#user-interaction-task-source>user interaction task source</a> as the task
source.</li>
<li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> that bubbles named <code title=event-select>select</code> at the element, using the <a href=#user-interaction-task-source>user interaction task
source</a> as the task source.</li>

</ol><p>All elements to which this API applies have either a selection or
a text entry cursor position at all times (even for elements that
are not <a href=#being-rendered>being rendered</a>). User agents should follow
platform conventions to determine their initial state.</p>
</ol><p>All elements to which this API applies have either a selection or a text entry cursor position
at all times (even for elements that are not <a href=#being-rendered>being rendered</a>). User agents should
follow platform conventions to determine their initial state.</p>

</div>


<p>Characters with no visible rendering, such as U+200D ZERO WIDTH
JOINER, still count as characters. Thus, for instance, the selection
can include just an invisible character, and the text insertion
Expand Down Expand Up @@ -106532,6 +106520,7 @@ <h2 class=no-num id=references>References</h2><!--REFS-->
Olivier Gendrin,
Olli Pettay,
oSand, <!-- from reddit -->
Pablo Flouret,
Patrick H. Lauke,
Patrik Persson,
Paul Adenot,
Expand Down

0 comments on commit 3de820e

Please sign in to comment.