mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 19:47:17 +02:00
LibWeb: Fix document element's .scrollHeight and .scrollWidth
We were using the viewport's size as the viewport scrolling area, but those are completely different things.
This commit is contained in:
committed by
Tim Ledbetter
parent
8f139d065c
commit
e8e6dbcee0
Notes:
github-actions[bot]
2025-06-17 16:18:46 +00:00
Author: https://github.com/gmta Commit: https://github.com/LadybirdBrowser/ladybird/commit/e8e6dbcee06 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5121 Reviewed-by: https://github.com/tcl3 ✅
26
Tests/LibWeb/Text/input/DOM/Element-scrollWidth.html
Normal file
26
Tests/LibWeb/Text/input/DOM/Element-scrollWidth.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<style>
|
||||
* {
|
||||
outline: 1px solid black;
|
||||
}
|
||||
|
||||
.scrollable {
|
||||
width: 300px;
|
||||
overflow-x: auto;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
span {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
<div class="scrollable"><span>Item 1</span><span>Item 2</span><span>Item 3</span><span>Item 4</span><span>Item 5</span><span>Item 6</span><span>Item 7</span><span>Item 8</span><span>Item 9</span><span>Item 10</span><span>Item 11</span><span>Item 12</span></div>
|
||||
<script>
|
||||
test(() => {
|
||||
const scrollable = document.querySelector(".scrollable");
|
||||
println(scrollable.scrollWidth);
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user