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
parent 62f4cebbee
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

@ -42,6 +42,7 @@ NavigateEvent::NavigateEvent(JS::Realm& realm, FlyString const& event_name, Navi
, m_download_request(event_init.download_request)
, m_info(event_init.info.value_or(JS::js_undefined()))
, m_has_ua_visual_transition(event_init.has_ua_visual_transition)
, m_source_element(event_init.source_element)
{
}
@ -62,6 +63,7 @@ void NavigateEvent::visit_edges(JS::Cell::Visitor& visitor)
visitor.visit(m_signal);
visitor.visit(m_form_data);
visitor.visit(m_info);
visitor.visit(m_source_element);
}
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigateevent-intercept