[html5] r6060 - [giow] (0) Add input.selectionDirection and textarea.selectionDirection, to allo [...]
whatwg at whatwg.org
whatwg at whatwg.org
Tue May 3 16:49:51 PDT 2011
Author: ianh
Date: 2011-05-03 16:49:50 -0700 (Tue, 03 May 2011)
New Revision: 6060
Modified:
complete.html
index
source
Log:
[giow] (0) Add input.selectionDirection and textarea.selectionDirection, to allow authors to save the direction of the selection.
Modified: complete.html
===================================================================
--- complete.html 2011-05-03 22:09:18 UTC (rev 6059)
+++ complete.html 2011-05-03 23:49:50 UTC (rev 6060)
@@ -41632,7 +41632,8 @@
void <a href=#dom-textarea/input-select title=dom-textarea/input-select>select</a>();
attribute unsigned long <a href=#dom-textarea/input-selectionstart title=dom-textarea/input-selectionStart>selectionStart</a>;
attribute unsigned long <a href=#dom-textarea/input-selectionend title=dom-textarea/input-selectionEnd>selectionEnd</a>;
- void <a href=#dom-textarea/input-setselectionrange title=dom-textarea/input-setSelectionRange>setSelectionRange</a>(in unsigned long start, in unsigned long end);
+ attribute DOMString <a href=#dom-textarea/input-selectiondirection title=dom-textarea/input-selectionDirection>selectionDirection</a>;
+ void <a href=#dom-textarea/input-setselectionrange title=dom-textarea/input-setSelectionRange>setSelectionRange</a>(in unsigned long start, in unsigned long end, in optional DOMString direction);
};</pre>
</dd>
</dl><p>The <code><a href=#the-input-element>input</a></code> element <a href=#represents>represents</a> a typed data field,
@@ -41744,8 +41745,9 @@
</table><p>The <i>missing value default</i> is the <a href=#text-state-and-search-state title=attr-input-type-text>Text</a> state.</p>
<p>Which of the <code title=attr-input-accept><a href=#attr-input-accept>accept</a></code>, <code title=attr-input-alt><a href=#attr-input-alt>alt</a></code>, <code title=attr-input-autocomplete><a href=#attr-input-autocomplete>autocomplete</a></code>, <code title=attr-input-checked><a href=#attr-input-checked>checked</a></code>, <code title=attr-input-dirname><a href=#attr-input-dirname>dirname</a></code>, <code title=attr-fs-formaction><a href=#attr-fs-formaction>formaction</a></code>, <code title=attr-fs-formenctype><a href=#attr-fs-formenctype>formenctype</a></code>, <code title=attr-fs-formmethod><a href=#attr-fs-formmethod>formmethod</a></code>, <code title=attr-fs-formnovalidate><a href=#attr-fs-formnovalidate>formnovalidate</a></code>, <code title=attr-fs-formtarget><a href=#attr-fs-formtarget>formtarget</a></code>, <code title=attr-dim-height><a href=#attr-dim-height>height</a></code>, <code title=attr-input-list><a href=#attr-input-list>list</a></code>, <code tit
le=attr-input-max><a href=#attr-input-max>max</a></code>, <code title=attr-input-maxlength><a href=#attr-input-maxlength>maxlength</a></code>, <code title=attr-input-min><a href=#attr-input-min>min</a></code>, <code title=attr-input-multiple><a href=#attr-input-multiple>multiple</a></code>, <code title=attr-input-pattern><a href=#attr-input-pattern>pattern</a></code>, <code title=attr-input-placeholder><a href=#attr-input-placeholder>placeholder</a></code>, <code title=attr-input-readonly><a href=#attr-input-readonly>readonly</a></code>, <code title=attr-input-required><a href=#attr-input-required>required</a></code>, <code title=attr-input-size><a href=#attr-input-size>size</a></code>, <code title=attr-input-src><a href=#attr-input-src>src</a></code>, <code title=attr-input-step><a href=#attr-input-step>step</a></code>, and <code title=attr-dim-width><a href=#attr-dim-width>width</a></code> content attributes, the <code title=dom-input-checked><a href=#dom-input-checked>che
cked</a></code>, <code title=dom-input-files><a href=#dom-input-files>files</a></code>, <code title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, <code title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code>, <code title=dom-input-list><a href=#dom-input-list>list</a></code>, and <code title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code> IDL
- attributes, the <code title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> method, the <code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code> and
- <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>
+ attributes, the <code title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> method, the <code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
+ <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
IDL attributes, the <code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code>
method, the <code title=dom-input-stepUp><a href=#dom-input-stepup>stepUp()</a></code> and
<code title=dom-input-stepDown><a href=#dom-input-stepdown>stepDown()</a></code> methods, and the
@@ -42600,6 +42602,30 @@
<td class=no> · <!-- Reset Button -->
<!-- <td class="no"> · Button -->
+ <tr><th> <code title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>
+ <td class=no> · <!-- Hidden -->
+ <td class=yes> Yes <!-- Text -->
+<!-- <td class="yes"> Yes Search -->
+ <td class=yes> Yes <!-- URL, Telephone -->
+ <td class=no> · <!-- E-mail -->
+ <td class=yes> Yes <!-- Password -->
+ <td class=no> · <!-- Date and Time -->
+<!-- <td class="no"> · Date -->
+<!-- <td class="no"> · Month -->
+<!-- <td class="no"> · Week -->
+<!-- <td class="no"> · Time -->
+ <td class=no> · <!-- Local Date and Time -->
+<!-- <td class="no"> · Number -->
+ <td class=no> · <!-- Range -->
+ <td class=no> · <!-- Color -->
+ <td class=no> · <!-- Checkbox -->
+<!-- <td class="no"> · Radio Button -->
+ <td class=no> · <!-- File Upload -->
+ <td class=no> · <!-- Submit Button -->
+ <td class=no> · <!-- Image Button -->
+ <td class=no> · <!-- Reset Button -->
+<!-- <td class="no"> · Button -->
+
<tr><th> <code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code>
<td class=no> · <!-- Hidden -->
<td class=yes> Yes <!-- Text -->
@@ -42900,6 +42926,7 @@
<code title=dom-lfe-labels><a href=#dom-lfe-labels>labels</a></code> attribute provides a list
of the element's <code><a href=#the-label-element>label</a></code>s. The <code title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>, <code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
and <code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code>
methods and attributes expose the element's text selection. The
<code title=dom-fe-autofocus><a href=#dom-fe-autofocus>autofocus</a></code>, <code title=dom-fe-disabled><a href=#dom-fe-disabled>disabled</a></code>, <code title=dom-fae-form><a href=#dom-fae-form>form</a></code>, and <code title=dom-fe-name><a href=#dom-fe-name>name</a></code> IDL attributes are part of the
@@ -42981,6 +43008,7 @@
<code class=no-backref title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, and
<code class=no-backref title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>,
@@ -43069,7 +43097,8 @@
<code title=dom-input-list><a href=#dom-input-list>list</a></code>,
<code title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
- <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>, and
<code title=dom-input-value><a href=#dom-input-value>value</a></code> IDL attributes;
<code title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -43167,7 +43196,8 @@
<code title=dom-input-list><a href=#dom-input-list>list</a></code>,
<code title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
- <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>, and
<code title=dom-input-value><a href=#dom-input-value>value</a></code> IDL attributes;
<code title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -43270,7 +43300,8 @@
<code title=dom-input-list><a href=#dom-input-list>list</a></code>,
<code title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
- <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>, and
<code title=dom-input-value><a href=#dom-input-value>value</a></code> IDL attributes;
<code title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -43568,6 +43599,7 @@
<code class=no-backref title=dom-input-files><a href=#dom-input-files>files</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, and
<code class=no-backref title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>,
@@ -43623,7 +43655,8 @@
<code title=attr-input-required><a href=#attr-input-required>required</a></code>, and
<code title=attr-input-size><a href=#attr-input-size>size</a></code> content attributes;
<code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
- <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>, and
<code title=dom-input-value><a href=#dom-input-value>value</a></code> IDL attributes;
<code title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>, and
<code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -43821,8 +43854,9 @@
element:
<code class=no-backref title=dom-input-checked><a href=#dom-input-checked>checked</a></code>,
<code class=no-backref title=dom-input-files><a href=#dom-input-files>files</a></code>,
- <code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>, and
- <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code> IDL attributes;
+ <code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code class=no-backref title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -43994,8 +44028,9 @@
<p>The following IDL attributes and methods do not apply to the
element:
<code class=no-backref title=dom-input-checked><a href=#dom-input-checked>checked</a></code>,
- <code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>, and
- <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code> IDL attributes;
+ <code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code class=no-backref title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -44147,8 +44182,9 @@
element:
<code class=no-backref title=dom-input-checked><a href=#dom-input-checked>checked</a></code>,
<code class=no-backref title=dom-input-files><a href=#dom-input-files>files</a></code>,
- <code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>, and
- <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code> IDL attributes;
+ <code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code class=no-backref title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -44301,8 +44337,9 @@
element:
<code class=no-backref title=dom-input-checked><a href=#dom-input-checked>checked</a></code>,
<code class=no-backref title=dom-input-files><a href=#dom-input-files>files</a></code>,
- <code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>, and
- <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code> IDL attributes;
+ <code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code class=no-backref title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -44452,8 +44489,9 @@
element:
<code class=no-backref title=dom-input-checked><a href=#dom-input-checked>checked</a></code>,
<code class=no-backref title=dom-input-files><a href=#dom-input-files>files</a></code>,
- <code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>, and
- <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code> IDL attributes;
+ <code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code class=no-backref title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -44593,7 +44631,8 @@
<code class=no-backref title=dom-input-checked><a href=#dom-input-checked>checked</a></code>,
<code class=no-backref title=dom-input-files><a href=#dom-input-files>files</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
- <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>, and
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code class=no-backref title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -44756,7 +44795,8 @@
<code class=no-backref title=dom-input-checked><a href=#dom-input-checked>checked</a></code>,
<code class=no-backref title=dom-input-files><a href=#dom-input-files>files</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
- <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>, and
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code class=no-backref title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -44923,7 +44963,8 @@
<code class=no-backref title=dom-input-checked><a href=#dom-input-checked>checked</a></code>,
<code class=no-backref title=dom-input-files><a href=#dom-input-files>files</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
- <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>, and
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code class=no-backref title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -45083,6 +45124,7 @@
<code class=no-backref title=dom-input-files><a href=#dom-input-files>files</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, and
<code class=no-backref title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>,
@@ -45191,6 +45233,7 @@
<code class=no-backref title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, and
<code class=no-backref title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>,
@@ -45326,6 +45369,7 @@
<code class=no-backref title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, and
<code class=no-backref title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>,
@@ -45518,6 +45562,7 @@
<code class=no-backref title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, and
<code class=no-backref title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>,
@@ -45610,6 +45655,7 @@
<code class=no-backref title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, and
<code class=no-backref title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>,
@@ -45824,6 +45870,7 @@
<code class=no-backref title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, and
<code class=no-backref title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>,
@@ -45912,6 +45959,7 @@
<code class=no-backref title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, and
<code class=no-backref title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>,
@@ -45992,6 +46040,7 @@
<code class=no-backref title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, and
<code class=no-backref title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>,
@@ -48185,7 +48234,8 @@
void <a href=#dom-textarea/input-select title=dom-textarea/input-select>select</a>();
attribute unsigned long <a href=#dom-textarea/input-selectionstart title=dom-textarea/input-selectionStart>selectionStart</a>;
attribute unsigned long <a href=#dom-textarea/input-selectionend title=dom-textarea/input-selectionEnd>selectionEnd</a>;
- void <a href=#dom-textarea/input-setselectionrange title=dom-textarea/input-setSelectionRange>setSelectionRange</a>(in unsigned long start, in unsigned long end);
+ attribute DOMString <a href=#dom-textarea/input-selectiondirection title=dom-textarea/input-selectionDirection>selectionDirection</a>;
+ void <a href=#dom-textarea/input-setselectionrange title=dom-textarea/input-setSelectionRange>setSelectionRange</a>(in unsigned long start, in unsigned long end, in optional DOMString direction);
};</pre>
</dd>
</dl><p>The <code><a href=#the-textarea-element>textarea</a></code> element <a href=#represents>represents</a> a
@@ -48476,6 +48526,7 @@
<code title=dom-lfe-labels><a href=#dom-lfe-labels>labels</a></code> attribute provides a list
of the element's <code><a href=#the-label-element>label</a></code>s. The <code title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>, <code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
and <code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code>
methods and attributes expose the element's text selection. The
<code title=dom-fe-autofocus><a href=#dom-fe-autofocus>autofocus</a></code>, <code title=dom-fe-disabled><a href=#dom-fe-disabled>disabled</a></code>, <code title=dom-fae-form><a href=#dom-fae-form>form</a></code>, and <code title=dom-fe-name><a href=#dom-fe-name>name</a></code> IDL attributes are part of the
@@ -50008,7 +50059,8 @@
<pre class="idl extract"> void <a href=#dom-textarea/input-select title=dom-textarea/input-select>select</a>();
attribute unsigned long <a href=#dom-textarea/input-selectionstart title=dom-textarea/input-selectionStart>selectionStart</a>;
attribute unsigned long <a href=#dom-textarea/input-selectionend title=dom-textarea/input-selectionEnd>selectionEnd</a>;
- void <a href=#dom-textarea/input-setselectionrange title=dom-textarea/input-setSelectionRange>setSelectionRange</a>(in unsigned long start, in unsigned long end);</pre>
+ attribute DOMString <a href=#dom-textarea/input-selectiondirection title=dom-textarea/input-selectionDirection>selectionDirection</a>;
+ void <a href=#dom-textarea/input-setselectionrange title=dom-textarea/input-setSelectionRange>setSelectionRange</a>(in unsigned long start, in unsigned long end, in optional DOMString direction);</pre>
<!-- v2: also add textLength? it seems to be widely used -->
<p>These methods and attributes expose and control the selection of
@@ -50042,14 +50094,26 @@
</dd>
- <dt><var title="">element</var> . <code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange</a></code>(<var title="">start</var>, <var title="">end</var>)</dt>
+ <dt><var title="">element</var> . <code title=dom-textarea/input-selecionDirection>selectionDirection</code> [ = <var title="">value</var> ]</dt>
<dd>
- <p>Changes the selection to cover the given substring.</p>
+ <p>Returns the current direction of the selection.</p>
+ <p>Can be set, to change the direction of the selection.</p>
+
+ <p>The possible values are "<code title="">forward</code>", "<code title="">backward</code>", and "<code title="">none</code>".</p>
+
</dd>
+ <dt><var title="">element</var> . <code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange</a></code>(<var title="">start</var>, <var title="">end</var> [, <var title="">direction</var>] )</dt>
+
+ <dd>
+
+ <p>Changes the selection to cover the given substring in the given direction. If the direction is omitted, it will be reset to be the platform default (none or forward).</p>
+
+ </dd>
+
</dl><div class=impl>
<p>When these methods and attributes are used with
@@ -50062,9 +50126,34 @@
elements, these methods and attributes must operate on the element's
<a href=#concept-textarea-raw-value title=concept-textarea-raw-value>raw value</a>.</p>
+ <p>The selections of <code><a href=#the-input-element>input</a></code> and <code><a href=#the-textarea-element>textarea</a></code>
+ elements have a <i>direction</i>, which is either <i>forward</i>,
+ <i>backward</i>, or <i>none</i>. This direction is set when the user
+ manipulates the selection. The exact meaning of the selection
+ direction depends on the platform.</p>
+
+ <p class=note>On Windows, the direction indicates the position of
+ the caret relative to the selection: a <i>forward</i> selection has
+ the caret at the end of the selection and a <i>backward</i>
+ selection has the caret at the start of the selection. Windows has
+ no <i>none</i> direction. On Mac, the direction indicates which end
+ of the selection is affected when the user adjusts the size of the
+ selection using the arrow keys with the Shift modifier: the forward
+ direction means the end of the selection is modified, and the
+ backwards direction means the start of the selection is modified.
+ The none direction is the default on Mac, it indicates that no
+ particular direction has yet been selected. The user sets the
+ direction implicitly when first adjusting the selection, based on
+ which directional arrow key was used.</p>
+
+
<p>The <dfn id=dom-textarea/input-select title=dom-textarea/input-select><code>select()</code></dfn> method
- must cause the contents of the text field to be fully selected.</p>
+ must cause the contents of the text field to be fully selected, with
+ the selection direction being none, if the platform support
+ selections with the direction <i>none</i>, or otherwise
+ <i>forward</i>.</p>
+
<p>The <dfn id=dom-textarea/input-selectionstart title=dom-textarea/input-selectionStart><code>selectionStart</code></dfn>
attribute must, on getting, return the offset (in logical order) to
the character that immediately follows the start of the
@@ -50073,13 +50162,15 @@
text entry cursor.</p>
<p>On setting, it must act as if the <code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code>
- method had been called, with the new value as the first argument,
- and the current value of the <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>
+ method had been called, with the new value as the first argument;
+ the current value of the <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>
attribute as the second argument, unless the current value of the
<code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code> is
less than the new value, in which case the second argument must also
- be the new value.</p>
+ be the new value; and the current value of the <code title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>
+ as the third argument.</p>
+
<p>The <dfn id=dom-textarea/input-selectionend title=dom-textarea/input-selectionEnd><code>selectionEnd</code></dfn>
attribute must, on getting, return the offset (in logical order) to
the character that immediately follows the end of the selection. If
@@ -50089,21 +50180,43 @@
<p>On setting, it must act as if the <code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code>
method had been called, with the current value of the <code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>
- attribute as the first argument, and new value as the second
+ attribute as the first argument, the new value as the second
+ argument, and the current value of the <code title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>
+ as the third argument.</p>
+
+
+ <p>The <dfn id=dom-textarea/input-selectiondirection title=dom-textarea/input-selectionDirection><code>selectionDirection</code></dfn>
+ attribute must, on getting, return the string corresponding to the
+ current selection direction: if the direction is <i>forward</i>,
+ "<code title="">forward</code>"; if the direction is
+ <i>backward</i>, "<code title="">backward</code>"; and otherwise,
+ "<code title="">none</code>".</p>
+
+ <p>On setting, it must act as if the <code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code>
+ method had been called, with the current value of the <code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>
+ attribute as the first argument, the current value of the <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>
+ attribute as the first argument, and the new value as the third
argument.</p>
- <p>The <dfn id=dom-textarea/input-setselectionrange title=dom-textarea/input-setSelectionRange><code>setSelectionRange(<var title="">start</var>, <var title="">end</var>)</code></dfn> method
- must set the selection of the text field to 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. Arguments greater than the
+
+ <p>The <dfn id=dom-textarea/input-setselectionrange title=dom-textarea/input-setSelectionRange><code>setSelectionRange(<var title="">start</var>, <var title="">end</var>, <var title="">direction</var>)</code></dfn> method must set the selection
+ of the text field to 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. Arguments greater than the
length of the value in the text field must be treated as pointing at
the end of the text field. If <var title="">end</var> is less than
or equal to <var title="">start</var> then the start of the
selection and the end of the selection must both be placed
immediately before the character with offset <var title="">end</var>. 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>.</p>
+ with offset <var title="">end</var>. The direction of the selection
+ must be set to <i>backward</i> if <var title="">direction</var> is a
+ <a href=#case-sensitive>case-sensitive</a> match for the string "<code title="">backward</code>", <i>forward</i> if <var title="">direction</var> is a <a href=#case-sensitive>case-sensitive</a> match for
+ the string "<code title="">forward</code>" or if the platform does
+ not support selections with the direction <i>none</i>, and
+ <i>none</i> otherwise (including if the argument is omitted).</p>
+
<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
@@ -50111,6 +50224,11 @@
</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
+ cursor can be placed to one side or another of such a character.</p>
+
<div class=example>
<p>To obtain the currently selected text, the following JavaScript
@@ -50123,13 +50241,26 @@
</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
- cursor can be placed to one side or another of such a character.</p>
+ <div class=example>
+ <p>To add some text at the start of a text control, while
+ maintaining the text selection, the three attributes must be
+ preserved:</p>
+ <pre>var oldStart = control.selectionStart;
+var oldEnd = control.selectionEnd;
+var oldDirection = control.selectionDirection;
+var prefix = "http://";
+control.value = prefix + control.value;
+control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldDirection);</pre>
+ <p>...where <var title="">control</var> is the <code><a href=#the-input-element>input</a></code>
+ or <code><a href=#the-textarea-element>textarea</a></code> element.</p>
+
+ </div>
+
+
+
<h4 id=constraints><span class=secno>4.10.21 </span>Constraints</h4>
<h5 id=definitions><span class=secno>4.10.21.1 </span>Definitions</h5>
Modified: index
===================================================================
--- index 2011-05-03 22:09:18 UTC (rev 6059)
+++ index 2011-05-03 23:49:50 UTC (rev 6060)
@@ -41661,7 +41661,8 @@
void <a href=#dom-textarea/input-select title=dom-textarea/input-select>select</a>();
attribute unsigned long <a href=#dom-textarea/input-selectionstart title=dom-textarea/input-selectionStart>selectionStart</a>;
attribute unsigned long <a href=#dom-textarea/input-selectionend title=dom-textarea/input-selectionEnd>selectionEnd</a>;
- void <a href=#dom-textarea/input-setselectionrange title=dom-textarea/input-setSelectionRange>setSelectionRange</a>(in unsigned long start, in unsigned long end);
+ attribute DOMString <a href=#dom-textarea/input-selectiondirection title=dom-textarea/input-selectionDirection>selectionDirection</a>;
+ void <a href=#dom-textarea/input-setselectionrange title=dom-textarea/input-setSelectionRange>setSelectionRange</a>(in unsigned long start, in unsigned long end, in optional DOMString direction);
};</pre>
</dd>
</dl><p>The <code><a href=#the-input-element>input</a></code> element <a href=#represents>represents</a> a typed data field,
@@ -41773,8 +41774,9 @@
</table><p>The <i>missing value default</i> is the <a href=#text-state-and-search-state title=attr-input-type-text>Text</a> state.</p>
<p>Which of the <code title=attr-input-accept><a href=#attr-input-accept>accept</a></code>, <code title=attr-input-alt><a href=#attr-input-alt>alt</a></code>, <code title=attr-input-autocomplete><a href=#attr-input-autocomplete>autocomplete</a></code>, <code title=attr-input-checked><a href=#attr-input-checked>checked</a></code>, <code title=attr-input-dirname><a href=#attr-input-dirname>dirname</a></code>, <code title=attr-fs-formaction><a href=#attr-fs-formaction>formaction</a></code>, <code title=attr-fs-formenctype><a href=#attr-fs-formenctype>formenctype</a></code>, <code title=attr-fs-formmethod><a href=#attr-fs-formmethod>formmethod</a></code>, <code title=attr-fs-formnovalidate><a href=#attr-fs-formnovalidate>formnovalidate</a></code>, <code title=attr-fs-formtarget><a href=#attr-fs-formtarget>formtarget</a></code>, <code title=attr-dim-height><a href=#attr-dim-height>height</a></code>, <code title=attr-input-list><a href=#attr-input-list>list</a></code>, <code tit
le=attr-input-max><a href=#attr-input-max>max</a></code>, <code title=attr-input-maxlength><a href=#attr-input-maxlength>maxlength</a></code>, <code title=attr-input-min><a href=#attr-input-min>min</a></code>, <code title=attr-input-multiple><a href=#attr-input-multiple>multiple</a></code>, <code title=attr-input-pattern><a href=#attr-input-pattern>pattern</a></code>, <code title=attr-input-placeholder><a href=#attr-input-placeholder>placeholder</a></code>, <code title=attr-input-readonly><a href=#attr-input-readonly>readonly</a></code>, <code title=attr-input-required><a href=#attr-input-required>required</a></code>, <code title=attr-input-size><a href=#attr-input-size>size</a></code>, <code title=attr-input-src><a href=#attr-input-src>src</a></code>, <code title=attr-input-step><a href=#attr-input-step>step</a></code>, and <code title=attr-dim-width><a href=#attr-dim-width>width</a></code> content attributes, the <code title=dom-input-checked><a href=#dom-input-checked>che
cked</a></code>, <code title=dom-input-files><a href=#dom-input-files>files</a></code>, <code title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, <code title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code>, <code title=dom-input-list><a href=#dom-input-list>list</a></code>, and <code title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code> IDL
- attributes, the <code title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> method, the <code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code> and
- <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>
+ attributes, the <code title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> method, the <code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
+ <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
IDL attributes, the <code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code>
method, the <code title=dom-input-stepUp><a href=#dom-input-stepup>stepUp()</a></code> and
<code title=dom-input-stepDown><a href=#dom-input-stepdown>stepDown()</a></code> methods, and the
@@ -42629,6 +42631,30 @@
<td class=no> · <!-- Reset Button -->
<!-- <td class="no"> · Button -->
+ <tr><th> <code title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>
+ <td class=no> · <!-- Hidden -->
+ <td class=yes> Yes <!-- Text -->
+<!-- <td class="yes"> Yes Search -->
+ <td class=yes> Yes <!-- URL, Telephone -->
+ <td class=no> · <!-- E-mail -->
+ <td class=yes> Yes <!-- Password -->
+ <td class=no> · <!-- Date and Time -->
+<!-- <td class="no"> · Date -->
+<!-- <td class="no"> · Month -->
+<!-- <td class="no"> · Week -->
+<!-- <td class="no"> · Time -->
+ <td class=no> · <!-- Local Date and Time -->
+<!-- <td class="no"> · Number -->
+ <td class=no> · <!-- Range -->
+ <td class=no> · <!-- Color -->
+ <td class=no> · <!-- Checkbox -->
+<!-- <td class="no"> · Radio Button -->
+ <td class=no> · <!-- File Upload -->
+ <td class=no> · <!-- Submit Button -->
+ <td class=no> · <!-- Image Button -->
+ <td class=no> · <!-- Reset Button -->
+<!-- <td class="no"> · Button -->
+
<tr><th> <code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code>
<td class=no> · <!-- Hidden -->
<td class=yes> Yes <!-- Text -->
@@ -42929,6 +42955,7 @@
<code title=dom-lfe-labels><a href=#dom-lfe-labels>labels</a></code> attribute provides a list
of the element's <code><a href=#the-label-element>label</a></code>s. The <code title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>, <code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
and <code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code>
methods and attributes expose the element's text selection. The
<code title=dom-fe-autofocus><a href=#dom-fe-autofocus>autofocus</a></code>, <code title=dom-fe-disabled><a href=#dom-fe-disabled>disabled</a></code>, <code title=dom-fae-form><a href=#dom-fae-form>form</a></code>, and <code title=dom-fe-name><a href=#dom-fe-name>name</a></code> IDL attributes are part of the
@@ -43010,6 +43037,7 @@
<code class=no-backref title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, and
<code class=no-backref title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>,
@@ -43098,7 +43126,8 @@
<code title=dom-input-list><a href=#dom-input-list>list</a></code>,
<code title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
- <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>, and
<code title=dom-input-value><a href=#dom-input-value>value</a></code> IDL attributes;
<code title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -43196,7 +43225,8 @@
<code title=dom-input-list><a href=#dom-input-list>list</a></code>,
<code title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
- <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>, and
<code title=dom-input-value><a href=#dom-input-value>value</a></code> IDL attributes;
<code title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -43299,7 +43329,8 @@
<code title=dom-input-list><a href=#dom-input-list>list</a></code>,
<code title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
- <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>, and
<code title=dom-input-value><a href=#dom-input-value>value</a></code> IDL attributes;
<code title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -43597,6 +43628,7 @@
<code class=no-backref title=dom-input-files><a href=#dom-input-files>files</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, and
<code class=no-backref title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>,
@@ -43652,7 +43684,8 @@
<code title=attr-input-required><a href=#attr-input-required>required</a></code>, and
<code title=attr-input-size><a href=#attr-input-size>size</a></code> content attributes;
<code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
- <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>, and
<code title=dom-input-value><a href=#dom-input-value>value</a></code> IDL attributes;
<code title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>, and
<code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -43850,8 +43883,9 @@
element:
<code class=no-backref title=dom-input-checked><a href=#dom-input-checked>checked</a></code>,
<code class=no-backref title=dom-input-files><a href=#dom-input-files>files</a></code>,
- <code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>, and
- <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code> IDL attributes;
+ <code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code class=no-backref title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -44023,8 +44057,9 @@
<p>The following IDL attributes and methods do not apply to the
element:
<code class=no-backref title=dom-input-checked><a href=#dom-input-checked>checked</a></code>,
- <code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>, and
- <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code> IDL attributes;
+ <code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code class=no-backref title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -44176,8 +44211,9 @@
element:
<code class=no-backref title=dom-input-checked><a href=#dom-input-checked>checked</a></code>,
<code class=no-backref title=dom-input-files><a href=#dom-input-files>files</a></code>,
- <code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>, and
- <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code> IDL attributes;
+ <code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code class=no-backref title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -44330,8 +44366,9 @@
element:
<code class=no-backref title=dom-input-checked><a href=#dom-input-checked>checked</a></code>,
<code class=no-backref title=dom-input-files><a href=#dom-input-files>files</a></code>,
- <code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>, and
- <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code> IDL attributes;
+ <code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code class=no-backref title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -44481,8 +44518,9 @@
element:
<code class=no-backref title=dom-input-checked><a href=#dom-input-checked>checked</a></code>,
<code class=no-backref title=dom-input-files><a href=#dom-input-files>files</a></code>,
- <code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>, and
- <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code> IDL attributes;
+ <code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code class=no-backref title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -44622,7 +44660,8 @@
<code class=no-backref title=dom-input-checked><a href=#dom-input-checked>checked</a></code>,
<code class=no-backref title=dom-input-files><a href=#dom-input-files>files</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
- <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>, and
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code class=no-backref title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -44785,7 +44824,8 @@
<code class=no-backref title=dom-input-checked><a href=#dom-input-checked>checked</a></code>,
<code class=no-backref title=dom-input-files><a href=#dom-input-files>files</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
- <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>, and
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code class=no-backref title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -44952,7 +44992,8 @@
<code class=no-backref title=dom-input-checked><a href=#dom-input-checked>checked</a></code>,
<code class=no-backref title=dom-input-files><a href=#dom-input-files>files</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
- <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>, and
+ <code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>, and
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code> and
<code class=no-backref title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code> methods.</p>
@@ -45112,6 +45153,7 @@
<code class=no-backref title=dom-input-files><a href=#dom-input-files>files</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, and
<code class=no-backref title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>,
@@ -45220,6 +45262,7 @@
<code class=no-backref title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, and
<code class=no-backref title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>,
@@ -45355,6 +45398,7 @@
<code class=no-backref title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, and
<code class=no-backref title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>,
@@ -45547,6 +45591,7 @@
<code class=no-backref title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, and
<code class=no-backref title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>,
@@ -45639,6 +45684,7 @@
<code class=no-backref title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, and
<code class=no-backref title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>,
@@ -45853,6 +45899,7 @@
<code class=no-backref title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, and
<code class=no-backref title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>,
@@ -45941,6 +45988,7 @@
<code class=no-backref title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, and
<code class=no-backref title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>,
@@ -46021,6 +46069,7 @@
<code class=no-backref title=dom-input-selectedOption><a href=#dom-input-selectedoption>selectedOption</a></code>,
<code class=no-backref title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code class=no-backref title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code class=no-backref title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
<code class=no-backref title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAsDate</a></code>, and
<code class=no-backref title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> IDL attributes;
<code class=no-backref title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>,
@@ -48214,7 +48263,8 @@
void <a href=#dom-textarea/input-select title=dom-textarea/input-select>select</a>();
attribute unsigned long <a href=#dom-textarea/input-selectionstart title=dom-textarea/input-selectionStart>selectionStart</a>;
attribute unsigned long <a href=#dom-textarea/input-selectionend title=dom-textarea/input-selectionEnd>selectionEnd</a>;
- void <a href=#dom-textarea/input-setselectionrange title=dom-textarea/input-setSelectionRange>setSelectionRange</a>(in unsigned long start, in unsigned long end);
+ attribute DOMString <a href=#dom-textarea/input-selectiondirection title=dom-textarea/input-selectionDirection>selectionDirection</a>;
+ void <a href=#dom-textarea/input-setselectionrange title=dom-textarea/input-setSelectionRange>setSelectionRange</a>(in unsigned long start, in unsigned long end, in optional DOMString direction);
};</pre>
</dd>
</dl><p>The <code><a href=#the-textarea-element>textarea</a></code> element <a href=#represents>represents</a> a
@@ -48505,6 +48555,7 @@
<code title=dom-lfe-labels><a href=#dom-lfe-labels>labels</a></code> attribute provides a list
of the element's <code><a href=#the-label-element>label</a></code>s. The <code title=dom-textarea/input-select><a href=#dom-textarea/input-select>select()</a></code>, <code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>,
<code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>,
+ <code title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>,
and <code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code>
methods and attributes expose the element's text selection. The
<code title=dom-fe-autofocus><a href=#dom-fe-autofocus>autofocus</a></code>, <code title=dom-fe-disabled><a href=#dom-fe-disabled>disabled</a></code>, <code title=dom-fae-form><a href=#dom-fae-form>form</a></code>, and <code title=dom-fe-name><a href=#dom-fe-name>name</a></code> IDL attributes are part of the
@@ -50037,7 +50088,8 @@
<pre class="idl extract"> void <a href=#dom-textarea/input-select title=dom-textarea/input-select>select</a>();
attribute unsigned long <a href=#dom-textarea/input-selectionstart title=dom-textarea/input-selectionStart>selectionStart</a>;
attribute unsigned long <a href=#dom-textarea/input-selectionend title=dom-textarea/input-selectionEnd>selectionEnd</a>;
- void <a href=#dom-textarea/input-setselectionrange title=dom-textarea/input-setSelectionRange>setSelectionRange</a>(in unsigned long start, in unsigned long end);</pre>
+ attribute DOMString <a href=#dom-textarea/input-selectiondirection title=dom-textarea/input-selectionDirection>selectionDirection</a>;
+ void <a href=#dom-textarea/input-setselectionrange title=dom-textarea/input-setSelectionRange>setSelectionRange</a>(in unsigned long start, in unsigned long end, in optional DOMString direction);</pre>
<!-- v2: also add textLength? it seems to be widely used -->
<p>These methods and attributes expose and control the selection of
@@ -50071,14 +50123,26 @@
</dd>
- <dt><var title="">element</var> . <code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange</a></code>(<var title="">start</var>, <var title="">end</var>)</dt>
+ <dt><var title="">element</var> . <code title=dom-textarea/input-selecionDirection>selectionDirection</code> [ = <var title="">value</var> ]</dt>
<dd>
- <p>Changes the selection to cover the given substring.</p>
+ <p>Returns the current direction of the selection.</p>
+ <p>Can be set, to change the direction of the selection.</p>
+
+ <p>The possible values are "<code title="">forward</code>", "<code title="">backward</code>", and "<code title="">none</code>".</p>
+
</dd>
+ <dt><var title="">element</var> . <code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange</a></code>(<var title="">start</var>, <var title="">end</var> [, <var title="">direction</var>] )</dt>
+
+ <dd>
+
+ <p>Changes the selection to cover the given substring in the given direction. If the direction is omitted, it will be reset to be the platform default (none or forward).</p>
+
+ </dd>
+
</dl><div class=impl>
<p>When these methods and attributes are used with
@@ -50091,9 +50155,34 @@
elements, these methods and attributes must operate on the element's
<a href=#concept-textarea-raw-value title=concept-textarea-raw-value>raw value</a>.</p>
+ <p>The selections of <code><a href=#the-input-element>input</a></code> and <code><a href=#the-textarea-element>textarea</a></code>
+ elements have a <i>direction</i>, which is either <i>forward</i>,
+ <i>backward</i>, or <i>none</i>. This direction is set when the user
+ manipulates the selection. The exact meaning of the selection
+ direction depends on the platform.</p>
+
+ <p class=note>On Windows, the direction indicates the position of
+ the caret relative to the selection: a <i>forward</i> selection has
+ the caret at the end of the selection and a <i>backward</i>
+ selection has the caret at the start of the selection. Windows has
+ no <i>none</i> direction. On Mac, the direction indicates which end
+ of the selection is affected when the user adjusts the size of the
+ selection using the arrow keys with the Shift modifier: the forward
+ direction means the end of the selection is modified, and the
+ backwards direction means the start of the selection is modified.
+ The none direction is the default on Mac, it indicates that no
+ particular direction has yet been selected. The user sets the
+ direction implicitly when first adjusting the selection, based on
+ which directional arrow key was used.</p>
+
+
<p>The <dfn id=dom-textarea/input-select title=dom-textarea/input-select><code>select()</code></dfn> method
- must cause the contents of the text field to be fully selected.</p>
+ must cause the contents of the text field to be fully selected, with
+ the selection direction being none, if the platform support
+ selections with the direction <i>none</i>, or otherwise
+ <i>forward</i>.</p>
+
<p>The <dfn id=dom-textarea/input-selectionstart title=dom-textarea/input-selectionStart><code>selectionStart</code></dfn>
attribute must, on getting, return the offset (in logical order) to
the character that immediately follows the start of the
@@ -50102,13 +50191,15 @@
text entry cursor.</p>
<p>On setting, it must act as if the <code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code>
- method had been called, with the new value as the first argument,
- and the current value of the <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>
+ method had been called, with the new value as the first argument;
+ the current value of the <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>
attribute as the second argument, unless the current value of the
<code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code> is
less than the new value, in which case the second argument must also
- be the new value.</p>
+ be the new value; and the current value of the <code title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>
+ as the third argument.</p>
+
<p>The <dfn id=dom-textarea/input-selectionend title=dom-textarea/input-selectionEnd><code>selectionEnd</code></dfn>
attribute must, on getting, return the offset (in logical order) to
the character that immediately follows the end of the selection. If
@@ -50118,21 +50209,43 @@
<p>On setting, it must act as if the <code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code>
method had been called, with the current value of the <code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>
- attribute as the first argument, and new value as the second
+ attribute as the first argument, the new value as the second
+ argument, and the current value of the <code title=dom-textarea/input-selectionDirection><a href=#dom-textarea/input-selectiondirection>selectionDirection</a></code>
+ as the third argument.</p>
+
+
+ <p>The <dfn id=dom-textarea/input-selectiondirection title=dom-textarea/input-selectionDirection><code>selectionDirection</code></dfn>
+ attribute must, on getting, return the string corresponding to the
+ current selection direction: if the direction is <i>forward</i>,
+ "<code title="">forward</code>"; if the direction is
+ <i>backward</i>, "<code title="">backward</code>"; and otherwise,
+ "<code title="">none</code>".</p>
+
+ <p>On setting, it must act as if the <code title=dom-textarea/input-setSelectionRange><a href=#dom-textarea/input-setselectionrange>setSelectionRange()</a></code>
+ method had been called, with the current value of the <code title=dom-textarea/input-selectionStart><a href=#dom-textarea/input-selectionstart>selectionStart</a></code>
+ attribute as the first argument, the current value of the <code title=dom-textarea/input-selectionEnd><a href=#dom-textarea/input-selectionend>selectionEnd</a></code>
+ attribute as the first argument, and the new value as the third
argument.</p>
- <p>The <dfn id=dom-textarea/input-setselectionrange title=dom-textarea/input-setSelectionRange><code>setSelectionRange(<var title="">start</var>, <var title="">end</var>)</code></dfn> method
- must set the selection of the text field to 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. Arguments greater than the
+
+ <p>The <dfn id=dom-textarea/input-setselectionrange title=dom-textarea/input-setSelectionRange><code>setSelectionRange(<var title="">start</var>, <var title="">end</var>, <var title="">direction</var>)</code></dfn> method must set the selection
+ of the text field to 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. Arguments greater than the
length of the value in the text field must be treated as pointing at
the end of the text field. If <var title="">end</var> is less than
or equal to <var title="">start</var> then the start of the
selection and the end of the selection must both be placed
immediately before the character with offset <var title="">end</var>. 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>.</p>
+ with offset <var title="">end</var>. The direction of the selection
+ must be set to <i>backward</i> if <var title="">direction</var> is a
+ <a href=#case-sensitive>case-sensitive</a> match for the string "<code title="">backward</code>", <i>forward</i> if <var title="">direction</var> is a <a href=#case-sensitive>case-sensitive</a> match for
+ the string "<code title="">forward</code>" or if the platform does
+ not support selections with the direction <i>none</i>, and
+ <i>none</i> otherwise (including if the argument is omitted).</p>
+
<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
@@ -50140,6 +50253,11 @@
</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
+ cursor can be placed to one side or another of such a character.</p>
+
<div class=example>
<p>To obtain the currently selected text, the following JavaScript
@@ -50152,13 +50270,26 @@
</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
- cursor can be placed to one side or another of such a character.</p>
+ <div class=example>
+ <p>To add some text at the start of a text control, while
+ maintaining the text selection, the three attributes must be
+ preserved:</p>
+ <pre>var oldStart = control.selectionStart;
+var oldEnd = control.selectionEnd;
+var oldDirection = control.selectionDirection;
+var prefix = "http://";
+control.value = prefix + control.value;
+control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldDirection);</pre>
+ <p>...where <var title="">control</var> is the <code><a href=#the-input-element>input</a></code>
+ or <code><a href=#the-textarea-element>textarea</a></code> element.</p>
+
+ </div>
+
+
+
<h4 id=constraints><span class=secno>4.10.21 </span>Constraints</h4>
<h5 id=definitions><span class=secno>4.10.21.1 </span>Definitions</h5>
Modified: source
===================================================================
--- source 2011-05-03 22:09:18 UTC (rev 6059)
+++ source 2011-05-03 23:49:50 UTC (rev 6060)
@@ -46539,7 +46539,8 @@
void <span title="dom-textarea/input-select">select</span>();
attribute unsigned long <span title="dom-textarea/input-selectionStart">selectionStart</span>;
attribute unsigned long <span title="dom-textarea/input-selectionEnd">selectionEnd</span>;
- void <span title="dom-textarea/input-setSelectionRange">setSelectionRange</span>(in unsigned long start, in unsigned long end);
+ attribute DOMString <span title="dom-textarea/input-selectionDirection">selectionDirection</span>;
+ void <span title="dom-textarea/input-setSelectionRange">setSelectionRange</span>(in unsigned long start, in unsigned long end, in optional DOMString direction);
};</pre>
</dd>
</dl>
@@ -46714,8 +46715,9 @@
title="dom-input-selectedOption">selectedOption</code> IDL
attributes, the <code
title="dom-textarea/input-select">select()</code> method, the <code
- title="dom-textarea/input-selectionStart">selectionStart</code> and
- <code title="dom-textarea/input-selectionEnd">selectionEnd</code>
+ title="dom-textarea/input-selectionStart">selectionStart</code>,
+ <code title="dom-textarea/input-selectionEnd">selectionEnd</code>, and
+ <code title="dom-textarea/input-selectionDirection">selectionDirection</code>,
IDL attributes, the <code
title="dom-textarea/input-setSelectionRange">setSelectionRange()</code>
method, the <code title="dom-input-stepUp">stepUp()</code> and
@@ -47615,6 +47617,31 @@
<!-- <td class="no"> · Button -->
<tr>
+ <th> <code title="dom-textarea/input-selectionDirection">selectionDirection</code>
+ <td class="no"> · <!-- Hidden -->
+ <td class="yes"> Yes <!-- Text -->
+<!-- <td class="yes"> Yes Search -->
+ <td class="yes"> Yes <!-- URL, Telephone -->
+ <td class="no"> · <!-- E-mail -->
+ <td class="yes"> Yes <!-- Password -->
+ <td class="no"> · <!-- Date and Time -->
+<!-- <td class="no"> · Date -->
+<!-- <td class="no"> · Month -->
+<!-- <td class="no"> · Week -->
+<!-- <td class="no"> · Time -->
+ <td class="no"> · <!-- Local Date and Time -->
+<!-- <td class="no"> · Number -->
+ <td class="no"> · <!-- Range -->
+ <td class="no"> · <!-- Color -->
+ <td class="no"> · <!-- Checkbox -->
+<!-- <td class="no"> · Radio Button -->
+ <td class="no"> · <!-- File Upload -->
+ <td class="no"> · <!-- Submit Button -->
+ <td class="no"> · <!-- Image Button -->
+ <td class="no"> · <!-- Reset Button -->
+<!-- <td class="no"> · Button -->
+
+ <tr>
<th> <code title="dom-textarea/input-setSelectionRange">setSelectionRange()</code>
<td class="no"> · <!-- Hidden -->
<td class="yes"> Yes <!-- Text -->
@@ -48018,6 +48045,7 @@
title="dom-textarea/input-select">select()</code>, <code
title="dom-textarea/input-selectionStart">selectionStart</code>,
<code title="dom-textarea/input-selectionEnd">selectionEnd</code>,
+ <code title="dom-textarea/input-selectionDirection">selectionDirection</code>,
and <code
title="dom-textarea/input-setSelectionRange">setSelectionRange()</code>
methods and attributes expose the element's text selection. The
@@ -48106,6 +48134,7 @@
<code class="no-backref" title="dom-input-selectedOption">selectedOption</code>,
<code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>,
<code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>,
+ <code class="no-backref" title="dom-textarea/input-selectionDirection">selectionDirection</code>,
<code class="no-backref" title="dom-input-valueAsDate">valueAsDate</code>, and
<code class="no-backref" title="dom-input-valueAsNumber">valueAsNumber</code> IDL attributes;
<code class="no-backref" title="dom-textarea/input-select">select()</code>,
@@ -48210,7 +48239,8 @@
<code title="dom-input-list">list</code>,
<code title="dom-input-selectedOption">selectedOption</code>,
<code title="dom-textarea/input-selectionStart">selectionStart</code>,
- <code title="dom-textarea/input-selectionEnd">selectionEnd</code>, and
+ <code title="dom-textarea/input-selectionEnd">selectionEnd</code>,
+ <code title="dom-textarea/input-selectionDirection">selectionDirection</code>, and
<code title="dom-input-value">value</code> IDL attributes;
<code title="dom-textarea/input-select">select()</code> and
<code title="dom-textarea/input-setSelectionRange">setSelectionRange()</code> methods.</p>
@@ -48318,7 +48348,8 @@
<code title="dom-input-list">list</code>,
<code title="dom-input-selectedOption">selectedOption</code>,
<code title="dom-textarea/input-selectionStart">selectionStart</code>,
- <code title="dom-textarea/input-selectionEnd">selectionEnd</code>, and
+ <code title="dom-textarea/input-selectionEnd">selectionEnd</code>,
+ <code title="dom-textarea/input-selectionDirection">selectionDirection</code>, and
<code title="dom-input-value">value</code> IDL attributes;
<code title="dom-textarea/input-select">select()</code> and
<code title="dom-textarea/input-setSelectionRange">setSelectionRange()</code> methods.</p>
@@ -48430,7 +48461,8 @@
<code title="dom-input-list">list</code>,
<code title="dom-input-selectedOption">selectedOption</code>,
<code title="dom-textarea/input-selectionStart">selectionStart</code>,
- <code title="dom-textarea/input-selectionEnd">selectionEnd</code>, and
+ <code title="dom-textarea/input-selectionEnd">selectionEnd</code>,
+ <code title="dom-textarea/input-selectionDirection">selectionDirection</code>, and
<code title="dom-input-value">value</code> IDL attributes;
<code title="dom-textarea/input-select">select()</code> and
<code title="dom-textarea/input-setSelectionRange">setSelectionRange()</code> methods.</p>
@@ -48768,6 +48800,7 @@
<code class="no-backref" title="dom-input-files">files</code>,
<code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>,
<code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>,
+ <code class="no-backref" title="dom-textarea/input-selectionDirection">selectionDirection</code>,
<code class="no-backref" title="dom-input-valueAsDate">valueAsDate</code>, and
<code class="no-backref" title="dom-input-valueAsNumber">valueAsNumber</code> IDL attributes;
<code class="no-backref" title="dom-textarea/input-select">select()</code>,
@@ -48828,7 +48861,8 @@
<code title="attr-input-required">required</code>, and
<code title="attr-input-size">size</code> content attributes;
<code title="dom-textarea/input-selectionStart">selectionStart</code>,
- <code title="dom-textarea/input-selectionEnd">selectionEnd</code>, and
+ <code title="dom-textarea/input-selectionEnd">selectionEnd</code>,
+ <code title="dom-textarea/input-selectionDirection">selectionDirection</code>, and
<code title="dom-input-value">value</code> IDL attributes;
<code title="dom-textarea/input-select">select()</code>, and
<code title="dom-textarea/input-setSelectionRange">setSelectionRange()</code> methods.</p>
@@ -49051,8 +49085,9 @@
element:
<code class="no-backref" title="dom-input-checked">checked</code>,
<code class="no-backref" title="dom-input-files">files</code>,
- <code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>, and
- <code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code> IDL attributes;
+ <code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>,
+ <code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>, and
+ <code class="no-backref" title="dom-textarea/input-selectionDirection">selectionDirection</code> IDL attributes;
<code class="no-backref" title="dom-textarea/input-select">select()</code> and
<code class="no-backref" title="dom-textarea/input-setSelectionRange">setSelectionRange()</code> methods.</p>
@@ -49246,8 +49281,9 @@
<p>The following IDL attributes and methods do not apply to the
element:
<code class="no-backref" title="dom-input-checked">checked</code>,
- <code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>, and
- <code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code> IDL attributes;
+ <code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>,
+ <code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>, and
+ <code class="no-backref" title="dom-textarea/input-selectionDirection">selectionDirection</code> IDL attributes;
<code class="no-backref" title="dom-textarea/input-select">select()</code> and
<code class="no-backref" title="dom-textarea/input-setSelectionRange">setSelectionRange()</code> methods.</p>
@@ -49421,8 +49457,9 @@
element:
<code class="no-backref" title="dom-input-checked">checked</code>,
<code class="no-backref" title="dom-input-files">files</code>,
- <code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>, and
- <code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code> IDL attributes;
+ <code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>,
+ <code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>, and
+ <code class="no-backref" title="dom-textarea/input-selectionDirection">selectionDirection</code> IDL attributes;
<code class="no-backref" title="dom-textarea/input-select">select()</code> and
<code class="no-backref" title="dom-textarea/input-setSelectionRange">setSelectionRange()</code> methods.</p>
@@ -49598,8 +49635,9 @@
element:
<code class="no-backref" title="dom-input-checked">checked</code>,
<code class="no-backref" title="dom-input-files">files</code>,
- <code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>, and
- <code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code> IDL attributes;
+ <code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>,
+ <code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>, and
+ <code class="no-backref" title="dom-textarea/input-selectionDirection">selectionDirection</code> IDL attributes;
<code class="no-backref" title="dom-textarea/input-select">select()</code> and
<code class="no-backref" title="dom-textarea/input-setSelectionRange">setSelectionRange()</code> methods.</p>
@@ -49772,8 +49810,9 @@
element:
<code class="no-backref" title="dom-input-checked">checked</code>,
<code class="no-backref" title="dom-input-files">files</code>,
- <code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>, and
- <code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code> IDL attributes;
+ <code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>,
+ <code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>, and
+ <code class="no-backref" title="dom-textarea/input-selectionDirection">selectionDirection</code> IDL attributes;
<code class="no-backref" title="dom-textarea/input-select">select()</code> and
<code class="no-backref" title="dom-textarea/input-setSelectionRange">setSelectionRange()</code> methods.</p>
@@ -49930,7 +49969,8 @@
<code class="no-backref" title="dom-input-checked">checked</code>,
<code class="no-backref" title="dom-input-files">files</code>,
<code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>,
- <code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>, and
+ <code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>,
+ <code class="no-backref" title="dom-textarea/input-selectionDirection">selectionDirection</code>, and
<code class="no-backref" title="dom-input-valueAsDate">valueAsDate</code> IDL attributes;
<code class="no-backref" title="dom-textarea/input-select">select()</code> and
<code class="no-backref" title="dom-textarea/input-setSelectionRange">setSelectionRange()</code> methods.</p>
@@ -50104,7 +50144,8 @@
<code class="no-backref" title="dom-input-checked">checked</code>,
<code class="no-backref" title="dom-input-files">files</code>,
<code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>,
- <code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>, and
+ <code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>,
+ <code class="no-backref" title="dom-textarea/input-selectionDirection">selectionDirection</code>, and
<code class="no-backref" title="dom-input-valueAsDate">valueAsDate</code> IDL attributes;
<code class="no-backref" title="dom-textarea/input-select">select()</code> and
<code class="no-backref" title="dom-textarea/input-setSelectionRange">setSelectionRange()</code> methods.</p>
@@ -50296,7 +50337,8 @@
<code class="no-backref" title="dom-input-checked">checked</code>,
<code class="no-backref" title="dom-input-files">files</code>,
<code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>,
- <code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>, and
+ <code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>,
+ <code class="no-backref" title="dom-textarea/input-selectionDirection">selectionDirection</code>, and
<code class="no-backref" title="dom-input-valueAsDate">valueAsDate</code> IDL attributes;
<code class="no-backref" title="dom-textarea/input-select">select()</code> and
<code class="no-backref" title="dom-textarea/input-setSelectionRange">setSelectionRange()</code> methods.</p>
@@ -50464,6 +50506,7 @@
<code class="no-backref" title="dom-input-files">files</code>,
<code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>,
<code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>,
+ <code class="no-backref" title="dom-textarea/input-selectionDirection">selectionDirection</code>,
<code class="no-backref" title="dom-input-valueAsDate">valueAsDate</code>, and
<code class="no-backref" title="dom-input-valueAsNumber">valueAsNumber</code> IDL attributes;
<code class="no-backref" title="dom-textarea/input-select">select()</code>,
@@ -50588,6 +50631,7 @@
<code class="no-backref" title="dom-input-selectedOption">selectedOption</code>,
<code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>,
<code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>,
+ <code class="no-backref" title="dom-textarea/input-selectionDirection">selectionDirection</code>,
<code class="no-backref" title="dom-input-valueAsDate">valueAsDate</code>, and
<code class="no-backref" title="dom-input-valueAsNumber">valueAsNumber</code> IDL attributes;
<code class="no-backref" title="dom-textarea/input-select">select()</code>,
@@ -50744,6 +50788,7 @@
<code class="no-backref" title="dom-input-selectedOption">selectedOption</code>,
<code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>,
<code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>,
+ <code class="no-backref" title="dom-textarea/input-selectionDirection">selectionDirection</code>,
<code class="no-backref" title="dom-input-valueAsDate">valueAsDate</code>, and
<code class="no-backref" title="dom-input-valueAsNumber">valueAsNumber</code> IDL attributes;
<code class="no-backref" title="dom-textarea/input-select">select()</code>,
@@ -50950,6 +50995,7 @@
<code class="no-backref" title="dom-input-selectedOption">selectedOption</code>,
<code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>,
<code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>,
+ <code class="no-backref" title="dom-textarea/input-selectionDirection">selectionDirection</code>,
<code class="no-backref" title="dom-input-valueAsDate">valueAsDate</code>, and
<code class="no-backref" title="dom-input-valueAsNumber">valueAsNumber</code> IDL attributes;
<code class="no-backref" title="dom-textarea/input-select">select()</code>,
@@ -51053,6 +51099,7 @@
<code class="no-backref" title="dom-input-selectedOption">selectedOption</code>,
<code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>,
<code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>,
+ <code class="no-backref" title="dom-textarea/input-selectionDirection">selectionDirection</code>,
<code class="no-backref" title="dom-input-valueAsDate">valueAsDate</code>, and
<code class="no-backref" title="dom-input-valueAsNumber">valueAsNumber</code> IDL attributes;
<code class="no-backref" title="dom-textarea/input-select">select()</code>,
@@ -51330,6 +51377,7 @@
<code class="no-backref" title="dom-input-selectedOption">selectedOption</code>,
<code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>,
<code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>,
+ <code class="no-backref" title="dom-textarea/input-selectionDirection">selectionDirection</code>,
<code class="no-backref" title="dom-input-valueAsDate">valueAsDate</code>, and
<code class="no-backref" title="dom-input-valueAsNumber">valueAsNumber</code> IDL attributes;
<code class="no-backref" title="dom-textarea/input-select">select()</code>,
@@ -51425,6 +51473,7 @@
<code class="no-backref" title="dom-input-selectedOption">selectedOption</code>,
<code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>,
<code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>,
+ <code class="no-backref" title="dom-textarea/input-selectionDirection">selectionDirection</code>,
<code class="no-backref" title="dom-input-valueAsDate">valueAsDate</code>, and
<code class="no-backref" title="dom-input-valueAsNumber">valueAsNumber</code> IDL attributes;
<code class="no-backref" title="dom-textarea/input-select">select()</code>,
@@ -51511,6 +51560,7 @@
<code class="no-backref" title="dom-input-selectedOption">selectedOption</code>,
<code class="no-backref" title="dom-textarea/input-selectionStart">selectionStart</code>,
<code class="no-backref" title="dom-textarea/input-selectionEnd">selectionEnd</code>,
+ <code class="no-backref" title="dom-textarea/input-selectionDirection">selectionDirection</code>,
<code class="no-backref" title="dom-input-valueAsDate">valueAsDate</code>, and
<code class="no-backref" title="dom-input-valueAsNumber">valueAsNumber</code> IDL attributes;
<code class="no-backref" title="dom-textarea/input-select">select()</code>,
@@ -54139,7 +54189,8 @@
void <span title="dom-textarea/input-select">select</span>();
attribute unsigned long <span title="dom-textarea/input-selectionStart">selectionStart</span>;
attribute unsigned long <span title="dom-textarea/input-selectionEnd">selectionEnd</span>;
- void <span title="dom-textarea/input-setSelectionRange">setSelectionRange</span>(in unsigned long start, in unsigned long end);
+ attribute DOMString <span title="dom-textarea/input-selectionDirection">selectionDirection</span>;
+ void <span title="dom-textarea/input-setSelectionRange">setSelectionRange</span>(in unsigned long start, in unsigned long end, in optional DOMString direction);
};</pre>
</dd>
</dl>
@@ -54498,6 +54549,7 @@
title="dom-textarea/input-select">select()</code>, <code
title="dom-textarea/input-selectionStart">selectionStart</code>,
<code title="dom-textarea/input-selectionEnd">selectionEnd</code>,
+ <code title="dom-textarea/input-selectionDirection">selectionDirection</code>,
and <code
title="dom-textarea/input-setSelectionRange">setSelectionRange()</code>
methods and attributes expose the element's text selection. The
@@ -56300,7 +56352,8 @@
<pre class="idl extract"> void <span title="dom-textarea/input-select">select</span>();
attribute unsigned long <span title="dom-textarea/input-selectionStart">selectionStart</span>;
attribute unsigned long <span title="dom-textarea/input-selectionEnd">selectionEnd</span>;
- void <span title="dom-textarea/input-setSelectionRange">setSelectionRange</span>(in unsigned long start, in unsigned long end);</pre>
+ attribute DOMString <span title="dom-textarea/input-selectionDirection">selectionDirection</span>;
+ void <span title="dom-textarea/input-setSelectionRange">setSelectionRange</span>(in unsigned long start, in unsigned long end, in optional DOMString direction);</pre>
<!-- v2: also add textLength? it seems to be widely used -->
<p>These methods and attributes expose and control the selection of
@@ -56336,14 +56389,26 @@
</dd>
- <dt><var title="">element</var> . <code title="dom-textarea/input-setSelectionRange">setSelectionRange</code>(<var title="">start</var>, <var title="">end</var>)</dt>
+ <dt><var title="">element</var> . <code title="dom-textarea/input-selecionDirection">selectionDirection</code> [ = <var title="">value</var> ]</dt>
<dd>
- <p>Changes the selection to cover the given substring.</p>
+ <p>Returns the current direction of the selection.</p>
+ <p>Can be set, to change the direction of the selection.</p>
+
+ <p>The possible values are "<code title="">forward</code>", "<code title="">backward</code>", and "<code title="">none</code>".</p>
+
</dd>
+ <dt><var title="">element</var> . <code title="dom-textarea/input-setSelectionRange">setSelectionRange</code>(<var title="">start</var>, <var title="">end</var> [, <var title="">direction</var>] )</dt>
+
+ <dd>
+
+ <p>Changes the selection to cover the given substring in the given direction. If the direction is omitted, it will be reset to be the platform default (none or forward).</p>
+
+ </dd>
+
</dl>
<div class="impl">
@@ -56359,10 +56424,35 @@
elements, these methods and attributes must operate on the element's
<span title="concept-textarea-raw-value">raw value</span>.</p>
+ <p>The selections of <code>input</code> and <code>textarea</code>
+ elements have a <i>direction</i>, which is either <i>forward</i>,
+ <i>backward</i>, or <i>none</i>. This direction is set when the user
+ manipulates the selection. The exact meaning of the selection
+ direction depends on the platform.</p>
+
+ <p class="note">On Windows, the direction indicates the position of
+ the caret relative to the selection: a <i>forward</i> selection has
+ the caret at the end of the selection and a <i>backward</i>
+ selection has the caret at the start of the selection. Windows has
+ no <i>none</i> direction. On Mac, the direction indicates which end
+ of the selection is affected when the user adjusts the size of the
+ selection using the arrow keys with the Shift modifier: the forward
+ direction means the end of the selection is modified, and the
+ backwards direction means the start of the selection is modified.
+ The none direction is the default on Mac, it indicates that no
+ particular direction has yet been selected. The user sets the
+ direction implicitly when first adjusting the selection, based on
+ which directional arrow key was used.</p>
+
+
<p>The <dfn
title="dom-textarea/input-select"><code>select()</code></dfn> method
- must cause the contents of the text field to be fully selected.</p>
+ must cause the contents of the text field to be fully selected, with
+ the selection direction being none, if the platform support
+ selections with the direction <i>none</i>, or otherwise
+ <i>forward</i>.</p>
+
<p>The <dfn
title="dom-textarea/input-selectionStart"><code>selectionStart</code></dfn>
attribute must, on getting, return the offset (in logical order) to
@@ -56373,14 +56463,17 @@
<p>On setting, it must act as if the <code
title="dom-textarea/input-setSelectionRange">setSelectionRange()</code>
- method had been called, with the new value as the first argument,
- and the current value of the <code
+ method had been called, with the new value as the first argument;
+ the current value of the <code
title="dom-textarea/input-selectionEnd">selectionEnd</code>
attribute as the second argument, unless the current value of the
<code title="dom-textarea/input-selectionEnd">selectionEnd</code> is
less than the new value, in which case the second argument must also
- be the new value.</p>
+ be the new value; and the current value of the <code
+ title="dom-textarea/input-selectionDirection">selectionDirection</code>
+ as the third argument.</p>
+
<p>The <dfn
title="dom-textarea/input-selectionEnd"><code>selectionEnd</code></dfn>
attribute must, on getting, return the offset (in logical order) to
@@ -56393,16 +56486,37 @@
title="dom-textarea/input-setSelectionRange">setSelectionRange()</code>
method had been called, with the current value of the <code
title="dom-textarea/input-selectionStart">selectionStart</code>
- attribute as the first argument, and new value as the second
+ attribute as the first argument, the new value as the second
+ argument, and the current value of the <code
+ title="dom-textarea/input-selectionDirection">selectionDirection</code>
+ as the third argument.</p>
+
+
+ <p>The <dfn
+ title="dom-textarea/input-selectionDirection"><code>selectionDirection</code></dfn>
+ attribute must, on getting, return the string corresponding to the
+ current selection direction: if the direction is <i>forward</i>,
+ "<code title="">forward</code>"; if the direction is
+ <i>backward</i>, "<code title="">backward</code>"; and otherwise,
+ "<code title="">none</code>".</p>
+
+ <p>On setting, it must act as if the <code
+ title="dom-textarea/input-setSelectionRange">setSelectionRange()</code>
+ method had been called, with the current value of the <code
+ title="dom-textarea/input-selectionStart">selectionStart</code>
+ attribute as the first argument, the current value of the <code
+ title="dom-textarea/input-selectionEnd">selectionEnd</code>
+ attribute as the first argument, and the new value as the third
argument.</p>
+
<p>The <dfn
title="dom-textarea/input-setSelectionRange"><code>setSelectionRange(<var
- title="">start</var>, <var title="">end</var>)</code></dfn> method
- must set the selection of the text field to 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="">start</var>, <var title="">end</var>, <var
+ title="">direction</var>)</code></dfn> method must set the selection
+ of the text field to 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. Arguments greater than the
length of the value in the text field must be treated as pointing at
the end of the text field. If <var title="">end</var> is less than
@@ -56411,8 +56525,16 @@
immediately before the character with offset <var
title="">end</var>. 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>.</p>
+ with offset <var title="">end</var>. The direction of the selection
+ must be set to <i>backward</i> if <var title="">direction</var> is a
+ <span>case-sensitive</span> match for the string "<code
+ title="">backward</code>", <i>forward</i> if <var
+ title="">direction</var> is a <span>case-sensitive</span> match for
+ the string "<code title="">forward</code>" or if the platform does
+ not support selections with the direction <i>none</i>, and
+ <i>none</i> otherwise (including if the argument is omitted).</p>
+
<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 <span>being rendered</span>). User agents should follow
@@ -56420,6 +56542,11 @@
</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
+ cursor can be placed to one side or another of such a character.</p>
+
<div class="example">
<p>To obtain the currently selected text, the following JavaScript
@@ -56432,13 +56559,26 @@
</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
- cursor can be placed to one side or another of such a character.</p>
+ <div class="example">
+ <p>To add some text at the start of a text control, while
+ maintaining the text selection, the three attributes must be
+ preserved:</p>
+ <pre>var oldStart = control.selectionStart;
+var oldEnd = control.selectionEnd;
+var oldDirection = control.selectionDirection;
+var prefix = "http://";
+control.value = prefix + control.value;
+control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldDirection);</pre>
+ <p>...where <var title="">control</var> is the <code>input</code>
+ or <code>textarea</code> element.</p>
+
+ </div>
+
+
+
<h4>Constraints</h4>
<h5>Definitions</h5>
More information about the Commit-Watchers
mailing list