<script>
onload = function() {
scroller.scrollTop = 100;
}
</script>
<style>
.composited {
/* Triggers promotion and creates a stacking context */
will-change: transform;
}
#scroller {
height: 200px;
overflow: auto;
width: 200px;
}
.sticky {
position: sticky;
top: 0;
height: 50px;
background: green;
}
.spacer {
height: 2000px;
}
</style>
<div id="scroller" class="composited">
<div class="composited sticky"></div>
<div class="spacer"></div>
</div>