From a4d78c7df9c954dce0d9f7aed7f6b7f882413649 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Thu, 1 Feb 2024 14:48:14 +0100 Subject: [PATCH] LibWeb: Use Window::scroll() in Element::set_scroll_left() Now when Window::scroll() could do actual scrolling we can remove this FIXME. --- Userland/Libraries/LibWeb/DOM/Element.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index 5cde4c6fe2..ec16cbcf5e 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -1241,17 +1241,13 @@ void Element::set_scroll_left(double x) // 8. If the element is the root element invoke scroll() on window with x as first argument and scrollY on window as second argument, and terminate these steps. if (document.document_element() == this) { - // FIXME: Implement this in terms of invoking scroll() on window. - if (document.browsing_context() == &document.page().top_level_browsing_context()) - document.page().client().page_did_request_scroll_to({ static_cast(x), static_cast(window->scroll_y()) }); + window->scroll(x, window->scroll_y()); return; } // 9. If the element is the body element, document is in quirks mode, and the element is not potentially scrollable, invoke scroll() on window with x as first argument and scrollY on window as second argument, and terminate these steps. if (document.body() == this && document.in_quirks_mode() && !is_potentially_scrollable()) { - // FIXME: Implement this in terms of invoking scroll() on window. - if (document.browsing_context() == &document.page().top_level_browsing_context()) - document.page().client().page_did_request_scroll_to({ static_cast(x), static_cast(window->scroll_y()) }); + window->scroll(x, window->scroll_y()); return; }