mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-08 12:12:53 +00:00
LibWeb: Bring HistoryHandlingBehavior up to date with the specification
Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
This commit is contained in:
parent
b6cf62d00a
commit
39f74d3437
Notes:
sideshowbarker
2024-07-17 08:59:18 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: 39f74d3437
Pull-request: https://github.com/SerenityOS/serenity/pull/23751
8 changed files with 24 additions and 24 deletions
|
@ -186,6 +186,7 @@ bool Navigation::can_go_forward() const
|
|||
return (m_current_entry_index != static_cast<i64>(m_entry_list.size()));
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#history-handling-behavior
|
||||
HistoryHandlingBehavior to_history_handling_behavior(Bindings::NavigationHistoryBehavior b)
|
||||
{
|
||||
// A history handling behavior is a NavigationHistoryBehavior that is either "push" or "replace",
|
||||
|
@ -203,6 +204,21 @@ HistoryHandlingBehavior to_history_handling_behavior(Bindings::NavigationHistory
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#history-handling-behavior
|
||||
Bindings::NavigationHistoryBehavior to_navigation_history_behavior(HistoryHandlingBehavior b)
|
||||
{
|
||||
// A history handling behavior is a NavigationHistoryBehavior that is either "push" or "replace",
|
||||
// i.e., that has been resolved away from any initial "auto" value.
|
||||
|
||||
switch (b) {
|
||||
case HistoryHandlingBehavior::Push:
|
||||
return Bindings::NavigationHistoryBehavior::Push;
|
||||
case HistoryHandlingBehavior::Replace:
|
||||
return Bindings::NavigationHistoryBehavior::Replace;
|
||||
}
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-navigate
|
||||
WebIDL::ExceptionOr<NavigationResult> Navigation::navigate(String url, NavigationNavigateOptions const& options)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue