diff --git a/Libraries/LibWeb/HTML/AttributeNames.h b/Libraries/LibWeb/HTML/AttributeNames.h
index 1afe13b69ee..3aa23cb82b4 100644
--- a/Libraries/LibWeb/HTML/AttributeNames.h
+++ b/Libraries/LibWeb/HTML/AttributeNames.h
@@ -314,7 +314,8 @@ namespace AttributeNames {
__ENUMERATE_HTML_ATTRIBUTE(vspace, "vspace") \
__ENUMERATE_HTML_ATTRIBUTE(width, "width") \
__ENUMERATE_HTML_ATTRIBUTE(willvalidate, "willvalidate") \
- __ENUMERATE_HTML_ATTRIBUTE(wrap, "wrap")
+ __ENUMERATE_HTML_ATTRIBUTE(wrap, "wrap") \
+ __ENUMERATE_HTML_ATTRIBUTE(writingsuggestions, "writingsuggestions")
#define __ENUMERATE_HTML_ATTRIBUTE(name, attribute) extern WEB_API FlyString name;
ENUMERATE_HTML_ATTRIBUTES
diff --git a/Libraries/LibWeb/HTML/HTMLElement.cpp b/Libraries/LibWeb/HTML/HTMLElement.cpp
index ac5d902f069..c669132d945 100644
--- a/Libraries/LibWeb/HTML/HTMLElement.cpp
+++ b/Libraries/LibWeb/HTML/HTMLElement.cpp
@@ -2195,4 +2195,41 @@ void HTMLElement::set_spellcheck(bool spellcheck)
MUST(set_attribute(HTML::AttributeNames::spellcheck, "false"_string));
}
+// https://html.spec.whatwg.org/multipage/interaction.html#dom-writingsuggestions
+String HTMLElement::writing_suggestions() const
+{
+ // The 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.
+
+ // 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.
+
+ // 1. If element's writingsuggestions content attribute is in the False state, return "false".
+ auto maybe_writing_suggestions_attribute = attribute(HTML::AttributeNames::writingsuggestions);
+
+ if (maybe_writing_suggestions_attribute.has_value() && maybe_writing_suggestions_attribute.value().equals_ignoring_ascii_case("false"sv))
+ return "false"_string;
+
+ // 2. 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".
+ if (!maybe_writing_suggestions_attribute.has_value() && first_ancestor_of_type() && first_ancestor_of_type()->writing_suggestions() == "false"sv) {
+ return "false"_string;
+ }
+
+ // 3. Return "true".
+ return "true"_string;
+}
+
+// https://html.spec.whatwg.org/multipage/interaction.html#dom-writingsuggestions
+void HTMLElement::set_writing_suggestions(String const& given_value)
+{
+ // 1. Set this's writingsuggestions content attribute to the given value.
+ MUST(set_attribute(HTML::AttributeNames::writingsuggestions, given_value));
+}
+
}
diff --git a/Libraries/LibWeb/HTML/HTMLElement.h b/Libraries/LibWeb/HTML/HTMLElement.h
index 492785128fa..cd2807214c9 100644
--- a/Libraries/LibWeb/HTML/HTMLElement.h
+++ b/Libraries/LibWeb/HTML/HTMLElement.h
@@ -120,6 +120,9 @@ public:
bool spellcheck() const;
void set_spellcheck(bool);
+ String writing_suggestions() const;
+ void set_writing_suggestions(String const&);
+
bool fire_a_synthetic_pointer_event(FlyString const& type, DOM::Element& target, bool not_trusted);
// https://html.spec.whatwg.org/multipage/forms.html#category-label
diff --git a/Libraries/LibWeb/HTML/HTMLElement.idl b/Libraries/LibWeb/HTML/HTMLElement.idl
index 743a0f89d60..b2b43c346dc 100644
--- a/Libraries/LibWeb/HTML/HTMLElement.idl
+++ b/Libraries/LibWeb/HTML/HTMLElement.idl
@@ -25,6 +25,7 @@ interface HTMLElement : Element {
readonly attribute DOMString accessKeyLabel;
[CEReactions] attribute boolean draggable;
[CEReactions] attribute boolean spellcheck;
+ [CEReactions] attribute DOMString writingSuggestions;
[FIXME, CEReactions] attribute DOMString autocapitalize;
[FIXME, CEReactions] attribute boolean autocorrect;
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/editing/editing-0/writing-suggestions/writingsuggestions.txt b/Tests/LibWeb/Text/expected/wpt-import/html/editing/editing-0/writing-suggestions/writingsuggestions.txt
new file mode 100644
index 00000000000..8f6bf41ce9e
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/editing/editing-0/writing-suggestions/writingsuggestions.txt
@@ -0,0 +1,85 @@
+Harness status: OK
+
+Found 80 tests
+
+80 Pass
+Pass Test that the writingsuggestions attribute is available on HTMLInputElement.
+Pass Test that the writingsuggestions attribute is available on HTMLTextAreaElement.
+Pass Test that the writingsuggestions attribute is available on HTMLDivElement.
+Pass Test that the writingsuggestions attribute is available on HTMLSpanElement.
+Pass Test that the writingsuggestions attribute is available on custom elements.
+Pass Test that the writingsuggestions attribute is available on an input type which the attribute doesn't apply. The User Agent is responsible that writing suggestions are not applied to the element.
+Pass Test that the writingsuggestions attribute is available on a disabled element. The User Agent is responsible that writing suggestions are not applied to the element.
+Pass Test setting the `writingsuggestions` IDL attribute to `true` directly on the target element.
+Pass Test setting the `writingsuggestions` content attribute to `true` directly on the target element.
+Pass Test setting the `writingsuggestions` IDL attribute to boolean `true` directly on the target element.
+Pass Test setting the `writingsuggestions` content attribute to boolean `true` directly on the target element.
+Pass Test setting the `writingsuggestions` IDL attribute to `TrUe` directly on the target element.
+Pass Test setting the `writingsuggestions` content attribute to `TrUe` directly on the target element.
+Pass Test setting the `writingsuggestions` IDL attribute to `false` directly on the target element.
+Pass Test setting the `writingsuggestions` content attribute to `false` directly on the target element.
+Pass Test setting the `writingsuggestions` IDL attribute to boolean `false` directly on the target element.
+Pass Test setting the `writingsuggestions` content attribute to boolean `false` directly on the target element.
+Pass Test setting the `writingsuggestions` IDL attribute to `FaLsE` directly on the target element.
+Pass Test setting the `writingsuggestions` content attribute to `FaLsE` directly on the target element.
+Pass Test setting the `writingsuggestions` IDL attribute to the empty string directly on the target element.
+Pass Test setting the `writingsuggestions` content attribute to the empty string directly on the target element.
+Pass Test setting the `writingsuggestions` IDL attribute to an invalid value directly on the target element.
+Pass Test setting the `writingsuggestions` content attribute to an invalid value directly on the target element.
+Pass Test the writing suggestions state when the `writingsuggestions` attribute is missing.
+Pass Test setting the `writingsuggestions` content attribute to `false` after the IDL attribute was set to `true`.
+Pass Test setting the `writingsuggestions` content attribute to the empty string after the IDL attribute was set to `true`.
+Pass Test setting the `writingsuggestions` content attribute to an invalid value after the IDL attribute was set to `true`.
+Pass Test setting the `writingsuggestions` content attribute to `TrUe` after the IDL attribute was set to `true`.
+Pass Test setting the `writingsuggestions` content attribute to `FaLsE` after the IDL attribute was set to `true`.
+Pass Test setting the `writingsuggestions` content attribute to boolean `true` after the IDL attribute was set to `true`.
+Pass Test setting the `writingsuggestions` content attribute to boolean `false` after the IDL attribute was set to `true`.
+Pass Test setting the `writingsuggestions` content attribute to `true` after the IDL attribute was set to `false`.
+Pass Test setting the `writingsuggestions` content attribute to the empty string after the IDL attribute was set to `false`.
+Pass Test setting the `writingsuggestions` content attribute to an invalid value after the IDL attribute was set to `false`.
+Pass Test setting the `writingsuggestions` content attribute to `TrUe` after the IDL attribute was set to `false`.
+Pass Test setting the `writingsuggestions` content attribute to `FaLsE` after the IDL attribute was set to `false`.
+Pass Test setting the `writingsuggestions` content attribute to boolean `true` after the IDL attribute was set to `false`.
+Pass Test setting the `writingsuggestions` content attribute to boolean `false` after the IDL attribute was set to `false`.
+Pass Test setting the `writingsuggestions` attribute with a missing value directly on the target element.
+Pass Test setting the `writingsuggestions` attribute to "true" on a parent element.
+Pass Test setting the `writingsuggestions` attribute to an empty string on a parent element.
+Pass Test setting the `writingsuggestions` attribute to "false" on a parent element.
+Pass Test setting the `writingsuggestions` attribute to an invalid value on a parent element.
+Pass Test overriding the parent element's `writingsuggestions` attribute from "true" to "false".
+Pass Test overriding the parent element's `writingsuggestions` attribute from the empty string to "false".
+Pass Test overriding the parent element's `writingsuggestions` attribute from "false" to "true".
+Pass Test overriding the parent element's `writingsuggestions` attribute from "false" to an invalid value.
+Pass Test overriding the parent element's `writingsuggestions` attribute from "false" to the empty string.
+Pass Test turning off writing suggestions for an entire document.
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on an input element from "false" to "true".
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on a textarea element from "false" to "true".
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on a div element from "false" to "true".
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on a span element from "false" to "true".
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on an input type which the attribute doesn't apply from "false" to "true". The User Agent is responsible that writing suggestions are not applied to the element
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on a disabled textarea element from "false" to "true". The User Agent is responsible that writing suggestions are not applied to the element
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on an input element from "false" to the empty string.
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on a textarea element from "false" to the empty string.
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on a div element from "false" to the empty string.
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on a span element from "false" to the empty string.
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on an input type which the attribute doesn't apply from "false" to the empty string. The User Agent is responsible that writing suggestions are not applied to the element.
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on a disabled textarea element from "false" to the empty string. The User Agent is responsible that writing suggestions are not applied to the element.
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on an input element from "false" to an invalid value.
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on a textarea element from "false" to an invalid value.
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on a div element from "false" to an invalid value.
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on a span element from "false" to an invalid value.
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on an input type which the attribute doesn't apply from "false" to an invalid value. The User Agent is responsible that writing suggestions are not applied to the element.
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on a disabled textarea element from "false" to an invalid value. The User Agent is responsible that writing suggestions are not applied to the element.
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on an input element from "true" to "false".
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on a textarea element from "true" to "false".
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on a div element from "true" to "false".
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on a span element from "true" to "false".
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on an input type which the attribute doesn't apply from "true" to "false". The User Agent is responsible that writing suggestions are not applied to the element.
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on a disabled textarea element from "true" to "false". The User Agent is responsible that writing suggestions are not applied to the element.
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on an input element from the empty string to "false".
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on a textarea element from the empty string to "false".
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on a div element from the empty string to "false".
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on a span element from the empty string to "false".
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on an input type which the attribute doesn't apply from the empty string to "false". The User Agent is responsible that writing suggestions are not applied to the element.
+Pass Test overriding a non-parent ancestor element's `writingsuggestions` attribute on a disabled textarea element from the empty string to "false". The User Agent is responsible that writing suggestions are not applied to the element.
+Pass Test that for continuous text on the screen, writing suggestions may be allowed in one part but not another.
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/input/wpt-import/html/editing/editing-0/writing-suggestions/writingsuggestions.html b/Tests/LibWeb/Text/input/wpt-import/html/editing/editing-0/writing-suggestions/writingsuggestions.html
new file mode 100644
index 00000000000..0603b53f67b
--- /dev/null
+++ b/Tests/LibWeb/Text/input/wpt-import/html/editing/editing-0/writing-suggestions/writingsuggestions.html
@@ -0,0 +1,599 @@
+
+Tests for the writingsuggestions attribute
+
+
+
+
+
+