Title: [204872] trunk
Revision
204872
Author
[email protected]
Date
2016-08-23 17:30:22 -0700 (Tue, 23 Aug 2016)

Log Message

REGRESSION: SVG clip-path doesn't work on root <svg>
https://bugs.webkit.org/show_bug.cgi?id=129180

Patch by Said Abou-Hallawa <[email protected]> on 2016-08-23
Reviewed by Tim Horton.

Source/WebCore:

Build the resources cache for the RenderSVGRoot element when it's been
inserted in the render tree. Remove the resources cache before removing
the RenderSVGRoot from the render tree. No worries for the child <svg>
elements since their renderers are of type RenderSVGViewportContainer.

Tests: svg/clip-path/clip-path-on-svg-003.svg
       svg/clip-path/clip-path-on-svg-004.svg

* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::insertedIntoTree):
(WebCore::RenderSVGRoot::willBeRemovedFromTree):
* rendering/svg/RenderSVGRoot.h:
These changes are very similar to what we do for adding and removing the
child SVG elements in RenderSVGRoot::addChild() and removeChild().

LayoutTests:

* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
* svg/clip-path/clip-path-on-svg-003-expected.svg: Added.
* svg/clip-path/clip-path-on-svg-003.svg: Added.
* svg/clip-path/clip-path-on-svg-004-expected.svg: Added.
* svg/clip-path/clip-path-on-svg-004.svg: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (204871 => 204872)


--- trunk/LayoutTests/ChangeLog	2016-08-24 00:24:34 UTC (rev 204871)
+++ trunk/LayoutTests/ChangeLog	2016-08-24 00:30:22 UTC (rev 204872)
@@ -1,3 +1,20 @@
+2016-08-23  Said Abou-Hallawa  <[email protected]>
+
+        REGRESSION: SVG clip-path doesn't work on root <svg>
+        https://bugs.webkit.org/show_bug.cgi?id=129180
+
+        Reviewed by Tim Horton.
+
+        * platform/efl/TestExpectations:
+        * platform/gtk/TestExpectations:
+        * platform/ios-simulator/TestExpectations:
+        * platform/mac/TestExpectations:
+        * platform/win/TestExpectations:
+        * svg/clip-path/clip-path-on-svg-003-expected.svg: Added.
+        * svg/clip-path/clip-path-on-svg-003.svg: Added.
+        * svg/clip-path/clip-path-on-svg-004-expected.svg: Added.
+        * svg/clip-path/clip-path-on-svg-004.svg: Added.
+
 2016-08-23  Chris Dumez  <[email protected]>
 
         HTMLAreaElement should have a stringifier

Modified: trunk/LayoutTests/platform/efl/TestExpectations (204871 => 204872)


--- trunk/LayoutTests/platform/efl/TestExpectations	2016-08-24 00:24:34 UTC (rev 204871)
+++ trunk/LayoutTests/platform/efl/TestExpectations	2016-08-24 00:30:22 UTC (rev 204872)
@@ -949,10 +949,6 @@
 
 webkit.org/b/125573 compositing/backgrounds/fixed-backgrounds.html [ Crash Pass ]
 
-# Regressions in svg/clip-path
-webkit.org/b/129180 svg/clip-path/clip-path-on-svg-001.svg [ ImageOnlyFailure Pass ]
-webkit.org/b/129180 svg/clip-path/clip-path-on-svg-002.svg [ ImageOnlyFailure Pass ]
-
 webkit.org/b/119789 fast/events/touch/touch-inside-iframe.html [ Crash Pass ]
 
 webkit.org/b/133305 fast/text/mark-matches-rendering.html [ ImageOnlyFailure Pass ]

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (204871 => 204872)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2016-08-24 00:24:34 UTC (rev 204871)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2016-08-24 00:30:22 UTC (rev 204872)
@@ -1274,8 +1274,6 @@
 webkit.org/b/118665 fast/regions/webkit-flow-float-unable-to-push.html [ ImageOnlyFailure Pass ]
 
 # Regressions in svg/clip-path
