ladybird/Tests/LibWeb/Text/input/scrollable-viewport-with-position-fixed.html
Jelle Raaijmakers 2fc1cafb8a LibWeb: Exclude fixed positioned boxes from scrollable overflow
Sometimes fixed positioned boxes would extend the viewport's scrollable
overflow, which according to the spec should never happen. There are
some nuances to this, such as properly determining the fixed positioning
containing block for a fixed position box, but for now this prevents
some pages from being overly scrollable.

Fixes horizontal scrollability of https://tweakers.net.
2025-04-25 14:07:38 +02:00

21 lines
468 B
HTML

<!DOCTYPE html>
<script src="include.js"></script>
<style>
#main {
background: red;
}
#side {
background: green;
position: fixed;
right: -200px;
width: 200px;
}
</style>
<div id="main">bar</div>
<div id="side">foo</div>
<script>
test(() => {
document.querySelector('#side').scrollIntoView();
println(JSON.stringify(document.querySelector('#main').getBoundingClientRect()));
});
</script>