OLD | NEW |
| 1 <!-- Based on fast/repaint/fixed-under-composited-fixed-scrolled.html --> |
1 <!DOCTYPE html> | 2 <!DOCTYPE html> |
2 <script src="resources/text-based-repaint.js"></script> | 3 <script src="resources/paint-invalidation-test.js"></script> |
3 <script> | 4 <script> |
4 function repaintTest() { | 5 window.expectedPaintInvalidationObjects = [ |
| 6 "LayoutBlockFlow (positioned) DIV id='fixed'", |
| 7 ]; |
| 8 function paintInvalidationTest() { |
5 document.getElementById('fixed').style.display = 'none'; | 9 document.getElementById('fixed').style.display = 'none'; |
6 } | 10 } |
7 onload = function() { | 11 onload = function() { |
8 // Scroll before repaint test to test correct scroll offset of invalidation re
ct | 12 // Scroll before repaint test to test correct scroll offset of invalidation re
ct |
9 // for fixed-position element when it needs repaint. | 13 // for fixed-position element when it needs repaint. |
10 window.scrollTo(0, 400); | 14 window.scrollTo(0, 400); |
11 runRepaintTest(); | 15 runPaintInvalidationTest(); |
12 }; | 16 }; |
13 </script> | 17 </script> |
14 <style> | 18 <style> |
15 body { | 19 body { |
16 height: 2000px; | 20 height: 2000px; |
17 } | 21 } |
18 #fixed-container { | 22 #fixed-container { |
19 position: fixed; | 23 position: fixed; |
20 top: 0; | 24 top: 0; |
21 left: 0; | 25 left: 0; |
22 width: 100%; | 26 width: 100%; |
23 height: 100%; | 27 height: 100%; |
24 background-color: green; | 28 background-color: green; |
25 backface-visibility: hidden; | 29 backface-visibility: hidden; |
26 } | 30 } |
27 #fixed { | 31 #fixed { |
28 position: fixed; | 32 position: fixed; |
29 top: 100px; | 33 top: 100px; |
30 left: 100px; | 34 left: 100px; |
31 width: 200px; | 35 width: 200px; |
32 height: 200px; | 36 height: 200px; |
33 background-color: red; | 37 background-color: red; |
34 } | 38 } |
35 </style> | 39 </style> |
36 Tests paint invalidation of fixed elements under a composited fixed element afte
r scrolled. | 40 Tests paint invalidation of fixed elements under a composited fixed element afte
r scrolled. |
37 Passes if there is only green background. | 41 Passes if there is only green background. |
38 <div id="fixed-container"> | 42 <div id="fixed-container"> |
39 <div id="fixed"></div> | 43 <div id="fixed"></div> |
40 </div> | 44 </div> |
OLD | NEW |