| 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 28 matching lines...) Expand all Loading... |
| 39 background-color: red; | 39 background-color: red; |
| 40 } | 40 } |
| 41 | 41 |
| 42 .shouldBeSeen { | 42 .shouldBeSeen { |
| 43 background-color: green; | 43 background-color: green; |
| 44 } | 44 } |
| 45 </style> | 45 </style> |
| 46 | 46 |
| 47 </head> | 47 </head> |
| 48 | 48 |
| 49 <script src="../../resources/run-after-display.js"></script> |
| 49 <script src="../../fast/repaint/resources/repaint.js"></script> | 50 <script src="../../fast/repaint/resources/repaint.js"></script> |
| 50 | 51 |
| 51 <script> | 52 <script> |
| 52 if (window.testRunner) { | 53 if (window.testRunner) { |
| 53 testRunner.dumpAsTextWithPixelResults(); | 54 testRunner.dumpAsTextWithPixelResults(); |
| 54 testRunner.waitUntilDone(); | 55 testRunner.waitUntilDone(); |
| 55 } | 56 } |
| 56 | 57 |
| 57 function changeDivPosition() { | 58 function changeDivPosition() { |
| 58 document.getElementById("scrolldiv").style.left="50px"; | 59 document.getElementById("scrolldiv").style.left="50px"; |
| 59 } | 60 } |
| 60 | 61 |
| 61 function repaintTest() { | 62 function repaintTest() { |
| 62 // Changing the position will cause the scrolldiv to become composited b
ecuase it overlaps another compostied element. | 63 // Changing the position will cause the scrolldiv to become composited b
ecuase it overlaps another compostied element. |
| 63 changeDivPosition(); | 64 changeDivPosition(); |
| 64 | 65 |
| 65 // Force DumpRenderTree to do a layout and repaint here, this is where t
he repaintRect | 66 // Force DumpRenderTree to do a layout and repaint here, this is where t
he repaintRect |
| 66 // goes wrong because it does not get updated for a newly composited ele
ment. | 67 // goes wrong because it does not get updated for a newly composited ele
ment. |
| 67 if (window.testRunner) | 68 runAfterDisplay(function() { |
| 68 testRunner.display(); | |
| 69 | |
| 70 window.setTimeout(function() { | |
| 71 // Scrolling a little will demonstrate whether the repaint rect is c
orrect or not. | 69 // Scrolling a little will demonstrate whether the repaint rect is c
orrect or not. |
| 72 document.getElementById('scrolldiv').scrollTop = 500; | 70 document.getElementById('scrolldiv').scrollTop = 500; |
| 73 testRunner.notifyDone(); | 71 testRunner.notifyDone(); |
| 74 }, 0); | 72 }); |
| 75 } | 73 } |
| 76 | 74 |
| 77 </script> | 75 </script> |
| 78 | 76 |
| 79 <body onload="runRepaintTest()"> | 77 <body onload="runRepaintTest()"> |
| 80 <div class="composited box"></div> | 78 <div class="composited box"></div> |
| 81 <div id="scrolldiv"> | 79 <div id="scrolldiv"> |
| 82 <div class="shouldNotBeSeen box"></div> | 80 <div class="shouldNotBeSeen box"></div> |
| 83 <div class="shouldBeSeen box"></div> | 81 <div class="shouldBeSeen box"></div> |
| 84 </div> | 82 </div> |
| 85 </body> | 83 </body> |
| 86 | 84 |
| 87 </html> | 85 </html> |
| OLD | NEW |