LibWeb: Add Base::apply_presentational_hints call to <symbol> element

This commit is contained in:
0GreenClover0 2023-08-20 00:17:42 +02:00 committed by Andreas Kling
parent d296992fb3
commit f6c3ec3742
Notes: sideshowbarker 2024-07-17 02:22:23 +09:00
4 changed files with 14 additions and 1 deletions

View file

@ -4,5 +4,6 @@
"opacity-stacking.html": "opacity-stacking-ref.html",
"css-gradient-currentcolor.html": "css-gradient-currentcolor-ref.html",
"css-lang-selector.html": "css-lang-selector-ref.html",
"css-gradients.html": "css-gradients-ref.html"
"css-gradients.html": "css-gradients-ref.html",
"svg-symbol.html": "svg-symbol-ref.html"
}

View file

@ -0,0 +1,5 @@
<svg><symbol fill="green" id="dot" width="500" height="500" viewBox="0 0 2 10">
<circle cx="1" cy="1" r="1"/>
<circle fill="blue" cx="1.5" cy="1" r="1"/>
</symbol>
<use href="#dot"/>

After

Width:  |  Height:  |  Size: 183 B

View file

@ -0,0 +1,5 @@
<svg><symbol id="dot" width="500" height="500" viewBox="0 0 2 10">
<circle fill="green" cx="1" cy="1" r="1"/>
<circle fill="blue" cx="1.5" cy="1" r="1"/>
</symbol>
<use href="#dot"/>

After

Width:  |  Height:  |  Size: 183 B

View file

@ -31,6 +31,8 @@ void SVGSymbolElement::initialize(JS::Realm& realm)
// https://svgwg.org/svg2-draft/struct.html#SymbolNotes
void SVGSymbolElement::apply_presentational_hints(CSS::StyleProperties& style) const
{
Base::apply_presentational_hints(style);
// The user agent style sheet sets the overflow property for symbol elements to hidden.
auto hidden = CSS::IdentifierStyleValue::create(CSS::ValueID::Hidden);
style.set_property(CSS::PropertyID::Overflow, CSS::OverflowStyleValue::create(hidden, hidden));