haikuwebkit/LayoutTests/svg/css/mix-blend-mode-opacity-root...

7 lines
362 B
XML
Raw Permalink Normal View History

Garbage is displayed when root svg element has mix-blend-mode set https://bugs.webkit.org/show_bug.cgi?id=150556 Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-01-27 Reviewed by Darin Adler. Source/WebCore: This bug happens when compositing on a CALayer and drawing on a transparent layer, so it happens with WK2 with <svg style="mix-blend-mode...">. And it can happen with WK1 also with <svg style="opacity=...;mix-blend-mode...">. But in both cases, the SVG root renderer should be the root of the render tree. So it happens only with the stand alone SVG documents. SVGRenderContext::prepareToRenderSVGContent() ignores the opacity of the SVG root but it creates a transparent layer for the blend-mode. But RenderLayer::beginTransparencyLayers() creates a transparent layer for opacity and it sets the blend-mode also. The fix is to begin two transparent layers for the SVG root renderer: one for the opacity and the second for the blend-mode. The opacity transparent layer will be still managed by RenderLayer::beginTransparencyLayers(). While the blend-mode transparent layer will be managed by SVGRenderContext ::prepareToRenderSVGContent(). Tests: svg/css/mix-blend-mode-background-root.svg svg/css/mix-blend-mode-opacity-root.svg * rendering/RenderLayer.cpp: (WebCore::RenderLayer::beginTransparencyLayers): LayoutTests: Ensure blending the SVG root renderer will be displayed correctly with compositing when the SVG root renderer is the root of the render tree. * svg/css/mix-blend-mode-background-root-expected.svg: Added. * svg/css/mix-blend-mode-background-root.svg: Added. * svg/css/mix-blend-mode-opacity-root-expected.svg: Added. * svg/css/mix-blend-mode-opacity-root.svg: Added. Canonical link: https://commits.webkit.org/171650@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195724 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-28 02:21:25 +00:00
<svg xmlns="http://www.w3.org/2000/svg" style="opacity: 0.6;">
<rect x="20" y="20" width="100" height="100" fill="rgb(0,255,255)"/>
<rect x="140" y="20" width="100" height="100" fill="rgb(255,0,255)"/>
<rect x="20" y="140" width="100" height="100" fill="rgb(255,255,0)"/>
<rect x="140" y="140" width="100" height="100" fill="rgb(0,0,0)"/>
</svg>