1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 15:17:45 +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

@ -88,6 +88,11 @@ private:
JS_DECLARE_NATIVE_FUNCTION(scroll);
JS_DECLARE_NATIVE_FUNCTION(scroll_by);
JS_DECLARE_NATIVE_GETTER(screen_x_getter);
JS_DECLARE_NATIVE_GETTER(screen_y_getter);
JS_DECLARE_NATIVE_GETTER(screen_left_getter);
JS_DECLARE_NATIVE_GETTER(screen_top_getter);
JS_DECLARE_NATIVE_FUNCTION(alert);
JS_DECLARE_NATIVE_FUNCTION(confirm);
JS_DECLARE_NATIVE_FUNCTION(prompt);