Diff
Modified: branches/safari-600.1.4.15-branch/LayoutTests/ChangeLog (179145 => 179146)
--- branches/safari-600.1.4.15-branch/LayoutTests/ChangeLog 2015-01-26 22:44:19 UTC (rev 179145)
+++ branches/safari-600.1.4.15-branch/LayoutTests/ChangeLog 2015-01-26 22:50:15 UTC (rev 179146)
@@ -1,5 +1,30 @@
2015-01-26 David Kilzer <[email protected]>
+ Merge r177927.
+
+ 2015-01-05 Chris Dumez <[email protected]>
+
+ Regression(r163928): Animated images are not resumed on window resizing
+ https://bugs.webkit.org/show_bug.cgi?id=139714
+ <rdar://problem/18855285>
+
+ Reviewed by Darin Adler.
+
+ Add a layout test to make sure animated images are correctly paused /
+ resumed when resizing the window.
+
+ Also add another test to make sure animated images are correctly paused
+ / resumed when zooming in and out.
+
+ * fast/images/animated-gif-window-resizing-expected.txt: Added.
+ * fast/images/animated-gif-window-resizing.html: Added.
+ * fast/images/animated-gif-zooming-expected.txt: Added.
+ * fast/images/animated-gif-zooming.html: Added.
+ * fast/images/resources/animated-gif-window-resize.html: Added.
+ * platform/mac-wk1/TestExpectations:
+
+2015-01-26 David Kilzer <[email protected]>
+
Merge r177404.
2014-12-16 Myles C. Maxfield <[email protected]>
Added: branches/safari-600.1.4.15-branch/LayoutTests/fast/images/animated-gif-window-resizing-expected.txt (0 => 179146)
--- branches/safari-600.1.4.15-branch/LayoutTests/fast/images/animated-gif-window-resizing-expected.txt (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/fast/images/animated-gif-window-resizing-expected.txt 2015-01-26 22:50:15 UTC (rev 179146)
@@ -0,0 +1,13 @@
+Test that animated images are properly stopped / resumed on window resizing.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+The animated GIF should initially be outside the viewport.
+PASS isImagePaused() became true
+Resize window so that the image is now inside the viewport.
+PASS isImagePaused() became false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: branches/safari-600.1.4.15-branch/LayoutTests/fast/images/animated-gif-window-resizing.html (0 => 179146)
--- branches/safari-600.1.4.15-branch/LayoutTests/fast/images/animated-gif-window-resizing.html (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/fast/images/animated-gif-window-resizing.html 2015-01-26 22:50:15 UTC (rev 179146)
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body _onload_="runTest()">
+<script>
+description("Test that animated images are properly stopped / resumed on window resizing.");
+jsTestIsAsync = true;
+
+var testWindow;
+
+function isImagePaused()
+{
+ return internals.hasPausedImageAnimations(testWindow.document.getElementById("testImage"));
+}
+
+function enlargeWindow()
+{
+ debug("Resize window so that the image is now inside the viewport.");
+ testWindow.resizeTo(500, 500);
+ shouldBecomeEqual("isImagePaused()", "false", finishJSTest);
+}
+
+function windowLoaded()
+{
+ debug("The animated GIF should initially be outside the viewport.");
+ shouldBecomeEqual("isImagePaused()", "true", enlargeWindow);
+}
+
+function runTest()
+{
+ if (window.testRunner)
+ testRunner.setCanOpenWindows();
+
+ testWindow = window.open("resources/animated-gif-window-resize.html", "testWindow", "width=200, height=200");
+ testWindow._onload_ = windowLoaded;
+}
+
+</script>
+<script src=""
+</body>
+</html>
Added: branches/safari-600.1.4.15-branch/LayoutTests/fast/images/animated-gif-zooming-expected.txt (0 => 179146)
--- branches/safari-600.1.4.15-branch/LayoutTests/fast/images/animated-gif-zooming-expected.txt (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/fast/images/animated-gif-zooming-expected.txt 2015-01-26 22:50:15 UTC (rev 179146)
@@ -0,0 +1,14 @@
+Make sure that animated images are properly stopped / resumed when zooming in or out.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS isImageAnimated() became false
+Zoom out so that the image becomes visible.
+PASS isImageAnimated() became true
+Zoom in so that the image is no longer visible.
+PASS isImageAnimated() became false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: branches/safari-600.1.4.15-branch/LayoutTests/fast/images/animated-gif-zooming.html (0 => 179146)
--- branches/safari-600.1.4.15-branch/LayoutTests/fast/images/animated-gif-zooming.html (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/fast/images/animated-gif-zooming.html 2015-01-26 22:50:15 UTC (rev 179146)
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body _onload_="runTest()">
+<div style="position: relative; width: 1600px; height: 2400px; background-color: green;">
+ <div style="position:absolute; left: 600px; top: 800px;"><img src="" id="testImage"/></div>
+</div>
+<script>
+description("Make sure that animated images are properly stopped / resumed when zooming in or out.");
+jsTestIsAsync = true;
+
+function isImageAnimated()
+{
+ return !internals.hasPausedImageAnimations(document.getElementById("testImage"));
+}
+
+function zoomIn() {
+ debug("Zoom in so that the image is no longer visible.");
+ for (var i = 0; i < 5; ++i)
+ window.eventSender.zoomPageIn();
+
+ shouldBecomeEqual("isImageAnimated()", "false", finishJSTest);
+}
+
+function zoomOut() {
+ debug("Zoom out so that the image becomes visible.");
+
+ for (var i = 0; i < 5; ++i)
+ window.eventSender.zoomPageOut();
+
+ shouldBecomeEqual("isImageAnimated()", "true", zoomIn);
+}
+
+function imageLoaded() {
+ shouldBecomeEqual("isImageAnimated()", "false", zoomOut);
+}
+
+function runTest() {
+ if (!window.internals)
+ return;
+
+ var img = new Image();
+ // Make sure the image is loaded before we check if it is animated.
+ img._onload_ = imageLoaded;
+ img.src = ""
+}
+</script>
+<script src=""
+</body>
+</html>
Added: branches/safari-600.1.4.15-branch/LayoutTests/fast/images/resources/animated-gif-window-resize.html (0 => 179146)
--- branches/safari-600.1.4.15-branch/LayoutTests/fast/images/resources/animated-gif-window-resize.html (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/fast/images/resources/animated-gif-window-resize.html 2015-01-26 22:50:15 UTC (rev 179146)
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+<img src="" id="testImage" style="position: absolute; left: 250px; top: 250px;"/>
+</body>
+</html>
Modified: branches/safari-600.1.4.15-branch/LayoutTests/platform/mac-wk1/TestExpectations (179145 => 179146)
--- branches/safari-600.1.4.15-branch/LayoutTests/platform/mac-wk1/TestExpectations 2015-01-26 22:44:19 UTC (rev 179145)
+++ branches/safari-600.1.4.15-branch/LayoutTests/platform/mac-wk1/TestExpectations 2015-01-26 22:50:15 UTC (rev 179146)
@@ -49,5 +49,10 @@
# Disable snapshotting tests on WK1 only
plugins/snapshotting
+# Animated image throttling behaves differently on WK1.
+fast/images/animated-gif-body-outside-viewport.html [ Skip ]
+fast/images/animated-gif-window-resizing.html [ Skip ]
+fast/images/animated-gif-zooming.html [ Skip ]
+
### END OF (2) Failures without bug reports
########################################
Modified: branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog (179145 => 179146)
--- branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog 2015-01-26 22:44:19 UTC (rev 179145)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog 2015-01-26 22:50:15 UTC (rev 179146)
@@ -1,5 +1,27 @@
2015-01-26 David Kilzer <[email protected]>
+ Merge r177927.
+
+ 2015-01-05 Chris Dumez <[email protected]>
+
+ Regression(r163928): Animated images are not resumed on window resizing
+ https://bugs.webkit.org/show_bug.cgi?id=139714
+ <rdar://problem/18855285>
+
+ Reviewed by Darin Adler.
+
+ After r163928, animated images were not resumed if they became visible
+ after resizing the window. This patch calls resumes animated images if
+ necessary in FrameView::setFrameRect() to handle this case properly.
+
+ Tests: fast/images/animated-gif-window-resizing.html
+ fast/images/animated-gif-zooming.html
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::setFrameRect):
+
+2015-01-26 David Kilzer <[email protected]>
+
Merge r177404.
2014-12-16 Myles C. Maxfield <[email protected]>
Modified: branches/safari-600.1.4.15-branch/Source/WebCore/page/FrameView.cpp (179145 => 179146)
--- branches/safari-600.1.4.15-branch/Source/WebCore/page/FrameView.cpp 2015-01-26 22:44:19 UTC (rev 179145)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/page/FrameView.cpp 2015-01-26 22:50:15 UTC (rev 179146)
@@ -435,6 +435,9 @@
if (renderView->usesCompositing())
renderView->compositor().frameViewDidChangeSize();
}
+
+ // The frame view was resized, check if we should resume animated images.
+ resumeVisibleImageAnimationsIncludingSubframes();
}
#if ENABLE(REQUEST_ANIMATION_FRAME)