mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibWeb: Support mask-type style attribute for SVGs
This fixes the painting of an SVG on https://discord.com/.
This commit is contained in:
11
Tests/LibWeb/Ref/svg-alpha-mask-attribute.html
Normal file
11
Tests/LibWeb/Ref/svg-alpha-mask-attribute.html
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<link rel="match" href="reference/simple-svg-mask-ref.html" />
|
||||||
|
<svg width="120" viewBox="-10 -10 120 120">
|
||||||
|
<defs>
|
||||||
|
<mask id="myMask" mask-type="alpha">
|
||||||
|
<!-- Everything solid pixel (alpha=255) will be visible -->
|
||||||
|
<rect x="50" y="0" width="50" height="100" fill="black" />
|
||||||
|
</mask>
|
||||||
|
</defs>
|
||||||
|
<rect x="-10" y="-10" width="120" height="120" fill="blue" />
|
||||||
|
<rect x="10" y="10" width="80" height="80" fill="red" mask="url(#myMask)" />
|
||||||
|
</svg>
|
||||||
@@ -141,7 +141,8 @@ void SVGGraphicsElement::apply_presentational_hints(CSS::StyleProperties& style)
|
|||||||
NamedPropertyID(CSS::PropertyID::Opacity),
|
NamedPropertyID(CSS::PropertyID::Opacity),
|
||||||
NamedPropertyID(CSS::PropertyID::TextAnchor),
|
NamedPropertyID(CSS::PropertyID::TextAnchor),
|
||||||
NamedPropertyID(CSS::PropertyID::FontSize),
|
NamedPropertyID(CSS::PropertyID::FontSize),
|
||||||
NamedPropertyID(CSS::PropertyID::Mask)
|
NamedPropertyID(CSS::PropertyID::Mask),
|
||||||
|
NamedPropertyID(CSS::PropertyID::MaskType)
|
||||||
};
|
};
|
||||||
|
|
||||||
CSS::Parser::ParsingContext parsing_context { document(), CSS::Parser::ParsingContext::Mode::SVGPresentationAttribute };
|
CSS::Parser::ParsingContext parsing_context { document(), CSS::Parser::ParsingContext::Mode::SVGPresentationAttribute };
|
||||||
|
|||||||
Reference in New Issue
Block a user