mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:57:35 +00:00
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.
This commit is contained in:
parent
d36838d050
commit
5e61382849
4 changed files with 40 additions and 14 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue