OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="resources/text-based-repaint.js"></script> | 2 <script src="resources/text-based-repaint.js"></script> |
3 <script> | 3 <script> |
4 function repaintTest() { | 4 function repaintTest() { |
5 document.getElementById('fixed').style.height = '200px'; | 5 document.getElementById('fixed').style.height = '200px'; |
6 } | 6 } |
7 onload = function() { | 7 onload = function() { |
8 // Scroll before repaint test to test correct scroll offset of invalidation re
ct | 8 // Scroll before repaint test to test correct scroll offset of invalidation re
ct |
9 // for fixed-position element when it needs repaint. | 9 // for fixed-position element when it needs repaint. |
10 window.scrollTo(0, 400); | 10 window.scrollTo(0, 400); |
11 runRepaintAndPixelTest(); | 11 runRepaintAndPixelTest(); |
12 }; | 12 }; |
13 </script> | 13 </script> |
14 <style> | 14 <style> |
15 #indicator { | 15 #indicator { |
16 position: absolute; | 16 position: absolute; |
17 height: 200px; | 17 height: 220px; |
18 width: 100px; | 18 width: 120px; |
19 top: 400px; | 19 top: 400px; |
20 left: 0; | 20 left: 0; |
21 background-color: red; | 21 background-color: red; |
22 } | 22 } |
23 #absolute { | 23 #absolute { |
24 position: absolute; | 24 position: absolute; |
25 top: 2000px; | 25 top: 2000px; |
26 width: 1px; | 26 width: 1px; |
27 height: 1px; | 27 height: 1px; |
28 background-color: red; | 28 background-color: red; |
29 backface-visibility: hidden; | 29 backface-visibility: hidden; |
30 z-index: 1000; | 30 z-index: 1000; |
31 } | 31 } |
32 #fixed { | 32 #fixed { |
33 position: fixed; | |
34 /* Using 99% opacity to ensure fixed position is not automatically promoted. *
/ | 33 /* Using 99% opacity to ensure fixed position is not automatically promoted. *
/ |
35 opacity: 0.99; | 34 opacity: 0.99; |
| 35 position: fixed; |
36 top: 0; | 36 top: 0; |
37 left: 0; | 37 left: 0; |
38 width: 100px; | 38 width: 100px; |
39 height: 100px; | 39 height: 100px; |
| 40 border: 10px solid blue; |
40 background-color: green; | 41 background-color: green; |
41 } | 42 } |
42 </style> | 43 </style> |
43 Tests paint invalidation of fixed element under a composited absolute element on
resize after scrolled. | 44 Tests paint invalidation of fixed element under a composited absolute element on
resize after scrolled. |
44 Passes if there is a 100x200 green rectangle and no red. | 45 Passes if there is a 100x200 green rectangle with blue border and no red. |
45 <div id="indicator"></div> | 46 <div id="indicator"></div> |
46 <div id="absolute"> | 47 <div id="absolute"> |
47 <div id="fixed"> | 48 <div id="fixed"> |
48 </div> | 49 </div> |
49 </div> | 50 </div> |
OLD | NEW |