diff options
author | Luke Wilde <lukew@serenityos.org> | 2021-09-06 00:21:59 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-06 02:36:04 +0200 |
commit | 5e61382849fa1a3f597b109ca571d90765753053 (patch) | |
tree | 6393e067904e11c0967a9fbce9d7561dc9bc98b9 /Userland/Libraries/LibWeb/DOM/Node.idl | |
parent | d36838d05045e83da7c0cf27fabf525bc717584e (diff) | |
download | serenity-5e61382849fa1a3f597b109ca571d90765753053.zip |
LibWeb: Make Node.textContent more spec compliant
The current implementation felt a bit ad-hoc and notably allowed
textContent to operate on all node types. It also only returned the
child text content of the Node instead of the descendant text content.
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM/Node.idl')
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Node.idl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Node.idl b/Userland/Libraries/LibWeb/DOM/Node.idl index edd50ca84f..603095e5ed 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.idl +++ b/Userland/Libraries/LibWeb/DOM/Node.idl @@ -14,7 +14,11 @@ interface Node : EventTarget { readonly attribute Element? parentElement; readonly attribute boolean isConnected; readonly attribute Document? ownerDocument; - attribute DOMString textContent; + + // FIXME: [LegacyNullToEmptyString] is not allowed on nullable types as per the Web IDL spec. + // However, we only apply it to setters, so this works as a stop gap. + // Replace this with something like a special cased [LegacyNullToEmptyString]. + [LegacyNullToEmptyString] attribute DOMString? textContent; Node appendChild(Node node); [ImplementedAs=pre_insert] Node insertBefore(Node node, Node? child); |