mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
LibWeb: Remove BrowsingContext::scroll_to()
Let's use navigable directly instead of going through browsing context to request a scroll.
This commit is contained in:
parent
0c92c80544
commit
7ad0767aa0
Notes:
sideshowbarker
2024-07-16 18:06:41 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/7ad0767aa0 Pull-request: https://github.com/SerenityOS/serenity/pull/23054
3 changed files with 2 additions and 17 deletions
|
@ -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
|
||||
|
|
|
@ -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> BrowsingContext::top_level_browsing_context() const
|
||||
{
|
||||
auto const* start = this;
|
||||
|
|
|
@ -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<BrowsingContext> top_level_browsing_context() const;
|
||||
|
||||
enum class WindowType {
|
||||
|
|
Loading…
Reference in a new issue