mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:57:45 +00:00
LibWeb/Tests: Add basic test for Element::scroll(x, y)
This commit is contained in:
parent
433d3f988d
commit
dc08e9138c
2 changed files with 33 additions and 0 deletions
11
Tests/LibWeb/Layout/expected/misc/scroll.txt
Normal file
11
Tests/LibWeb/Layout/expected/misc/scroll.txt
Normal 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]
|
22
Tests/LibWeb/Layout/input/misc/scroll.html
Normal file
22
Tests/LibWeb/Layout/input/misc/scroll.html
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue