Subpixel rendering: Wrong cliprect on absolute positioned elements.
[WebKit-https.git] / LayoutTests / fast / repaint / hidpi-absolute-positioned-element-wrong-cliprect-after-move.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>This tests absolute positioned elements' repaint clipping after move. Pass if all borders are painted properly.</title>
5 <head>
6 <style>
7   div {
8     position: absolute;
9     border: green solid 1px;
10     width: 20px;
11     height: 20px;
12     left: 0px;
13     top: 0px;
14   }
15 </style>
16 </head>
17 <body>
18 <p id="container"></p>
19 <script>
20   var container = document.getElementById("container");
21   for (j = 0; j < 10; ++j) {
22     var e = document.createElement("div");
23     e.style.left = (25 * j) + "px";
24     container.appendChild(e);
25   }
26   
27   function move() {
28     divs = document.getElementsByTagName("div");
29     for (i = 0; i < divs.length; ++i)
30       divs[i].style.left = (parseFloat(divs[i].style.left) + 0.3) + "px";
31
32     if (window.testRunner && window.internals) {
33         var dummy = document.body.offsetTop;
34         var repaintRects = window.internals.repaintRectsAsText();
35         window.internals.stopTrackingRepaints();
36
37         var pre = document.createElement('pre');
38         document.body.appendChild(pre);
39         pre.innerHTML = repaintRects;
40         testRunner.notifyDone();
41       }
42   }
43   
44   if (window.testRunner && window.internals) {
45     window.testRunner.dumpAsText(false);
46     window.internals.startTrackingRepaints();
47     testRunner.waitUntilDone();
48   }
49
50   setTimeout(move, 0);
51 </script>
52 </body>
53 </html>