mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Limit scroll position by overflow area in Window::scroll()
This change fixes "vertical shift" in inspector.
This commit is contained in:
committed by
Andreas Kling
parent
de993be02f
commit
4969ad9d6b
Notes:
sideshowbarker
2024-07-17 23:07:41 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/4969ad9d6b Pull-request: https://github.com/SerenityOS/serenity/pull/22421 Reviewed-by: https://github.com/awesomekling
28
Tests/LibWeb/Text/input/window-scrollTo.html
Normal file
28
Tests/LibWeb/Text/input/window-scrollTo.html
Normal 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>
|
||||
Reference in New Issue
Block a user