OLD | NEW |
| 1 <!-- Based on fast/repaint/position-change-keeping-geometry.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 changePositionKeepingGeometry(id, newPosition) { | 5 function changePositionKeepingGeometry(id, newPosition) { |
5 var target = document.getElementById(id); | 6 var target = document.getElementById(id); |
6 var originalTop = target.offsetTop; | 7 var originalTop = target.offsetTop; |
7 var originalLeft = target.offsetLeft; | 8 var originalLeft = target.offsetLeft; |
8 target.style.position = newPosition; | 9 target.style.position = newPosition; |
9 target.style.top = originalTop + 'px'; | 10 target.style.top = originalTop + 'px'; |
10 target.style.left = originalLeft + 'px'; | 11 target.style.left = originalLeft + 'px'; |
11 } | 12 } |
12 | 13 |
13 function repaintTest() | 14 window.expectedPaintInvalidationObjects = [ |
| 15 "LayoutBlockFlow (positioned) DIV id='target2'", |
| 16 "LayoutBlockFlow (positioned) DIV id='target3'", |
| 17 ]; |
| 18 function paintInvalidationTest() |
14 { | 19 { |
15 changePositionKeepingGeometry('target1', 'absolute'); | 20 changePositionKeepingGeometry('target1', 'absolute'); |
16 changePositionKeepingGeometry('target2', 'absolute'); | 21 changePositionKeepingGeometry('target2', 'absolute'); |
17 changePositionKeepingGeometry('target3', 'fixed'); | 22 changePositionKeepingGeometry('target3', 'fixed'); |
18 } | 23 } |
19 onload = runRepaintTest; | 24 onload = runPaintInvalidationTest; |
20 </script> | 25 </script> |
21 <style> | 26 <style> |
22 body { | 27 body { |
23 margin: 0; | 28 margin: 0; |
24 } | 29 } |
25 div { | 30 div { |
26 width: 100px; | 31 width: 100px; |
27 height: 100px; | 32 height: 100px; |
28 top: 20px; | 33 top: 20px; |
29 background-color: blue; | 34 background-color: blue; |
(...skipping 16 matching lines...) Expand all Loading... |
46 position: absolute; | 51 position: absolute; |
47 z-index: 0; | 52 z-index: 0; |
48 } | 53 } |
49 </style> | 54 </style> |
50 There should be no invalildations on change of position without actual change of
position and size. | 55 There should be no invalildations on change of position without actual change of
position and size. |
51 <!-- target0 ensures we don't strip anonymous wrappers (and trigger a layout) wh
en the other elements change position. --> | 56 <!-- target0 ensures we don't strip anonymous wrappers (and trigger a layout) wh
en the other elements change position. --> |
52 <div id="target0"></div> | 57 <div id="target0"></div> |
53 <div id="target1"></div> | 58 <div id="target1"></div> |
54 <div id="target2"></div> | 59 <div id="target2"></div> |
55 <div id="target3"></div> | 60 <div id="target3"></div> |
OLD | NEW |