1 <!-- Based on fast/repaint/position-change-keeping-geometry.html -->
3 <script src=
"resources/paint-invalidation-test.js"></script>
5 function changePositionKeepingGeometry(id
, newPosition
) {
6 var target
= document
.getElementById(id
);
7 var originalTop
= target
.offsetTop
;
8 var originalLeft
= target
.offsetLeft
;
9 target
.style
.position
= newPosition
;
10 target
.style
.top
= originalTop
+ 'px';
11 target
.style
.left
= originalLeft
+ 'px';
14 window
.expectedPaintInvalidationObjects
= [
15 "LayoutBlockFlow (positioned) DIV id='target2'",
16 "LayoutBlockFlow (positioned) DIV id='target3'",
18 function paintInvalidationTest()
20 changePositionKeepingGeometry('target1', 'absolute');
21 changePositionKeepingGeometry('target2', 'absolute');
22 changePositionKeepingGeometry('target3', 'fixed');
24 onload
= runPaintInvalidationTest
;
34 background-color: blue;
55 There should be no invalildations on change of position without actual change of position and size.
56 <!-- target0 ensures we don't strip anonymous wrappers (and trigger a layout) when the other elements change position. -->
57 <div id=
"target0"></div>
58 <div id=
"target1"></div>
59 <div id=
"target2"></div>
60 <div id=
"target3"></div>