mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:17:35 +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
3 changed files with 21 additions and 6 deletions
|
@ -510,9 +510,7 @@ JS_DEFINE_NATIVE_GETTER(WindowObject::scroll_x_getter)
|
|||
auto* impl = impl_from(vm, global_object);
|
||||
if (!impl)
|
||||
return {};
|
||||
if (!impl->page())
|
||||
return JS::Value(0);
|
||||
return JS::Value(impl->page()->top_level_browsing_context().viewport_scroll_offset().x());
|
||||
return JS::Value(impl->scroll_x());
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom-view/#dom-window-scrolly
|
||||
|
@ -521,9 +519,7 @@ JS_DEFINE_NATIVE_GETTER(WindowObject::scroll_y_getter)
|
|||
auto* impl = impl_from(vm, global_object);
|
||||
if (!impl)
|
||||
return {};
|
||||
if (!impl->page())
|
||||
return JS::Value(0);
|
||||
return JS::Value(impl->page()->top_level_browsing_context().viewport_scroll_offset().y());
|
||||
return JS::Value(impl->scroll_y());
|
||||
}
|
||||
|
||||
enum class ScrollBehavior {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue