LibWeb: Add basic support for maskUnits=userSpaceOnUse

This still does not use the x, y, width, or height attributes on the
mask, but this allows at least displaying these masks.
This commit is contained in:
MacDue 2023-10-07 20:23:52 +01:00 committed by Andreas Kling
commit 92fc426562
Notes: sideshowbarker 2024-07-17 06:51:48 +09:00
2 changed files with 15 additions and 7 deletions

View file

@ -53,10 +53,6 @@ MaskUnits SVGMaskElement::mask_units() const
CSSPixelRect SVGMaskElement::resolve_masking_area(CSSPixelRect const& mask_target) const
{
if (mask_units() == SVG::MaskUnits::UserSpaceOnUse) {
dbgln("SVG: maskUnits=userSpaceOnUse is not supported");
return {};
}
// TODO: Resolve this based on the x, y, width, and height of the mask.
return mask_target.inflated(mask_target.size().scaled(CSSPixels(2) / 10));
}