mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibWeb: Move window.scroll{X,Y} from wrapper into DOM::Window
The less we do in WindowObject, the easier it will be to eventually auto-generate the entire thing.
This commit is contained in:
parent
38157a6093
commit
2c0987c93b
Notes:
sideshowbarker
2024-07-18 03:27:38 +09:00
Author: https://github.com/awesomekling
Commit: 2c0987c93b
3 changed files with 21 additions and 6 deletions
|
@ -260,4 +260,20 @@ NonnullRefPtr<CSS::MediaQueryList> Window::match_media(String media)
|
|||
return CSS::MediaQueryList::create(associated_document(), move(media));
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom-view/#dom-window-scrollx
|
||||
float Window::scroll_x() const
|
||||
{
|
||||
if (auto* page = this->page())
|
||||
return page->top_level_browsing_context().viewport_scroll_offset().x();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom-view/#dom-window-scrolly
|
||||
float Window::scroll_y() const
|
||||
{
|
||||
if (auto* page = this->page())
|
||||
return page->top_level_browsing_context().viewport_scroll_offset().y();
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue