| <!-- Based on fast/repaint/padding-keeping-visual-size.html --> |
| <!DOCTYPE HTML> |
| <script src="resources/paint-invalidation-test.js"></script> |
| <script> |
| window.expectedPaintInvalidationObjects = [ |
| "LayoutBlockFlow (positioned) DIV id='target2' class='outer'", |
| "LayoutBlockFlow DIV class='inner'", |
| ]; |
| function paintInvalidationTest() |
| { |
| // No visual change. Optimally, there should be no repaint. |
| var target1 = document.getElementById('target1'); |
| target1.style.padding = '20px'; |
| target1.style.width = '60px'; |
| target1.style.height = '60px'; |
| |
| // Content will shrink. Should repaint at least the content. |
| var target2 = document.getElementById('target2'); |
| target2.style.padding = '20px'; |
| target2.style.width = '60px'; |
| target2.style.height = '60px'; |
| } |
| window.onload = runPaintInvalidationTest; |
| </script> |
| <style> |
| body { |
| margin: 0; |
| } |
| .outer { |
| width: 100px; |
| height: 100px; |
| position: absolute; |
| background-color: green; |
| } |
| #target2 { |
| top: 200px; |
| } |
| .inner { |
| width: 100%; |
| height: 100%; |
| background-color: yellow; |
| } |
| </style> |
| <div id="target1" class="outer"></div> |
| <div id="target2" class="outer"><div class="inner"></div></div> |