Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / paint / invalidation / spv2 / position-change-keeping-geometry.html
blob5b4c9744c160025bdc1d2036015f2db6f945a634
1 <!-- Based on fast/repaint/position-change-keeping-geometry.html -->
2 <!DOCTYPE html>
3 <script src="resources/paint-invalidation-test.js"></script>
4 <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;
25 </script>
26 <style>
27 body {
28 margin: 0;
30 div {
31 width: 100px;
32 height: 100px;
33 top: 20px;
34 background-color: blue;
36 #target0 {
37 left: 20px;
38 position: relative;
40 #target1 {
41 left: 20px;
42 position: relative;
44 #target2 {
45 left: 220px;
46 position: fixed;
47 z-index: 0;
49 #target3 {
50 left: 420px;
51 position: absolute;
52 z-index: 0;
54 </style>
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>