OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <script src="../resources/text-based-repaint.js"></script> | |
3 <script> | |
4 window.testIsAsync = true; | |
5 | |
6 // Disable under-invalidation checking because the "under-invalidation" of | |
7 // offscreen SVG animation is intentional. | |
8 if (window.internals) | |
9 internals.runtimeFlags.paintUnderInvalidationCheckingEnabled = false; | |
10 | |
11 function repaintTest() { | |
12 if (window.internals) | |
13 internals.advanceImageAnimation(testTarget); | |
14 requestAnimationFrame(function() { | |
15 finishRepaintTest(); | |
16 }); | |
17 } | |
18 | |
19 function targetImageOnload() { | |
20 // Scroll targetImage offscreen. | |
21 window.scrollTo(0, 1000); | |
22 runRepaintTest(); | |
23 } | |
24 | |
25 window.onload = function() { | |
26 targetImage.style.background = "url(../../../svg/as-image/resources/animated -rect-fixed-size-2.svg)"; | |
chrishtr
2017/03/30 15:42:35
Does this sufficiently test the case of an animate
fs
2017/03/31 10:32:46
Yes, this should trigger the code in LayoutBox::im
| |
27 | |
28 // Use a parallel image element as a hack to detect whether the image has lo aded, and therefore | |
29 // we'll get a frame. | |
chrishtr
2017/03/30 15:42:35
onload events don't work for SVG Images? Weird. Wh
fs
2017/03/31 10:32:46
They do, but for background images you won't get a
| |
30 testTarget.onload = targetImageOnload; | |
31 testTarget.src = "../../../svg/as-image/resources/animated-rect-fixed-size-2 .svg"; | |
32 } | |
33 </script> | |
34 <div style="height: 2000px; width: 2000px;"> | |
35 <div id="targetImage" style="width: 50px; height: 50px"></div> | |
36 <img id="testTarget" style="visibility: hidden"> | |
37 </div> | |
OLD | NEW |