1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:57:43 +00:00

LibWeb: Implement navigation.{traverseTo, back, forward}

The proper abstract operations on Navigable and TraversableNavigable are
not quite ready to call from Navigation. With this commit all of the
user-facing APIs of Navigation are in place, and the stage should be set
to implement the parts of the navigation and traversal AOs that need to
interact with the Navigation object.
This commit is contained in:
Andrew Kaster 2023-08-25 20:35:22 -06:00 committed by Andreas Kling
parent 03eae09619
commit b1f06e42ce
3 changed files with 211 additions and 3 deletions

View file

@ -85,6 +85,10 @@ public:
WebIDL::ExceptionOr<NavigationResult> navigate(String url, NavigationNavigateOptions const&);
WebIDL::ExceptionOr<NavigationResult> reload(NavigationReloadOptions const&);
WebIDL::ExceptionOr<NavigationResult> traverse_to(String key, NavigationOptions const&);
WebIDL::ExceptionOr<NavigationResult> back(NavigationOptions const&);
WebIDL::ExceptionOr<NavigationResult> forward(NavigationOptions const&);
// Event Handlers
void set_onnavigate(WebIDL::CallbackType*);
WebIDL::CallbackType* onnavigate();
@ -114,6 +118,8 @@ private:
NavigationResult early_error_result(AnyException);
JS::NonnullGCPtr<NavigationAPIMethodTracker> maybe_set_the_upcoming_non_traverse_api_method_tracker(JS::Value info, Optional<SerializationRecord>);
JS::NonnullGCPtr<NavigationAPIMethodTracker> add_an_upcoming_traverse_api_method_tracker(String destination_key, JS::Value info);
WebIDL::ExceptionOr<NavigationResult> perform_a_navigation_api_traversal(String key, NavigationOptions const&);
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#navigation-entry-list
// Each Navigation has an associated entry list, a list of NavigationHistoryEntry objects, initially empty.