Bug 127350

Summary: [CSS Background Blending] -webkit-background-blend-mode fails for certain SVG files
Product: WebKit Reporter: Mihai Tica <mitica>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, d-r, fmalita, gyuyoung.kim, krit, mihnea, pdr, schenney
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 108546    
Attachments:
Description Flags
Patch V1
krit: review+, krit: commit-queue-
Patch V2 none

Description Mihai Tica 2014-01-21 08:21:40 PST
-webkit-background-blend-mode fails for certain SVG background layers
Related sample can be found at:
http://codepen.io/mihait/pen/pFCtH

What happens is that if the background layer has a blend mode attached, it seems that the blend mode is inherited by the SVG graphicsContext when performing its painting.
Comment 1 Mihai Tica 2014-01-22 03:34:40 PST
Created attachment 221853 [details]
Patch V1
Comment 2 Dirk Schulze 2014-01-22 04:18:58 PST
Comment on attachment 221853 [details]
Patch V1

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

snippets. Otherwise great.

> Source/WebCore/ChangeLog:10
> +        [CSS Background Blending] Background blending works
> +        incorrectly for certain SVG background layers: the
> +        graphics context of the SVG inherits the blend mode set
> +        on the background layer. Fix consists in drawing the SVG
> +        in a transparency layer.
> +        https://bugs.webkit.org/show_bug.cgi?id=127350
> +
> +        Reviewed by NOBODY (OOPS!).

The style for changelegs are:

date  name  email

Bug title
bug reference

reviewed by

fix description.

tests

* changed files

> Source/WebCore/ChangeLog:15
> +        (WebCore::SVGImage::draw): begin a transparency layer if a blend mode is set.

s/begin/Begin/

> LayoutTests/css3/compositing/background-blend-mode-svg.html:12
> +        -webkit-background-blend-mode: multiply, normal;

One value should be enough here, right?
Comment 3 Mihai Tica 2014-01-22 04:39:23 PST
> > LayoutTests/css3/compositing/background-blend-mode-svg.html:12
> > +        -webkit-background-blend-mode: multiply, normal;
> 
> One value should be enough here, right?

It is, however, according to the spec, there should be a blend mode specified per background layer.
Comment 4 Mihai Tica 2014-01-22 04:40:10 PST
Created attachment 221858 [details]
Patch V2
Comment 5 WebKit Commit Bot 2014-01-22 06:48:51 PST
Comment on attachment 221858 [details]
Patch V2

Clearing flags on attachment: 221858

Committed r162517: <http://trac.webkit.org/changeset/162517>