OLD | NEW |
1 <!doctype HTML> | 1 <!doctype HTML> |
2 <body> | 2 <body> |
3 <div id="targetDiv" style="height: 2000px; width: 2000px; will-change: transform
"> | 3 <div id="targetDiv" style="height: 2000px; width: 2000px; will-change: transform
"> |
4 <img id="targetImage"> | 4 <img id="targetImage"> |
5 </div> | 5 </div> |
6 <script src="../../fast/repaint/resources/text-based-repaint.js"></script> | 6 <script src="resources/text-based-repaint.js"></script> |
7 <script> | 7 <script> |
8 window.testIsAsync = true; | 8 window.testIsAsync = true; |
9 | 9 |
10 // Disable under-invalidation checking because the "under-invalidation" of | 10 // Disable under-invalidation checking because the "under-invalidation" of |
11 // offscreen gif animation is intentional. | 11 // offscreen gif animation is intentional. |
12 if (window.internals) | 12 if (window.internals) |
13 internals.runtimeFlags.paintUnderInvalidationCheckingEnabled = false; | 13 internals.runtimeFlags.paintUnderInvalidationCheckingEnabled = false; |
14 | 14 |
15 function repaintTest() { | 15 function repaintTest() { |
16 if (window.internals) | 16 if (window.internals) |
17 internals.advanceImageAnimation(targetImage); | 17 internals.advanceImageAnimation(targetImage); |
18 requestAnimationFrame(function() { | 18 requestAnimationFrame(function() { |
19 finishRepaintTest(); | 19 finishRepaintTest(); |
20 }); | 20 }); |
21 } | 21 } |
22 | 22 |
23 function targetImageOnload() { | 23 function targetImageOnload() { |
24 targetDiv.style.transform = "translateY(-1000px)"; | 24 targetDiv.style.transform = "translateY(-1000px)"; |
25 runRepaintTest(); | 25 runRepaintTest(); |
26 } | 26 } |
27 | 27 |
28 window.onload = function() { | 28 window.onload = function() { |
29 targetImage.onload = targetImageOnload; | 29 targetImage.onload = targetImageOnload; |
30 targetImage.src="../../fast/backgrounds/resources/red-green-animated.gif"; | 30 targetImage.src="../../fast/backgrounds/resources/red-green-animated.gif"; |
31 } | 31 } |
32 </script> | 32 </script> |
OLD | NEW |