diff --git a/source b/source
index a92d86863c1..ed34e174f2e 100644
--- a/source
+++ b/source
@@ -49830,7 +49830,11 @@ interface HTMLInputElement : HTMLElement {
is false, the user agent must set the value of the element
to the value of the value
content attribute, if there is
one, or the empty string otherwise, and then run the current value sanitization
- algorithm, if one is defined.
type
attribute's
current state defines one.
+
+ If the element supports form control range and its + value has changed as a result of this algorithm, then run the + form control range full replacement steps with the + element, the old value's length, and the new + value's length.
Each input
element can be mutable. Except where
@@ -50087,6 +50097,11 @@ interface HTMLInputElement : HTMLElement {
element's text entry cursor position to the
beginning of the text control, and set its selection
direction to "none
".
If previouslySelectable is true and nowSelectable is false, then for
+ each FormControlRange
object whose control is this
+ element, set that object's control to null and set both its start offset and end offset to 0.
form
, and name
IDL attributes
are part of the element's forms API.
+ The following concepts and algorithms integrate the {{FormControlRange}} interface (defined in + the DOM Standard) with HTML form controls.
+ +A {{FormControlRange}} object is associated + with an element if its control is that element. An element's form control ranges are the {{FormControlRange}} objects + associated with it.
+ +The form control range value mutation algorithm +updates each {{FormControlRange}} associated with a supported +text control when a contiguous substring of its {{FormControlRange/value string}} +is replaced. It is passed an element el, non‑negative integers start, +oldLength (removed length), and newLength (inserted length). Let delta = +newLength − oldLength. For each {{FormControlRange}} object range in +el's form control ranges:
+Let rs be range's start offset; let re + be its end offset.
Let editStart be start; let editEnd be start + + oldLength.
If editEnd ≤ rs, then (edit strictly before range) set rs = + rs + delta and re = re + delta and jump to step + Clamp.
If editStart ≥ re, then (edit strictly after range) jump to step + Clamp.
(Overlapping removal) If oldLength > 0, then:
+If rs ≥ editStart and rs < editEnd, set + rs = editStart.
If re ≥ editStart and re < editEnd, set + re = editStart.
(Replacement insertion remap) If oldLength > 0 and newLength > 0 + and editStart ≤ rs ≤ re ≤ editEnd, then for each boundary + (rs then re): let offsetWithin be that boundary's original value − + editStart; set boundary = editStart + min(offsetWithin, + newLength).
(Pure insertion) If oldLength = 0 and newLength > 0 and + editStart is within [rs, re] then:
+If rs = re (collapsed), set rs = re = rs + + newLength.
Otherwise, if editStart = rs, set re = re + + newLength. (Insertion at start expands.)
Otherwise, if editStart = re, do nothing. (Insertion at end does not + expand.)
Clamp: Let valueLen be the length of + el's current {{FormControlRange/value string}}. Set rs = + min(rs, valueLen) and re = min(re, valueLen). If + rs > re, then set re = rs.
Set range's start offset to rs and its end offset to re.
This algorithm mirrors {{Range}} boundary adjustment rules, operating instead on the +UTF-16 code unit indices of a form control's value string.
+ +The form control range full replacement steps + for an element el with previous value length oldLength and new value length + newLength are to run the form control range value + mutation algorithm with el, 0, oldLength, and newLength.
+ +User agents typically call the algorithm explicitly at each value mutation point; it is not + implicitly invoked by unspecified text modifications.
@@ -54799,6 +54894,12 @@ You cannot submit this form when the field is incorrect.Invoke the value sanitization algorithm, if the element's type
attribute's current state defines one.
If the element's value is different from + oldValue, and the element supports form control + range, then run the form control range full + replacement steps with element, oldValue's length, and the + current value's length.
If the element's value (after applying the value sanitization algorithm) is different from oldValue, and the element has a text entry cursor position, @@ -57529,6 +57630,10 @@ interface HTMLTextAreaElement : HTMLElement { interaction before queuing the task; for example, a user agent could wait for the user to have not hit a key for 100ms, so as to only fire the event when the user pauses, instead of continuously for each keystroke.
+Before queuing that task, the user agent must run the + form control range value mutation algorithm for this + element, using the edit's offset, deleted length, and inserted length + to describe the change.
@@ -57549,7 +57654,11 @@ interface HTMLTextAreaElement : HTMLElement {The children changed steps for textarea
elements must, if the
element's dirty value flag is false, set the element's
raw value to its child text
- content.
The defaultValue
attribute's setter must
- string replace all with the given value within this element.
Set this element's raw value to the new value.
Set this element's dirty value flag to - true.
Set this element's dirty value flag to true.
If this changes the element's API value, then run the + form control range value mutation algorithm for this + element, with a change offset of 0, a deleted length equal to the length of + oldAPIValue, and an inserted length equal to the length of the element's new + API value.
If the new API value is different from
oldAPIValue, then move the text entry
@@ -61689,6 +61812,11 @@ MIT Room 32-G524
+ Text-entry controls support The Let new length be the length of the value of the first
argument. Let new end be the sum of start and new length. Let new end be the sum of start and new length. Let deleted count be max(0, end minus start). If this element supports form control range,
+ then run the form control range value mutation algorithm
+ with this element, start, deleted count, and new length. Run the appropriate set of substeps from the following list:APIs for the text control selections
+FormControlRange
. Liveness is maintained by HTML's
+ form-control range adjustment algorithm, and the algorithms
+ in this section invoke it whenever they modify a control's value string.input
and textarea
elements define several attributes and methods
@@ -62137,7 +62265,13 @@ MIT Room 32-G524