Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <style> | |
| 3 body { | |
| 4 margin: 0; | |
| 5 } | |
| 6 | |
| 7 table { | |
| 8 background: red; | |
| 9 } | |
| 10 | |
| 11 td, th { | |
| 12 height: 50px; | |
| 13 width: 50px; | |
| 14 padding: 0; | |
| 15 } | |
| 16 | |
| 17 th { | |
| 18 background: green; | |
|
flackr
2017/04/26 15:21:01
If the sticky element is known opaque we may promo
yigu
2017/04/26 21:46:57
Done.
| |
| 19 position: sticky; | |
| 20 top: 0px; | |
| 21 } | |
| 22 | |
| 23 .scroller { | |
| 24 width: 100px; | |
| 25 height: 200px; | |
| 26 } | |
| 27 | |
| 28 .composited { | |
| 29 will-change: transform; | |
| 30 } | |
| 31 </style> | |
| 32 | |
| 33 <script> | |
| 34 function doTest() { | |
| 35 for (let scroller of document.querySelectorAll('.scroller')) { | |
|
flackr
2017/04/26 15:21:01
There's only a single scroller, can just querySele
yigu
2017/04/26 21:46:57
Done.
| |
| 36 scroller.scrollTop = 200; | |
| 37 } | |
| 38 } | |
| 39 | |
| 40 window.addEventListener('load', function() { | |
| 41 window.requestAnimationFrame(function() { | |
|
flackr
2017/04/26 15:21:00
Doesn't this need to be declared an async test tha
yigu
2017/04/26 21:46:57
Done.
| |
| 42 window.requestAnimationFrame(doTest); | |
| 43 }) | |
| 44 }); | |
| 45 </script> | |
| 46 | |
| 47 <div class="scroller"> | |
| 48 <table class="composited"> | |
|
flackr
2017/04/26 15:21:01
A simpler test would just be a large composited di
yigu
2017/04/26 21:46:57
Done.
| |
| 49 <thead> | |
| 50 <tr><th></th></tr> | |
| 51 </thead> | |
| 52 <tbody> | |
| 53 <tr><td></td></tr> | |
| 54 <tr><td></td></tr> | |
| 55 <tr><td></td></tr> | |
| 56 <tr><td></td></tr> | |
| 57 </tbody> | |
| 58 </table> | |
| 59 </div> | |
| 60 | |
| OLD | NEW |