LibWeb: Add support for SVG display attribute

(cherry picked from commit 97d5cf4eefaf3ef7dd68f68701435c05da1cffb1)
This commit is contained in:
Colin Reeder 2024-08-15 21:45:41 -06:00 committed by Nico Weber
parent 3f1147bb7e
commit f86e2d61af
3 changed files with 12 additions and 0 deletions

View file

@ -0,0 +1,4 @@
<svg width="120" viewBox="0 0 100 100">
<circle cx="25" cy="25" fill="blue" r="25" />
<g><circle cx="75" cy="25" fill="red" r="25" /></g>
</svg>

After

Width:  |  Height:  |  Size: 150 B

View file

@ -0,0 +1,7 @@
<link rel="match" href="reference/svg-display-attr.html" />
<svg width="120" viewBox="0 0 100 100">
<circle cx="25" cy="25" fill="blue" r="25" />
<g><circle cx="75" cy="25" fill="red" r="25" /></g>
<circle cx="75" cy="25" fill="blue" r="25" display="none" />
<g display="none"><circle cx="75" cy="75" fill="red" r="25" /></g>
</svg>

View file

@ -163,6 +163,7 @@ void SVGGraphicsElement::apply_presentational_hints(CSS::StyleProperties& style)
NamedPropertyID(CSS::PropertyID::MaskType), NamedPropertyID(CSS::PropertyID::MaskType),
NamedPropertyID(CSS::PropertyID::ClipPath), NamedPropertyID(CSS::PropertyID::ClipPath),
NamedPropertyID(CSS::PropertyID::ClipRule), NamedPropertyID(CSS::PropertyID::ClipRule),
NamedPropertyID(CSS::PropertyID::Display),
}; };
CSS::Parser::ParsingContext parsing_context { document(), CSS::Parser::ParsingContext::Mode::SVGPresentationAttribute }; CSS::Parser::ParsingContext parsing_context { document(), CSS::Parser::ParsingContext::Mode::SVGPresentationAttribute };