mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibWeb/Layout: Properly remove layout nodes
This properly remove the old layout node subtree when no new layout node is created during layout update.
This commit is contained in:
parent
85e28a29f0
commit
5c5f34989a
2 changed files with 23 additions and 0 deletions
|
@ -448,6 +448,10 @@ void TreeBuilder::update_layout_tree(DOM::Node& dom_node, TreeBuilder::Context&
|
|||
dom_node.for_each_in_inclusive_subtree([&](auto& node) {
|
||||
node.set_needs_layout_tree_update(false);
|
||||
node.set_child_needs_layout_tree_update(false);
|
||||
auto layout_node = node.layout_node();
|
||||
if (layout_node && layout_node->parent()) {
|
||||
layout_node->remove();
|
||||
}
|
||||
node.detach_layout_node({});
|
||||
node.clear_paintable();
|
||||
if (is<DOM::Element>(node))
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
<html class="test-wait">
|
||||
<body>
|
||||
<div aria-owns="id1"></div>
|
||||
<video>
|
||||
<mark>
|
||||
<span id='id1'></span>
|
||||
</mark>
|
||||
</video>
|
||||
</body>
|
||||
<script>
|
||||
window.onload = () => {
|
||||
requestAnimationFrame(() => {
|
||||
requestAnimationFrame(() => {
|
||||
document.documentElement.style.display = 'none';
|
||||
document.documentElement.className = '';
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
Loading…
Add table
Reference in a new issue