Title: [234136] trunk
Revision
234136
Author
[email protected]
Date
2018-07-24 01:14:40 -0700 (Tue, 24 Jul 2018)

Log Message

[css-masking] Black backdrop on -webkit-clip-path on SVG root
https://bugs.webkit.org/show_bug.cgi?id=187880

Source/WebCore:

Reviewed by Simon Fraser.

For SVG document root elements, we currently clip twice:
In RenderLayer and SVGRenderSupport.
Avoid clipping in RenderLayer which currently clips before we established a
backdrop for an SVG document.

Tests: svg/clip-path/clip-path-on-svg-005-expected.svg
       svg/clip-path/clip-path-on-svg-005.svg

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::setupClipPath): Skip actual clipping.

LayoutTests:

Avoid duplicated clip in RenderLayer.

Reviewed by Simon Fraser.

* svg/clip-path/clip-path-on-svg-005-expected.svg: Added.
* svg/clip-path/clip-path-on-svg-005.svg: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (234135 => 234136)


--- trunk/LayoutTests/ChangeLog	2018-07-24 07:34:13 UTC (rev 234135)
+++ trunk/LayoutTests/ChangeLog	2018-07-24 08:14:40 UTC (rev 234136)
@@ -1,3 +1,15 @@
+2018-07-24  Dirk Schulze  <[email protected]>
+
+        [css-masking] Black backdrop on -webkit-clip-path on SVG root
+        https://bugs.webkit.org/show_bug.cgi?id=187880
+
+        Avoid duplicated clip in RenderLayer.
+
+        Reviewed by Simon Fraser.
+
+        * svg/clip-path/clip-path-on-svg-005-expected.svg: Added.
+        * svg/clip-path/clip-path-on-svg-005.svg: Added.
+
 2018-07-23  Per Arne Vollan  <[email protected]>
 
         The test webanimations/accessing-current-time-after-finished-css-animation-target-removal.html is failing on Windows.

Added: trunk/LayoutTests/svg/clip-path/clip-path-on-svg-005-expected.svg (0 => 234136)


--- trunk/LayoutTests/svg/clip-path/clip-path-on-svg-005-expected.svg	                        (rev 0)
+++ trunk/LayoutTests/svg/clip-path/clip-path-on-svg-005-expected.svg	2018-07-24 08:14:40 UTC (rev 234136)
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>

Added: trunk/LayoutTests/svg/clip-path/clip-path-on-svg-005.svg (0 => 234136)


--- trunk/LayoutTests/svg/clip-path/clip-path-on-svg-005.svg	                        (rev 0)
+++ trunk/LayoutTests/svg/clip-path/clip-path-on-svg-005.svg	2018-07-24 08:14:40 UTC (rev 234136)
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" style="-webkit-clip-path: url(#clip1)">
+<clipPath id="clip1">
+  <rect x="50" y="50" width="100" height="100"/>
+</clipPath>
+<rect width="200" height="200" fill="green"/>
+</svg>

Modified: trunk/Source/WebCore/ChangeLog (234135 => 234136)


--- trunk/Source/WebCore/ChangeLog	2018-07-24 07:34:13 UTC (rev 234135)
+++ trunk/Source/WebCore/ChangeLog	2018-07-24 08:14:40 UTC (rev 234136)
@@ -1,3 +1,21 @@
+2018-07-24  Dirk Schulze  <[email protected]>
+
+        [css-masking] Black backdrop on -webkit-clip-path on SVG root
+        https://bugs.webkit.org/show_bug.cgi?id=187880
+
+        Reviewed by Simon Fraser.
+
+        For SVG document root elements, we currently clip twice:
+        In RenderLayer and SVGRenderSupport.
+        Avoid clipping in RenderLayer which currently clips before we established a
+        backdrop for an SVG document.
+
+        Tests: svg/clip-path/clip-path-on-svg-005-expected.svg
+               svg/clip-path/clip-path-on-svg-005.svg
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::setupClipPath): Skip actual clipping.
+
 2018-07-24  Zan Dobersek  <[email protected]>
 
         [Nicosia] Add TextureMapperAnimations member to CompositingLayer::LayerState

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (234135 => 234136)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2018-07-24 07:34:13 UTC (rev 234135)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2018-07-24 08:14:40 UTC (rev 234136)
@@ -100,6 +100,7 @@
 #include "RenderMultiColumnFlow.h"
 #include "RenderReplica.h"
 #include "RenderSVGResourceClipper.h"
+#include "RenderSVGRoot.h"
 #include "RenderScrollbar.h"
 #include "RenderScrollbarPart.h"
 #include "RenderTableCell.h"
@@ -4156,6 +4157,10 @@
         rootRelativeBoundsComputed = true;
     }
 
+    // SVG elements get clipped in SVG code.
+    if (is<RenderSVGRoot>(renderer()))
+        return false;
+
     auto& style = renderer().style();
     LayoutSize paintingOffsetFromRoot = LayoutSize(snapSizeToDevicePixel(offsetFromRoot + paintingInfo.subpixelOffset, LayoutPoint(), renderer().document().deviceScaleFactor()));
     ASSERT(style.clipPath());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to