diff --git a/source b/source index b2fe9a497c3..9debaf45650 100644 --- a/source +++ b/source @@ -3251,6 +3251,15 @@ 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
  • @@ -48558,6 +48567,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(); @@ -48740,7 +48750,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 @@ -49764,6 +49775,30 @@ interface HTMLInputElement : HTMLElement { · + + · + · + · + · + · + + · + · + · + · + + + + createValueRange() + · + Yes + + Yes + · + Yes + · + + · · @@ -49919,6 +49954,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.

    @@ -49964,7 +50004,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 @@ -50022,6 +50065,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:

    @@ -50175,6 +50225,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.

  • @@ -54900,6 +54953,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, @@ -55386,6 +55445,9 @@ You cannot submit this form when the field is incorrect. data-x="dom-Event-composed">composed attributes initialized to true. The corresponding change event, if any, will be fired when the control loses focus.

    +

    Before queuing that task, 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.

    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.
    @@ -57688,6 +57751,9 @@ 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, 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.

    @@ -57704,11 +57770,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, and the element supports opaque + ranges, 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.

    @@ -57716,7 +57792,11 @@ 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, and the element supports opaque ranges, 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.

    @@ -57989,8 +58069,13 @@ 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, + and the element supports opaque ranges, 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 @@ -61926,6 +62011,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.

    +
    @@ -62298,6 +62401,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:

    @@ -62362,6 +62471,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: