OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <!-- This test case reproduces a bug that is hopefully solved by https://bugs.
webkit.org/show_bug.cgi?id=80641 | 4 <!-- This test case reproduces a bug that is hopefully solved by https://bugs.
webkit.org/show_bug.cgi?id=80641 |
5 | 5 |
6 In the bug, a div element begins as non-composited, and the repaintRect h
ad a | 6 In the bug, a div element begins as non-composited, and the repaintRect h
ad a |
7 correct non-zero offset because it paints into an ancestor container. Lat
er, the | 7 correct non-zero offset because it paints into an ancestor container. Lat
er, the |
8 layer becomes composited (in this case, because the layer is moved to ove
rlap | 8 layer becomes composited (in this case, because the layer is moved to ove
rlap |
9 another composited layer). Because the layer is now composited, the repai
ntRect | 9 another composited layer). Because the layer is now composited, the repai
ntRect |
10 should have been recomputed - in particular, the offset of the repaintRec
t should | 10 should have been recomputed - in particular, the offset of the repaintRec
t should |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 testRunner.dumpAsTextWithPixelResults(); | 53 testRunner.dumpAsTextWithPixelResults(); |
54 testRunner.waitUntilDone(); | 54 testRunner.waitUntilDone(); |
55 } | 55 } |
56 | 56 |
57 function changeDivPosition() { | 57 function changeDivPosition() { |
58 document.getElementById("scrolldiv").style.left="50px"; | 58 document.getElementById("scrolldiv").style.left="50px"; |
59 } | 59 } |
60 | 60 |
61 function repaintTest() { | 61 function repaintTest() { |
62 runAfterLayoutAndPaint(function() { | 62 runAfterLayoutAndPaint(function() { |
63 // Changing the position will cause the scrolldiv to become composited
becuase it overlaps another compostied element. | 63 // Changing the position will cause the scrolldiv to become composited
because it overlaps another compostied element. |
64 changeDivPosition(); | 64 changeDivPosition(); |
65 | 65 |
66 // Force DumpRenderTree to do a layout and repaint here, this is where
the repaintRect | 66 // Force DumpRenderTree to do a layout and repaint here, this is where
the repaintRect |
67 // goes wrong because it does not get updated for a newly composited e
lement. | 67 // goes wrong because it does not get updated for a newly composited e
lement. |
68 runAfterLayoutAndPaint(function() { | 68 runAfterLayoutAndPaint(function() { |
69 // Scrolling a little will demonstrate whether the repaint rect is
correct or not. | 69 // Scrolling a little will demonstrate whether the repaint rect is
correct or not. |
70 document.getElementById('scrolldiv').scrollTop = 500; | 70 document.getElementById('scrolldiv').scrollTop = 500; |
71 testRunner.notifyDone(); | 71 testRunner.notifyDone(); |
72 }); | 72 }); |
73 }); | 73 }); |
74 } | 74 } |
75 | 75 |
76 </script> | 76 </script> |
77 | 77 |
78 <body onload="repaintTest()"> | 78 <body onload="repaintTest()"> |
79 <div class="composited box"></div> | 79 <div class="composited box"></div> |
80 <div id="scrolldiv"> | 80 <div id="scrolldiv"> |
81 <div class="shouldNotBeSeen box"></div> | 81 <div class="shouldNotBeSeen box"></div> |
82 <div class="shouldBeSeen box"></div> | 82 <div class="shouldBeSeen box"></div> |
83 </div> | 83 </div> |
84 </body> | 84 </body> |
85 | 85 |
86 </html> | 86 </html> |
OLD | NEW |