ASSERTION FAILED: !canAnimate() && !m_currentFrame
[WebKit.git] / LayoutTests / fast / images / animated-gif-paint-after-animation.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5     if (window.internals && window.testRunner) {
6         internals.clearMemoryCache();
7         internals.settings.setLargeImageAsyncDecodingEnabled(true);
8         internals.settings.setWebkitImageReadyEventEnabled(true);
9         testRunner.dumpAsText(true);
10         testRunner.waitUntilDone();
11     }
12 </script>
13 </head>
14 <body>
15     PASS if no assertion failure
16     <img>
17     <script>
18         var img = document.getElementsByTagName('img')[0];
19         img.onload = function() {
20             // Force layout and display so the image frame starts decoding.
21             document.body.offsetHeight;
22             if (window.testRunner)
23                 testRunner.display();
24         }
25         img.addEventListener("webkitImageFrameReady", function() {
26             // Force the page to be displayed. The image element is already invalidated when the frame finished decoding.
27             if (window.testRunner)
28                 testRunner.display();
29             // Change the width of the img element
30             img.width = "100";
31             // notifyDone() will force the last layout and display.
32             if (window.testRunner)
33                 testRunner.notifyDone();
34         });
35         img.src = 'resources/animated-red-green-1000x1000-repeat-1.gif';
36     </script>
37 </body>
38 </html>