Quellcode durchsuchen

LibWeb: Use Window::scroll() in Element::set_scroll_top()

Now when Window::scroll() could do actual scrolling we can remove
this FIXME.
Aliaksandr Kalenik vor 1 Jahr
Ursprung
Commit
79b73b7fbb
1 geänderte Dateien mit 2 neuen und 6 gelöschten Zeilen
  1. 2 6
      Userland/Libraries/LibWeb/DOM/Element.cpp

+ 2 - 6
Userland/Libraries/LibWeb/DOM/Element.cpp

@@ -1299,17 +1299,13 @@ void Element::set_scroll_top(double y)
 
 
     // 8. If the element is the root element invoke scroll() on window with scrollX on window as first argument and y as second argument, and terminate these steps.
     // 8. If the element is the root element invoke scroll() on window with scrollX on window as first argument and y as second argument, and terminate these steps.
     if (document.document_element() == this) {
     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<float>(window->scroll_x()), static_cast<float>(y) });
+        window->scroll(window->scroll_x(), y);
         return;
         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 scrollX as first argument and y as second argument, and terminate these steps.
     // 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 scrollX as first argument and y as second argument, and terminate these steps.
     if (document.body() == this && document.in_quirks_mode() && !is_potentially_scrollable()) {
     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<float>(window->scroll_x()), static_cast<float>(y) });
+        window->scroll(window->scroll_x(), y);
         return;
         return;
     }
     }