Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <style> | |
| 3 .scroller { | |
| 4 overflow: scroll; | |
| 5 width: 200px; | |
| 6 height: 600px; | |
| 7 } | |
| 8 | |
| 9 .composited { | |
| 10 will-change: transform; | |
| 11 } | |
| 12 | |
| 13 .box { | |
| 14 background: rgba(255, 0, 0, 0.5); | |
|
flackr
2017/04/27 14:22:56
nit: Use a greenish color - i.e. rgba(0, 255, 0, 0
yigu
2017/04/27 15:20:10
Done.
| |
| 15 position: sticky; | |
| 16 width: 100%; | |
| 17 height: 50px; | |
| 18 top: 0px; | |
| 19 } | |
| 20 | |
| 21 .container { | |
| 22 width: 100%; | |
| 23 height: 1000px; | |
| 24 background: green; | |
|
flackr
2017/04/27 14:22:56
nit: Let's just make this gray or something simila
yigu
2017/04/27 15:20:10
Done.
| |
| 25 } | |
| 26 </style> | |
| 27 | |
| 28 <div id="scroller" class="scroller"> | |
| 29 <div class="composited container"> | |
| 30 <div class="box"></div> | |
|
flackr
2017/04/27 14:22:56
While not necessary, the nice way to represent thi
yigu
2017/04/27 15:20:10
Done.
| |
| 31 </div> | |
| 32 </div> | |
| 33 | |
| 34 <script> | |
| 35 if (window.testRunner) | |
| 36 testRunner.waitUntilDone() | |
| 37 | |
| 38 function doTest() { | |
| 39 let scroller = document.getElementById('scroller'); | |
| 40 window.requestAnimationFrame(function() { | |
| 41 scroller.scrollTop = 200; | |
| 42 if (window.testRunner) | |
| 43 testRunner.notifyDone(); | |
| 44 }); | |
| 45 } | |
| 46 | |
| 47 window.addEventListener('load', function() { | |
| 48 window.requestAnimationFrame(function() { | |
| 49 window.requestAnimationFrame(doTest); | |
| 50 }) | |
| 51 }); | |
| 52 </script> | |
| 53 | |
| OLD | NEW |