LibWeb: Add NavigateEvent.sourceElement

Corresponds to:
- https://github.com/whatwg/html/pull/10898
- https://github.com/whatwg/html/pull/10971

I've also updated the imported WPT test as it's been recently changed to
account for 10898 being merged.
This commit is contained in:
Sam Atkins 2025-01-30 14:14:13 +00:00 committed by Andreas Kling
commit 26b7946123
Notes: github-actions[bot] 2025-02-04 11:25:44 +00:00
8 changed files with 44 additions and 25 deletions

View file

@ -116,10 +116,11 @@ public:
URL::URL destination_url,
bool is_same_document,
UserNavigationInvolvement = UserNavigationInvolvement::None,
GC::Ptr<DOM::Element> source_element = {},
Optional<Vector<XHR::FormDataEntry>&> form_data_entry_list = {},
Optional<SerializationRecord> navigation_api_state = {},
Optional<SerializationRecord> classic_history_api_state = {});
bool fire_a_download_request_navigate_event(URL::URL destination_url, UserNavigationInvolvement user_involvement, String filename);
bool fire_a_download_request_navigate_event(URL::URL destination_url, UserNavigationInvolvement user_involvement, GC::Ptr<DOM::Element> source_element, String filename);
void initialize_the_navigation_api_entries_for_a_new_document(Vector<GC::Ref<SessionHistoryEntry>> const& new_shes, GC::Ref<SessionHistoryEntry> initial_she);
void update_the_navigation_api_entries_for_a_same_document_navigation(GC::Ref<SessionHistoryEntry> destination_she, Bindings::NavigationType);
@ -154,6 +155,7 @@ private:
Bindings::NavigationType,
GC::Ref<NavigationDestination>,
UserNavigationInvolvement,
GC::Ptr<DOM::Element> source_element,
Optional<Vector<XHR::FormDataEntry>&> form_data_entry_list,
Optional<String> download_request_filename,
Optional<SerializationRecord> classic_history_api_state);