diff --git a/source b/source index 6ce33ef86e2..e5df61bdd0d 100644 --- a/source +++ b/source @@ -2691,6 +2691,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • "IndexSizeError"
  • "HierarchyRequestError"
  • "InvalidCharacterError"
  • +
  • "NoModificationAllowedError"
  • "NotFoundError"
  • "NotSupportedError"
  • "InvalidStateError"
  • @@ -2960,7 +2961,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute shadow-including descendant, shadow-including inclusive descendant, and shadow-including inclusive ancestor concepts -
  • The first child and next sibling concepts
  • +
  • The first child, + next sibling, and + previous sibling concepts
  • The document element concept
  • The in a document tree, in a document (legacy), and connected concepts
  • The slot concept, and its name and assigned nodes
  • @@ -2981,7 +2984,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • The change, append, remove, replace, and set value algorithms for attributes
  • The attribute change steps hook for attributes
  • The attribute list concept
  • -
  • The data of a text node
  • +
  • The data of a text node and its + replace data algorithm
  • The child text content of a node
  • The descendant text content of a node
  • Event interface
  • @@ -10173,6 +10177,7 @@ interface HTMLElement : Element { [CEReactions] attribute DOMString autocapitalize; [CEReactions] attribute [LegacyNullToEmptyString] DOMString innerText; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString outerText; ElementInternals attachInternals(); }; @@ -12570,8 +12575,8 @@ interface DOMStringMap { -

    The innerText getter and - setter

    +

    The innerText and outerText properties

    element . innerText [ = value ]
    @@ -12580,12 +12585,22 @@ interface DOMStringMap {

    Can be set, to replace the element's children with the given value, but with line breaks converted to br elements.

    + + +
    element . outerText [ = value ]
    +
    +

    Returns the element's text content "as rendered".

    + +

    Can be set, to replace the element with the given value, but with line breaks converted to + br elements.

    +
    -

    The innerText getter - steps are:

    +

    The innerText and + outerText getter steps + are:

    1. @@ -12605,9 +12620,10 @@ interface DOMStringMap {

      For each child node node of this:

        -
      1. Let current be the list resulting in running the inner - text collection steps with node. Each item in results will either - be a string or a positive integer (a required line break count).

        +
      2. Let current be the list resulting in running the + rendered text collection steps with node. Each item in + results will either be a string or a positive integer (a required + line break count).

        Intuitively, a required line break count item means that a certain number of line breaks appear at that point, but they can be collapsed with the line breaks @@ -12626,19 +12642,19 @@ interface DOMStringMap { count items at the start or end of results.

      3. Replace each remaining run of consecutive required - line break count items with a string consisting of as many U+000A LINE FEED (LF) characters - as the maximum of the values in the required line break count items.

      4. + line break count items with a string consisting of as many U+000A LF code points as the + maximum of the values in the required line break count items.

      5. Return the concatenation of the string items in results.

      -

      The inner text collection steps, given a node node, are - as follows:

      +

      The rendered text collection steps, given a node node, + are as follows:

        -
      1. Let items be the result of running the inner text collection steps - with each child node of node in tree order, and then concatenating - the results to a single list.

      2. +
      3. Let items be the result of running the rendered text collection + steps with each child node of node in tree order, and then + concatenating the results to a single list.

      4. If node's computed value of 'visibility' is not 'visible', then return items.

      5. @@ -12675,20 +12691,20 @@ interface DOMStringMap { spec=CSSTEXT>

      6. If node is a br element, then append a string containing a single U+000A LINE FEED (LF) character to + append">append a string containing a single U+000A LF code point to items.

      7. If node's computed value of 'display' is 'table-cell', and node's CSS box is not the last 'table-cell' box of its enclosing 'table-row' box, then append a string containing a single U+0009 CHARACTER TABULATION (tab) - character to items.

      8. + data-x="list append">append a string containing a single U+0009 TAB code point to + items.

      9. If node's computed value of 'display' is 'table-row', and node's CSS box is not the last 'table-row' box of the nearest ancestor 'table' box, then append a string containing a single U+000A LINE FEED (LF) character - to items.

      10. + data-x="list append">append a string containing a single U+000A LF code point to + items.

      11. If node is a p element, then append 2 (a required line break count) at the beginning and end of @@ -12716,18 +12732,48 @@ interface DOMStringMap { stringifier and maybe expose it directly on ranges. See Bugzilla bug 10583.

        +
        +

        The innerText setter steps are:

          -
        1. Let document be this's node document.

        2. +
        3. Let fragment be the rendered text fragment for the given value + given this's node document.

        4. + +
        5. Replace all with fragment within + this.

        6. +
        + +

        The outerText setter steps are:

        + +
          +
        1. If this's parent is null, then throw a + "NoModificationAllowedError" DOMException.

        2. + +
        3. Let next be this's next sibling.

        4. -
        5. Let fragment be a new DocumentFragment object whose node - document is document.

        6. +
        7. Let previous be this's previous sibling.

        8. -
        9. Let input be the given value.

        10. +
        11. Let fragment be the rendered text fragment for the given value + given this's node document.

        12. -
        13. Let position be a pointer into input, initially pointing at the start - of the string.

        14. +
        15. Replace this with + fragment within this's parent.

        16. + +
        17. If next is non-null and next's previous sibling is a + Text node, then merge with the next text node given next's + previous sibling.

        18. + +
        19. If previous is a Text node, then merge with the next text + node given previous.

        20. +
        + +

        The rendered text fragment for a string input given a + Document document is the result of running the following steps:

        + +
          +
        1. Let position be a position variable for input, + initially pointing at the start of input.

        2. Let text be the empty string.

        3. @@ -12735,9 +12781,8 @@ interface DOMStringMap {

          While position is not past the end of input:

            -
          1. Collect a sequence of code points that are not U+000A LINE FEED (LF) or - U+000D CARRIAGE RETURN (CR) characters from input given position. Set - text to the collected characters.

          2. +
          3. Collect a sequence of code points that are not U+000A LF or U+000D CR from + input given position, and set text to the result.

          4. If text is not the empty string, then append a new Text node whose DOMStringMap { document to fragment.

          5. -

            While position is not past the end of input, and the character at - position is either a U+000A LINE FEED (LF) or U+000D CARRIAGE RETURN (CR) - character:

            +

            While position is not past the end of input, and the code point at + position is either U+000A LF or U+000D CR:

              -
            1. If the character at position is a U+000D CARRIAGE RETURN (CR) character and - the next character is a U+000A LINE FEED (LF) character, then advance position to - the next character in input.

            2. +
            3. If the code point at position is U+000D CR and the next code point is + U+000A LF, then advance position to the next code point in + input.

            4. -
            5. Advance position to the next character in input.

            6. +
            7. Advance position to the next code point in input.

            8. -
            9. Append the result of creating an element given document, - br, and the HTML namespace to fragment.

            10. +
            11. Append the result of creating an element given document, br, and the + HTML namespace to fragment.

          +
        -
      12. Replace all with fragment within - this.

      13. +

        To merge with the next text node given a Text node node:

        + +
          +
        1. Let next be node's next sibling.

        2. + +
        3. If next is not a Text node, then return.

        4. + +
        5. Replace data with node, node's data's length, 0, and next's data.

        6. + +
        7. +

          If next's parent is non-null, then remove next.

          + +

          The parent check is necessary as the previous step might have triggered mutation + events.

          +
    @@ -68205,14 +68266,10 @@ customElements.define("x-foo", class extends HTMLElement { known to fall into this category: