From 5a3eac7ff894ed7eed9aa6524f40d058f8b2c774 Mon Sep 17 00:00:00 2001 From: Sanket Joshi Date: Thu, 30 Nov 2023 18:09:25 -0800 Subject: [PATCH 01/39] Initial commit - building. --- source | 204 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 204 insertions(+) diff --git a/source b/source index edb4d2b57c1..86a7aa45556 100644 --- a/source +++ b/source @@ -80774,6 +80774,209 @@ body { display:none } checkers. A user agent could offer on-demand checking, could perform continuous checking while the checking is enabled, or could use other interfaces.

+

Writing suggestions

+ +
+ +

User agents can offer writing suggests as users modify editable text, either in form + controls (such as the value of textarea elements), or in elements in an editing + host (e.g. using contenteditable).

+ +

For each element, user agents must establish a default + behavior, either through defaults or through preferences expressed by the user. There are + three possible default behaviors for each element:

+ +
+
true-by-default + +
The element will offer writing suggestions if its contents are editable and + writing suggestions are not explicitly disabled through the writingsuggestions attribute. + +
false-by-default + +
The element will not offer writing suggestions unless writing suggestions are + explicitly enabled through the writingsuggestions attribute. + +
inherit-by-default + +
The element's default behavior is the same as its parent element's. Elements that have no + parent element cannot have this as their default behavior. +
+ +
+ +
+ +

The writingsuggestions + attribute is an enumerated attribute whose keywords are the empty string, true and false. The empty string and the true keyword map to the true state. The false + keyword maps to the false state. In addition, there is a third state, the default + state, which is the missing value default and invalid value default.

+ +

The true state indicates that the element is to have its spelling and + grammar checked. The default state indicates that the element is to act according to a + default behavior, possibly based on the parent element's own spellcheck state, as defined below. The false state + indicates that the element is not to be checked.

+ +
+ +
+ +
+ +
+
element.writingsuggestions [ = value ]
+ +
+

Returns "on" if writing suggestions are explicitly enabled for the element, "off" if they are explicitly disabled, or an empty string if this + attribute has not been explicitly set.

+ +

Can be set, to override the default and set the writingsuggestions content attribute.

+
+
+ +
+ +

The writingsuggestions IDL + attribute, on getting, must return true if the element's writingsuggestions content attribute is in the true state, or if + the element's writingsuggestions content attribute is in the + default state and the element's default + behavior is true-by-default, or if + the element's writingsuggestions content attribute is in the + default state and the element's default + behavior is inherit-by-default and + the element's parent element's writingsuggestions IDL attribute would + return true; otherwise, if none of those conditions applies, then the attribute must instead + return false.

+ +

The writingsuggestions IDL attribute is not affected + by user preferences that override the writingsuggestions content + attribute, and therefore might not reflect the actual spellchecking state.

+ +

On setting, if the new value is true, then the element's writingsuggestions content attribute must be set to the literal string + "true", otherwise it must be set to the literal string "false". + +


+ +

User agents must only consider the following pieces of text as checkable for the purposes of + this feature:

+ + + +

For text that is part of a Text node, the element with which the text is + associated is the element that is the immediate parent of the first character of the word, + sentence, or other piece of text. For text in attributes, it is the attribute's element. For the + values of input and textarea elements, it is the element itself.

+ +

To determine if a word, sentence, or other piece of text in an applicable element (as defined + above) is to have spelling- and grammar-checking enabled, the UA must use the following + algorithm:

+ +
    + + +
  1. If the user has disabled the checking for this text, then the checking is disabled.
  2. + +
  3. Otherwise, if the user has forced the checking for this text to always be enabled, then the + checking is enabled.
  4. + + + +
  5. Otherwise, if the element with which the text is associated has a spellcheck content attribute, then: if that attribute is in the + true state, then checking is enabled; otherwise, if that attribute is in the false + state, then checking is disabled.
  6. + + + +
  7. Otherwise, if there is an ancestor element with a spellcheck content attribute that is not in the default + state, then: if the nearest such ancestor's writingsuggestions + content attribute is in the true state, then checking is enabled; otherwise, checking is + disabled.
  8. + + + +
  9. Otherwise, if the element's default behavior + is true-by-default, then checking is + enabled.
  10. + +
  11. Otherwise, if the element's default behavior + is false-by-default, then checking is + disabled.
  12. + + + +
  13. Otherwise, if the element's parent element has its checking enabled, then checking + is enabled.
  14. + +
  15. Otherwise, checking is disabled.
  16. +
+ +

If the checking is enabled for a word/sentence/text, the user agent should indicate spelling + and grammar errors in that text. User agents should take into account the other semantics given in + the document when suggesting spelling and grammar corrections. User agents may use the language of + the element to determine what spelling and grammar rules to use, or may use the user's preferred + language settings. UAs should use input element attributes such as pattern to ensure that the resulting value is valid, where + possible.

+ +

If checking is disabled, the user agent should not indicate spelling or grammar errors for that + text.

+ +
+ +

The element with ID "a" in the following example would be the one used to determine if the + word "Hello" is checked for spelling errors. In this example, it would not be.

+ +
<div contenteditable="true">
+ <span spellcheck="false" id="a">Hell</span><em>o!</em>
+</div>
+ +

The element with ID "b" in the following example would have checking enabled (the leading + space character in the attribute's value on the input element causes the attribute + to be ignored, so the ancestor's value is used instead, regardless of the default).

+ +
<p spellcheck="true">
+ <label>Name: <input spellcheck=" false" id="b"></label>
+</p>
+ +
+ +
+ +

This specification does not define the user interface for spelling and grammar + checkers. A user agent could offer on-demand checking, could perform continuous checking while the + checking is enabled, or could use other interfaces.

+

Autocapitalization

