mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +00:00
LibWeb: Implement the inner navigate event firing algorithm
This algorithm is the meat of firing the NavigateEvent at navigation. In order to implement it, we also need to add some getters/setters on NavigateEvent. The implemetentation deviates from the spec in when exactly the NavigateEvent is created. In following the pattern for other events. we construct the event from the NavigateEventInit structure from our native code. This makes the code a lot simpler than adding 10 getters to the NavigateEvent that are only ever used just after construction. I'm not 100% conviced the promise resolution code is correct, but we can add tests for that later :^).
This commit is contained in:
parent
0650edc7d7
commit
3935105d0a
3 changed files with 366 additions and 7 deletions
|
@ -10,6 +10,8 @@
|
|||
#include <LibWeb/Bindings/NavigationPrototype.h>
|
||||
#include <LibWeb/DOM/EventTarget.h>
|
||||
#include <LibWeb/HTML/HistoryHandlingBehavior.h>
|
||||
#include <LibWeb/HTML/Navigable.h>
|
||||
#include <LibWeb/HTML/NavigationType.h>
|
||||
#include <LibWeb/HTML/StructuredSerialize.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
@ -133,6 +135,14 @@ private:
|
|||
void reject_the_finished_promise(JS::NonnullGCPtr<NavigationAPIMethodTracker>, JS::Value exception);
|
||||
void clean_up(JS::NonnullGCPtr<NavigationAPIMethodTracker>);
|
||||
|
||||
bool inner_navigate_event_firing_algorithm(
|
||||
Bindings::NavigationType,
|
||||
JS::NonnullGCPtr<NavigationDestination>,
|
||||
UserNavigationInvolvement,
|
||||
Optional<Vector<XHR::FormDataEntry>&> form_data_entry_list,
|
||||
Optional<String> download_request_filename,
|
||||
Optional<SerializationRecord> classic_history_api_state);
|
||||
|
||||
// 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.
|
||||
Vector<JS::NonnullGCPtr<NavigationHistoryEntry>> m_entry_list;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue