1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:07:34 +00:00

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
parent 479451498b
commit 92fc426562
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));
}