LibWeb: Traverse shadow-including subtree when adopting DOM nodes

This takes care of two FIXMEs and fixes an issue on Google Docs where
we'd mix boxes from different documents in the same layout tree.
(This happened because shadow trees remained attached to their old
document when their host was adopted.)
This commit is contained in:
Andreas Kling 2022-07-12 23:13:57 +02:00
commit 3ee5bdcfb7
Notes: sideshowbarker 2024-07-17 09:26:19 +09:00
3 changed files with 24 additions and 4 deletions

View file

@ -231,6 +231,10 @@ public:
void queue_mutation_record(FlyString const& type, String attribute_name, String attribute_namespace, String old_value, NonnullRefPtr<NodeList> added_nodes, NonnullRefPtr<NodeList> removed_nodes, Node* previous_sibling, Node* next_sibling);
// https://dom.spec.whatwg.org/#concept-shadow-including-descendant
template<typename Callback>
IterationDecision for_each_shadow_including_descendant(Callback);
protected:
Node(Document&, NodeType);