-webkit.org/b/129180 svg/clip-path/clip-path-on-svg-001.svg [ ImageOnlyFailure Pass ]
-webkit.org/b/129180 svg/clip-path/clip-path-on-svg-002.svg [ ImageOnlyFailure Pass ]
 webkit.org/b/115440 svg/stroke/animated-non-scaling-stroke.html [ ImageOnlyFailure Pass ]
 
 webkit.org/b/105296 webaudio/delaynode-maxdelay.html [ Pass Failure ]

Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (204871 => 204872)


--- trunk/LayoutTests/platform/ios-simulator/TestExpectations	2016-08-24 00:24:34 UTC (rev 204871)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations	2016-08-24 00:30:22 UTC (rev 204872)
@@ -1115,8 +1115,6 @@
 svg/carto.net/tabgroup.svg [ Failure ]
 svg/carto.net/textbox.svg [ Failure ]
 svg/carto.net/window.svg [ Failure ]
-svg/clip-path/clip-path-on-svg-001.svg [ ImageOnlyFailure ]
-svg/clip-path/clip-path-on-svg-002.svg [ ImageOnlyFailure ]
 svg/css/composite-shadow-example.html [ Failure ]
 svg/css/composite-shadow-with-opacity.html [ Failure ]
 svg/css/css-box-min-width.html [ Failure ]

Modified: trunk/LayoutTests/platform/mac/TestExpectations (204871 => 204872)


--- trunk/LayoutTests/platform/mac/TestExpectations	2016-08-24 00:24:34 UTC (rev 204871)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2016-08-24 00:30:22 UTC (rev 204872)
@@ -775,10 +775,6 @@
 webkit.org/b/122040 animations/combo-transform-translate+scale.html [ Pass Failure ]
 webkit.org/b/128379 animations/suspend-resume-animation.html [ Pass Failure ]
 
-# Regressions in svg/clip-path
-webkit.org/b/129180 svg/clip-path/clip-path-on-svg-001.svg [ ImageOnlyFailure ]
-webkit.org/b/129180 svg/clip-path/clip-path-on-svg-002.svg [ ImageOnlyFailure ]
-
 # Skipped for ios-simulator as well:
 webkit.org/b/129758 js/dom/create-lots-of-workers.html [ Skip ]
 

Modified: trunk/LayoutTests/platform/win/TestExpectations (204871 => 204872)


--- trunk/LayoutTests/platform/win/TestExpectations	2016-08-24 00:24:34 UTC (rev 204871)
+++ trunk/LayoutTests/platform/win/TestExpectations	2016-08-24 00:30:22 UTC (rev 204872)
@@ -1883,10 +1883,6 @@
 svg/animations/animate-linear-discrete-additive.svg [ Pass Timeout ]
 svg/custom/use-display-none.svg [ Pass Timeout ]
 
-# Regressions in svg/clip-path
-webkit.org/b/129180 svg/clip-path/clip-path-on-svg-001.svg [ ImageOnlyFailure ]
-webkit.org/b/129180 svg/clip-path/clip-path-on-svg-002.svg [ ImageOnlyFailure ]
-
 svg/clip-path/mask-objectboundingbox-content-clip.svg [ ImageOnlyFailure ]
 svg/clip-path/mask-userspaceonuse-content-clip.svg [ ImageOnlyFailure ]
 svg/custom/inline-svg-in-xhtml.xml [ Failure ]

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


--- trunk/LayoutTests/svg/clip-path/clip-path-on-svg-003-expected.svg	                        (rev 0)
+++ trunk/LayoutTests/svg/clip-path/clip-path-on-svg-003-expected.svg	2016-08-24 00:30:22 UTC (rev 204872)
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+    <rect x="25" y="25" width="150" height="150" fill="green"/>
+</svg>

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


