mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Implement and use "scroll to the fragment" algorithm
This will eventually be used by Navigable but for now, it's just when traversing the history.
This commit is contained in:
committed by
Andreas Kling
parent
be9c975b2e
commit
8bd3b74e3a
Notes:
sideshowbarker
2024-07-16 23:57:20 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/8bd3b74e3a Pull-request: https://github.com/SerenityOS/serenity/pull/20501 Reviewed-by: https://github.com/shannonbooth
@@ -1407,11 +1407,8 @@ WebIDL::ExceptionOr<void> BrowsingContext::traverse_the_history(size_t entry_ind
|
||||
}
|
||||
|
||||
// 10. If entry's persisted user state is null, and its URL's fragment is non-null, then scroll to the fragment.
|
||||
if (!entry->url.fragment().is_null()) {
|
||||
// FIXME: Implement the full "scroll to the fragment" algorithm:
|
||||
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#scroll-to-the-fragment-identifier
|
||||
scroll_to_anchor(entry->url.fragment());
|
||||
}
|
||||
if (!entry->url.fragment().is_null())
|
||||
active_document()->scroll_to_the_fragment();
|
||||
|
||||
// 11. Set the current entry to entry.
|
||||
m_session_history_index = entry_index;
|
||||
|
||||
Reference in New Issue
Block a user