Bug 139237

Summary: SVG filter effect does not respect its region when its ancestor filter is referenced in the svg
Product: WebKit Reporter: Said Abou-Hallawa <sabouhallawa>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: webkit-bug-importer, zimmermann
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Safari-Rendering
none
FireFox Rendering none

Description Said Abou-Hallawa 2014-12-03 15:47:26 PST
Created attachment 242533 [details]
Safari-Rendering

Open the following svg in WebKit:

<svg xmlns="http://www.w3.org/2000/svg">

  <filter id="f2" filterUnits="objectBoundingBox" primitiveUnits="objectBoundingBox" 
         x="0" y="0" width="1" height="1">
    <feFlood flood-color="#ff0000" result="flood"/>
    <feComposite x="10%" y="10%" width="80%" height="80%" style="color-interpolation-filters:sRGB"
         in="flood" operator="in" in2="SourceGraphic"/>
  </filter>
  <g filter="url(#f2)">
    <rect x="0" y="0" width="100" height="100" fill="#00ff00"/>
  </g>

</svg>

Result: The region applied on the filter effect <feComposite> is ignored. The red rectangle is displayed at position = (0,0) with size = (100,100).
Expected: The red rectangle should be displayed at position = (10,10) with size (80,80). See the attached screen-shots for how Safari and FireFox are displaying the above svg.

NOTE: Chrome and FireFox respect the filter effect region and they behave exactly the same.
Comment 1 Said Abou-Hallawa 2014-12-03 15:47:44 PST
Created attachment 242534 [details]
FireFox Rendering
Comment 2 Radar WebKit Bug Importer 2014-12-03 15:49:07 PST
<rdar://problem/19135823>
Comment 3 Said Abou-Hallawa 2015-06-08 13:07:14 PDT
This is caused because of the bug in calculating the absolutePaintRect of the feComposite filter when the operator is 'in'. This issue is already covered by https://bugs.webkit.org/show_bug.cgi?id=137856. So closing this is a d dupe.

*** This bug has been marked as a duplicate of bug 137856 ***