mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:27:46 +00:00
LibWeb: Detach stale layout nodes from DOM during layout tree build
When toggling `display: none` on an element, it can go from having a layout subtree to not having one. In the `none` case, we were previously leaving stale layout nodes hanging off DOM nodes in the subtree. These layout nodes could be queried for outdated information and probably other things that we shouldn't allow. Fix this by having TreeBuilder prune any old layout nodes hanging off nodes in a subtree after its subtree root doesn't produce a layout node.
This commit is contained in:
parent
0805060e5e
commit
28fdc7af05
5 changed files with 33 additions and 3 deletions
|
@ -185,7 +185,7 @@ public:
|
|||
Painting::Paintable const* paintable() const;
|
||||
|
||||
void set_layout_node(Badge<Layout::Node>, JS::NonnullGCPtr<Layout::Node>);
|
||||
void detach_layout_node(Badge<DOM::Document>);
|
||||
void detach_layout_node(Badge<Layout::TreeBuilder>);
|
||||
|
||||
virtual bool is_child_allowed(Node const&) const { return true; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue