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