1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:17:35 +00:00

LibWeb: Implement Window.scroll() and Window.scrollBy() JS methods

... and `Window.scrollTo()`, which is an alias for `scroll()`.

There is still work that needs to be done here, regarding bringing the
scroll position calculation in line with the spec. Currently we get the
viewport rect from outside, and treat it as if it was the result of
calculating steps 5-9 of the `scroll()` method. But it works. :^)
This commit is contained in:
Sam Atkins 2021-09-08 21:27:44 +01:00 committed by Linus Groh
parent 9588a377ec
commit 57371f7608
2 changed files with 154 additions and 0 deletions

View file

@ -75,6 +75,8 @@ private:
JS_DECLARE_NATIVE_GETTER(scroll_x_getter);
JS_DECLARE_NATIVE_GETTER(scroll_y_getter);
JS_DECLARE_NATIVE_FUNCTION(scroll);
JS_DECLARE_NATIVE_FUNCTION(scroll_by);
JS_DECLARE_NATIVE_FUNCTION(alert);
JS_DECLARE_NATIVE_FUNCTION(confirm);