| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="resources/text-based-repaint.js"></script> | 4 <script src="resources/text-based-repaint.js"></script> |
| 5 <style> | 5 <style> |
| 6 | 6 |
| 7 #scroller { | 7 #scroller { |
| 8 position: absolute; | 8 position: absolute; |
| 9 left: 10px; | 9 left: 10px; |
| 10 top: 60px; | 10 top: 60px; |
| 11 height: 400px; | 11 height: 400px; |
| 12 overflow: scroll; | 12 overflow: scroll; |
| 13 width: 300px; | 13 width: 300px; |
| 14 will-change: transform; | 14 will-change: transform; |
| 15 } | 15 } |
| 16 #block { | 16 #block { |
| 17 background-color: #cef; | 17 background-color: #cef; |
| 18 height: 50px; | 18 height: 50px; |
| 19 left: 50px; | 19 left: 50px; |
| 20 position: absolute; | 20 position: absolute; |
| 21 top: 200px; | 21 top: 200px; |
| 22 width: 200px; | 22 width: 200px; |
| 23 } | 23 } |
| 24 | 24 |
| 25 </style> | 25 </style> |
| 26 </head> | 26 </head> |
| 27 <body onload="runRepaintTest()"> | 27 <body onload="runRepaintAndPixelTest()"> |
| 28 | 28 |
| 29 This tests that an element which is moved by the synchronous layout in | 29 This tests that an element which is moved by the synchronous layout in |
| 30 Element::setScrollTop, and again by the scroll itself, has its original | 30 Element::setScrollTop, and again by the scroll itself, has its original |
| 31 location correctly invalidated. | 31 location correctly invalidated. |
| 32 | 32 |
| 33 <div id="scroller"> | 33 <div id="scroller"> |
| 34 <div style="height: 900px"></div> | 34 <div style="height: 900px"></div> |
| 35 <div id="block"></div> | 35 <div id="block"></div> |
| 36 </div> | 36 </div> |
| 37 <script> | 37 <script> |
| 38 | 38 |
| 39 function repaintTest() | 39 function repaintTest() |
| 40 { | 40 { |
| 41 document.querySelector("#block").style.top = '310px'; | 41 document.querySelector("#block").style.top = '310px'; |
| 42 document.querySelector("#scroller").scrollTop = 150; | 42 document.querySelector("#scroller").scrollTop = 150; |
| 43 } | 43 } |
| 44 | 44 |
| 45 </script> | 45 </script> |
| 46 </body> | 46 </body> |
| 47 </html> | 47 </html> |
| OLD | NEW |