From 01a5426ec518c468a7758ceade9d208034bcc95c Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Sat, 30 May 2020 12:14:49 +0200 Subject: [PATCH 1/2] Editorial: refactor designMode --- source | 65 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/source b/source index d76ca234b80..924257f3fc8 100644 --- a/source +++ b/source @@ -73576,21 +73576,11 @@ body { display:none } -

Making entire documents editable: the designMode - IDL attribute

- -
- -

Documents have a designMode, which can be either enabled or - disabled.

- -
+

Making entire documents + editable: the designMode getter and setter

-
document . designMode [ = value ]
-

Returns "on" if the document is editable, and "off" if it isn't.

@@ -73602,28 +73592,37 @@ body { display:none }
-

The designMode IDL attribute on the - Document object takes two values, "on" and "off". On setting, the new value must be compared in an ASCII - case-insensitive manner to these two values; if it matches the "on" - value, then designMode must be enabled, and if it - matches the "off" value, then designMode must be disabled. Other values must be - ignored.

+

Document objects have an associated design mode enabled, which is a + boolean. It is initially false.

-

On getting, if designMode is enabled, the IDL - attribute must return the value "on"; otherwise it is disabled, and the - attribute must return the value "off".

+

The designMode getter + steps are to return "on" if this's design mode + enabled is true; otherwise "off".

-

The last state set must persist until the document is destroyed or the state is changed. - Initially, documents must have their designMode - disabled.

+

The designMode setter steps are:

-

When the designMode changes from being disabled to - being enabled, the user agent must immediately reset the document's active range's - start and end boundary points to be at the start of the Document and then run the - focusing steps for the document element of the Document, if - non-null.

+
    +
  1. Let value be the given value, converted to ASCII + lowercase.

  2. + +
  3. +

    If value is "on" and this's design mode + enabled is false, then:

    + +
      +
    1. Set this's design mode enabled to true.

    2. + +
    3. Reset this's active range's start and end boundary points to + be at the start of this.

    4. + +
    5. Run the focusing steps for this's document + element, if non-null.

    6. +
    +
  4. + +
  5. If value is "off", then set this's + design mode enabled to false.

  6. +
@@ -73665,8 +73664,8 @@ body { display:none }

An editing host is either an HTML element with its contenteditable attribute in the true state, or a child HTML element of a Document with designMode enabled.

+ elements">HTML element of a Document whose design mode enabled is + true.

The definition of the terms active range, Date: Sat, 30 May 2020 12:24:16 +0200 Subject: [PATCH 2/2] Editorial: refactor innerText --- source | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/source b/source index 924257f3fc8..4e4d94ab625 100644 --- a/source +++ b/source @@ -12272,12 +12272,11 @@ interface DOMStringMap { -

The innerText IDL attribute

+

The innerText getter and + setter

-
element . innerText [ = value ]
-

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

@@ -12287,16 +12286,15 @@ interface DOMStringMap {
-

On getting, the innerText attribute must follow - these steps:

+

The innerText getter steps are:

  1. -

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

    +

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

    This step can produce surprising results, as when the innerText attribute is accessed on an element not being + data-x="dom-innerText">innerText getter is invoked on an element not being rendered, its text contents are returned, but when accessed on an element that is being rendered, all of its children that are not being rendered have their text contents ignored.

    @@ -12305,7 +12303,7 @@ interface DOMStringMap {
  2. Let results be a new empty list.

  3. -

    For each child node node of this element:

    +

    For each child node node of this:

    1. Let current be the list resulting in running the inner @@ -12419,11 +12417,10 @@ interface DOMStringMap { stringifier and maybe expose it directly on ranges. See Bugzilla bug 10583.

      -

      On setting, the innerText attribute must follow these - steps:

      +

      The innerText setter steps are:

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

      2. +
      3. Let document be this's node document.

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

      5. @@ -12469,7 +12466,7 @@ interface DOMStringMap {
      6. Replace all with fragment within - this element.

      7. + this.

@@ -121894,8 +121891,8 @@ INSERT INTERFACES HERE href="https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document">W3C Permissive Document License.

-

Part of the revision history of the innerText IDL attribute - can be found in the Part of the revision history of the innerText getter and + setter can be found in the rocallahan/innerText-spec repository.