LibWeb/Tests: Add basic test for Element::scroll(x, y)

This commit is contained in:
Aliaksandr Kalenik 2023-08-06 21:38:39 +02:00 committed by Andreas Kling
parent 433d3f988d
commit dc08e9138c
Notes: sideshowbarker 2024-07-17 09:39:38 +09:00
2 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,11 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x600 [BFC] children: not-inline
BlockContainer <body> at (8,8) content-size 784x202 children: not-inline
BlockContainer <div#scrollbox> at (9,9) content-size 200x200 [BFC] children: not-inline
BlockContainer <div#content> at (9,9) content-size 200x1000 children: not-inline
PaintableWithLines (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600]
PaintableWithLines (BlockContainer<BODY>) [8,8 784x202]
PaintableWithLines (BlockContainer<DIV>#scrollbox) [8,8 202x202] overflow: [9,9 200x1000] scroll-offset: [0,100]
PaintableWithLines (BlockContainer<DIV>#content) [9,9 200x1000]

View File

@ -0,0 +1,22 @@
<style>
#scrollbox {
width: 200px;
height: 200px;
overflow: scroll;
border: 1px solid black;
}
#content {
height: 1000px;
}
</style>
<script>
document.addEventListener(
"DOMContentLoaded",
function () {
document.getElementById("scrollbox").scroll(0, 100);
},
false
);
</script>
<div id="scrollbox"><div id="content"></div></div>