mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-19 08:51:57 +00:00
LibWeb: Retrieve the last known window position for window.screenX/Y
This commit is contained in:
parent
325e3c7bc6
commit
8cc1997f33
Notes:
sideshowbarker
2024-07-17 04:53:44 +09:00
Author: https://github.com/trflynn89
Commit: 8cc1997f33
Pull-request: https://github.com/SerenityOS/serenity/pull/15883
Reviewed-by: https://github.com/linusg ✅
1 changed files with 4 additions and 0 deletions
|
@ -509,6 +509,8 @@ int Window::screen_x() const
|
|||
{
|
||||
// The screenX and screenLeft attributes must return the x-coordinate, relative to the origin of the Web-exposed screen area,
|
||||
// of the left of the client window as number of CSS pixels, or zero if there is no such thing.
|
||||
if (auto* page = this->page())
|
||||
return page->window_position().x();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -517,6 +519,8 @@ int Window::screen_y() const
|
|||
{
|
||||
// The screenY and screenTop attributes must return the y-coordinate, relative to the origin of the screen of the Web-exposed screen area,
|
||||
// of the top of the client window as number of CSS pixels, or zero if there is no such thing.
|
||||
if (auto* page = this->page())
|
||||
return page->window_position().y();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue