CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=182299
<rdar://problem/36853088>
Reviewed by Simon Fraser.
Source/WebCore:
Mostly speculative fix for the case where a scrollTo moves an
animated SVG image into view, causing its animation to restart during
a paint operation. This was causing a release ASSERT, so we now defer
the resumption of the animation into a timer.
Test: svg/animated-svgImage-scroll.html
* rendering/RenderElement.cpp:
(WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded): Enqueue the
animation if it is an SVGImage.
* svg/graphics/SVGImage.cpp: Add a timer to enqueue animation starts.
(WebCore::SVGImage::SVGImage):
(WebCore::SVGImage::startAnimationTimerFired):
(WebCore::SVGImage::enqueueStartAnimation):
(WebCore::SVGImage::stopAnimation):
* svg/graphics/SVGImage.h:
LayoutTests:
* svg/animated-svgImage-scroll-expected.txt: Added.
* svg/animated-svgImage-scroll.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@227841 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/svg/animated-svgImage-scroll.html b/LayoutTests/svg/animated-svgImage-scroll.html
new file mode 100644
index 0000000..47a2b58
--- /dev/null
+++ b/LayoutTests/svg/animated-svgImage-scroll.html
@@ -0,0 +1,41 @@
+<style>
+ #container {
+ overflow: scroll;
+ width: 300px;
+ height: 200px;
+ }
+ #expander {
+ background-color: blue;
+ height: 500px;
+ }
+</style>
+<p>Before text</p>
+<div id="container">
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <img src="resources/animated.svg" width="200" height="100"></img>
+ <p id="expander"></p>
+</div>
+<p>After text</p>
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+function run() {
+ let container = document.getElementById("container");
+ container.scrollTo(0, 1000);
+ setTimeout(function () {
+ let expander = document.getElementById("expander");
+ expander.style.height = "1px";
+ if (window.testRunner) {
+ setTimeout(function () {
+ testRunner.notifyDone();
+ }, 0);
+ }
+ }, 0);
+}
+
+window.addEventListener("load", run, false);
+</script>
\ No newline at end of file