Comment 4 for bug 1403613

Revision history for this message
su_v (suv-lp) wrote :

From the simplified test file:
    <mask
       id="mask3511"
       height="1"
       width="1"
       y="0"
       x="0"
       maskUnits="userSpaceOnUse">

From the SVG spec:
«maskUnits = "userSpaceOnUse | objectBoundingBox"
    Defines the coordinate system for attributes ‘x’, ‘y’, ‘width’ and ‘height’.
    If maskUnits="userSpaceOnUse", ‘x’, ‘y’, ‘width’ and ‘height’ represent values in the current user coordinate system in place at the time when the ‘mask’ element is referenced (i.e., the user coordinate system for the element referencing the ‘mask’ element via the ‘mask’ property).»

Removing the width/height and X/Y attributes from the mask definition (the used values seem to refer to a kind of normalized size of the masked object, or maybe to objectBoundingBox) makes the masked object getting rendered in other SVG viewers too (except librsvg which doesn't render Inkscape's masks either if those attributes are missing and 'maskUnits' are 'userSpaceOnUse'). IIRC Inkscape does not set these parameters itself when applying a mask (the spec defines fallback values for them when using 'userSpaceOnUse' for 'maskUnits' …).

A gray outer background instead of full transparency seems correct to me (though rendered too dark in Inkscape compared to other SVG viewers), since the embedded bitmap image doesn't use full black (which would render the masked area transparent) but some dark shade (#2d2c2e). Possibly there's a bug report about that already.

Note that the bitmap image lacks the attribute 'preserveAspectRatio="none"', so it renders differently scaled in other (compliant) SVG renderers and in Inkscape 0.91(pre3|+devel).