| 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 function repaintTest() { |
| 13 testRunner.dumpAsText(); | 13 if (window.internals) |
| 14 testRunner.waitUntilDone(); | 14 internals.advanceImageAnimation(testTarget); |
| 15 requestAnimationFrame(function() { |
| 16 finishRepaintTest(); |
| 17 }); |
| 15 } | 18 } |
| 16 | 19 |
| 17 function targetImageOnload() { | 20 function targetImageOnload() { |
| 18 window.scrollTo(0, 100); | 21 // Scroll targetImage offscreen. |
| 19 runAfterLayoutAndPaint(function() { | 22 window.scrollTo(0, 1000); |
| 20 setTimeout(function() { | 23 runRepaintTest(); |
| 21 if (window.testRunner) | |
| 22 testRunner.notifyDone(); | |
| 23 }, 150); | |
| 24 }); | |
| 25 } | 24 } |
| 26 | 25 |
| 27 onload = function() { | 26 onload = function() { |
| 28 targetImage.style.background = "url(../../fast/backgrounds/resources/red-gre
en-animated.gif)"; | 27 targetImage.style.background = "url(../../fast/backgrounds/resources/red-gre
en-animated.gif)"; |
| 29 | 28 |
| 30 // Use a parallel image element as a hack to detect whether the image has lo
aded, and therefore | 29 // Use a parallel image element as a hack to detect whether the image has lo
aded, and therefore |
| 31 // we'll get a frame. | 30 // we'll get a frame. |
| 32 testTarget.onload = targetImageOnload; | 31 testTarget.onload = targetImageOnload; |
| 33 testTarget.src = "../../fast/backgrounds/resources/red-green-animated.gif"; | 32 testTarget.src = "../../fast/backgrounds/resources/red-green-animated.gif"; |
| 34 } | 33 } |
| 35 </script> | 34 </script> |
| OLD | NEW |