OLD | NEW |
| (Empty) |
1 <!-- Based on fast/repaint/padding-keeping-visual-size.html --> | |
2 <!DOCTYPE HTML> | |
3 <script src="resources/paint-invalidation-test.js"></script> | |
4 <script> | |
5 function paintInvalidationTest() | |
6 { | |
7 // No visual change. Optimally, there should be no repaint. | |
8 var target1 = document.getElementById('target1'); | |
9 target1.style.padding = '20px'; | |
10 target1.style.width = '60px'; | |
11 target1.style.height = '60px'; | |
12 | |
13 // Content will shrink. Should repaint at least the content. | |
14 var target2 = document.getElementById('target2'); | |
15 target2.style.padding = '20px'; | |
16 target2.style.width = '60px'; | |
17 target2.style.height = '60px'; | |
18 } | |
19 window.onload = runPaintInvalidationTest; | |
20 </script> | |
21 <style> | |
22 body { | |
23 margin: 0; | |
24 } | |
25 .outer { | |
26 width: 100px; | |
27 height: 100px; | |
28 position: absolute; | |
29 background-color: green; | |
30 } | |
31 #target2 { | |
32 top: 200px; | |
33 } | |
34 .inner { | |
35 width: 100%; | |
36 height: 100%; | |
37 background-color: yellow; | |
38 } | |
39 </style> | |
40 <div id="target1" class="outer"></div> | |
41 <div id="target2" class="outer"><div class="inner"></div></div> | |
OLD | NEW |