--- trunk/LayoutTests/svg/clip-path/clip-path-on-svg-003.svg	                        (rev 0)
+++ trunk/LayoutTests/svg/clip-path/clip-path-on-svg-003.svg	2016-08-24 00:30:22 UTC (rev 204872)
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" clip-path="url(#clip1)">
+    <clipPath id="clip2">
+        <rect x="25" y="25" width="150" height="150"/>
+    </clipPath>
+    <clipPath id="clip1">
+        <rect x="50" y="50" width="100" height="100"/>
+    </clipPath>
+    <rect width="200" height="200" fill="green"/>
+    <script>
+        var svg = document.documentElement;
+        svg.setAttribute('clip-path','url(#clip2)');
+    </script>
+</svg>

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


--- trunk/LayoutTests/svg/clip-path/clip-path-on-svg-004-expected.svg	                        (rev 0)
+++ trunk/LayoutTests/svg/clip-path/clip-path-on-svg-004-expected.svg	2016-08-24 00:30:22 UTC (rev 204872)
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+    <rect x="25" y="25" width="150" height="150" fill="green"/>
+</svg>

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


--- trunk/LayoutTests/svg/clip-path/clip-path-on-svg-004.svg	                        (rev 0)
+++ trunk/LayoutTests/svg/clip-path/clip-path-on-svg-004.svg	2016-08-24 00:30:22 UTC (rev 204872)
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" clip-path="url(#clip1)">
+    <clipPath id="clip2">
+        <rect x="25" y="25" width="175" height="175"/>
+    </clipPath>
+    <clipPath id="clip1">
+        <rect width="175" height="175"/>
+    </clipPath>
+    <svg clip-path="url(#clip2)">
+        <rect width="200" height="200" fill="green"/>
+    </svg>
+</svg>

Modified: trunk/Source/WebCore/ChangeLog (204871 => 204872)


--- trunk/Source/WebCore/ChangeLog	2016-08-24 00:24:34 UTC (rev 204871)
+++ trunk/Source/WebCore/ChangeLog	2016-08-24 00:30:22 UTC (rev 204872)
@@ -1,3 +1,25 @@
+2016-08-23  Said Abou-Hallawa  <[email protected]>
+
+        REGRESSION: SVG clip-path doesn't work on root <svg>
+        https://bugs.webkit.org/show_bug.cgi?id=129180
+
+        Reviewed by Tim Horton.
+
+        Build the resources cache for the RenderSVGRoot element when it's been
+        inserted in the render tree. Remove the resources cache before removing
+        the RenderSVGRoot from the render tree. No worries for the child <svg>
+        elements since their renderers are of type RenderSVGViewportContainer.
+
+        Tests: svg/clip-path/clip-path-on-svg-003.svg
+               svg/clip-path/clip-path-on-svg-004.svg
+
+        * rendering/svg/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::insertedIntoTree):
+        (WebCore::RenderSVGRoot::willBeRemovedFromTree):
+        * rendering/svg/RenderSVGRoot.h:
+        These changes are very similar to what we do for adding and removing the
+        child SVG elements in RenderSVGRoot::addChild() and removeChild().
+
 2016-08-23  Chris Dumez  <[email protected]>
 
         HTMLAreaElement should have a stringifier

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp (204871 => 204872)


--- trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp	2016-08-24 00:24:34 UTC (rev 204871)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp	2016-08-24 00:30:22 UTC (rev 204872)
@@ -298,6 +298,18 @@
     RenderReplaced::willBeDestroyed();
 }
 
+void RenderSVGRoot::insertedIntoTree()
+{
+    RenderReplaced::insertedIntoTree();
+    SVGResourcesCache::clientWasAddedToTree(*this);
+}
+
+void RenderSVGRoot::willBeRemovedFromTree()
+{
+    SVGResourcesCache::clientWillBeRemovedFromTree(*this);
+    RenderReplaced::willBeRemovedFromTree();
+}
+
 void RenderSVGRoot::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     if (diff == StyleDifferenceLayout)

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h (204871 => 204872)


--- trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h	2016-08-24 00:24:34 UTC (rev 204871)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h	2016-08-24 00:30:22 UTC (rev 204872)
@@ -78,6 +78,10 @@
     void paintReplaced(PaintInfo&, const LayoutPoint&) override;
 
     void willBeDestroyed() override;
+
+    void insertedIntoTree() override;
+    void willBeRemovedFromTree() override;
+
     void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
     void addChild(RenderObject* child, RenderObject* beforeChild = 0) override;
     void removeChild(RenderObject&) override;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to