| 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 29 matching lines...) Expand all Loading... |
| 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="../../resources/run-after-display.js"></script> |
| 50 <script src="../../fast/repaint/resources/repaint.js"></script> | |
| 51 | 50 |
| 52 <script> | 51 <script> |
| 53 if (window.testRunner) { | 52 if (window.testRunner) { |
| 54 testRunner.dumpAsTextWithPixelResults(); | 53 testRunner.dumpAsTextWithPixelResults(); |
| 55 testRunner.waitUntilDone(); | 54 testRunner.waitUntilDone(); |
| 56 } | 55 } |
| 57 | 56 |
| 58 function changeDivPosition() { | 57 function changeDivPosition() { |
| 59 document.getElementById("scrolldiv").style.left="50px"; | 58 document.getElementById("scrolldiv").style.left="50px"; |
| 60 } | 59 } |
| 61 | 60 |
| 62 function repaintTest() { | 61 function repaintTest() { |
| 63 // Changing the position will cause the scrolldiv to become composited b
ecuase it overlaps another compostied element. | 62 runAfterDisplay(function() { |
| 64 changeDivPosition(); | 63 // Changing the position will cause the scrolldiv to become composited
becuase it overlaps another compostied element. |
| 64 changeDivPosition(); |
| 65 | 65 |
| 66 // 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
the repaintRect |
| 67 // 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 e
lement. |
| 68 runAfterDisplay(function() { | 68 runAfterDisplay(function() { |
| 69 // 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
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 </script> | 76 </script> |
| 76 | 77 |
| 77 <body onload="runRepaintTest()"> | 78 <body onload="repaintTest()"> |
| 78 <div class="composited box"></div> | 79 <div class="composited box"></div> |
| 79 <div id="scrolldiv"> | 80 <div id="scrolldiv"> |
| 80 <div class="shouldNotBeSeen box"></div> | 81 <div class="shouldNotBeSeen box"></div> |
| 81 <div class="shouldBeSeen box"></div> | 82 <div class="shouldBeSeen box"></div> |
| 82 </div> | 83 </div> |
| 83 </body> | 84 </body> |
| 84 | 85 |
| 85 </html> | 86 </html> |
| OLD | NEW |