Title: [143957] branches/chromium/1410
- Revision
- 143957
- Author
- [email protected]
- Date
- 2013-02-25 12:27:41 -0800 (Mon, 25 Feb 2013)
Log Message
Merge 143640
> Stop starting animations when leaving a page
> https://bugs.webkit.org/show_bug.cgi?id=110257
>
> Reviewed by Stephen Chenney.
>
> Source/WebCore:
>
> SVGImage::resetAnimation() incorrectly started animations which could cause a crash
> when leaving the page. This patch fixes resetAnimation to only stop the animation,
> similar to BitmapImage::resetAnimation().
>
> Additionally, this patch removes an unneeded call to Document::updateStyleForAllDocuments()
> that was present in the animation loop. This makes the animation code more resistant to
> similar bugs in the future.
>
> Both of these changes are functionally covered with existing tests.
>
> Test: svg/animations/reset-animation-crash.html
>
> * svg/animation/SMILTimeContainer.cpp:
> (WebCore::SMILTimeContainer::updateAnimations):
> * svg/graphics/SVGImage.cpp:
> (WebCore::SVGImage::resetAnimation):
>
> LayoutTests:
>
> * svg/animations/reset-animation-crash-expected.html: Added.
> * svg/animations/reset-animation-crash.html: Added.
>
[email protected]
Review URL: https://codereview.chromium.org/12310113
Modified Paths
Added Paths
Diff
Copied: branches/chromium/1410/LayoutTests/svg/animations/reset-animation-crash-expected.html (from rev 143640, trunk/LayoutTests/svg/animations/reset-animation-crash-expected.html) (0 => 143957)
--- branches/chromium/1410/LayoutTests/svg/animations/reset-animation-crash-expected.html (rev 0)
+++ branches/chromium/1410/LayoutTests/svg/animations/reset-animation-crash-expected.html 2013-02-25 20:27:41 UTC (rev 143957)
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+<body>
+ Test for WK110257: This test passes if it does not crash.
+</body>
+</html>
+
Copied: branches/chromium/1410/LayoutTests/svg/animations/reset-animation-crash.html (from rev 143640, trunk/LayoutTests/svg/animations/reset-animation-crash.html) (0 => 143957)
--- branches/chromium/1410/LayoutTests/svg/animations/reset-animation-crash.html (rev 0)
+++ branches/chromium/1410/LayoutTests/svg/animations/reset-animation-crash.html 2013-02-25 20:27:41 UTC (rev 143957)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style id='style'>
+ #div {
+ -webkit-mask-image: url('resources/remove-animation-element-while-animation-is-running.svg');
+ }
+</style>
+<script>
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ function setupCrash() {
+ setTimeout("crash()", 1);
+ }
+
+ function crash() {
+ var styleEl = document.getElementById('style');
+ styleEl.parentNode.removeChild(styleEl);
+ var divEl = document.getElementById('div');
+ document.adoptNode(divEl);
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }
+</script>
+</head>
+<body _onload_="setupCrash()">
+ Test for WK110257: This test passes if it does not crash.
+ <div id='div'></div>
+</body>
+</html>
+
Modified: branches/chromium/1410/Source/WebCore/svg/animation/SMILTimeContainer.cpp (143956 => 143957)
--- branches/chromium/1410/Source/WebCore/svg/animation/SMILTimeContainer.cpp 2013-02-25 20:23:58 UTC (rev 143956)
+++ branches/chromium/1410/Source/WebCore/svg/animation/SMILTimeContainer.cpp 2013-02-25 20:27:41 UTC (rev 143957)
@@ -323,7 +323,6 @@
#endif
startTimer(earliestFireTime, animationFrameDelay);
- Document::updateStyleForAllDocuments();
}
}
Modified: branches/chromium/1410/Source/WebCore/svg/graphics/SVGImage.cpp (143956 => 143957)
--- branches/chromium/1410/Source/WebCore/svg/graphics/SVGImage.cpp 2013-02-25 20:23:58 UTC (rev 143956)
+++ branches/chromium/1410/Source/WebCore/svg/graphics/SVGImage.cpp 2013-02-25 20:27:41 UTC (rev 143957)
@@ -281,7 +281,6 @@
void SVGImage::resetAnimation()
{
stopAnimation();
- startAnimation();
}
bool SVGImage::dataChanged(bool allDataReceived)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes