mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:37:36 +00:00
LibWeb: Implement document.scrollingElement
This returns a reference to the element that scrolls the document. In standards mode it is equivalent to `document.documentElement`.
This commit is contained in:
parent
fc8f6c07b4
commit
c24652bd2e
7 changed files with 44 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
|||
document.compatMode: BackCompat
|
||||
document.scrollingElement is body element: true
|
2
Tests/LibWeb/Text/expected/document-scrollingElement.txt
Normal file
2
Tests/LibWeb/Text/expected/document-scrollingElement.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
document.compatMode: CSS1Compat
|
||||
document.scrollingElement is document root element: true
|
|
@ -0,0 +1,8 @@
|
|||
<!-- quirks mode -->
|
||||
<script src="include.js"></script>
|
||||
<script type="">
|
||||
test(() => {
|
||||
println(`document.compatMode: ${document.compatMode}`);
|
||||
println(`document.scrollingElement is body element: ${document.scrollingElement === document.body}`);
|
||||
});
|
||||
</script>
|
8
Tests/LibWeb/Text/input/document-scrollingElement.html
Normal file
8
Tests/LibWeb/Text/input/document-scrollingElement.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
println(`document.compatMode: ${document.compatMode}`);
|
||||
println(`document.scrollingElement is document root element: ${document.scrollingElement === document.documentElement}`);
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue