Title: [204790] releases/WebKitGTK/webkit-2.12
Revision
204790
Author
[email protected]
Date
2016-08-23 02:52:09 -0700 (Tue, 23 Aug 2016)

Log Message

Merge r202022 - SVG elements don't blend correctly into HTML
https://bugs.webkit.org/show_bug.cgi?id=158718
<rdar://problem/26782004>

Reviewed by Antoine Quint.

Source/WebCore:

We were not creating any transparency layers for the root SVG nodes.
This is ok if the SVG is the root document, because it is the backdrop.
However, if it is inline SVG, it needs to apply the operation in
order to composite into the document.

Test: svg/css/mix-blend-mode-with-inline-svg.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::beginTransparencyLayers):

LayoutTests:

* svg/css/mix-blend-mode-with-inline-svg-expected.html: Added.
* svg/css/mix-blend-mode-with-inline-svg.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog (204789 => 204790)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-08-23 09:51:15 UTC (rev 204789)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-08-23 09:52:09 UTC (rev 204790)
@@ -1,3 +1,14 @@
+2016-06-13  Dean Jackson  <[email protected]>
+
+        SVG elements don't blend correctly into HTML
+        https://bugs.webkit.org/show_bug.cgi?id=158718
+        <rdar://problem/26782004>
+
+        Reviewed by Antoine Quint.
+
+        * svg/css/mix-blend-mode-with-inline-svg-expected.html: Added.
+        * svg/css/mix-blend-mode-with-inline-svg.html: Added.
+
 2016-06-09  Antoine Quint  <[email protected]>
 
         Changing canvas height immediately after page load does not relayout canvas

Added: releases/WebKitGTK/webkit-2.12/LayoutTests/svg/css/mix-blend-mode-with-inline-svg-expected.html (0 => 204790)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/svg/css/mix-blend-mode-with-inline-svg-expected.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/svg/css/mix-blend-mode-with-inline-svg-expected.html	2016-08-23 09:52:09 UTC (rev 204790)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<body>
+<svg width="300" height="300">
+    <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>
+</body>

Added: releases/WebKitGTK/webkit-2.12/LayoutTests/svg/css/mix-blend-mode-with-inline-svg.html (0 => 204790)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/svg/css/mix-blend-mode-with-inline-svg.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/svg/css/mix-blend-mode-with-inline-svg.html	2016-08-23 09:52:09 UTC (rev 204790)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<body>
+<svg width="300" height="300" style="mix-blend-mode: difference;">
+    <rect x="20" y="20" width="100" height="100" fill="rgb(255,0,0)"/>
+    <rect x="140" y="20" width="100" height="100" fill="rgb(0,255,0)"/>
+    <rect x="20" y="140" width="100" height="100" fill="rgb(0,0,255)"/>
+    <rect x="140" y="140" width="100" height="100" fill="rgb(255,255,255)"/>
+</svg>
+</body>

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (204789 => 204790)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-08-23 09:51:15 UTC (rev 204789)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-08-23 09:52:09 UTC (rev 204790)
@@ -1,3 +1,21 @@
+2016-06-13  Dean Jackson  <[email protected]>
+
+        SVG elements don't blend correctly into HTML
+        https://bugs.webkit.org/show_bug.cgi?id=158718
+        <rdar://problem/26782004>
+
+        Reviewed by Antoine Quint.
+
+        We were not creating any transparency layers for the root SVG nodes.
+        This is ok if the SVG is the root document, because it is the backdrop.
+        However, if it is inline SVG, it needs to apply the operation in
+        order to composite into the document.
+
+        Test: svg/css/mix-blend-mode-with-inline-svg.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::beginTransparencyLayers):
+
 2016-06-09  Antoine Quint  <[email protected]>
 
         Changing canvas height immediately after page load does not relayout canvas

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/RenderLayer.cpp (204789 => 204790)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/RenderLayer.cpp	2016-08-23 09:51:15 UTC (rev 204789)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/RenderLayer.cpp	2016-08-23 09:52:09 UTC (rev 204790)
@@ -1805,8 +1805,8 @@
         context.clip(pixelSnappedClipRect);
 
 #if ENABLE(CSS_COMPOSITING)
-        // RenderSVGRoot takes care of its blend mode.
-        if (!renderer().isSVGRoot() && hasBlendMode())
+        bool usesCompositeOperation = hasBlendMode() && !(renderer().isSVGRoot() && parent() && parent()->isRootLayer());
+        if (usesCompositeOperation)
             context.setCompositeOperation(context.compositeOperation(), blendMode());
 #endif
 
@@ -1813,7 +1813,7 @@
         context.beginTransparencyLayer(renderer().opacity());
 
 #if ENABLE(CSS_COMPOSITING)
-        if (!renderer().isSVGRoot() && hasBlendMode())
+        if (usesCompositeOperation)
             context.setCompositeOperation(context.compositeOperation(), BlendModeNormal);
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to