3 <div style=
"height: 2000px; width: 2000px;">
6 <script src=
"../../fast/repaint/resources/text-based-repaint.js"></script>
8 window
.testIsAsync
= true;
10 // The image should not show a paint invalidation if offscreen if Slimming Paint is on.
11 // Otherwise it should.
15 // 2. Move the image offscreen
16 // 3. Start tracking paint invalidation rects
17 // 4. Call layoutAndPaintAsyncThen (via runRepaintTest, which does this for us) to draw a frame
18 // 5. Wait longer than 100ms, so that the timer between the first and second animated GIF
19 // frame expires and a paint invalidation is issued on the animated GIF. (100ms is the
20 // length of the first frame of the animation in the GIF file.)
21 // 6. Stop tracking paint invalidation rects (finishRepaintTest does this for us)
23 // These steps differ from a standard repaint test in that step 3 precedes step 4.
24 // This is critical because layoutAndPaintAsyncThen may take longer than the 100ms of the timer,
27 function repaintTest() {
28 setTimeout(finishRepaintTest
, 150);
31 function targetImageOnload() {
32 window
.scrollTo(0, 1000);
34 internals
.startTrackingRepaints(document
);
39 targetImage
.onload
= targetImageOnload
;
40 targetImage
.src
= "../../fast/backgrounds/resources/red-green-animated.gif";