| 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); |
| 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; |
| 25 } |
| 26 |
| 27 .spacer { |
| 28 height: 300px; |
| 29 } |
| 30 </style> |
| 31 |
| 32 <div id="scroller" class="scroller"> |
| 33 <div class="spacer"></div> |
| 34 <div class="composited container"> |
| 35 <div class="box"></div> |
| 36 </div> |
| 37 </div> |
| 38 |
| 39 <script src="../resources/text-based-repaint.js"></script> |
| 40 <script> |
| 41 // The sticky box should not be invalidated as it hasn't |
| 42 // passed the starting constraint yet. |
| 43 function repaintTest() { |
| 44 let scroller = document.getElementById('scroller'); |
| 45 scroller.scrollTop = 200; |
| 46 } |
| 47 onload = runRepaintAndPixelTest; |
| 48 </script> |
| OLD | NEW |