LibWeb: Implement Node.normalize()

This method puts the given node and all of its sub-tree into a
normalized form. A normalized sub-tree has no empty text nodes and no
adjacent text nodes.
This commit is contained in:
Tim Ledbetter 2024-07-11 21:52:03 +01:00 committed by Andreas Kling
commit 0a0651f34e
Notes: sideshowbarker 2024-07-17 02:29:45 +09:00
5 changed files with 148 additions and 0 deletions

View file

@ -28,6 +28,7 @@ interface Node : EventTarget {
// However, we only apply it to setters, so this works as a stop gap.
// Replace this with something like a special cased [LegacyNullToEmptyString].
[LegacyNullToEmptyString, CEReactions] attribute DOMString? textContent;
[CEReactions] undefined normalize();
[CEReactions] Node appendChild(Node node);
[ImplementedAs=pre_insert, CEReactions] Node insertBefore(Node node, Node? child);