mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-27 11:19:36 +00:00
Whenever we end up with a scrollable overflow rect that goes beyond either of its axes (i.e. the rect has a negative X or Y position relative to its parent's absolute padding box position), we need to clip that rect to prevent going into the "unreachable scrollable overflow". This fixes the horizontal scrolling on https://ladybird.org (gets more pronounced if you make the window very narrow).
18 lines
378 B
HTML
18 lines
378 B
HTML
<!DOCTYPE html>
|
|
<script src="include.js"></script>
|
|
<style>
|
|
.a {
|
|
border: 1px solid green;
|
|
height: 50px;
|
|
position: absolute;
|
|
right: 0;
|
|
width: 1000px;
|
|
}
|
|
</style>
|
|
<div class="a"></div>
|
|
<script>
|
|
test(() => {
|
|
// scrollWidth must not exceed the viewport size (800px)
|
|
println(`html scrollWidth: ${document.querySelector('html').scrollWidth}`);
|
|
});
|
|
</script>
|