mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 09:12:13 -05:00
LibWeb: Invalidate entire layout tree on SVG <use> clone instantiation
This is sub-optimal but let's rebuild the whole tree for now, since this case gets quite complicated and there are more valuable things to chase after first. Thanks to Gingeh for the reduced test case!
This commit is contained in:
parent
6a564376fc
commit
ceb6348811
Notes:
github-actions[bot]
2025-01-19 13:39:08 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/ceb63488116 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3305
3 changed files with 14 additions and 0 deletions
|
@ -183,6 +183,9 @@ void SVGUseElement::clone_element_tree_as_our_shadow_tree(Element* to_clone)
|
|||
auto cloned_reference_node = MUST(to_clone->clone_node(nullptr, true));
|
||||
shadow_root()->append_child(cloned_reference_node).release_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
// FIXME: Only invalidate the part of the layout tree that is affected by this change.
|
||||
document().invalidate_layout_tree();
|
||||
}
|
||||
|
||||
bool SVGUseElement::is_valid_reference_element(Element const& reference_element) const
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
PASS (didn't fall apart)
|
|
@ -0,0 +1,10 @@
|
|||
<script src="../include.js"></script>
|
||||
<svg><symbol id="foo"></symbol><use href="#foo"></use></svg>
|
||||
<script>
|
||||
test(() => {
|
||||
document.body.offsetWidth; // force layout
|
||||
foo.setAttribute("id", "bar");
|
||||
document.body.offsetWidth; // force layout
|
||||
println("PASS (didn't fall apart)");
|
||||
});
|
||||
</script>
|
Loading…
Reference in a new issue