1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:17:35 +00:00

LibWeb: Limit scroll position by overflow area in Window::scroll()

This change fixes "vertical shift" in inspector.
This commit is contained in:
Aliaksandr Kalenik 2023-12-24 20:10:14 +01:00 committed by Andreas Kling
parent de993be02f
commit 4969ad9d6b
3 changed files with 42 additions and 7 deletions

View file

@ -0,0 +1 @@
The page has been scrolled to y: 1616

View file

@ -0,0 +1,28 @@
<style>
div {
width: 1000px;
height: 1000px;
border: 50px solid magenta;
}
#a {
background-color: yellow;
}
#b {
background-color: blue;
}
</style>
<script src="include.js"></script>
<script>
asyncTest(done => {
document.addEventListener("scroll", (event) => {
println("The page has been scrolled to y: " + window.scrollY);
done();
});
window.scrollTo(0, 2000);
});
</script>
<div id="a"></div>
<div id="b"></div>