diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index b9206f1483..cc5e9e6a66 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -1879,8 +1879,8 @@ void Document::scroll_to_the_fragment() void Document::scroll_to_the_beginning_of_the_document() { // FIXME: Actually implement this algorithm - if (auto browsing_context = this->browsing_context()) - browsing_context->scroll_to({ 0, 0 }); + if (auto navigable = this->navigable()) + navigable->perform_scroll_of_viewport({ 0, 0 }); } StringView Document::ready_state() const diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp index 59f7170534..f75c557671 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp @@ -343,19 +343,6 @@ bool BrowsingContext::is_focused_context() const return &m_page->focused_context() == this; } -void BrowsingContext::scroll_to(CSSPixelPoint position) -{ - // NOTE: Scrolling to a position requires up-to-date layout *unless* we're scrolling to (0, 0) - // as (0, 0) is always guaranteed to be a valid scroll position. - if (!position.is_zero()) { - if (active_document()) - active_document()->update_layout(); - } - - if (auto navigable = active_document()->navigable()) - navigable->perform_scroll_of_viewport(position); -} - JS::GCPtr BrowsingContext::top_level_browsing_context() const { auto const* start = this; diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.h b/Userland/Libraries/LibWeb/HTML/BrowsingContext.h index 5afed69c01..9f1407c4ca 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.h +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.h @@ -121,8 +121,6 @@ public: Web::EventHandler& event_handler() { return m_event_handler; } Web::EventHandler const& event_handler() const { return m_event_handler; } - void scroll_to(CSSPixelPoint); - JS::GCPtr top_level_browsing_context() const; enum class WindowType {