Files
ladybird/Tests/LibWeb/Ref/scrollable-contains-box-with-gradient-background.html
Aliaksandr Kalenik 040653311e LibWeb: Fix background clip for elements nested into scrollable boxes
add_clip_rect() accepts a rectangle in viewport-relative coordinates,
so it must be translated by the enclosing scroll offset to be displayed
correctly inside a scrollable box.
2024-08-06 09:40:34 +02:00

31 lines
746 B
HTML

<!DOCTYPE html>
<link rel="match" href="reference/scrollable-contains-box-with-gradient-background-ref.html" />
<style type="text/css">
* {
scrollbar-width: none;
}
.box {
width: 180px;
height: 64px;
background: linear-gradient(rgb(109, 152, 204), rgb(138, 100, 229));
border-radius: 100px;
}
#scrollable {
width: 200px;
height: 200px;
overflow: scroll;
border: 10px solid orchid;
}
</style>
<div id="scrollable">
<div style="height: 100px"></div>
<div class="box"></div>
<div style="height: 200px"></div>
</div>
<script>
const scrollContainer = document.getElementById("scrollable");
scrollContainer.scrollTop = 100;
</script>