Bug 26231

Summary: <marker> clipped when opacity < 1
Product: WebKit Reporter: Tim Barham <tbarham>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: krit, zimmermann
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows Vista   
URL: http://www.barhams.info/webkit/opacity.xml
Bug Depends on: 32815    
Bug Blocks:    

Description Tim Barham 2009-06-05 21:16:10 PDT
A marker attached to a path is clipped if the opacity of the path's container is less than one. Repro can be seen at the referenced URL (http://www.barhams.info/webkit/opacity.xml), which shows three paths with a marker attached to each end.

The first path is within a <g> with opacity set to 0.25, showing clipping of the markers.

The second path is within a <g> with opacity set to 1, showing no clipping.

The third path shows the best, but less than ideal, work-around I have been able to come up with, which is applying the opacity to each component (the path and each marker). However, this looks poor in areas where the marker overlaps the path.

I found bugs reported regarding clipping of various elements when opacity is less than 1, but none specifically dealt with markers that I could find. This may be an additional repro case for those bugs, or a separate problem.
Comment 1 Dirk Schulze 2009-12-25 15:08:43 PST
We calculate the clipping rect for TransparencyLayer with repaintRectInLocalCoordinates() right before calling paint() (see SVGRenderBase::prepareToRenderSVGContent in SVGRenderSupport.cpp as well as RenderPath::paint). The problem is, that paint() creates the markers and the marker size. That is too late.
Comment 2 Dirk Schulze 2009-12-30 01:04:16 PST
Thanks for reportting this bug.  This will be fixed, once the patch on bug 33012 is landed.
Comment 3 Nikolas Zimmermann 2010-01-02 13:12:21 PST
Marking as duplicate of 33012, instead of depending on it, as the patch attached to 33012, will fix this problem as well. Adding the attached opacity.xml as new testcase. Thanks for that!

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