LibWeb: Add support for SVG display attribute

This commit is contained in:
Colin Reeder 2024-08-15 21:45:41 -06:00 committed by Alexander Kalenik
parent 73ca9516a9
commit 97d5cf4eef
Notes: github-actions[bot] 2024-08-16 10:13:01 +00:00
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

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