From e19d60b30ec54e7f5b76a6e82211f184b9d8332d Mon Sep 17 00:00:00 2001
From: Stephanie Y Zhang {{StaticRange}} and {{Range}} objects (ranges) represent a sequence of content within a
node tree. Each range has a start and an end which
@@ -8494,7 +8494,7 @@ be between 0 and the boundary point's node's
- Objects implementing the {{FormControlRange}} interface are live and update as their associated
+element's user-visible A {{FormControlRange}} has an associated element,
+which is a supported text control ( For a {{FormControlRange}}, the start node and end node are
+both the element, and the start offset and end offset are
+interpreted as 16-bit code unit indices into the element's This differs from {{Range}}, where offsets for non-{{CharacterData}} nodes refer to child
+indices. {{FormControlRange}} offsets always refer to positions within the control's The The
+ If element is not a supported text control (i.e., neither a {{HTMLTextAreaElement}} nor an
+ {{HTMLInputElement}} whose Let L be the length, in 16-bit code units, of element's If startOffset greater than L or endOffset greater than L,
+ then throw an "{{IndexSizeError!!exception}}" {{DOMException}}. If startOffset less than 0 or endOffset less than 0, then throw an
+ "{{IndexSizeError!!exception}}" {{DOMException}}. If startOffset is greater than endOffset, then set
+ startOffset and endOffset to startOffset. This matches
+ {{Range}}'s collapsing behavior for reversed endpoints. Set this's element to element. Set this's start to
+ (element, startOffset) and end to
+ (element, endOffset). Because a {{FormControlRange}} extends {{AbstractRange}}, its
+startContainer, startOffset,
+endContainer, endOffset, and
+collapsed attributes work as defined for {{AbstractRange}}, with the
+interpretation described above. The stringification behavior
+must return the substring of this's element's User agents must update {{FormControlRange}} objects as their element's Layout and geometry methods such as {{NodeIterator}} and {{TreeWalker}} objects can be used to filter and traverse node
From d7b3bee51118dd712074f16d787bd693ea0f4b3e Mon Sep 17 00:00:00 2001
From: Stephanie Zhang {{StaticRange}} and {{Range}} objects (ranges) represent a sequence of content within a
node tree. Each range has a start and an end which
@@ -8494,7 +8494,7 @@ be between 0 and the boundary point's node's
- Objects implementing the {{FormControlRange}} interface are known as
+live FormControlRanges. Objects implementing the {{FormControlRange}} interface are live and update as their associated
-element's user-visible A {{FormControlRange}} has an associated element,
-which is a supported text control ( For a {{FormControlRange}}, the start node and end node are
-both the element, and the start offset and end offset are
-interpreted as 16-bit code unit indices into the element's A {{FormControlRange}} is a range whose boundary points are defined in the
+host text control’s value string rather than in the node tree. Its
+start node and end node are always the host
+ This differs from {{Range}}, where offsets for non-{{CharacterData}} nodes refer to child
-indices. {{FormControlRange}} offsets always refer to positions within the control's The A {{FormControlRange}} has associated state: The
- The {{AbstractRange/startContainer}} and {{AbstractRange/endContainer}} getters of a
+{{FormControlRange}} return its control. The
+{{AbstractRange/startOffset}} and {{AbstractRange/endOffset}} getters return its
+start offset and end offset.
+{{AbstractRange/collapsed}} is true if and only if the two offsets are equal. An {{Element}} el supports form control ranges if it is an {{HTMLTextAreaElement}},
+or an {{HTMLInputElement}} whose type
+supports the selection APIs:
+" For a supported host element el, its value string is the same string exposed by
+its IDL attribute {{HTMLTextAreaElement/value}}/{{HTMLInputElement/value}}. Offsets for
+{{FormControlRange}} are indices into this string in the inclusive range
+[0, The
+ The
+ If element is not a supported text control (i.e., neither a {{HTMLTextAreaElement}} nor an
- {{HTMLInputElement}} whose Let L be the length, in 16-bit code units, of element's A {{FormControlRange}} is live: when the control’s value string changes, the range’s
+{{AbstractRange/startOffset}} and {{AbstractRange/endOffset}} are updated automatically
+to preserve the same logical content. These behaviors mirror {{Range}} boundary adjustments
+in the DOM, but are applied to the UTF-16 code units of a form control’s value. If startOffset greater than L or endOffset greater than L,
- then throw an "{{IndexSizeError!!exception}}" {{DOMException}}. If startOffset less than 0 or endOffset less than 0, then throw an
- "{{IndexSizeError!!exception}}" {{DOMException}}. The stringification behavior must run these steps: If startOffset is greater than endOffset, then set
- startOffset and endOffset to startOffset. This matches
- {{Range}}'s collapsing behavior for reversed endpoints. If control is null, then return the empty string. Let value be control's value string. Let start be start offset, and let end be min(end offset, value. If start ≥ end, then return the empty string. Return the substring of value from start to end. Set this's element to element. Set this's start to
- (element, startOffset) and end to
- (element, endOffset). Because a {{FormControlRange}} extends {{AbstractRange}}, its
-startContainer, startOffset,
-endContainer, endOffset, and
-collapsed attributes work as defined for {{AbstractRange}}, with the
-interpretation described above. The stringification behavior
-must return the substring of this's element's User agents must update {{FormControlRange}} objects as their element's Layout and geometry methods such as Objects implementing the {{FormControlRange}} interface are known as
-live FormControlRanges. A {{FormControlRange}} is a range whose boundary points are defined in the
-host text control’s value string rather than in the node tree. Its
+host text control's value string rather than in the node tree. Its
start node and end node are always the host
- A {{FormControlRange}} has associated state:Introduction to "DOM Ranges"
+Introduction to "DOM Ranges"
// Start here
Interface {{AbstractRange}}
+Interface {{AbstractRange}}
// Abstract Range
[Exposed=Window]
@@ -8561,7 +8561,7 @@ getter steps are to return this's end offset.
getter steps are to return true if this is collapsed; otherwise false.
-
Interface {{StaticRange}}
+Interface {{StaticRange}}
// Static Range
dictionary StaticRangeInit {
@@ -8614,7 +8614,7 @@ constructor steps are:
-
Interface {{Range}}
+Interface {{Range}}
// Range
[Exposed=Window]
@@ -9891,8 +9891,111 @@ and {{Range/getBoundingClientRect()}} methods are defined in other specification
[[DOM-Parsing]]
[[CSSOM-VIEW]]
+// End here
+
Interface {{FormControlRange}}
+
+
+[Exposed=Window]
+interface FormControlRange : AbstractRange {
+ constructor();
+
+ undefined setFormControlRange((HTMLInputElement or HTMLTextAreaElement) element,
+ unsigned long startOffset,
+ unsigned long endOffset);
+
+ stringifier;
+};
+
+
+
+
+
+formRange = new FormControlRange()
+ formRange . setFormControlRange(element, startOffset, endOffset)
+ element.value
starting at
+ startOffset and ending at endOffset. Throws if element is not a
+ supported text control or if offsets are out of bounds.
+value
changes. They do not expose or mutate any
+implementation-internal nodes of the element.<textarea>
or an <input>
whose
+type
is one of text
, search
, tel
,
+url
, or password
).value
. These offsets do
+not refer to the element's children.value
.new FormControlRange()
+constructor steps are to construct a new {{FormControlRange}} whose element, start,
+and end are initially unset.setFormControlRange(element, startOffset, endOffset)
+method steps are:
+
+
+type
is one of
+ text
, search
, tel
, url
, or password
),
+ then throw a "{{NotSupportedError!!exception}}" {{DOMException}}.value
.value
defined by this's
+start offset and end offset.Live update semantics
+
+value
is
+mutated so that they continue to refer to the same logical text positions. This updating must behave as
+if the element's value
were represented by a single {{Text}} node that is a child of
+the element, and modifications to value
performed the corresponding replace data
+operations on that conceptual node. In particular, boundary points are adjusted per the existing
+live range mutation rules that apply to {{CharacterData}} changes.getClientRects()
and
+getBoundingClientRect()
are defined in other specifications as partial interfaces on {{Range}}.
+Those specifications can extend {{FormControlRange}} in the same way; when present, they operate over the
+text rendered by the element's value
.Traversal
Introduction to "DOM Ranges"
// Start here
+Introduction to "DOM Ranges"
Interface {{AbstractRange}}
// Abstract Range
+Interface {{AbstractRange}}
[Exposed=Window]
@@ -8561,7 +8561,7 @@ getter steps are to return this's end offset.
getter steps are to return true if this is collapsed; otherwise false.
-
Interface {{StaticRange}}
// Static Range
+Interface {{StaticRange}}
dictionary StaticRangeInit {
@@ -8614,7 +8614,7 @@ constructor steps are:
-
Interface {{Range}}
// Range
+Interface {{Range}}
[Exposed=Window]
@@ -9891,8 +9891,6 @@ and {{Range/getBoundingClientRect()}} methods are defined in other specification
[[DOM-Parsing]]
[[CSSOM-VIEW]]
-// End here
-
-Interface {{FormControlRange}}
@@ -9905,96 +9903,115 @@ interface FormControlRange : AbstractRange {
unsigned long startOffset,
unsigned long endOffset);
+ DOMRectList getClientRects();
+ DOMRect getBoundingClientRect();
stringifier;
};
-
formRange = new FormControlRange()
- formRange . setFormControlRange(element, startOffset, endOffset)
- element.value
starting at
- startOffset and ending at endOffset. Throws if element is not a
- supported text control or if offsets are out of bounds.
+
+
-formControlRange = new
+ FormControlRange()
+ formControlRange .
+ {{FormControlRange/setFormControlRange()}} (element,
+ startOffset, endOffset)
+ [start, end)
within element’s
+ value string. Throws {{NotSupportedError}} for unsupported elements and
+ {{IndexSizeError}} for out-of-bounds offsets.value
changes. They do not expose or mutate any
-implementation-internal nodes of the element.<textarea>
or an <input>
whose
-type
is one of text
, search
, tel
,
-url
, or password
).value
. These offsets do
-not refer to the element's children.<input>
or <textarea>
, and its offsets are indices into that
+string.value
.new FormControlRange()
-constructor steps are to construct a new {{FormControlRange}} whose element, start,
-and end are initially unset.
+
-setFormControlRange(element, startOffset, endOffset)
+text
", "search
", "tel
", "url
", or
+"password
".value.length
], matching
+{{HTMLTextAreaElement/selectionStart}}/{{HTMLTextAreaElement/selectionEnd}} and
+{{HTMLInputElement/selectionStart}}/{{HTMLInputElement/selectionEnd}} units.new FormControlRange()
constructor steps are to set this’s
+control to null and its
+start offset and end offset to 0.setFormControlRange(element, start, end)
method steps are:
-
- type
is one of
- text
, search
, tel
, url
, or password
),
- then throw a "{{NotSupportedError!!exception}}" {{DOMException}}.value
.
+
-
+
- length
).value
defined by this's
-start offset and end offset.Live update semantics
-
-value
is
-mutated so that they continue to refer to the same logical text positions. This updating must behave as
-if the element's value
were represented by a single {{Text}} node that is a child of
-the element, and modifications to value
performed the corresponding replace data
-operations on that conceptual node. In particular, boundary points are adjusted per the existing
-live range mutation rules that apply to {{CharacterData}} changes.getClientRects()
and
-getBoundingClientRect()
are defined in other specifications as partial interfaces on {{Range}}.
-Those specifications can extend {{FormControlRange}} in the same way; when present, they operate over the
-text rendered by the element's value
.Traversal
From 05b6b0ae575a0ea0f3fcdd5430ce41e983d8ed0e Mon Sep 17 00:00:00 2001
From: Stephanie Zhang
formControlRange = new
- FormControlRange()
- formControlRange .
- {{FormControlRange/setFormControlRange()}} (element,
+ {{FormControlRange/setFormControlRange()}}(element,
startOffset, endOffset)
- [start, end)
within element’s
- value string. Throws {{NotSupportedError}} for unsupported elements and
- {{IndexSizeError}} for out-of-bounds offsets.[startOffset, endOffset]
within
+ element's value string. Throws {{NotSupportedError}} for
+ unsupported elements and {{IndexSizeError}} for out-of-bounds offsets.
<input>
or <textarea>
, and its offsets are indices into that
+<input>
or <textarea>
, and its offsets are indices into that
string.
The {{AbstractRange/startContainer}} and {{AbstractRange/endContainer}} getters of a -{{FormControlRange}} return its control. The -{{AbstractRange/startOffset}} and {{AbstractRange/endOffset}} getters return its -start offset and end offset. -{{AbstractRange/collapsed}} is true if and only if the two offsets are equal.
- -An {{Element}} el supports form control ranges if it is an {{HTMLTextAreaElement}}, -or an {{HTMLInputElement}} whose type +
The startContainer getter steps are to return this’s +control.
+The endContainer getter steps are to return this’s +control.
+The startOffset getter steps are to return this’s +start offset.
+The endOffset getter steps are to return this’s +end offset.
+The collapsed getter steps are to return true if this’s +start offset equals this’s +end offset; otherwise false.
+ +An {{Element}} el supports form control range if it is an
+{{HTMLTextAreaElement}}, or an {{HTMLInputElement}} whose type
supports the selection APIs:
"text
", "search
", "tel
", "url
", or
"password
".
For a supported host element el, its value string is the same string exposed by -its IDL attribute {{HTMLTextAreaElement/value}}/{{HTMLInputElement/value}}. Offsets for +
For a supported host element el, its
+value string is the same string exposed by its IDL attribute
+{{HTMLTextAreaElement/value}}/{{HTMLInputElement/value}}. Offsets for
{{FormControlRange}} are indices into this string in the inclusive range
[0, value.length
], matching
{{HTMLTextAreaElement/selectionStart}}/{{HTMLTextAreaElement/selectionEnd}} and
{{HTMLInputElement/selectionStart}}/{{HTMLInputElement/selectionEnd}} units.
The
-new FormControlRange()
constructor steps are to set this’s
+new FormControlRange()
constructor steps are to set this’s
control to null and its
start offset and end offset to 0.
The
-setFormControlRange(element, start, end)
+setFormControlRange(element, startOffset, endOffset)
method steps are:
If an {{HTMLInputElement}}’s type
changes to a type that does not
+support form control range (e.g., switching to date
), then each
+associated {{FormControlRange}} must set its
+control to null and set both its
+start offset and end offset to 0.
A {{FormControlRange}} is live: when the control’s value string changes, the range’s -{{AbstractRange/startOffset}} and {{AbstractRange/endOffset}} are updated automatically -to preserve the same logical content. These behaviors mirror {{Range}} boundary adjustments -in the DOM, but are applied to the UTF-16 code units of a form control’s value.
+A {{FormControlRange}} is live: when the control's value string changes, the range's +{{AbstractRange/startOffset}} and {{AbstractRange/endOffset}} are updated automatically to +preserve the same logical content. These behaviors mirror {{Range}} boundary adjustments in the DOM, +but are applied to the UTF-16 code units of a form control's value.
The stringification behavior must run these steps:
+ + +The stringification +behavior must run these steps:
If control is null, then return the empty string.
-Let value be control's value string.
-Let start be start offset, and let end be min(end offset, value.length
).
If start ≥ end, then return the empty string.
-Return the substring of value from start to end.
+Objects implementing the {{FormControlRange}} interface are known as -{{FormControlRange}} objects.
+Objects implementing the {{FormControlRange}} interface are known as {{FormControlRange}} objects.
formControlRange = new
FormControlRange()
- formControlRange .
+ formControlRange.
{{FormControlRange/setFormControlRange()}}(element,
startOffset, endOffset)
- - Sets the endpoints to
[startOffset, endOffset]
within
- element's value string. Throws {{NotSupportedError}} for
- unsupported elements and {{IndexSizeError}} for out-of-bounds offsets.
+ - Sets the endpoints to
[startOffset, endOffset]
within element's
+ value string. Throws {{NotSupportedError}} for unsupported elements and {{IndexSizeError}}
+ for out-of-bounds offsets.
A {{FormControlRange}} is a range whose boundary points are defined in the
-host text control's value string rather than in the node tree. Its
-start node and end node are always the host
-<input>
or <textarea>
, and its offsets are indices into that
-string.
A {{FormControlRange}} is a range whose boundary points are defined in the host text
+control's value string rather than in the node tree. Its start node
+and end node are always the host <input>
or <textarea>
,
+and its offsets are indices into that string.
+
+
A {{FormControlRange}} has associated state: -
A {{FormControlRange}} has associated state:
control (null or an + {{HTMLInputElement}}/{{HTMLTextAreaElement}}). + +
start offset (a + non-negative integer). + +
end offset (a non-negative + integer).
The startContainer getter steps are to return this’s -control.
-The endContainer getter steps are to return this’s -control.
-The startOffset getter steps are to return this’s -start offset.
-The endOffset getter steps are to return this’s -end offset.
-The collapsed getter steps are to return true if this’s -start offset equals this’s -end offset; otherwise false.
+The startContainer getter steps are to return this's +control. + +
The endContainer getter steps are to return this's +control. + +
The startOffset getter steps are to return this's +start offset. + +
The endOffset getter steps are to return this's +end offset. + +
The collapsed getter steps are to return true if this's +start offset equals this's +end offset; otherwise false.
An {{Element}} el supports form control range if it is an
{{HTMLTextAreaElement}}, or an {{HTMLInputElement}} whose type
-supports the selection APIs:
-"text
", "search
", "tel
", "url
", or
-"password
".
text
", "search
", "tel
", "url
", or
+"password
".
For a supported host element el, its
value string is the same string exposed by its IDL attribute
-{{HTMLTextAreaElement/value}}/{{HTMLInputElement/value}}. Offsets for
-{{FormControlRange}} are indices into this string in the inclusive range
-[0, value.length
], matching
+{{HTMLTextAreaElement/value}}/{{HTMLInputElement/value}}. Offsets for {{FormControlRange}} are
+indices into this string in the inclusive range [0, value.length
], matching
{{HTMLTextAreaElement/selectionStart}}/{{HTMLTextAreaElement/selectionEnd}} and
-{{HTMLInputElement/selectionStart}}/{{HTMLInputElement/selectionEnd}} units.
The
-new FormControlRange()
constructor steps are to set this’s
-control to null and its
-start offset and end offset to 0.
new FormControlRange()
constructor steps are to set this's
+control to null and its start offset and
+end offset to 0.
The
-setFormControlRange(element, startOffset, endOffset)
-method steps are:
setFormControlRange(element, startOffset,
+endOffset)
method steps are:
If element does not support form control range, then throw a + "{{NotSupportedError!!exception}}" {{DOMException}}. + +
Let len be the length of element's value string. + +
If startOffset > len or endOffset > len, + then throw an "{{IndexSizeError!!exception}}" {{DOMException}}. + +
If startOffset > endOffset, then set endOffset to + startOffset. + +
Set this's control to element, + this's start offset to startOffset, and + this's end offset to endOffset.
If an {{HTMLInputElement}}’s type
changes to a type that does not
-support form control range (e.g., switching to date
), then each
-associated {{FormControlRange}} must set its
-control to null and set both its
-start offset and end offset to 0.
If an {{HTMLInputElement}}'s type
changes to a type that does not
+support form control range (e.g., switching to date
), then each associated
+{{FormControlRange}} must set its control to null and set both its
+start offset and end offset to 0.
A {{FormControlRange}} is live: when the control's value string changes, the range's -{{AbstractRange/startOffset}} and {{AbstractRange/endOffset}} are updated automatically to -preserve the same logical content. These behaviors mirror {{Range}} boundary adjustments in the DOM, -but are applied to the UTF-16 code units of a form control's value.
+{{AbstractRange/startOffset}} and {{AbstractRange/endOffset}} are updated automatically to preserve +the same logical content. These behaviors mirror {{Range}} boundary adjustments in the DOM, but are +applied to the UTF-16 code units of a form control's value.Edits before the range: Offsets shift by the net length change. + +
Edits after the range: Offsets remain unchanged. + +
Edits overlapping the range: If a boundary falls inside text that was removed, move it to the + start of the change. If the edit also inserted new text, remap the boundary into the inserted span + at the closest corresponding offset, not exceeding its end. + +
Insertion at the start boundary: A non-{{AbstractRange/collapsed}} range expands to include + the new text. A collapsed range (caret) moves after the insertion. + +
Insertion at the end boundary: A non-collapsed range does not expand to include the new text. + A collapsed range moves after the insertion. + +
Clamping and collapse: Offsets are clamped to the current value length. If the + {{AbstractRange/startOffset}} would exceed the {{AbstractRange/endOffset}}, set the end to the + start.
The stringification -behavior must run these steps:
+behavior must run these steps:If this's control is null, then return the empty + string. + +
Let value be this's control's value + string. + +
Let start be this's start offset, and let + end be this's end offset. + +
If start ≥ end, then return the empty string. + +
Return the substring of value from start to end.
The startContainer getter steps are to return this's +
The startContainer getter steps are to return this's control. -
The endContainer getter steps are to return this's +
The endContainer getter steps are to return this's control. -
The startOffset getter steps are to return this's +
The startOffset getter steps are to return this's start offset. -
The endOffset getter steps are to return this's +
The endOffset getter steps are to return this's end offset. -
The collapsed getter steps are to return true if this's -start offset equals this's +
The collapsed getter steps are to return true if this's +start offset equals this's end offset; otherwise false.
An {{Element}} el supports form control range if it is an
-{{HTMLTextAreaElement}}, or an {{HTMLInputElement}} whose type
+{{HTMLInputElement}}, or an {{HTMLTextAreaElement}} whose type
supports the selection
APIs: "text
", "search
", "tel
", "url
", or
"password
".
-
For a supported host element el, its
-value string is the same string exposed by its IDL attribute
-{{HTMLTextAreaElement/value}}/{{HTMLInputElement/value}}. Offsets for {{FormControlRange}} are
-indices into this string in the inclusive range [0, value.length
], matching
-{{HTMLTextAreaElement/selectionStart}}/{{HTMLTextAreaElement/selectionEnd}} and
-{{HTMLInputElement/selectionStart}}/{{HTMLInputElement/selectionEnd}} units.
-
The
-new FormControlRange()
constructor steps are to set this's
+new FormControlRange()
constructor steps are to set this's
control to null and its start offset and
end offset to 0.
+
For a supported host element el, its
+value string is the same string exposed by its IDL attribute
+{{HTMLInputElement/value}}/{{HTMLTextAreaElement/value}}. Offsets for {{FormControlRange}} are
+indices into this string in the inclusive range [0, value.length
], matching
+{{HTMLInputElement/selectionStart}}/{{HTMLInputElement/selectionEnd}} and
+{{HTMLTextAreaElement/selectionStart}}/{{HTMLTextAreaElement/selectionEnd}} units.
+
The
setFormControlRange(element, startOffset,
endOffset)
method steps are:
@@ -9996,9 +9997,9 @@ indices into this string in the inclusive range [0, value.length
],
If startOffset > endOffset, then set endOffset to startOffset. -
Set this's control to element, - this's start offset to startOffset, and - this's end offset to endOffset. +
Set this's control to element, + this's start offset to startOffset, and + this's end offset to endOffset.
If an {{HTMLInputElement}}'s type
changes to a type that does not
@@ -10039,14 +10040,14 @@ applied to the UTF-16 code units of a form control's value.
behavior must run these steps:
If this's control is null, then return the empty +
Let value be this's control's value
+ Let start be this's start offset, and let
- end be this's end offset.
+ Let start be this's start offset, and let
+ end be this's end offset.
If start ≥ end, then return the empty string.
From 98585990b0ee8bc14fdbd4822dbf35374fbc9725 Mon Sep 17 00:00:00 2001
From: Stephanie Zhang A {{FormControlRange}} is a range whose boundary points are defined in the host text
-control's value string rather than in the node tree. Its start node
-and end node are always the host A {{FormControlRange}} has associated state:
@@ -9962,23 +9965,29 @@ and its offsets are indices into that string.
start offset equals this's
end offset; otherwise false.
- An {{Element}} el supports form control range if it is an
-{{HTMLInputElement}}, or an {{HTMLTextAreaElement}} whose type
-supports the selection
-APIs: " An {{Element}} el
+supports form control range if it is an
+{{HTMLTextAreaElement}}, or an {{HTMLInputElement}} whose type is one of
+" These are exactly the types for which the related selection APIs
+apply in HTML; see
+selection APIs applicability for The
For a supported host element el, its
-value string is the same string exposed by its IDL attribute
-{{HTMLInputElement/value}}/{{HTMLTextAreaElement/value}}. Offsets for {{FormControlRange}} are
-indices into this string in the inclusive range [0, The
If element does not support form control range, then throw a
"{{NotSupportedError!!exception}}" {{DOMException}}.
- Let len be the length of element's value string.
+ Let len be the length of element's
+value string.
If startOffset > len or endOffset > len,
then throw an "{{IndexSizeError!!exception}}" {{DOMException}}.
@@ -10006,10 +10016,13 @@ indices into this string in the inclusive range [0, A {{FormControlRange}} is live: when the control's value string changes, the range's
-{{AbstractRange/startOffset}} and {{AbstractRange/endOffset}} are updated automatically to preserve
-the same logical content. These behaviors mirror {{Range}} boundary adjustments in the DOM, but are
-applied to the UTF-16 code units of a form control's value.
+ HTML will normatively call the associated range-adjustment algorithm wherever a
+control’s value changes or its type ceases to support selection. A {{FormControlRange}} is live: when the control's value
+string changes, the range's {{AbstractRange/startOffset}} and {{AbstractRange/endOffset}} are
+updated automatically to preserve the same logical content. These behaviors mirror {{Range}}
+boundary adjustments in the DOM, but are applied to the UTF-16 code units of a form control's value.
Edits before the range: Offsets shift by the net length change.
@@ -10036,21 +10049,18 @@ applied to the UTF-16 code units of a form control's value.
control value changes (similar to Range update handling in DOM). -->
The stringification
-behavior must run these steps:
+behavior If this's control is null, then return the empty
- string.
-
- Let start be this's start offset, and let
- end be this's end offset.
+ Let value be this's control's
+ value string. If start ≥ end, then return the empty string.
+ Let start be this's start offset, and let
+ end be this's end offset. Return the substring of value from start to end.
+ Return the substring of value from start to end.[startOffset, endOffset]
within element's
- value string. Throws {{NotSupportedError}} for unsupported elements and {{IndexSizeError}}
- for out-of-bounds offsets.
+value string. Throws {{NotSupportedError}} for
+unsupported elements and {{IndexSizeError}} for out-of-bounds offsets.
<input>
or <textarea>
,
-and its offsets are indices into that string.
+control's value string rather than in the node tree.
+Its start node and end node are always the host <input>
+or <textarea>
, and its offsets are indices into that string.
text
", "search
", "tel
", "url
", or
+text
", "search
", "tel
", "url
", or
"password
".
+input
types.
+This list is the complement of that section.new FormControlRange()
constructor steps are to set this's
control to null and its start offset and
end offset to 0.
value.length
], matching
+value string is the same string exposed by its IDL
+attribute {{HTMLInputElement/value}}/{{HTMLTextAreaElement/value}}. Offsets for {{FormControlRange}}
+are indices into this value string in the inclusive
+range [0, value.length
], matching
{{HTMLInputElement/selectionStart}}/{{HTMLInputElement/selectionEnd}} and
-{{HTMLTextAreaElement/selectionStart}}/{{HTMLTextAreaElement/selectionEnd}} units.
+{{HTMLTextAreaElement/selectionStart}}/{{HTMLTextAreaElement/selectionEnd}} units.setFormControlRange(element, startOffset,
@@ -9988,7 +9997,8 @@ indices into this string in the inclusive range [0,
must run these steps:value.length
],
value.length
],
{{FormControlRange}} must set its control to null and set both its
start offset and end offset to 0.
-
-