Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5edc9a7e9d4ce75ea7950a8efc9d71e3482dbbf2
      
https://github.com/WebKit/WebKit/commit/5edc9a7e9d4ce75ea7950a8efc9d71e3482dbbf2
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-05-08 (Fri, 08 May 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/html/dom/idlharness.https_include=HTML._-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/editing/editing-0/writing-suggestions/WEB_FEATURES.yml
    A 
LayoutTests/imported/w3c/web-platform-tests/html/editing/editing-0/writing-suggestions/w3c-import.log
    A 
LayoutTests/imported/w3c/web-platform-tests/html/editing/editing-0/writing-suggestions/writingsuggestions-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/editing/editing-0/writing-suggestions/writingsuggestions.html
    A 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/editing/editing-0/writing-suggestions/writingsuggestions-expected.txt
    M 
LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/dom/idlharness.https_include=HTML._-expected.txt
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/Element.h
    M Source/WebCore/html/HTMLElement.cpp
    M Source/WebCore/html/HTMLElement.h
    M Source/WebCore/html/HTMLElement.idl

  Log Message:
  -----------
  Align writingSuggestions IDL attribute with the HTML specification
https://bugs.webkit.org/show_bug.cgi?id=313805
rdar://problem/176000886

Reviewed by Aditya Keerthi.

The writingSuggestions IDL attribute was exposed as "writingsuggestions"
(all lowercase, boolean) instead of "writingSuggestions" (camelCase,
DOMString) as defined by the specification [1].

The getter was also returning the result of isWritingSuggestionsEnabled(),
which implements the "should offer suggestions" algorithm — checking
element eligibility, mutability, and user preferences. Per the spec [2],
the getter should instead return the "computed writing suggestions
value", which is purely based on content attribute state inheritance:

"If element's writingsuggestions content attribute is in the False
 state, return "false". 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". Return "true"."

The spec [2] further clarifies: "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."

This ancestor traversal logic is extracted into
Element::computedWritingSuggestionsValue(), which is shared with
Element::isWritingSuggestionsEnabled() to avoid duplication.

The setter uses [ReflectSetter] in the IDL to directly set the content
attribute string value via codegen.

isWritingSuggestionsEnabled() remains unchanged and continues to be
used internally for deciding when to actually offer writing suggestions.

[1] https://html.spec.whatwg.org/multipage/dom.html#htmlelement
[2] https://html.spec.whatwg.org/multipage/interaction.html#writing-suggestions

* Source/WebCore/dom/Element.cpp:
(WebCore::Element::computedWritingSuggestionsValue const): Helper function
(WebCore::Element::isWritingSuggestionsEnabled const):
* Source/WebCore/dom/Element.h:
* Source/WebCore/html/HTMLElement.cpp:
(WebCore::HTMLElement::writingSuggestions const):
(WebCore::HTMLElement::writingsuggestions const): Deleted.
(WebCore::HTMLElement::setWritingsuggestions): Deleted.
* Source/WebCore/html/HTMLElement.h:
* Source/WebCore/html/HTMLElement.idl:

> Progressions:
* 
LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/dom/idlharness.https_include=HTML._-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/html/dom/idlharness.https_include=HTML._-expected.txt:

> WPT Sync (as of Upstream commit: 
> https://github.com/web-platform-tests/wpt/commit/719d6108183fbad81611492080c9cf86b1a50a54):
* 
LayoutTests/imported/w3c/web-platform-tests/html/editing/editing-0/writing-suggestions/WEB_FEATURES.yml:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/html/editing/editing-0/writing-suggestions/w3c-import.log:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/html/editing/editing-0/writing-suggestions/writingsuggestions-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/html/editing/editing-0/writing-suggestions/writingsuggestions.html:
 Added.

> Platform Specific Expectation:
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/editing/editing-0/writing-suggestions/writingsuggestions-expected.txt:
 Added.

Canonical link: https://commits.webkit.org/312923@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to