[Webkit-unassigned] [Bug 172338] SVG mask is not applied as a group effect

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 17 01:25:36 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=172338

--- Comment #5 from Jan Bösenberg <jan.boesenberg at incors.com> ---
Here is an example that should make it obvious that masking is not being done correctly.

The same structure of two overlapping squares is displayed twice. The only difference on the right side is that an empty filter is added to the group containing the squares. Obviously this should not make a difference, but with Webkit the squares have different colors.

The reason behind this is that in the first case the mask is applied to the squares before they are rendered. The red and blue squares get opacity of 0.5, and consequently the resulting square appears purple.

In the second case the empty filter is applied to the group first. The intermediate result is a blue square, which is then masked.

Here is the SVG (here as a JSBin: http://jsbin.com/fovatajayu/edit?html,output)

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="600" height="512" viewBox="0,0,512,512" color-interpolation="sRGB" >
  <defs>
    <mask id="mask1" maskContentUnits="objectBoundingBox"> 
      <rect  x="0" y="0" width="100" height="100" fill="#808080"/>
    </mask>

    <filter id="filter1"> <!-- This filter does nothing -->
      <feColorMatrix values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 1 0" />
    </filter>
  </defs>

  <g mask="url(#mask1)"  >
    <g>
      <rect x="0" y="0" width="256" height="256" fill="red"  />
      <rect x="0" y="0" width="256" height="256" fill="blue" />
    </g>
  </g>

  <!-- Empty filter added -->
  <g mask="url(#mask1)">
    <g filter="url(#filter1)">
      <rect x="300" y="0" width="256" height="256" fill="red"  />
      <rect x="300" y="0" width="256" height="256" fill="blue" />
    </g>
  </g>
</svg>

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180517/716bc0be/attachment-0001.html>


More information about the webkit-unassigned mailing list