Title: [115730] trunk
Revision
115730
Author
p...@google.com
Date
2012-05-01 09:10:33 -0700 (Tue, 01 May 2012)

Log Message

Skip building instance tree for disallowed target
https://bugs.webkit.org/show_bug.cgi?id=85202

Reviewed by Nikolas Zimmermann.

Source/WebCore:

When the target of a use is disallowed (e.g., a mask element) we can
skip building the instance tree because the shadow tree will be
skipped as well.

Test: svg/custom/animate-disallowed-mask-element.svg

* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::buildInstanceTree):

LayoutTests:

* platform/chromium-win/svg/custom/use-on-disallowed-foreign-object-3-expected.txt:
* platform/gtk/svg/custom/use-on-disallowed-foreign-object-3-expected.txt:
* platform/mac/svg/custom/use-on-disallowed-foreign-object-3-expected.txt:
* platform/qt/svg/custom/use-on-disallowed-foreign-object-3-expected.txt:
* svg/custom/animate-disallowed-mask-element-expected.txt: Added.
* svg/custom/animate-disallowed-mask-element.svg: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (115729 => 115730)


--- trunk/LayoutTests/ChangeLog	2012-05-01 15:52:01 UTC (rev 115729)
+++ trunk/LayoutTests/ChangeLog	2012-05-01 16:10:33 UTC (rev 115730)
@@ -1,3 +1,17 @@
+2012-05-01  Philip Rogers  <p...@google.com>
+
+        Skip building instance tree for disallowed target
+        https://bugs.webkit.org/show_bug.cgi?id=85202
+
+        Reviewed by Nikolas Zimmermann.
+
+        * platform/chromium-win/svg/custom/use-on-disallowed-foreign-object-3-expected.txt:
+        * platform/gtk/svg/custom/use-on-disallowed-foreign-object-3-expected.txt:
+        * platform/mac/svg/custom/use-on-disallowed-foreign-object-3-expected.txt:
+        * platform/qt/svg/custom/use-on-disallowed-foreign-object-3-expected.txt:
+        * svg/custom/animate-disallowed-mask-element-expected.txt: Added.
+        * svg/custom/animate-disallowed-mask-element.svg: Added.
+
 2012-04-29  Nikolas Zimmermann  <nzimmerm...@rim.com>
 
         Accumulation for values-animation is broken

Modified: trunk/LayoutTests/platform/chromium-win/svg/custom/use-on-disallowed-foreign-object-3-expected.txt (115729 => 115730)


--- trunk/LayoutTests/platform/chromium-win/svg/custom/use-on-disallowed-foreign-object-3-expected.txt	2012-05-01 15:52:01 UTC (rev 115729)
+++ trunk/LayoutTests/platform/chromium-win/svg/custom/use-on-disallowed-foreign-object-3-expected.txt	2012-05-01 16:10:33 UTC (rev 115730)
@@ -8,4 +8,3 @@
           text run at (0,0) width 230: "You should only see this string ONCE"
     RenderSVGContainer {use} at (0,0) size 0x0 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(250.00,-35.86)}]
     RenderSVGContainer {use} at (0,0) size 0x0 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(250.00,-35.86)}]
-      RenderSVGContainer {g} at (0,0) size 0x0 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(250.00,-35.86)}]

Modified: trunk/LayoutTests/platform/gtk/svg/custom/use-on-disallowed-foreign-object-3-expected.txt (115729 => 115730)


--- trunk/LayoutTests/platform/gtk/svg/custom/use-on-disallowed-foreign-object-3-expected.txt	2012-05-01 15:52:01 UTC (rev 115729)
+++ trunk/LayoutTests/platform/gtk/svg/custom/use-on-disallowed-foreign-object-3-expected.txt	2012-05-01 16:10:33 UTC (rev 115730)
@@ -8,4 +8,3 @@
           text run at (0,0) width 244: "You should only see this string ONCE"
     RenderSVGContainer {use} at (0,0) size 0x0 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(250.00,-35.86)}]
     RenderSVGContainer {use} at (0,0) size 0x0 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(250.00,-35.86)}]
-      RenderSVGContainer {g} at (0,0) size 0x0 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(250.00,-35.86)}]

Modified: trunk/LayoutTests/platform/mac/svg/custom/use-on-disallowed-foreign-object-3-expected.txt (115729 => 115730)


--- trunk/LayoutTests/platform/mac/svg/custom/use-on-disallowed-foreign-object-3-expected.txt	2012-05-01 15:52:01 UTC (rev 115729)
+++ trunk/LayoutTests/platform/mac/svg/custom/use-on-disallowed-foreign-object-3-expected.txt	2012-05-01 16:10:33 UTC (rev 115730)
@@ -8,4 +8,3 @@
           text run at (0,0) width 244: "You should only see this string ONCE"
     RenderSVGContainer {use} at (0,0) size 0x0 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(250.00,-35.86)}]
     RenderSVGContainer {use} at (0,0) size 0x0 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(250.00,-35.86)}]
-      RenderSVGContainer {g} at (0,0) size 0x0 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(250.00,-35.86)}]

Modified: trunk/LayoutTests/platform/qt/svg/custom/use-on-disallowed-foreign-object-3-expected.txt (115729 => 115730)


--- trunk/LayoutTests/platform/qt/svg/custom/use-on-disallowed-foreign-object-3-expected.txt	2012-05-01 15:52:01 UTC (rev 115729)
+++ trunk/LayoutTests/platform/qt/svg/custom/use-on-disallowed-foreign-object-3-expected.txt	2012-05-01 16:10:33 UTC (rev 115730)
@@ -8,4 +8,3 @@
           text run at (0,0) width 268: "You should only see this string ONCE"
     RenderSVGContainer {use} at (0,0) size 0x0 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(250.00,-35.86)}]
     RenderSVGContainer {use} at (0,0) size 0x0 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(250.00,-35.86)}]
-      RenderSVGContainer {g} at (0,0) size 0x0 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(250.00,-35.86)}]

Added: trunk/LayoutTests/svg/custom/animate-disallowed-mask-element-expected.txt (0 => 115730)


--- trunk/LayoutTests/svg/custom/animate-disallowed-mask-element-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/animate-disallowed-mask-element-expected.txt	2012-05-01 16:10:33 UTC (rev 115730)
@@ -0,0 +1 @@
+PASS: Animating pruned shadow tree did not cause a crash.

Added: trunk/LayoutTests/svg/custom/animate-disallowed-mask-element.svg (0 => 115730)


--- trunk/LayoutTests/svg/custom/animate-disallowed-mask-element.svg	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/animate-disallowed-mask-element.svg	2012-05-01 16:10:33 UTC (rev 115730)
@@ -0,0 +1,17 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Test for wkbug.com/85202: Passes if a crash does not occur. -->
+    <script>
+        window._onload_ = function() {
+            if (window.layoutTestController) {
+                layoutTestController.dumpAsText();
+                layoutTestController.waitUntilDone();
+                setTimeout(function(){ layoutTestController.notifyDone() }, 0);
+            }
+        }
+    </script>
+    <mask id="mask"><a id="foo"/></mask>
+    <animateMotion xlink:href=""
+    <use xlink:href="" id="use"/>
+    <use xlink:href=""
+    <text x="20" y="20" fill="green">PASS: Animating pruned shadow tree did not cause a crash.</text>
+</svg>

Modified: trunk/Source/WebCore/ChangeLog (115729 => 115730)


--- trunk/Source/WebCore/ChangeLog	2012-05-01 15:52:01 UTC (rev 115729)
+++ trunk/Source/WebCore/ChangeLog	2012-05-01 16:10:33 UTC (rev 115730)
@@ -1,3 +1,19 @@
+2012-05-01  Philip Rogers  <p...@google.com>
+
+        Skip building instance tree for disallowed target
+        https://bugs.webkit.org/show_bug.cgi?id=85202
+
+        Reviewed by Nikolas Zimmermann.
+
+        When the target of a use is disallowed (e.g., a mask element) we can
+        skip building the instance tree because the shadow tree will be
+        skipped as well.
+
+        Test: svg/custom/animate-disallowed-mask-element.svg
+
+        * svg/SVGUseElement.cpp:
+        (WebCore::SVGUseElement::buildInstanceTree):
+
 2012-04-29  Nikolas Zimmermann  <nzimmerm...@rim.com>
 
         Accumulation for values-animation is broken

Modified: trunk/Source/WebCore/svg/SVGUseElement.cpp (115729 => 115730)


--- trunk/Source/WebCore/svg/SVGUseElement.cpp	2012-05-01 15:52:01 UTC (rev 115729)
+++ trunk/Source/WebCore/svg/SVGUseElement.cpp	2012-05-01 16:10:33 UTC (rev 115730)
@@ -595,6 +595,9 @@
         foundProblem = hasCycleUseReferencing(static_cast<SVGUseElement*>(target), targetInstance, newTarget);
         if (foundProblem)
             return;
+    } else if (isDisallowedElement(target)) {
+        foundProblem = true;
+        return;
     }
 
     // A general description from the SVG spec, describing what buildInstanceTree() actually does.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to