Some methods of entering text, for example virtual keyboards on mobile devices, and also voice @@ -141401,6 +141604,7 @@ INSERT INTERFACES HERE Samy Kamkar, Sander van Lambalgen, Sanjoy Pal, + Sanket Joshi, Sarah Gebauer, Sarven Capadisli, Satrujit Behera, From 26daf8a7287417c12053efefbb50ba0f849db0c0 Mon Sep 17 00:00:00 2001 From: Sanket Joshi Date: Thu, 30 Nov 2023 18:40:13 -0800 Subject: [PATCH 02/39] Add definitions for writingsuggestion attribute and values. --- source | 88 +++++++++++++++++++++------------------------------------- 1 file changed, 31 insertions(+), 57 deletions(-) diff --git a/source b/source index 86a7aa45556..b57e14d8ec3 100644 --- a/source +++ b/source @@ -12977,6 +12977,7 @@ https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%

  • tabindex
  • title
  • translate
  • +
  • writingsuggestions
  • @@ -80782,46 +80783,37 @@ body { display:none } controls (such as the value of textarea elements), or in elements in an editing host (e.g. using contenteditable).

    -

    For each element, user agents must establish a default - behavior, either through defaults or through preferences expressed by the user. There are - three possible default behaviors for each element:

    - -
    -
    true-by-default - -
    The element will offer writing suggestions if its contents are editable and - writing suggestions are not explicitly disabled through the writingsuggestions attribute. - -
    false-by-default - -
    The element will not offer writing suggestions unless writing suggestions are - explicitly enabled through the writingsuggestions attribute. +

    The writingsuggestions content attribute is an + enumerated attribute with the following keywords and states:

    -
    inherit-by-default + + + + + + +
    Keyword + State + Brief description +
    off + Off + UAs will not offer writing suggestions on this element. +
    on + On + UAs may offer writing suggestions on this element. +
    -
    The element's default behavior is the same as its parent element's. Elements that have no - parent element cannot have this as their default behavior. -
    +

    The attribute's missing value default and invalid value default are both the Off state.


    -

    The writingsuggestions - attribute is an enumerated attribute whose keywords are the empty string, true and false. The empty string and the true keyword map to the true state. The false - keyword maps to the false state. In addition, there is a third state, the default - state, which is the missing value default and invalid value default.

    - -

    The true state indicates that the element is to have its spelling and - grammar checked. The default state indicates that the element is to act according to a - default behavior, possibly based on the parent element's own spellcheck state, as defined below. The false state - indicates that the element is not to be checked.

    -

    @@ -80842,20 +80834,7 @@ body { display:none }
    -

    The writingsuggestions IDL - attribute, on getting, must return true if the element's writingsuggestions content attribute is in the true state, or if - the element's writingsuggestions content attribute is in the - default state and the element's default - behavior is true-by-default, or if - the element's writingsuggestions content attribute is in the - default state and the element's default - behavior is inherit-by-default and - the element's parent element's writingsuggestions IDL attribute would - return true; otherwise, if none of those conditions applies, then the attribute must instead - return false.

    - -

    The writingsuggestions IDL attribute is not affected +

    The writingsuggestions IDL attribute is not affected by user preferences that override the writingsuggestions content attribute, and therefore might not reflect the actual spellchecking state.

    @@ -80923,16 +80902,6 @@ body { display:none } content attribute is in the true state, then checking is enabled; otherwise, checking is disabled. - - -
  • Otherwise, if the element's default behavior - is true-by-default, then checking is - enabled.
  • - -
  • Otherwise, if the element's default behavior - is false-by-default, then checking is - disabled.
  • -
  • Otherwise, if the element's parent element has its checking enabled, then checking @@ -138588,6 +138557,11 @@ interface External { How the value of the form control is to be wrapped for form submission "soft"; "hard" + + writingsuggestions + HTML elements + Whether the element can offer writing suggestions or not. + "on"; "off"

    An asterisk (*) in a cell indicates that the actual rules are more From c9abb7a1142d12e0e2d1f181fc5bbdbd33bb4dad Mon Sep 17 00:00:00 2001 From: Sanket Joshi Date: Fri, 1 Dec 2023 17:44:39 -0800 Subject: [PATCH 03/39] Further updates to spec text. --- source | 63 ++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/source b/source index b57e14d8ec3..5010b319c3c 100644 --- a/source +++ b/source @@ -80779,9 +80779,31 @@ body { display:none }

    -

    User agents can offer writing suggests as users modify editable text, either in form - controls (such as the value of textarea elements), or in elements in an editing - host (e.g. using contenteditable).

    +

    User agents may offer writing suggestions as users type into editable regions, either in form + controls (ex. the textarea element) or in elements in an editing + host (ex. using contenteditable).

    + +

    User agents must establish a default + writing suggestions state (ex. based on preferences expressed by the user) for each element. + There are two possible default writing suggestions states:

    + +
    +
    on-by-default + +
    The user agent may offer writing suggestions on this element if its contents are editable + and writing suggestions are not explicitly disabled through the + writingsuggestions attribute. + +
    off-by-default + +
    The user agent will never offer writing suggestions on this element. + +
    inherit-by-default + +
    The element's default behavior is the same as its parent element's. + Elements that have no parent element cannot have this as their default behavior. + +

    The writingsuggestions content attribute is an @@ -80796,27 +80818,21 @@ body { display:none } off - Off - UAs will not offer writing suggestions on this element. + data-x="attr-writingsuggestions-on">on + default + The user agent will act according to the default writing suggestions state + established for this element. on - On - UAs may offer writing suggestions on this element. + data-x="attr-writingsuggestions-off">off + off + The user agent will not offer writing suggestions on this element.

    The attribute's missing value default and invalid value default are both the Off state.

    - -
    - -
    - -
    - -
    + data-x="attr-writingsuggestions-default-state">default state.

    @@ -80824,8 +80840,7 @@ body { display:none }
    element.writingsuggestions [ = value ]
    -

    Returns "on" if writing suggestions are explicitly enabled for the element, "off" if they are explicitly disabled, or an empty string if this - attribute has not been explicitly set.

    +

    Returns "on" if the user agent might offer writing suggestions on this element; otherwise, returns "off".

    Can be set, to override the default and set the writingsuggestions content attribute.

    @@ -80836,12 +80851,12 @@ body { display:none }

    The writingsuggestions IDL attribute is not affected by user preferences that override the writingsuggestions content - attribute, and therefore might not reflect the actual spellchecking state.

    + attribute, and therefore might not reflect the actual writing suggestions state.

    -

    On setting, if the new value is true, then the element's On setting, if the new value is "on", then the element's writingsuggestions content attribute must be set to the literal string - "true", otherwise it must be set to the literal string "false". + "on", otherwise it must be set to the literal string "off".


    From ea0bfc1c31fa94893c9394d2768e36aa9c1db927 Mon Sep 17 00:00:00 2001 From: Sanket Joshi Date: Thu, 21 Dec 2023 19:51:58 -0800 Subject: [PATCH 04/39] Initial iteration of writing suggestions spec. --- source | 184 +++++++++++++++++++++++---------------------------------- 1 file changed, 75 insertions(+), 109 deletions(-) diff --git a/source b/source index 5010b319c3c..0b36204e56a 100644 --- a/source +++ b/source @@ -80783,27 +80783,23 @@ body { display:none } controls (ex. the textarea element) or in elements in an editing host (ex. using contenteditable).

    -

    User agents must establish a default - writing suggestions state (ex. based on preferences expressed by the user) for each element. - There are two possible default writing suggestions states:

    +

    For each element, user agents must establish a default + behavior from amongst the following behaviors:

    -
    -
    on-by-default - -
    The user agent may offer writing suggestions on this element if its contents are editable - and writing suggestions are not explicitly disabled through the - writingsuggestions attribute. +
    +
    on -
    off-by-default +
    The user agent may offer writing suggestions on this element. -
    The user agent will never offer writing suggestions on this element. +
    off -
    inherit-by-default +
    The user agent must not offer writing suggestions on this element. -
    The element's default behavior is the same as its parent element's. - Elements that have no parent element cannot have this as their default behavior. +
    inherit -
    +
    The element's default writing suggestions state is the same as its parent element's. + Elements that have no parent element cannot have this as their default state. +

    The writingsuggestions content attribute is an @@ -80819,147 +80815,117 @@ body { display:none } on - default - The user agent will act according to the default writing suggestions state - established for this element. + on + The user agent may offer writing suggestions on this element. + + + (The empty string) off + data-x="attr-writingsuggestions-off">off off - The user agent will not offer writing suggestions on this element. + The user agent must not offer writing suggestions on this element. +

    The attribute's missing value default and invalid value default are both the default state.

    - -
  • + data-x="invalid value default">invalid value default are both the default state. The default state + indicates that the element is to act according to its established + default behavior.

    element.writingsuggestions [ = value ]
    -

    Returns "on" if the user agent might offer writing suggestions on this element; otherwise, returns "off".

    +

    Returns the keyword value corresponding to the writing suggestions state for the current element.

    Can be set, to override the default and set the writingsuggestions content attribute.

    -
    +

    The writingsuggestions IDL + attribute, on getting, must return "on" if the element's writingsuggestions content attribute + is in the on state, or if the element's writingsuggestions content attribute is in the + default state and the element's default behavior is + on, or if the element's + writingsuggestions content attribute is in the default state and the element's + default behavior is + inherit-by-default and the element's parent element's writingsuggestions IDL attribute + would return "on"; otherwise, if none of those conditions applies, then the attribute must instead return "off".

    -

    The writingsuggestions IDL attribute is not affected - by user preferences that override the writingsuggestions content - attribute, and therefore might not reflect the actual writing suggestions state.

    +

    The writingsuggestions IDL attribute + is not affected by user preferences that override the writingsuggestions content + attribute, and therefore might not reflect the actual writing suggestions state.

    -

    On setting, if the new value is "on", then the element's writingsuggestions content attribute must be set to the literal string - "on", otherwise it must be set to the literal string "off". +

    The writingsuggestions setter steps are to set the writingsuggestions content attribute to the given value.


    -

    User agents must only consider the following pieces of text as checkable for the purposes of - this feature:

    +

    User agents may only offer writing suggestions within the scope of the following element types.

      -
    • The value of input elements whose type attributes are in the Text, Search, - URL, or Email states and that are mutable (i.e. that do not have the readonly attribute specified and that are not disabled).
    • +
    • input elements whose type attributes are in the + Text, Search, + URL, or Email states + and that are mutable (i.e. that do not have the readonly attribute specified and that are not disabled).
    • -
    • The value of textarea elements that do not - have a readonly attribute and that are not disabled.
    • - -
    • Text in Text nodes that are children of editing - hosts or editable elements.
    • +
    • textarea elements that do not have a readonly + attribute and that are not disabled.
    • -
    • Text in attributes of editable elements.
    • +
    • Editing hosts or editable elements.
    -

    For text that is part of a Text node, the element with which the text is - associated is the element that is the immediate parent of the first character of the word, - sentence, or other piece of text. For text in attributes, it is the attribute's element. For the - values of input and textarea elements, it is the element itself.

    - -

    To determine if a word, sentence, or other piece of text in an applicable element (as defined - above) is to have spelling- and grammar-checking enabled, the UA must use the following - algorithm:

    +

    To determine if writing suggestions may be provided within a given element's scope, the user agent must use + the following algorithm:

      -
    1. If the user has disabled the checking for this text, then the checking is disabled.
    2. - -
    3. Otherwise, if the user has forced the checking for this text to always be enabled, then the - checking is enabled.
    4. +
    5. If the user has disabled writing suggestions for this element, then writing suggestions must be disabled.
    6. -
    7. Otherwise, if the element with which the text is associated has a spellcheck content attribute, then: if that attribute is in the - true state, then checking is enabled; otherwise, if that attribute is in the false - state, then checking is disabled.
    8. +
    9. Otherwise, if the element has a writingsuggestions content + attribute, then: if that attribute is in the on state, then writing suggestions may be enabled; + otherwise, if that attribute is in the off state, then writing suggestions must be disabled.
    10. -
    11. Otherwise, if there is an ancestor element with a spellcheck content attribute that is not in the default - state, then: if the nearest such ancestor's writingsuggestions - content attribute is in the true state, then checking is enabled; otherwise, checking is - disabled.
    12. - - - -
    13. Otherwise, if the element's parent element has its checking enabled, then checking - is enabled.
    14. - -
    15. Otherwise, checking is disabled.
    16. -
    +
  • Otherwise, if there is an ancestor element with a + writingsuggestions content attribute that is not in the default state, then: if the + nearest such ancestor's writingsuggestions content + attribute is in the on state, then writing suggestions may be enabled; otherwise, if the + nearest such ancestor's writingsuggestions content + attribute is in the off state, then writing suggestions must be disabled.
  • -

    If the checking is enabled for a word/sentence/text, the user agent should indicate spelling - and grammar errors in that text. User agents should take into account the other semantics given in - the document when suggesting spelling and grammar corrections. User agents may use the language of - the element to determine what spelling and grammar rules to use, or may use the user's preferred - language settings. UAs should use input element attributes such as pattern to ensure that the resulting value is valid, where - possible.

    - -

    If checking is disabled, the user agent should not indicate spelling or grammar errors for that - text.

    - -
    - -

    The element with ID "a" in the following example would be the one used to determine if the - word "Hello" is checked for spelling errors. In this example, it would not be.

    + -
    <div contenteditable="true">
    - <span spellcheck="false" id="a">Hell</span><em>o!</em>
    -</div>
    +
  • Otherwise, if the element's default behavior + is on, then writing suggestions may be + enabled.
  • -

    The element with ID "b" in the following example would have checking enabled (the leading - space character in the attribute's value on the input element causes the attribute - to be ignored, so the ancestor's value is used instead, regardless of the default).

    +
  • Otherwise, if the element's default behavior + is off, then writing suggestions must be + disabled.
  • -
    <p spellcheck="true">
    - <label>Name: <input spellcheck=" false" id="b"></label>
    -</p>
    + -
    +
  • Otherwise, if the element's parent element has writing suggestions enabled within its scope, + then writing suggestions may be enabled within this element's scope too.
  • -
    +
  • Otherwise, writing suggestions must be disabled within this element's scope.
  • + -

    This specification does not define the user interface for spelling and grammar - checkers. A user agent could offer on-demand checking, could perform continuous checking while the - checking is enabled, or could use other interfaces.

    +

    This specification does not define the user interface for writing suggestions. + A user agent could offer on-demand suggestions, continuous suggestions as the user types, inline + suggestions, autofill-like suggestions in a popup, or could use other interfaces.

    Autocapitalization

    From 95524a10e8d74e99bd7b2bb6953b90f51a907394 Mon Sep 17 00:00:00 2001 From: Sanket Joshi Date: Thu, 21 Dec 2023 19:56:49 -0800 Subject: [PATCH 05/39] Add IDL entry. --- source | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source b/source index 67a35a28b49..4d6dbf2f34a 100644 --- a/source +++ b/source @@ -11710,6 +11710,7 @@ interface HTMLElement : Element { readonly attribute DOMString accessKeyLabel; [CEReactions] attribute boolean draggable; [CEReactions] attribute boolean spellcheck; + [CEReactions] attribute boolean writingsuggestions; [CEReactions] attribute DOMString autocapitalize; [CEReactions] attribute [LegacyNullToEmptyString] DOMString innerText; @@ -80901,8 +80902,6 @@ body { display:none }

    The writingsuggestions setter steps are to set the writingsuggestions content attribute to the given value.

    -
    -

    User agents may only offer writing suggestions within the scope of the following element types.

      From 9aecd898a8678fddb2266744a70e1878e237ee88 Mon Sep 17 00:00:00 2001 From: Sanket Joshi Date: Fri, 22 Dec 2023 13:29:37 -0800 Subject: [PATCH 06/39] Update behavior of spellcheck attribute setter. --- source | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source b/source index 4d6dbf2f34a..3c851945887 100644 --- a/source +++ b/source @@ -80820,8 +80820,8 @@ body { display:none }

      User agents may offer writing suggestions as users type into editable regions, either in form - controls (ex. the textarea element) or in elements in an editing - host (ex. using contenteditable).

      + controls (ex. the textarea element) or in elements in an + editing host.

      For each element, user agents must establish a default behavior from amongst the following behaviors:

      @@ -80899,8 +80899,9 @@ body { display:none } is not affected by user preferences that override the writingsuggestions content attribute, and therefore might not reflect the actual writing suggestions state.

      -

      The writingsuggestions setter steps are to set the writingsuggestions content attribute to the given value.

      +

      On setting, if the new state is "on", then the element's writingsuggestions + content attribute must be set to the literal string "on", otherwise it must be set to the literal string + "off".

      User agents may only offer writing suggestions within the scope of the following element types.

      From 7fda857f6bb8985a8820036ce6b295d2bc709ac9 Mon Sep 17 00:00:00 2001 From: Sanket Joshi Date: Tue, 9 Jan 2024 01:37:12 -0800 Subject: [PATCH 07/39] Specify attribute inheritance with shadow trees. --- source | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source b/source index 3c851945887..f11c769e5c5 100644 --- a/source +++ b/source @@ -80837,8 +80837,11 @@ body { display:none }
      inherit -
      The element's default writing suggestions state is the same as its parent element's. - Elements that have no parent element cannot have this as their default state. +
      The element's default writing suggestions state is the same as its parent element's, + or the same as its parent's host if + its parent is a shadow root. Elements + that do not have a shadow-including + ancestor cannot have this as their default state.

      The Date: Tue, 9 Jan 2024 02:52:46 -0800 Subject: [PATCH 08/39] Switch from on/off to true/false. --- source | 57 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/source b/source index f11c769e5c5..7d8871fa93a 100644 --- a/source +++ b/source @@ -80827,11 +80827,11 @@ body { display:none } behavior from amongst the following behaviors:

      -
      on +
      true
      The user agent may offer writing suggestions on this element. -
      off +
      false
      The user agent must not offer writing suggestions on this element. @@ -80857,16 +80857,16 @@ body { display:none } on - on + data-x="attr-writingsuggestions-true">true + true The user agent may offer writing suggestions on this element. (The empty string) off - off + data-x="attr-writingsuggestions-false">false + false The user agent must not offer writing suggestions on this element. @@ -80889,22 +80889,22 @@ body { display:none }

      The writingsuggestions IDL - attribute, on getting, must return "on" if the element's writingsuggestions content attribute - is in the on state, or if the element's writingsuggestions content attribute is in the + attribute, on getting, must return "true" if the element's writingsuggestions content attribute + is in the true state, or if the element's writingsuggestions content attribute is in the default state and the element's default behavior is - on, or if the element's + true, or if the element's writingsuggestions content attribute is in the default state and the element's default behavior is - inherit-by-default and the element's parent element's writingsuggestions IDL attribute - would return "on"; otherwise, if none of those conditions applies, then the attribute must instead return "off".

      + inherit-by-default and the writingsuggestions IDL attribute of the element's parent element, + or parent's host element if the parent is a shadow root, would return "true"; otherwise, then the attribute must instead return "false".

      The writingsuggestions IDL attribute is not affected by user preferences that override the writingsuggestions content attribute, and therefore might not reflect the actual writing suggestions state.

      -

      On setting, if the new state is "on", then the element's writingsuggestions - content attribute must be set to the literal string "on", otherwise it must be set to the literal string - "off". +

      On setting, if the new state is "true", then the element's writingsuggestions + content attribute must be set to the literal string "true", otherwise it must be set to + the literal string "false".

      User agents may only offer writing suggestions within the scope of the following element types.

      @@ -80932,35 +80932,35 @@ body { display:none }
    • If the user has disabled writing suggestions for this element, then writing suggestions must be disabled.
    • - +
    • Otherwise, if the element has a writingsuggestions content - attribute, then: if that attribute is in the on state, then writing suggestions may be enabled; - otherwise, if that attribute is in the off state, then writing suggestions must be disabled.
    • + attribute, then: if that attribute returns "true", then writing suggestions may be enabled; + otherwise, if that attribute returns "false", then writing suggestions must be disabled. -
    • Otherwise, if there is an ancestor element with a - writingsuggestions content attribute that is not in the default state, then: if the - nearest such ancestor's writingsuggestions content - attribute is in the on state, then writing suggestions may be enabled; otherwise, if the - nearest such ancestor's writingsuggestions content - attribute is in the off state, then writing suggestions must be disabled.
    • +
    • Otherwise, if there is a shadow-including ancestor + element with a writingsuggestions content attribute, then: if the + nearest such ancestor's writingsuggestions content attribute returns + "true", then writing suggestions may be enabled; otherwise, if the nearest such ancestor's + writingsuggestions content attribute returns "false", then writing + suggestions must be disabled.
    • Otherwise, if the element's default behavior - is on, then writing suggestions may be + is true, then writing suggestions may be enabled.
    • Otherwise, if the element's default behavior - is off, then writing suggestions must be + is false, then writing suggestions must be disabled.
    • -
    • Otherwise, if the element's parent element has writing suggestions enabled within its scope, - then writing suggestions may be enabled within this element's scope too.
    • +
    • Otherwise, if the element's parent element, or the parent's host element if the parent is a shadow root, + has writing suggestions enabled, then writing suggestions may be enabled within this element's scope.
    • Otherwise, writing suggestions must be disabled within this element's scope.
    • @@ -138882,7 +138882,8 @@ interface External { writingsuggestions HTML elements Whether the element can offer writing suggestions or not. - "on"; "off" + "true"; + "false"

      An asterisk (*) in a cell indicates that the actual rules are more From ccaac6c9b7655e4b3d36aabeed46866540f42597 Mon Sep 17 00:00:00 2001 From: Sanket Joshi Date: Wed, 10 Jan 2024 10:43:29 -0800 Subject: [PATCH 09/39] Wording fixup. --- source | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source b/source index 7d8871fa93a..9bb5ae6116c 100644 --- a/source +++ b/source @@ -80819,7 +80819,7 @@ body { display:none }

      -

      User agents may offer writing suggestions as users type into editable regions, either in form +

      User agents offer writing suggestions as users type into editable regions, either in form controls (ex. the textarea element) or in elements in an editing host.

      @@ -80833,7 +80833,7 @@ body { display:none }
      false -
      The user agent must not offer writing suggestions on this element. +
      The user agent will not offer writing suggestions on this element.
      inherit @@ -80906,7 +80906,7 @@ body { display:none } content attribute must be set to the literal string "true", otherwise it must be set to the literal string "false". -

      User agents may only offer writing suggestions within the scope of the following element types.

      +

      User agents must only offer writing suggestions within the scope of the following element types.

        From ac65d839787a690f4bd621d73ddaa6831f08bb9c Mon Sep 17 00:00:00 2001 From: Sanket Joshi Date: Wed, 10 Jan 2024 22:51:30 -0800 Subject: [PATCH 10/39] Remove default behavior and rework states with inherit and true as defaults. --- source | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/source b/source index 9bb5ae6116c..cb918fe2659 100644 --- a/source +++ b/source @@ -80859,7 +80859,7 @@ body { display:none } true true - The user agent may offer writing suggestions on this element. + Writing suggestions will be offered on this element. (The empty string) @@ -80867,15 +80867,25 @@ body { display:none } false false - The user agent must not offer writing suggestions on this element. + Writing suggestions will not be offered on this element. -

        The attribute's missing value default and invalid value default are both the default state. The default state - indicates that the element is to act according to its established - default behavior.

        +

        The inherit state indicates that + the element's writing suggestions state is the same as its parent element's, or the same as its + parent's host if its parent is a + shadow root. Elements that do not have a + shadow-including ancestor cannot be in + the inherit state. + +

        For elements that can be in the inherit + state, the attribute's missing value default is the inherit state. For all other elements, + the attribute's missing value default is the true state. + +

        The attribute's invalid value default is the true state.

        element.writingsuggestions [ = value ]
        @@ -80903,8 +80913,8 @@ body { display:none } attribute, and therefore might not reflect the actual writing suggestions state.

        On setting, if the new state is "true", then the element's writingsuggestions - content attribute must be set to the literal string "true", otherwise it must be set to - the literal string "false". + content attribute must be set to the literal string "true", otherwise it must be set to + the literal string "false".

        User agents must only offer writing suggestions within the scope of the following element types.

        From d16055e5c8d97978af646b275876ca823a4d8c89 Mon Sep 17 00:00:00 2001 From: Sanket Joshi Date: Thu, 11 Jan 2024 00:12:38 -0800 Subject: [PATCH 11/39] Update spec for getter/setter. --- source | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/source b/source index cb918fe2659..fb827613ae7 100644 --- a/source +++ b/source @@ -80838,8 +80838,8 @@ body { display:none }
        inherit
        The element's default writing suggestions state is the same as its parent element's, - or the same as its parent's host if - its parent is a shadow root. Elements + or the same as its parent's host element + if its parent is a shadow root. Elements that do not have a shadow-including ancestor cannot have this as their default state.
        @@ -80898,23 +80898,22 @@ body { display:none } -

        The writingsuggestions IDL - attribute, on getting, must return "true" if the element's writingsuggestions content attribute - is in the true state, or if the element's writingsuggestions content attribute is in the - default state and the element's default behavior is - true, or if the element's - writingsuggestions content attribute is in the default state and the element's - default behavior is - inherit-by-default and the writingsuggestions IDL attribute of the element's parent element, - or parent's host element if the parent is a shadow root, would return "true"; otherwise, then the attribute must instead return "false".

        +

        The writingsuggestions IDL attribute, + on getting, must return "false" if the element's writingsuggestions content + attribute is in the false state, or if the element's + writingsuggestions content attribute is in the + inherit state and the + writingsuggestions IDL attribute of the element's parent element, or parent's + host element if the parent is a shadow root, would return "false". + Otherwise, the attribute must return "true".

        The writingsuggestions IDL attribute is not affected by user preferences that override the writingsuggestions content attribute, and therefore might not reflect the actual writing suggestions state.

        -

        On setting, if the new state is "true", then the element's writingsuggestions - content attribute must be set to the literal string "true", otherwise it must be set to - the literal string "false". +

        On setting, if the new value is an ASCII case-insensitive match for the string "false", then the element's + writingsuggestions content attribute must be set to the literal string "false". + Otherwise, it must be set to the literal string "true".

        User agents must only offer writing suggestions within the scope of the following element types.

        From 71cdc445032fc2570d99e34d1b05c74c187a39e0 Mon Sep 17 00:00:00 2001 From: Sanket Joshi Date: Thu, 11 Jan 2024 00:13:00 -0800 Subject: [PATCH 12/39] Delete default behavior section. --- source | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/source b/source index fb827613ae7..db0ab37cc5e 100644 --- a/source +++ b/source @@ -80823,27 +80823,6 @@ body { display:none } controls (ex. the textarea element) or in elements in an editing host.

        -

        For each element, user agents must establish a default - behavior from amongst the following behaviors:

        - -
        -
        true - -
        The user agent may offer writing suggestions on this element. - -
        false - -
        The user agent will not offer writing suggestions on this element. - -
        inherit - -
        The element's default writing suggestions state is the same as its parent element's, - or the same as its parent's host element - if its parent is a shadow root. Elements - that do not have a shadow-including - ancestor cannot have this as their default state. -
        -

        The writingsuggestions content attribute is an enumerated attribute with the following keywords and states:

        From d5a1d1649f9f1b9ebe98a612f0a9d91334198020 Mon Sep 17 00:00:00 2001 From: Sanket Joshi Date: Thu, 11 Jan 2024 00:34:32 -0800 Subject: [PATCH 13/39] Simplify algorithm and misc editorial fixup. --- source | 49 +++++++++++++++---------------------------------- 1 file changed, 15 insertions(+), 34 deletions(-) diff --git a/source b/source index db0ab37cc5e..6568012e0c4 100644 --- a/source +++ b/source @@ -80838,7 +80838,7 @@ body { display:none } true true - Writing suggestions will be offered on this element. + Writing suggestions should be offered on this element. (The empty string) @@ -80846,13 +80846,13 @@ body { display:none } false false - Writing suggestions will not be offered on this element. + Writing suggestions should not be offered on this element.

        The inherit state indicates that the element's writing suggestions state is the same as its parent element's, or the same as its - parent's host if its parent is a + parent's host element if its parent is a shadow root. Elements that do not have a shadow-including ancestor cannot be in the inherit state. @@ -80894,6 +80894,8 @@ body { display:none } writingsuggestions content attribute must be set to the literal string "false". Otherwise, it must be set to the literal string "true". +


        +

        User agents must only offer writing suggestions within the scope of the following element types.

          @@ -80901,56 +80903,35 @@ body { display:none }
        • input elements whose type attributes are in the Text, Search, URL, or Email states - and that are mutable (i.e. that do not have the readonly attribute specified and that are not disabled).
        • + and that are mutable.
        • textarea elements that do not have a readonly - attribute and that are not disabled.
        • + attribute and that are not mutable.
        • Editing hosts or editable elements.
        -

        To determine if writing suggestions may be provided within a given element's scope, the user agent must use +

        To determine if writing suggestions should be provided within a given element's scope, the user agent must use the following algorithm:

          -
        1. If the user has disabled writing suggestions for this element, then writing suggestions must be disabled.
        2. +
        3. If the user has disabled writing suggestions for this element, then respect the user's preference.
        4. - + -
        5. Otherwise, if the element has a writingsuggestions content - attribute, then: if that attribute returns "true", then writing suggestions may be enabled; - otherwise, if that attribute returns "false", then writing suggestions must be disabled.
        6. +
        7. Otherwise, if the element's writingsuggestions content + attribute returns "false", then writing suggestions should be disabled.
        8. Otherwise, if there is a shadow-including ancestor - element with a writingsuggestions content attribute, then: if the - nearest such ancestor's writingsuggestions content attribute returns - "true", then writing suggestions may be enabled; otherwise, if the nearest such ancestor's - writingsuggestions content attribute returns "false", then writing - suggestions must be disabled.
        9. - - - -
        10. Otherwise, if the element's default behavior - is true, then writing suggestions may be - enabled.
        11. - -
        12. Otherwise, if the element's default behavior - is false, then writing suggestions must be - disabled.
        13. - - - -
        14. Otherwise, if the element's parent element, or the parent's host element if the parent is a shadow root, - has writing suggestions enabled, then writing suggestions may be enabled within this element's scope.
        15. + element with a writingsuggestions content attribute that returns + "false", then writing suggestions should be disabled. -
        16. Otherwise, writing suggestions must be disabled within this element's scope.
        17. +
        18. Otherwise, writing suggestions should be enabled within this element's scope.

        This specification does not define the user interface for writing suggestions. From 1482e04d6a93bdc3e43736e3783acb3ba2c1703d Mon Sep 17 00:00:00 2001 From: Sanket Joshi Date: Thu, 11 Jan 2024 00:49:51 -0800 Subject: [PATCH 14/39] Editorial fixup. --- source | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source b/source index 6568012e0c4..32bc3a4bef0 100644 --- a/source +++ b/source @@ -80852,7 +80852,7 @@ body { display:none }

        The inherit state indicates that the element's writing suggestions state is the same as its parent element's, or the same as its - parent's host element if its parent is a + parent's host element's if its parent is a shadow root. Elements that do not have a shadow-including ancestor cannot be in the inherit state. @@ -80870,10 +80870,10 @@ body { display:none }

        element.writingsuggestions [ = value ]
        -

        Returns the keyword value corresponding to the writing suggestions state for the current element.

        +

        Returns "true" or "false" based on the state of the + writingsuggestions content attribute.

        -

        Can be set, to override the default and set the writingsuggestions content attribute.

        +

        Can be set, to change that state.

        @@ -80905,8 +80905,7 @@ body { display:none } URL, or Email states and that are mutable. -
      • textarea elements that do not have a readonly - attribute and that are not mutable.
      • +
      • textarea elements that are mutable.
      • Editing hosts or editable elements.
      • From 2c9f530be88125e8355c5ca6ac23071886eeafd7 Mon Sep 17 00:00:00 2001 From: Sanket Joshi Date: Thu, 11 Jan 2024 00:56:44 -0800 Subject: [PATCH 15/39] Fix wording of inherit case in algorithm. --- source | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source b/source index 32bc3a4bef0..ac2f3ed1f2b 100644 --- a/source +++ b/source @@ -80927,7 +80927,8 @@ body { display:none }
      • Otherwise, if there is a shadow-including ancestor - element with a writingsuggestions content attribute that returns + element with a writingsuggestions content attribute and the writingsuggestions content attribute of the nearest such ancestor returns "false", then writing suggestions should be disabled.
      • Otherwise, writing suggestions should be enabled within this element's scope.
      • From a7481abcd61180f3de9574610ee80ed49eefc016 Mon Sep 17 00:00:00 2001 From: Sanket Joshi Date: Thu, 11 Jan 2024 01:04:23 -0800 Subject: [PATCH 16/39] Fix return type in IDL interface. --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index ac2f3ed1f2b..479a08cc771 100644 --- a/source +++ b/source @@ -11710,7 +11710,7 @@ interface HTMLElement : Element { readonly attribute DOMString accessKeyLabel; [CEReactions] attribute boolean draggable; [CEReactions] attribute boolean spellcheck; - [CEReactions] attribute boolean writingsuggestions; + [CEReactions] attribute DOMString writingsuggestions; [CEReactions] attribute DOMString autocapitalize; [CEReactions] attribute [LegacyNullToEmptyString] DOMString innerText; From 3ba33e6475dc73f615115445b5e1573f00ecfa8f Mon Sep 17 00:00:00 2001 From: Sanket Joshi Date: Thu, 11 Jan 2024 01:18:17 -0800 Subject: [PATCH 17/39] Minor cleanup. --- source | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source b/source index 479a08cc771..29432f3a2f2 100644 --- a/source +++ b/source @@ -80855,16 +80855,16 @@ body { display:none } parent's host element's if its parent is a shadow root. Elements that do not have a shadow-including ancestor cannot be in - the inherit state. + the inherit state.

        For elements that can be in the inherit state, the attribute's missing value default is the inherit state. For all other elements, the attribute's missing value default is the true state. + data-x="attr-writingsuggestions-true-state">true state.

        The attribute's invalid value default is the true state. + data-x="attr-writingsuggestions-true-state">true state.

        element.writingsuggestions [ = value ]
        @@ -80892,7 +80892,7 @@ body { display:none }

        On setting, if the new value is an ASCII case-insensitive match for the string "false", then the element's writingsuggestions content attribute must be set to the literal string "false". - Otherwise, it must be set to the literal string "true". + Otherwise, it must be set to the literal string "true".


        From b6a32bbf01ee34554937159ca75d423bd97036fb Mon Sep 17 00:00:00 2001 From: Sanket Joshi Date: Thu, 11 Jan 2024 10:26:41 -0800 Subject: [PATCH 18/39] Align spec for inheritance behavior with spellcheck. --- source | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/source b/source index 29432f3a2f2..1301fd129d2 100644 --- a/source +++ b/source @@ -80851,11 +80851,9 @@ body { display:none }

        The inherit state indicates that - the element's writing suggestions state is the same as its parent element's, or the same as its - parent's host element's if its parent is a - shadow root. Elements that do not have a - shadow-including ancestor cannot be in - the inherit state.

        + the element's writing suggestions state is the same as its parent element's. Elements that do + not have a parent element cannot be in the + inherit state.

        For elements that can be in the inherit state, the attribute's missing value default is the false state, or if the element's writingsuggestions content attribute is in the inherit state and the - writingsuggestions IDL attribute of the element's parent element, or parent's - host element if the parent is a shadow root, would return "false". - Otherwise, the attribute must return "true".

        + writingsuggestions
        IDL attribute of the element's parent element would return "false". Otherwise, the attribute must + return "true".

        The writingsuggestions IDL attribute is not affected by user preferences that override the writingsuggestions content @@ -80922,14 +80919,15 @@ body { display:none }

      • Otherwise, if the element's writingsuggestions content - attribute returns "false", then writing suggestions should be disabled.
      • + attribute is in the false state, then writing + suggestions should be disabled. -
      • Otherwise, if there is a shadow-including ancestor - element with a writingsuggestions content attribute and the writingsuggestions content attribute of the nearest such ancestor returns - "false", then writing suggestions should be disabled.
      • +
      • Otherwise, if there is an ancestor element with a writingsuggestions + content attribute and the nearest such ancestor's writingsuggestions + content attribute is in the false state, then writing + suggestions should be disabled.
      • Otherwise, writing suggestions should be enabled within this element's scope.
      • From 7cdd6d50111fc59dbbc0e41fb963ab7fd486c8ea Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Fri, 19 Jan 2024 09:31:57 -0800 Subject: [PATCH 19/39] Address editorial suggestions --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index 1301fd129d2..a6bc7c91abc 100644 --- a/source +++ b/source @@ -80820,7 +80820,7 @@ body { display:none }

        User agents offer writing suggestions as users type into editable regions, either in form - controls (ex. the textarea element) or in elements in an + controls (e.g., the textarea element) or in elements in an editing host.

        The -

      • If the user has disabled writing suggestions for this element, then respect the user's preference.
      • +
      • If the user has disabled writing suggestions, then respect the user's preference.
      • From 15dfeca6e14745a9e6705e29a6d04996a1133baa Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Fri, 19 Jan 2024 09:37:55 -0800 Subject: [PATCH 20/39] Use inclusive ancestor --- source | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/source b/source index a6bc7c91abc..1dbacc0f7cc 100644 --- a/source +++ b/source @@ -80916,15 +80916,11 @@ body { display:none }
      • If the user has disabled writing suggestions, then respect the user's preference.
      • - - -
      • Otherwise, if the element's writingsuggestions content - attribute is in the false state, then writing - suggestions should be disabled.
      • - - + -
      • Otherwise, if there is an ancestor element with a writingsuggestions +
      • Otherwise, if there is an inclusive ancestor element with a writingsuggestions content attribute and the nearest such ancestor's writingsuggestions content attribute is in the false state, then writing suggestions should be disabled.
      • From ecb2b3d5a6bbd1f419ec9d95a6e11d52b275b53e Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Fri, 19 Jan 2024 09:50:33 -0800 Subject: [PATCH 21/39] Make the steps to determine if suggestions should be shown a bit more algorithmic --- source | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/source b/source index 1dbacc0f7cc..0b98f6d9fcc 100644 --- a/source +++ b/source @@ -80908,24 +80908,25 @@ body { display:none }
      -

      To determine if writing suggestions should be provided within a given element's scope, the user agent must use - the following algorithm:

      +

      User agents must only offer suggestions within an element's scope if the + result of running the following algorithm given element returns true:

        -
      1. If the user has disabled writing suggestions, then respect the user's preference.
      2. +
      3. If the user has disabled writing suggestions, then return false.
      4. -
      5. Otherwise, if there is an inclusive ancestor element with a writingsuggestions - content attribute and the nearest such ancestor's writingsuggestions - content attribute is in the false state, then writing - suggestions should be disabled.
      6. +
      7. Otherwise, if element has an inclusive ancestor with a writingsuggestions content attribute and the nearest + such ancestor's writingsuggestions content + attribute is in the false state, then + return false.
      8. -
      9. Otherwise, writing suggestions should be enabled within this element's scope.
      10. +
      11. Otherwise, return true.

      This specification does not define the user interface for writing suggestions. From 8e850bd8730567c3f5668de1a736a5de48c5441f Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Fri, 19 Jan 2024 10:46:55 -0800 Subject: [PATCH 22/39] Wrap lines at length 100 --- source | 112 ++++++++++++++++++++++++++++++--------------------------- 1 file changed, 59 insertions(+), 53 deletions(-) diff --git a/source b/source index 0b98f6d9fcc..7bee2342340 100644 --- a/source +++ b/source @@ -80820,49 +80820,50 @@ body { display:none }

      User agents offer writing suggestions as users type into editable regions, either in form - controls (e.g., the textarea element) or in elements in an - editing host.

      + controls (e.g., the textarea element) or in elements in an editing host.

      The writingsuggestions content attribute is an - enumerated attribute with the following keywords and states:

      + data-x="attr-writingsuggestions">writingsuggestions
      content attribute is an + enumerated attribute with the following keywords and states:

      - - - - - - - - - -
      Keyword - State - Brief description -
      true - true - Writing suggestions should be offered on this element. -
      (The empty string) -
      false - false - Writing suggestions should not be offered on this element. -
      + + + + + + + + + +
      Keyword + State + Brief description +
      true + true + Writing suggestions should be offered on this element. +
      (The empty string) +
      false + false + Writing suggestions should not be offered on this element. +
      -

      The inherit state indicates that - the element's writing suggestions state is the same as its parent element's. Elements that do - not have a parent element cannot be in the - inherit state.

      +

      The inherit state indicates that the + element's writing suggestions state is the same as its parent element's. Elements that do not + have a parent element cannot be in the + inherit state.

      -

      For elements that can be in the inherit - state, the attribute's missing value default is the inherit state. For all other elements, - the attribute's missing value default is the true state.

      +

      For elements that can be in the inherit state, the attribute's missing value default is the inherit state. For all other elements, the + attribute's missing value default is the true state.

      The attribute's invalid value default is the true state.

      + data-x="attr-writingsuggestions-true-state">true state.

      element.writingsuggestions [ = value ]
      @@ -80875,32 +80876,37 @@ body { display:none }
      -

      The writingsuggestions IDL attribute, - on getting, must return "false" if the element's writingsuggestions content - attribute is in the false state, or if the element's - writingsuggestions content attribute is in the - inherit state and the - writingsuggestions IDL attribute of the element's parent element would return "false". Otherwise, the attribute must - return "true".

      +

      The writingsuggestions IDL attribute, on getting, must + return "false" if the element's writingsuggestions + content attribute is in the false + state, or if the element's writingsuggestions + content attribute is in the inherit state + and the writingsuggestions IDL attribute of the + element's parent element would return "false". Otherwise, the attribute must return "true".

      The writingsuggestions IDL attribute - is not affected by user preferences that override the writingsuggestions content - attribute, and therefore might not reflect the actual writing suggestions state.

      + is not affected by user preferences that override the writingsuggestions content attribute, and therefore might + not reflect the actual writing suggestions state.

      -

      On setting, if the new value is an ASCII case-insensitive match for the string "false", then the element's - writingsuggestions content attribute must be set to the literal string "false". - Otherwise, it must be set to the literal string "true".

      +

      On setting, if the new value is an ASCII case-insensitive match for the string + "false", then the element's writingsuggestions + content attribute must be set to the literal string "false". Otherwise, it must be set to the + literal string "true".


      -

      User agents must only offer writing suggestions within the scope of the following element types.

      +

      User agents must only offer writing suggestions within the scope of the following element + types.

        -
      • input elements whose type attributes are in the - Text, Search, - URL, or Email states - and that are mutable.
      • +
      • input elements whose type attributes are + in the Text, Search, URL, or + Email states and that are mutable.
      • textarea elements that are mutable.
      • From f29afd0b2997eeefb8e642a2faa4ffb70202b1e2 Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Fri, 19 Jan 2024 11:38:53 -0800 Subject: [PATCH 23/39] Fix build break from wrong attribute name --- source | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source b/source index 7bee2342340..29940b25ff6 100644 --- a/source +++ b/source @@ -80881,9 +80881,10 @@ body { display:none } return "false" if the element's writingsuggestions content attribute is in the false state, or if the element's writingsuggestions - content attribute is in the inherit state - and the writingsuggestions IDL attribute of the - element's parent element would return "false". Otherwise, the attribute must return "true".

        + content attribute is in the inherit + state and the writingsuggestions IDL attribute of + the element's parent element would return "false". Otherwise, the attribute must return + "true".

        The writingsuggestions IDL attribute is not affected by user preferences that override the Date: Fri, 2 Feb 2024 16:03:03 -0800 Subject: [PATCH 24/39] IDL attribute to camelCase --- source | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source b/source index 29940b25ff6..ca6e864dfb0 100644 --- a/source +++ b/source @@ -11710,7 +11710,7 @@ interface HTMLElement : Element { readonly attribute DOMString accessKeyLabel; [CEReactions] attribute boolean draggable; [CEReactions] attribute boolean spellcheck; - [CEReactions] attribute DOMString writingsuggestions; + [CEReactions] attribute DOMString writingSuggestions; [CEReactions] attribute DOMString autocapitalize; [CEReactions] attribute [LegacyNullToEmptyString] DOMString innerText; @@ -80866,7 +80866,7 @@ body { display:none } data-x="attr-writingsuggestions-true-state">true state.

        -
        element.writingsuggestions [ = value ]
        +
        element.writingSuggestions [ = value ]

        Returns "true" or "false" based on the state of the @@ -80877,16 +80877,16 @@ body { display:none }

        The writingsuggestions IDL attribute, on getting, must + data-x="dom-writingSuggestions">writingSuggestions IDL attribute, on getting, must return "false" if the element's writingsuggestions content attribute is in the false state, or if the element's writingsuggestions content attribute is in the inherit - state and the writingsuggestions IDL attribute of + state and the writingSuggestions IDL attribute of the element's parent element would return "false". Otherwise, the attribute must return "true".

        -

        The writingsuggestions IDL attribute +

        The writingSuggestions IDL attribute is not affected by user preferences that override the writingsuggestions content attribute, and therefore might not reflect the actual writing suggestions state.

        From 2b0ab5577023024adeacdbe389f93120f8af26d3 Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Mon, 5 Feb 2024 17:29:11 -0800 Subject: [PATCH 25/39] Scope w-nodev to only IDL definitions --- source | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/source b/source index ca6e864dfb0..b3fc3a9bd2d 100644 --- a/source +++ b/source @@ -80817,8 +80817,6 @@ body { display:none }

        Writing suggestions

        -
        -

        User agents offer writing suggestions as users type into editable regions, either in form controls (e.g., the textarea element) or in elements in an editing host.

        @@ -80876,25 +80874,27 @@ body { display:none } -

        The writingSuggestions IDL attribute, on getting, must - return "false" if the element's writingsuggestions - content attribute is in the false - state, or if the element's writingsuggestions - content attribute is in the inherit - state and the writingSuggestions IDL attribute of - the element's parent element would return "false". Otherwise, the attribute must return - "true".

        - -

        The writingSuggestions IDL attribute - is not affected by user preferences that override the writingsuggestions content attribute, and therefore might - not reflect the actual writing suggestions state.

        - -

        On setting, if the new value is an ASCII case-insensitive match for the string - "false", then the element's writingsuggestions - content attribute must be set to the literal string "false". Otherwise, it must be set to the - literal string "true".

        +
        +

        The writingSuggestions IDL attribute, on getting, must + return "false" if the element's writingsuggestions + content attribute is in the false + state, or if the element's writingsuggestions + content attribute is in the inherit + state and the writingSuggestions IDL attribute of + the element's parent element would return "false". Otherwise, the attribute must return + "true".

        + +

        The writingSuggestions IDL attribute + is not affected by user preferences that override the writingsuggestions content attribute, and therefore might + not reflect the actual writing suggestions state.

        + +

        On setting, if the new value is an ASCII case-insensitive match for the string + "false", then the element's writingsuggestions + content attribute must be set to the literal string "false". Otherwise, it must be set to the + literal string "true".

        +

        From f68ba72f7f026658c6bc6db01ec84d093c1d9d1e Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Mon, 5 Feb 2024 17:47:05 -0800 Subject: [PATCH 26/39] Combine algorithms to determine if UA should show suggestions --- source | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/source b/source index b3fc3a9bd2d..0f2e815b10e 100644 --- a/source +++ b/source @@ -80898,23 +80898,6 @@ body { display:none }
        -

        User agents must only offer writing suggestions within the scope of the following element - types.

        - -
          - -
        • input elements whose type attributes are - in the Text, Search, URL, or - Email states and that are mutable.
        • - -
        • textarea elements that are mutable.
        • - -
        • Editing hosts or editable elements.
        • - -
        -

        User agents must only offer suggestions within an element's scope if the result of running the following algorithm given element returns true:

        @@ -80923,11 +80906,34 @@ body { display:none }
      • If the user has disabled writing suggestions, then return false.
      • + +
      • +

        If none of the following conditions are true:

        + +
          +
        • element is an input element whose type attribute is in either the Text, Search, URL, + or Email state and is mutable.
        • + +
        • element is a textarea element that is mutable.
        • + +
        • element is an editing hosts or is + editable.
        • + +
        + +

        then return false.

        +
      • + -
      • Otherwise, if element has an inclusive ancestor with a If element has an inclusive ancestor with a writingsuggestions content attribute and the nearest such ancestor's writingsuggestions content attribute is in the false state, then From d10905b5c5f18d2b01e645da52de0b13b3d36a87 Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Mon, 5 Feb 2024 18:17:13 -0800 Subject: [PATCH 27/39] Change writingSuggestions IDL getter/setter to use modern style --- source | 51 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/source b/source index 0f2e815b10e..7ba6f97bd52 100644 --- a/source +++ b/source @@ -80876,24 +80876,39 @@ body { display:none }

        The writingSuggestions IDL attribute, on getting, must - return "false" if the element's writingsuggestions - content attribute is in the false - state, or if the element's writingsuggestions - content attribute is in the inherit - state and the writingSuggestions IDL attribute of - the element's parent element would return "false". Otherwise, the attribute must return - "true".

        - -

        The writingSuggestions IDL attribute - is not affected by user preferences that override the writingsuggestions content attribute, and therefore might - not reflect the actual writing suggestions state.

        - -

        On setting, if the new value is an ASCII case-insensitive match for the string - "false", then the element's writingsuggestions - content attribute must be set to the literal string "false". Otherwise, it must be set to the - literal string "true".

        + data-x="dom-writingSuggestions">writingSuggestions
        getter steps are:

        + +
          +
        1. If this's writingsuggestions + content attribute is in the false + state, return "false".

        2. + +
        3. If this's writingsuggestions + content attribute is in the inherit state and the writingSuggestions IDL attribute of this's + parent element would return "false", return false.

        4. + +
        5. Return "true".

        6. +
        + +

        The writingSuggestions IDL + attribute is not affected by user preferences that override the writingsuggestions content attribute, and therefore + might not reflect the actual writing suggestions state.

        + +

        The writingSuggestions setter steps are:

        + +
          +
        1. If the given value is an ASCII case-insensitive match for the string + "false", then set this's writingsuggestions content attribute to the literal + string "false".

        2. + +
        3. Otherwise, set this's writingsuggestions content attribute to the literal + string "true".

        4. +

        From c927b6aba9a86e0f465e757aab9d015f9d56d748 Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Mon, 5 Feb 2024 18:28:06 -0800 Subject: [PATCH 28/39] Switch verbiage of non-normative IDL section to match spellcheck --- source | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source b/source index 7ba6f97bd52..5650e9ef254 100644 --- a/source +++ b/source @@ -80867,10 +80867,11 @@ body { display:none }
        element.writingSuggestions [ = value ]
        -

        Returns "true" or "false" based on the state of the - writingsuggestions content attribute.

        +

        Returns true if the user agent is to offer writing suggestions under the scope of the + element; otherwise, returns false.

        -

        Can be set, to change that state.

        +

        Can be set, to override the default and set the + writingsuggestions content attribute.

        From ec26b8dc68b77490a0bc99727069caca0f1d5df9 Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Mon, 5 Feb 2024 18:57:35 -0800 Subject: [PATCH 29/39] Remove the dependency of missing value default on the element. Push the parent check out to the algorithms instead. Rename inherit state to default state now that top-level element can be in that state. --- source | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/source b/source index 5650e9ef254..11b5baba588 100644 --- a/source +++ b/source @@ -80848,17 +80848,11 @@ body { display:none } -

        The inherit state indicates that the - element's writing suggestions state is the same as its parent element's. Elements that do not - have a parent element cannot be in the - inherit state.

        - -

        For elements that can be in the inherit state, the attribute's missing value default is the inherit state. For all other elements, the - attribute's missing value default is the true state.

        +

        The attribute's missing value default is the default state. The default state indicates + that the element is to act according to a default behavior, possibly based on the parent + element's own writingsuggestions state, as defined + below.

        The attribute's invalid value default is the true state.

        @@ -80886,9 +80880,9 @@ body { display:none }
      • If this's writingsuggestions content attribute is in the inherit state and the writingSuggestions IDL attribute of this's - parent element would return "false", return false.

      • + data-x="attr-writingsuggestions-default-state">default state, this has a + parent element, and the writingSuggestions IDL + attribute of this's parent element would return "false", return false.

      • Return "true".

      • @@ -80950,10 +80944,11 @@ body { display:none } -->
      • If element has an inclusive ancestor with a writingsuggestions content attribute and the nearest - such ancestor's writingsuggestions content - attribute is in the false state, then - return false.
      • + data-x="attr-writingsuggestions">writingsuggestions
        content attribute that's not in the + default and the nearest such + ancestor's writingsuggestions content attribute is + in the false state, then return + false.
      • Otherwise, return true.
      • From fc447b57efc3126449a75d19f90b15753f8e1f17 Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Mon, 5 Feb 2024 19:04:46 -0800 Subject: [PATCH 30/39] Typos --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index 11b5baba588..767f3a48224 100644 --- a/source +++ b/source @@ -80882,7 +80882,7 @@ body { display:none } content attribute is in the default state, this has a parent element, and the writingSuggestions IDL - attribute of this's parent element would return "false", return false.

        + attribute of this's parent element would return "false", return "false".

      • Return "true".

      • @@ -80931,7 +80931,7 @@ body { display:none }
      • element is a textarea element that is mutable.
      • -
      • element is an editing hosts or is +
      • element is an editing host or is editable.
      From 39cf16570c77a266facf44c693888ec3be2df851 Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Mon, 5 Feb 2024 19:14:04 -0800 Subject: [PATCH 31/39] Add 'empty string' to attributes table --- source | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source b/source index 767f3a48224..c53d4325bc6 100644 --- a/source +++ b/source @@ -138678,7 +138678,9 @@ interface External { spellcheck HTML elements Whether the element is to have its spelling and grammar checked - "true"; "false" + "true"; + "false"; + the empty string src audio; @@ -138871,7 +138873,8 @@ interface External { HTML elements Whether the element can offer writing suggestions or not. "true"; - "false" + "false"; + the empty string

      An asterisk (*) in a cell indicates that the actual rules are more From 743eeb133407ceaf9e7d089ad37501bbf35a5a88 Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Thu, 8 Feb 2024 16:10:43 -0800 Subject: [PATCH 32/39] Fix formatting of "true"/"false" strings --- source | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/source b/source index c53d4325bc6..98dd8bb9ab2 100644 --- a/source +++ b/source @@ -80861,8 +80861,8 @@ body { display:none }

      element.writingSuggestions [ = value ]
      -

      Returns true if the user agent is to offer writing suggestions under the scope of the - element; otherwise, returns false.

      +

      Returns "true" if the user agent is to offer writing suggestions under + the scope of the element; otherwise, returns "false".

      Can be set, to override the default and set the writingsuggestions content attribute.

      @@ -80876,15 +80876,16 @@ body { display:none }
      1. If this's writingsuggestions content attribute is in the false - state, return "false".

      2. + state, return "false".

      3. If this's writingsuggestions content attribute is in the default state, this has a parent element, and the writingSuggestions IDL - attribute of this's parent element would return "false", return "false".

      4. + attribute of this's parent element would return "false", + return "false".

        -
      5. Return "true".

      6. +
      7. Return "true".

      The writingSuggestions IDL @@ -80896,13 +80897,13 @@ body { display:none }

      1. If the given value is an ASCII case-insensitive match for the string - "false", then set this's false", then set this's writingsuggestions content attribute to the literal - string "false".

      2. + string "false".

      3. Otherwise, set this's writingsuggestions content attribute to the literal - string "true".

      4. + string "true".

      From a6b2931352f226fe8f3f46f3f888d927fcb08b59 Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Thu, 8 Feb 2024 16:30:59 -0800 Subject: [PATCH 33/39] Define 'computed writing suggestions value' instead of using public IDL --- source | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/source b/source index 98dd8bb9ab2..c9cb6edb93a 100644 --- a/source +++ b/source @@ -80870,22 +80870,29 @@ body { display:none }
      +

      The computed writing suggestions value of a given element is + deteremined by running the following steps:

      + +
        +
      1. If element's writingsuggestions + content attribute is in the false + state, return "false".

      2. + +
      3. If element's writingsuggestions content attribute is in the default state, element has a + parent element, and the computed writing suggestions value of + element's parent element would return "false", return + "false".

      4. + +
      5. Return "true".

      6. +
      +

      The writingSuggestions getter steps are:

        -
      1. If this's writingsuggestions - content attribute is in the false - state, return "false".

      2. - -
      3. If this's writingsuggestions - content attribute is in the default state, this has a - parent element, and the writingSuggestions IDL - attribute of this's parent element would return "false", - return "false".

      4. - -
      5. Return "true".

      6. +
      7. Return this's computed writing suggestions value.

      The writingSuggestions IDL From 57a5499b7ca0bc31496799047ee82aded40d4a1e Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Thu, 8 Feb 2024 16:35:36 -0800 Subject: [PATCH 34/39] Fix list punctuation --- source | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source b/source index c9cb6edb93a..5790eebedfd 100644 --- a/source +++ b/source @@ -80934,13 +80934,13 @@ body { display:none } data-x="attr-input-type-text">Text, Search, URL, or Email state and is mutable. + data-x="concept-fe-mutable">mutable;

    • element is a textarea element that is mutable.
    • + data-x="concept-fe-mutable">mutable; or
    • element is an editing host or is - editable.
    • + editable
    From d44464b92ac90b9cfe220ddbc06a98c8449e721d Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Thu, 8 Feb 2024 16:42:10 -0800 Subject: [PATCH 35/39]
  • --- source | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/source b/source index 5790eebedfd..250e0b864df 100644 --- a/source +++ b/source @@ -80922,25 +80922,25 @@ body { display:none }
      -
    1. If the user has disabled writing suggestions, then return false.
    2. +
    3. If the user has disabled writing suggestions, then return false.

    4. If none of the following conditions are true:

        -
      • element is an input element whose

        element is an input element whose type attribute is in either the Text, Search, URL, or Email state and is mutable;

      • + data-x="concept-fe-mutable">mutable;

        -
      • element is a textarea element that is mutable; or
      • +
      • element is a textarea element that is mutable; or

      • -
      • element is an editing host or is - editable
      • +
      • element is an editing host or is + editable

      @@ -80951,14 +80951,14 @@ body { display:none } content attribute: false on this element, or inherit if there is an ancestor to inherit from --> -
    5. If element has an inclusive ancestor with a

      If element has an inclusive ancestor with a writingsuggestions content attribute that's not in the default and the nearest such ancestor's writingsuggestions content attribute is in the false state, then return - false.

    6. + false.

      -
    7. Otherwise, return true.
    8. +
    9. Otherwise, return true.

    This specification does not define the user interface for writing suggestions. From c36127afc7be71d76eb25a27353a89fc39fd4c6e Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Thu, 8 Feb 2024 16:54:37 -0800 Subject: [PATCH 36/39] For the IDL setter, just set the content attribute to the given value whether it's valid or not. --- source | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/source b/source index 250e0b864df..51c0d19b5ef 100644 --- a/source +++ b/source @@ -80903,14 +80903,8 @@ body { display:none }

    The writingSuggestions setter steps are:

      -
    1. If the given value is an ASCII case-insensitive match for the string - "false", then set this's writingsuggestions content attribute to the literal - string "false".

    2. - -
    3. Otherwise, set this's writingsuggestions content attribute to the literal - string "true".

    4. +
    5. Set this's writingsuggestions + content attribute to the given value.

    From f0170639c1bc90adf1dedd2b232485cd62310216 Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Fri, 9 Feb 2024 10:14:33 -0800 Subject: [PATCH 37/39] Fix typos, indentation, extra tag --- source | 65 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/source b/source index 51c0d19b5ef..92cb0059d76 100644 --- a/source +++ b/source @@ -80870,42 +80870,42 @@ body { display:none }
    -

    The computed writing suggestions value of a given element is - deteremined by running the following steps:

    +

    The computed writing suggestions value of a given element is + determined by running the following steps:

    -
      -
    1. If element's writingsuggestions - content attribute is in the false - state, return "false".

    2. +
        +
      1. If element's writingsuggestions + content attribute is in the false + state, return "false".

      2. -
      3. If element's writingsuggestions content attribute is in the default state, element has a - parent element, and the computed writing suggestions value of - element's parent element would return "false", return - "false".

      4. +
      5. If element's writingsuggestions content attribute is in the default state, element has a + parent element, and the computed writing suggestions value of + element's parent element is "false", then return + "false".

      6. -
      7. Return "true".

      8. -
      +
    3. Return "true".

    4. +
    -

    The writingSuggestions getter steps are:

    +

    The writingSuggestions getter steps are:

    -
      -
    1. Return this's computed writing suggestions value.

    2. -
    +
      +
    1. Return this's computed writing suggestions value.

    2. +
    -

    The writingSuggestions IDL - attribute is not affected by user preferences that override the writingsuggestions content attribute, and therefore - might not reflect the actual writing suggestions state.

    +

    The writingSuggestions IDL + attribute is not affected by user preferences that override the writingsuggestions content attribute, and therefore + might not reflect the actual writing suggestions state.

    -

    The writingSuggestions setter steps are:

    +

    The writingSuggestions setter steps are:

    -
      -
    1. Set this's writingsuggestions - content attribute to the given value.

    2. -
    +
      +
    1. Set this's writingsuggestions + content attribute to the given value.

    2. +

    @@ -80930,12 +80930,11 @@ body { display:none } or Email state and is mutable;

    -
  • element is a textarea element that is mutable; or

  • +
  • element is a textarea element that is mutable; or

  • -
  • element is an editing host or is - editable

  • - +
  • element is an editing host or is + editable

  • then return false.

    From 17410f56c270531839a0d064d47fc62975b9cef3 Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Tue, 20 Feb 2024 09:50:53 -0800 Subject: [PATCH 38/39] Add input[type=telephone] to element types that can get writing suggestions --- source | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source b/source index 92cb0059d76..628d6fae362 100644 --- a/source +++ b/source @@ -80926,7 +80926,8 @@ body { display:none }
  • element is an input element whose type attribute is in either the Text, Search, URL, + data-x="attr-input-type-search">Search, Telephone, URL, or Email state and is mutable;

  • From 3ac0bb0cbca1c29fc63997a37276a29124cc1eba Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Mon, 11 Mar 2024 10:55:41 -0700 Subject: [PATCH 39/39] Change 'must' to 'should' in language about UAs not showing spell checking and writing suggestions UI --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index 628d6fae362..19e421466ba 100644 --- a/source +++ b/source @@ -80703,7 +80703,7 @@ body { display:none }
    -

    User agents must only consider the following pieces of text as checkable for the purposes of +

    User agents should only consider the following pieces of text as checkable for the purposes of this feature:

      @@ -80910,7 +80910,7 @@ body { display:none }
      -

      User agents must only offer suggestions within an element's scope if the +

      User agents should only offer suggestions within an element's scope if the result of running the following algorithm given element returns true: