Title: [200728] branches/safari-601-branch

Diff

Modified: branches/safari-601-branch/LayoutTests/ChangeLog (200727 => 200728)


--- branches/safari-601-branch/LayoutTests/ChangeLog	2016-05-12 01:31:41 UTC (rev 200727)
+++ branches/safari-601-branch/LayoutTests/ChangeLog	2016-05-12 01:31:45 UTC (rev 200728)
@@ -1,5 +1,24 @@
 2016-05-11  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r195724. rdar://problem/26228611
+
+    2016-01-27  Said Abou-Hallawa  <sabouhall...@apple.com>
+
+            Garbage is displayed when root svg element has mix-blend-mode set
+            https://bugs.webkit.org/show_bug.cgi?id=150556
+
+            Reviewed by Darin Adler.
+
+            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.
+
+2016-05-11  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r194399. rdar://problem/26228601
 
     2015-12-23  Pranjal Jumde  <pju...@apple.com>

Added: branches/safari-601-branch/LayoutTests/svg/css/mix-blend-mode-background-root-expected.svg (0 => 200728)


--- branches/safari-601-branch/LayoutTests/svg/css/mix-blend-mode-background-root-expected.svg	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/svg/css/mix-blend-mode-background-root-expected.svg	2016-05-12 01:31:45 UTC (rev 200728)
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+    <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>

Added: branches/safari-601-branch/LayoutTests/svg/css/mix-blend-mode-background-root.svg (0 => 200728)


--- branches/safari-601-branch/LayoutTests/svg/css/mix-blend-mode-background-root.svg	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/svg/css/mix-blend-mode-background-root.svg	2016-05-12 01:31:45 UTC (rev 200728)
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg" style="background-color:white; 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>
+

Added: branches/safari-601-branch/LayoutTests/svg/css/mix-blend-mode-opacity-root-expected.svg (0 => 200728)


--- branches/safari-601-branch/LayoutTests/svg/css/mix-blend-mode-opacity-root-expected.svg	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/svg/css/mix-blend-mode-opacity-root-expected.svg	2016-05-12 01:31:45 UTC (rev 200728)
@@ -0,0 +1,6 @@
+<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>

Added: branches/safari-601-branch/LayoutTests/svg/css/mix-blend-mode-opacity-root.svg (0 => 200728)


--- branches/safari-601-branch/LayoutTests/svg/css/mix-blend-mode-opacity-root.svg	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/svg/css/mix-blend-mode-opacity-root.svg	2016-05-12 01:31:45 UTC (rev 200728)
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg" style="opacity: 0.6; 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>
+

Modified: branches/safari-601-branch/Source/WebCore/ChangeLog (200727 => 200728)


--- branches/safari-601-branch/Source/WebCore/ChangeLog	2016-05-12 01:31:41 UTC (rev 200727)
+++ branches/safari-601-branch/Source/WebCore/ChangeLog	2016-05-12 01:31:45 UTC (rev 200728)
@@ -1,5 +1,40 @@
 2016-05-11  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r195724. rdar://problem/26228611
+
+    2016-01-27  Said Abou-Hallawa  <sabouhall...@apple.com>
+
+            Garbage is displayed when root svg element has mix-blend-mode set
+            https://bugs.webkit.org/show_bug.cgi?id=150556
+
+            Reviewed by Darin Adler.
+
+            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):
+
+2016-05-11  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r194399. rdar://problem/26228601
 
     2015-12-23  Pranjal Jumde  <pju...@apple.com>

Modified: branches/safari-601-branch/Source/WebCore/rendering/RenderLayer.cpp (200727 => 200728)


--- branches/safari-601-branch/Source/WebCore/rendering/RenderLayer.cpp	2016-05-12 01:31:41 UTC (rev 200727)
+++ branches/safari-601-branch/Source/WebCore/rendering/RenderLayer.cpp	2016-05-12 01:31:45 UTC (rev 200728)
@@ -1799,14 +1799,15 @@
         context->clip(pixelSnappedClipRect);
 
 #if ENABLE(CSS_COMPOSITING)
-        if (hasBlendMode())
+        // RenderSVGRoot takes care of its blend mode.
+        if (!renderer().isSVGRoot() && hasBlendMode())
             context->setCompositeOperation(context->compositeOperation(), blendMode());
 #endif
 
         context->beginTransparencyLayer(renderer().opacity());
 
 #if ENABLE(CSS_COMPOSITING)
-        if (hasBlendMode())
+        if (!renderer().isSVGRoot() && hasBlendMode())
             context->setCompositeOperation(context->compositeOperation(), BlendModeNormal);
 #endif
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to