mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Do not render SVG <symbol> elements unless part of <use>
We were always rendering <symbol> SVG elements, but we should only render them if they are a child of a <use>'s shadow root. This caused practically all instances of <symbol> to be drawn at least one time too many.
This commit is contained in:
parent
632854d870
commit
39ad7833f0
Notes:
github-actions[bot]
2025-11-27 06:56:50 +00:00
Author: https://github.com/gmta
Commit: 39ad7833f0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6939
5 changed files with 36 additions and 7 deletions
|
|
@ -62,7 +62,12 @@ bool SVGSymbolElement::is_direct_child_of_use_shadow_tree() const
|
|||
|
||||
GC::Ptr<Layout::Node> SVGSymbolElement::create_layout_node(GC::Ref<CSS::ComputedProperties> style)
|
||||
{
|
||||
return heap().allocate<Layout::SVGGraphicsBox>(document(), *this, move(style));
|
||||
// https://svgwg.org/svg2-draft/render.html#TermNeverRenderedElement
|
||||
// [..] it also includes a ‘symbol’ element that is not the instance root of a use-element shadow tree.
|
||||
if (!is_direct_child_of_use_shadow_tree())
|
||||
return {};
|
||||
|
||||
return heap().allocate<Layout::SVGGraphicsBox>(document(), *this, style);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue