Bug 116856

Summary: <svg> with opacity and compositing double-applies its opacity
Product: WebKit Reporter: Tim Horton <thorton>
Component: SVGAssignee: Philip Rogers <pdr>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, d-r, esprehn+autocc, fmalita, glenn, gyuyoung.kim, kondapallykalyan, krit, pdr, schenney, sergio, simon.fraser, webkit-bug-importer, zimmermann
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
testcase
none
screenshot
none
Patch
simon.fraser: review+, simon.fraser: commit-queue-
Patch for landing
none
Patch for landing
none
Patch none

Description Tim Horton 2013-05-28 02:06:08 PDT
Created attachment 203029 [details]
testcase

See attached testcase; the <svg> that has both opacity: 0.5 and -webkit-transform: translateZ(0); is lighter in color than the others.
Comment 1 Radar WebKit Bug Importer 2013-05-28 02:06:44 PDT
<rdar://problem/13998204>
Comment 2 Tim Horton 2013-05-28 02:07:02 PDT
Created attachment 203030 [details]
screenshot
Comment 3 Dirk Schulze 2014-05-12 07:46:17 PDT
We create a transparency layer on all SVG elements if opacity was specified. Looks like creating a compositing layer does it in GraphicsLayer as well? A simple check in RenderSVGRoot should prevent this, no?
Comment 4 Dirk Schulze 2014-05-12 13:10:57 PDT
Created attachment 231316 [details]
Patch

Patch
Comment 5 Simon Fraser (smfr) 2014-05-12 13:29:53 PDT
Comment on attachment 231316 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=231316&action=review

> Source/WebCore/rendering/svg/SVGRenderingContext.cpp:104
> +    float opacity = isRenderingMask || (renderer.hasLayer() && renderer.enclosingLayer()->isComposited()) ? 1 : style.opacity();

You should do hasLayer() && toRenderLayerModelObject(renderer)->layer()->isComposited()).
Comment 6 Dirk Schulze 2014-05-12 13:36:44 PDT
Created attachment 231318 [details]
Patch for landing
Comment 7 Dirk Schulze 2014-05-12 15:11:26 PDT
Created attachment 231329 [details]
Patch for landing
Comment 8 WebKit Commit Bot 2014-05-12 15:58:16 PDT
Comment on attachment 231329 [details]
Patch for landing

Clearing flags on attachment: 231329

Committed r168651: <http://trac.webkit.org/changeset/168651>
Comment 9 WebKit Commit Bot 2014-05-12 15:58:22 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Philip Rogers 2014-05-26 20:41:58 PDT
Reopening to attach new patch.
Comment 11 Philip Rogers 2014-05-26 20:42:04 PDT
Created attachment 232105 [details]
Patch
Comment 12 WebKit Commit Bot 2014-05-26 22:24:27 PDT
Comment on attachment 232105 [details]
Patch

Clearing flags on attachment: 232105

Committed r169368: <http://trac.webkit.org/changeset/169368>
Comment 13 WebKit Commit Bot 2014-05-26 22:24:33 PDT
All reviewed patches have been landed.  Closing bug.