From 4e9e183a34f6fcc3f2c6fea49a87c211ab447173 Mon Sep 17 00:00:00 2001 From: MacDue Date: Sun, 12 Nov 2023 12:22:16 +0000 Subject: [PATCH] LibWeb: Support `mask-type` style attribute for SVGs This fixes the painting of an SVG on https://discord.com/. --- Tests/LibWeb/Ref/svg-alpha-mask-attribute.html | 11 +++++++++++ Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 Tests/LibWeb/Ref/svg-alpha-mask-attribute.html diff --git a/Tests/LibWeb/Ref/svg-alpha-mask-attribute.html b/Tests/LibWeb/Ref/svg-alpha-mask-attribute.html new file mode 100644 index 0000000000..ffd46932c1 --- /dev/null +++ b/Tests/LibWeb/Ref/svg-alpha-mask-attribute.html @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp index aabdfdfa15..0eb74a9f81 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp @@ -141,7 +141,8 @@ void SVGGraphicsElement::apply_presentational_hints(CSS::StyleProperties& style) NamedPropertyID(CSS::PropertyID::Opacity), NamedPropertyID(CSS::PropertyID::TextAnchor), 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 };