Backed out changeset 57d71ba078d7 (bug 1932390) for causing wpt failures @ failures_A...
[gecko.git] / layout / reftests / transform / partial-prerender-expansion-with-resolution-1.html
blobd20027341a0c4d46f74299e64fc0c8c0071bd57c
1 <!DOCTYPE html>
2 <html class="reftest-wait reftest-no-flush" reftest-resolution="0.5">
3 <meta name="viewport" content="width=device-width,minimum-scale=0.5,initial-scale=1">
4 <!--
5 A test for a partial pre-rendered transform animation with <1.0 resolution.
6 -->
7 <style>
8 html {
9 scrollbar-width: none;
11 body {
12 margin: 0px;
13 padding: 0px;
15 @keyframes anim {
16 /* The reftest window size is (800x1000) and it's scaled by 0.5 */
17 /* (= 1600x2000), which means the partial pre-render size is (2250x2250) so */
18 /* move to a position inside the pre-render area and away from the */
19 /* pre-render right edge, translateX(-650px), so that we can avoid blurry */
20 /* edges in comparison with the reference. */
21 to { transform: translateX(-400px); }
23 #target {
24 width: 4000px;
25 height: 4000px;
26 position: absolute;
27 transform: translateX(0px);
29 </style>
30 <div id="target">
31 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4000 4000">
32 <rect fill="green" x="0" width="1600" height="4000"></rect>
33 <rect fill="blue" x="1600" width="650" height="4000"></rect>
34 <rect fill="red" x="2250" width="1750" height="4000"></rect>
35 </svg>
36 </div>
37 <script>
38 document.addEventListener("MozReftestInvalidate", () => {
39 target.style.animation = "anim 100s 1s step-start";
40 target.addEventListener("animationstart", () => {
41 // animationstart event is fired just before requestAnimationFrame callbacks,
42 // so we need to wait two rAF to make sure the initial animation value is
43 // composited on the compositor.
44 requestAnimationFrame(() => {
45 requestAnimationFrame(() => {
46 document.documentElement.classList.remove("reftest-wait");
47 });
48 });
49 });
50 }, { once: true });
51 </script>
52 </html>