Description
Graphite’s SVG importer reads resolved clip paths from usvg::Group::clip_path(), but
it never reads resolved masks from usvg::Group::mask().
When usvg parses an element with mask="url(#mask-id)", it places the resolved mask
on a generated usvg::Group. Graphite recursively imports that group’s visible
children while silently discarding its mask. Consequently, the unmasked source artwork
is imported.
Reproduction
Import HameronsDocs/usvg-group-mask-import-debug.svg.
The fixture deliberately contains only:
- One solid blue rectangle.
- One circular SVG mask.
mask-type="alpha" to exclude luminance-mask behavior from this issue.
- No gradients, transforms, strokes, clip paths, filters, or fill-rule dependencies.
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 128 128">
<defs>
<mask id="circle-mask" mask-type="alpha"
maskUnits="userSpaceOnUse" x="0" y="0" width="128" height="128">
<circle cx="64" cy="64" r="48" fill="white" />
</mask>
</defs>
<rect width="128" height="128" fill="#2563eb"
mask="url(#circle-mask)" />
</svg>
Description
Graphite’s SVG importer reads resolved clip paths from
usvg::Group::clip_path(), butit never reads resolved masks from
usvg::Group::mask().When
usvgparses an element withmask="url(#mask-id)", it places the resolved maskon a generated
usvg::Group. Graphite recursively imports that group’s visiblechildren while silently discarding its mask. Consequently, the unmasked source artwork
is imported.
Reproduction
Import
HameronsDocs/usvg-group-mask-import-debug.svg.The fixture deliberately contains only:
mask-type="alpha"to exclude luminance-mask behavior from this issue.