diff --git a/source b/source index 291c45fff57..16d57b74c46 100644 --- a/source +++ b/source @@ -3267,6 +3267,16 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • ShadowRoot interface
  • Text interface
  • Range interface
  • +
  • OpaqueRange + interface, and its + start container, + start offset, + end container, + end offset, + associated element, + and disconnect() method
  • +
  • The supports opaque ranges concept
  • +
  • The opaque range disconnect steps hook
  • node document concept
  • document type concept
  • @@ -49335,6 +49345,7 @@ interface HTMLInputElement : HTMLElement { undefined setRangeText(DOMString replacement); undefined setRangeText(DOMString replacement, unsigned long start, unsigned long end, optional SelectionMode selectionMode = "preserve"); undefined setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction); + [NewObject] OpaqueRange createValueRange(unsigned long start, unsigned long end); undefined showPicker(); @@ -49517,7 +49528,8 @@ interface HTMLInputElement : HTMLElement { selectionEnd, and selectionDirection, IDL attributes, the setRangeText() and - setSelectionRange() methods, the + setSelectionRange(), and + createValueRange() methods, the stepUp() and stepDown() methods, and the input and @@ -50541,6 +50553,30 @@ interface HTMLInputElement : HTMLElement { · + + · + · + · + · + · + + · + · + · + · + + + + createValueRange() + · + Yes + + Yes + · + Yes + · + + · · @@ -50696,6 +50732,11 @@ interface HTMLInputElement : HTMLElement { 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.

    + +

    If the element supports opaque ranges and this operation changes its value, then run the opaque range full replacement + steps with the element, the old value's length, and the new value's + length.

    @@ -50741,7 +50782,10 @@ interface HTMLInputElement : HTMLElement { attribute and false if it does not, empty the list of selected files, and then invoke the value sanitization algorithm, if the type attribute's - current state defines one.

    + current state defines one. If the element supports opaque ranges and its value changed, then run the opaque 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 @@ -50799,6 +50843,13 @@ interface HTMLInputElement : HTMLElement { copy.

    +
    +

    The input HTML element removing steps, given + removedNode and oldParent, are: if removedNode supports + opaque ranges, then disconnect all associated OpaqueRanges from + removedNode.

    +
    +

    The activation behavior for input elements element, given event, are these steps:

    @@ -50952,6 +51003,9 @@ 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 + disconnect all associated OpaqueRanges from this element.

  • @@ -55677,6 +55731,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 opaque ranges, then run + the opaque range full replacement steps with the 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, @@ -56156,13 +56216,22 @@ You cannot submit this form when the field is incorrect.

    For input elements without a defined input activation behavior, but to which these events apply, any time the user causes the element's value to change without an explicit commit - action, the user agent must queue an element task on the user interaction task - source given the input element to fire an - event named input at the input element, with - the bubbles and composed attributes initialized to true. The corresponding - change event, if any, will be fired when the control loses focus.

    + action, the user agent must run the following steps:

    + +
      +
    1. If the element supports opaque ranges, then run the opaque range + replacement steps with the element, the edit's code unit offset, the number of code units + removed, and the number of code units inserted.

    2. + +
    3. Queue an element task on the user interaction task source given + the input element to fire an event named + input at the input element, with the bubbles and composed + attributes initialized to true.

    4. +
    + +

    The corresponding change event, if any, will be fired when + the control loses focus.

    Examples of a user changing the element's HTMLTextAreaElement : HTMLElement { undefined setRangeText(DOMString replacement); undefined setRangeText(DOMString replacement, unsigned long start, unsigned long end, optional SelectionMode selectionMode = "preserve"); undefined setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction); + [NewObject] OpaqueRange createValueRange(unsigned long start, unsigned long end); };

    Uses HTMLTextAreaElement.
    @@ -58469,15 +58539,23 @@ interface HTMLTextAreaElement : HTMLElement { data-x="concept-textarea-raw-value">raw value should be editable by the user: the user agent should allow the user to edit, insert, and remove text, and to insert and remove line breaks in the form of U+000A LINE FEED (LF) characters. Any time the user causes the element's raw value to change, the user agent must queue an - element task on the user interaction task source given the - textarea element to fire an event named - input at the textarea element, with the bubbles and composed - attributes initialized to true. User agents may wait for a suitable break in the user's - 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.

    + data-x="concept-textarea-raw-value">raw value to change, the user agent must run the + following steps:

    + +
      +
    1. Run the opaque range replacement steps with the element, the edit's code + unit offset, the number of code units removed, and the number of code units inserted.

    2. + +
    3. Queue an element task on the user interaction task source given + the textarea element to fire an event + named input at the textarea element, with the + bubbles and composed attributes initialized to true.

    4. +
    + +

    User agents may wait for a suitable break in the user's 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.

    @@ -58494,11 +58572,21 @@ interface HTMLTextAreaElement : HTMLElement { value flag from node to copy.

    +
    +

    The textarea HTML element removing steps, given + removedNode and oldParent, are to disconnect all associated + OpaqueRanges from removedNode.

    +
    +

    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.

    + content. If this changes the element's raw value, then run the opaque range full + replacement steps with the element, the length of the previous API value, and the length of the new API value.

    @@ -58506,7 +58594,10 @@ interface HTMLTextAreaElement : HTMLElement { elements is to set the user validity to false, the dirty value flag back to false, and the raw value to its child text - content.

    + content. If this changes the element's API + value, then run the opaque range full replacement steps with the element, the + length of the previous API value, and the length of + the new API value.

    @@ -58779,8 +58870,12 @@ interface HTMLTextAreaElement : HTMLElement {
  • 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 opaque range full replacement steps with this element, the + length of oldAPIValue, and the length of the element's new + API value.

  • If the new API value is different from oldAPIValue, then move the text entry @@ -62717,6 +62812,24 @@ MIT Room 32-G524 + +

    range = element.createValueRange(start, end)
    + +
    +

    Returns an OpaqueRange object representing the portion of the element's relevant value from start to + end.

    + +

    Throws a "NotSupportedError" DOMException if the + element does not support opaque ranges.

    + +

    Throws an "IndexSizeError" DOMException if + start or end is greater than the length of the relevant value.

    + +

    If start is greater than end, the range is collapsed to + start.

    +
    @@ -63089,6 +63202,12 @@ MIT Room 32-G524
  • Let new end be the sum of start and new length.

  • +
  • Let deleted count be max(0, end minus start).

  • + +
  • If this element supports opaque ranges, then run the opaque range + replacement steps with this element, start, deleted count, and + new length.

  • +
  • Run the appropriate set of substeps from the following list:

    @@ -63153,6 +63272,108 @@ MIT Room 32-G524 +

    A textarea element, or an input element whose type attribute is in the Text, Search, + Telephone, URL, or Password state, supports opaque ranges.

    + +

    Each element that supports opaque ranges has a set of associated + OpaqueRanges, which is a set of OpaqueRange objects, initially + empty.

    + +

    For an element that supports opaque ranges, the opaque range internal + container is the internal node representing the element's relevant value text.

    + +
    +

    The opaque range full replacement steps, given an element + element, an integer oldLength, and an integer newLength, are to + run the opaque range replacement steps with element, 0, + oldLength, and newLength.

    +
    + +
    +

    The opaque range replacement steps, given an element element, + a non-negative integer offset, a non-negative integer count, and a + non-negative integer insertedLength, are:

    + +
      +
    1. For each OpaqueRange in element's set of associated + OpaqueRanges whose start offset is greater than offset but less + than or equal to offset plus count, set its start offset to + offset.

    2. + +
    3. For each OpaqueRange in element's set of associated + OpaqueRanges whose end offset is greater than offset but less + than or equal to offset plus count, set its end offset to + offset.

    4. + +
    5. For each OpaqueRange in element's set of associated + OpaqueRanges whose start offset is greater than offset plus + count, increase its start offset by insertedLength and + decrease it by count.

    6. + +
    7. For each OpaqueRange in element's set of associated + OpaqueRanges whose end offset is greater than offset plus + count, increase its end offset by insertedLength and + decrease it by count.

    8. +
    + +

    These updates operate on UTF-16 code unit indices.

    +
    + +
    +

    The opaque range disconnect steps, given an element element and an + OpaqueRange range, are to remove + range from element's set of associated OpaqueRanges.

    +
    + +
    +

    To disconnect all associated OpaqueRanges from an element element that + supports opaque ranges, run the disconnect() method steps on all items in + element's set of associated OpaqueRanges.

    +
    + +
    +

    The createValueRange(start, + end) method, when invoked, must run the following steps:

    + +
      +
    1. If this element is an input element, and createValueRange() does not apply to this element, then throw a + "NotSupportedError" DOMException.

    2. + +
    3. Let length be the length of this element's relevant value.

    4. + +
    5. If start is greater than length, then throw an + "IndexSizeError" DOMException.

    6. + +
    7. If end is greater than length, then throw an + "IndexSizeError" DOMException.

    8. + +
    9. If start is greater than end, then set end to + start.

    10. + +
    11. Let range be a new OpaqueRange with start container + and end container set to this element's opaque range internal container, + start offset start, and end offset end.

    12. + +
    13. Set range's associated + element to this element.

    14. + +
    15. Append range to this element's set of + associated OpaqueRanges.

    16. + +
    17. Return range.

    18. +
    +
    +

    The setRangeText() method uses the following enumeration: