Re: [fxtf-drafts] [css-masking-1] Mask on mask behavior (#328)

Just a couple of comments on the above test cases.

There are a couple of gotchas here, that may be worth noting just to avoid others scratching their heads like I did for a while.

The first issue is fairly obvious. In the original SVG supplied by @RazrFalcon, the `mask1` mask is a black square on black, so it is blank. Meaning that the correct rendering of the test case should be blank.  Ie. librsvg is the only correct one here (albeit possibly accidentally).

The second issue relates to the gradient.  It is interpolating from transparent white to black.  This can cause problems if gradients aren't being interpolated and composited in the correct colour space.  For example, Dirk's test case is blank on Firefox due to this.  If we modify the gradient by adding a halfway step, the masked green square is now visible.

To avoid these issues causing confusion, it might be a good idea not to use that problematic gradient and instead use a more straightforward test case that more directly addresses the mask on mask issue.

<svg viewBox="0 0 200 200" width="200" height="200">

    <mask id="mask1">
        <circle id="rect1" cx="100" cy="100" r="50" fill="gray"/>
    <mask id="mask2" mask="url(#mask1)" maskUnits="userSpaceOnUse"
          x="0" y="0" width="200" height="200">
        <rect id="rect1" x="20" y="20" width="160" height="160" fill="white"/>
    <rect id="rect2" x="20" y="20" width="160" height="160" fill="green" mask="url(#mask2)"/>

    <rect id="frame" x="1" y="1" width="198" height="198" fill="none" stroke="black"/>


GitHub Notification of comment by BigBadaboom
Please view or discuss this issue at using your GitHub account

Received on Monday, 10 December 2018 12:34:00 UTC