Bug 127350 - [CSS Background Blending] -webkit-background-blend-mode fails for certain SVG files
Summary: [CSS Background Blending] -webkit-background-blend-mode fails for certain SVG...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 108546
  Show dependency treegraph
 
Reported: 2014-01-21 08:21 PST by Mihai Tica
Modified: 2014-03-04 00:25 PST (History)
8 users (show)

See Also:


Attachments
Patch V1 (4.71 KB, patch)
2014-01-22 03:34 PST, Mihai Tica
krit: review+
krit: commit-queue-
Details | Formatted Diff | Diff
Patch V2 (4.50 KB, patch)
2014-01-22 04:40 PST, Mihai Tica
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>