1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:38:11 +00:00

LibWeb: Support window.screen{X,Y,Left,Top}

Some sites query these properties for whatever reason, so let's support
them. (But let's always pretend the screen coordinates are (0, 0))
This commit is contained in:
Andreas Kling 2021-09-29 00:15:26 +02:00
parent 0a90d466a0
commit 63d971d33b
4 changed files with 61 additions and 0 deletions

View file

@ -315,4 +315,20 @@ float Window::device_pixel_ratio() const
return 1.0f;
}
// https://drafts.csswg.org/cssom-view/#dom-window-screenx
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.
return 0;
}
// https://drafts.csswg.org/cssom-view/#dom-window-screeny
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.
return 0;
}
}