| OLD | NEW |
| (Empty) | |
| 1 <script> |
| 2 onload = function() { |
| 3 document.getElementById('scroller').scrollTop = 200; |
| 4 } |
| 5 </script> |
| 6 <style> |
| 7 #scroller { |
| 8 background: gray local content-box; |
| 9 overflow: scroll; |
| 10 padding: 10px; |
| 11 width: 200px; |
| 12 height: 200px; |
| 13 box-sizing: border-box; |
| 14 } |
| 15 |
| 16 #scroller-outline { |
| 17 will-change: transform; |
| 18 outline: 5px solid rgba(0, 255, 0, 0.5); |
| 19 outline-offset: -4px; |
| 20 position: absolute; |
| 21 width: 200px; |
| 22 height: 200px; |
| 23 } |
| 24 |
| 25 .spacer { |
| 26 height: 300px; |
| 27 } |
| 28 </style> |
| 29 <!-- #scroller should not be covered up by a negative offset outline. It is |
| 30 achieved by painting the outline into the decoration layer which draws |
| 31 on top of all other layers. --> |
| 32 <div id="scroller-outline"></div> |
| 33 <div id="scroller"> |
| 34 <div class="spacer"></div> |
| 35 </div> |
| 36 |
| OLD | NEW |