From e0b7739be27fd55ae42dec86d430cca951da0458 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Wed, 3 Apr 2024 15:05:58 +0100 Subject: [PATCH] Editorial: export Element's innerText getter and setter steps These will be used by Trusted Types (and eventually HTML once upstreamed) as part of shadowing this attribute to HTMLScriptElement. --- source | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/source b/source index de2845b5465..d2f3a21ea4a 100644 --- a/source +++ b/source @@ -14391,14 +14391,13 @@ interface DOMStringMap {
-

The innerText and - outerText getter steps - are:

+

The get the text steps, given an HTMLElement + element, are:

  1. -

    If this is not being rendered or if the user agent is a non-CSS - user agent, then return this's descendant text content.

    +

    If element is not being rendered or if the user agent is a non-CSS + user agent, then return element's descendant text content.

    This step can produce surprising results, as when the innerText getter is invoked on an element not being @@ -14410,13 +14409,12 @@ interface DOMStringMap {

  2. Let results be a new empty list.

  3. -

    For each child node node of this:

    +

    For each child node node of element:

      -
    1. 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).

      +
    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 @@ -14441,6 +14439,10 @@ interface DOMStringMap {

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

    +

    The innerText and + outerText getter steps + are to return the result of running get the text steps with this.

    +

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

    @@ -14527,16 +14529,20 @@ interface DOMStringMap {
    -

    The innerText setter steps are:

    +

    The set the inner text steps, given an HTMLElement + element, and a string value are:

      -
    1. Let fragment be the rendered text fragment for the given value - given this's node document.

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

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

    6. +
    7. Replace all with fragment + within element.

    +

    The innerText setter steps are to run set the inner + text steps.

    +

    The outerText setter steps are: