2011-02-03 Justin Schuh <jschuh@chromium.org>
authorjschuh@chromium.org <jschuh@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Feb 2011 00:07:45 +0000 (00:07 +0000)
committerjschuh@chromium.org <jschuh@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Feb 2011 00:07:45 +0000 (00:07 +0000)
        Reviewed by Dirk Schulze.

        startAnimations should use a local, RefCounted Vector.
        https://bugs.webkit.org/show_bug.cgi?id=53458

        Test: svg/custom/use-animation-in-fill.html

        * svg/SVGDocumentExtensions.cpp:
        (WebCore::SVGDocumentExtensions::startAnimations):
2011-02-03  Justin Schuh  <jschuh@chromium.org>

        Reviewed by Dirk Schulze.

        startAnimations should use a local, RefCounted Vector.
        https://bugs.webkit.org/show_bug.cgi?id=53458

        * svg/custom/use-animation-in-fill-expected.txt: Added.
        * svg/custom/use-animation-in-fill.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77548 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/svg/custom/use-animation-in-fill-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/use-animation-in-fill.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/svg/SVGDocumentExtensions.cpp

index 928a4a422a88fb8a81bfbce7975874a7e2ee670f..5fa09d3595f1ea6bb7534e540d83f416311b48c0 100644 (file)
@@ -1,3 +1,13 @@
+2011-02-03  Justin Schuh  <jschuh@chromium.org>
+
+        Reviewed by Dirk Schulze.
+
+        startAnimations should use a local, RefCounted Vector.
+        https://bugs.webkit.org/show_bug.cgi?id=53458
+
+        * svg/custom/use-animation-in-fill-expected.txt: Added.
+        * svg/custom/use-animation-in-fill.html: Added.
+
 2011-02-03  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         Unreviewed.
diff --git a/LayoutTests/svg/custom/use-animation-in-fill-expected.txt b/LayoutTests/svg/custom/use-animation-in-fill-expected.txt
new file mode 100644 (file)
index 0000000..3c535c5
--- /dev/null
@@ -0,0 +1 @@
+PASS: Referenced animation does not trigger crash.
diff --git a/LayoutTests/svg/custom/use-animation-in-fill.html b/LayoutTests/svg/custom/use-animation-in-fill.html
new file mode 100644 (file)
index 0000000..ae6f048
--- /dev/null
@@ -0,0 +1,23 @@
+<svg>
+  <defs>
+    <g id="g">
+      <svg>
+        <linearGradient>
+          <animateTransform attributeName="a">
+        </linearGradient>
+      </svg>
+    </g>
+  </defs>
+  <use xlink:href="#g"></use>
+</svg>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+}
+setTimeout(function () {
+        document.body.innerHTML = "PASS: Referenced animation does not trigger crash.";
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+    }, 0);
+</script>
index 5806a675ca07139d1b871cb228ad6f53f366eaec..89ff2848eaffae47f334edf6af932ba235824790 100644 (file)
@@ -1,3 +1,15 @@
+2011-02-03  Justin Schuh  <jschuh@chromium.org>
+
+        Reviewed by Dirk Schulze.
+
+        startAnimations should use a local, RefCounted Vector.
+        https://bugs.webkit.org/show_bug.cgi?id=53458
+
+        Test: svg/custom/use-animation-in-fill.html
+
+        * svg/SVGDocumentExtensions.cpp:
+        (WebCore::SVGDocumentExtensions::startAnimations):
+
 2011-02-03  Adam Barth  <abarth@webkit.org>
 
         Reviewed by Daniel Bates.
index 3fd976137b520d9e6bf67da767cfda1634a33adc..7f7ba67133568f98d1e27965e6827cb8788e3d5d 100644 (file)
@@ -93,8 +93,12 @@ void SVGDocumentExtensions::startAnimations()
     // FIXME: Eventually every "Time Container" will need a way to latch on to some global timer
     // starting animations for a document will do this "latching"
 #if ENABLE(SVG_ANIMATION)    
-    HashSet<SVGSVGElement*>::iterator end = m_timeContainers.end();
-    for (HashSet<SVGSVGElement*>::iterator itr = m_timeContainers.begin(); itr != end; ++itr)
+    // FIXME: We hold a ref pointers to prevent a shadow tree from getting removed out from underneath us.
+    // In the future we should refactor the use-element to avoid this. See https://webkit.org/b/53704
+    Vector<RefPtr<SVGSVGElement> > timeContainers;
+    timeContainers.appendRange(m_timeContainers.begin(), m_timeContainers.end());
+    Vector<RefPtr<SVGSVGElement> >::iterator end = timeContainers.end();
+    for (Vector<RefPtr<SVGSVGElement> >::iterator itr = timeContainers.begin(); itr != end; ++itr)
         (*itr)->timeContainer()->begin();
 #endif
 }