| OLD | NEW |
| 1 <!doctype HTML> | 1 <!doctype HTML> |
| 2 <style>targetImage::first-line { color: yellow; }</style> | 2 <style>targetImage::first-line { color: yellow; }</style> |
| 3 <div style="height: 2000px; width: 2000px;"> | 3 <div style="height: 2000px; width: 2000px;"> |
| 4 <div id="targetImage" style="width: 50px; height: 50px">text text</div> | 4 <div id="targetImage" style="width: 50px; height: 50px">text text</div> |
| 5 <img id="testTarget" style="visibility: hidden"> | 5 <img id="testTarget" style="visibility: hidden"> |
| 6 </div> |
| 6 | 7 |
| 7 <script src="../../resources/run-after-layout-and-paint.js"></script> | 8 <script src="../../fast/repaint/resources/text-based-repaint.js"></script> |
| 8 <script> | 9 <script> |
| 9 // Similar to animated-gif-background-offscreen.html except that the element als
o | 10 window.testIsAsync = true; |
| 10 // has first-line style. Passes if no assertion failure. | |
| 11 | 11 |
| 12 if (window.testRunner) { | 12 // Disable under-invalidation checking because the "under-invalidation" of |
| 13 testRunner.dumpAsText(); | 13 // offscreen gif animation is intentional. |
| 14 testRunner.waitUntilDone(); | 14 if (window.internals) |
| 15 internals.runtimeFlags.paintUnderInvalidationCheckingEnabled = false; |
| 16 |
| 17 function repaintTest() { |
| 18 if (window.internals) |
| 19 internals.advanceImageAnimation(testTarget); |
| 20 requestAnimationFrame(function() { |
| 21 finishRepaintTest(); |
| 22 }); |
| 15 } | 23 } |
| 16 | 24 |
| 17 function targetImageOnload() { | 25 function targetImageOnload() { |
| 18 window.scrollTo(0, 100); | 26 // Scroll targetImage offscreen. |
| 19 runAfterLayoutAndPaint(function() { | 27 window.scrollTo(0, 1000); |
| 20 setTimeout(function() { | 28 runRepaintTest(); |
| 21 if (window.testRunner) | |
| 22 testRunner.notifyDone(); | |
| 23 }, 150); | |
| 24 }); | |
| 25 } | 29 } |
| 26 | 30 |
| 27 onload = function() { | 31 onload = function() { |
| 28 targetImage.style.background = "url(../../fast/backgrounds/resources/red-gre
en-animated.gif)"; | 32 targetImage.style.background = "url(../../fast/backgrounds/resources/red-gre
en-animated.gif)"; |
| 29 | 33 |
| 30 // Use a parallel image element as a hack to detect whether the image has lo
aded, and therefore | 34 // Use a parallel image element as a hack to detect whether the image has lo
aded, and therefore |
| 31 // we'll get a frame. | 35 // we'll get a frame. |
| 32 testTarget.onload = targetImageOnload; | 36 testTarget.onload = targetImageOnload; |
| 33 testTarget.src = "../../fast/backgrounds/resources/red-green-animated.gif"; | 37 testTarget.src = "../../fast/backgrounds/resources/red-green-animated.gif"; |
| 34 } | 38 } |
| 35 </script> | 39 </script> |
| OLD | NEW |