LibWeb: Break the Window open steps into two methods for internal use

Some callers (namely WebDriver) will need access to the navigable opened
by these steps. But if the noopener parameter is set, the returned proxy
will always be null.

This splits some of the Window open steps into an internal method that
returns the chosen navigable.
This commit is contained in:
Timothy Flynn 2024-10-20 08:48:52 -04:00 committed by Tim Ledbetter
commit 981aaba96c
Notes: github-actions[bot] 2024-10-20 15:42:16 +00:00
2 changed files with 26 additions and 8 deletions

View file

@ -102,6 +102,14 @@ public:
void set_import_maps_allowed(bool import_maps_allowed) { m_import_maps_allowed = import_maps_allowed; }
WebIDL::ExceptionOr<JS::GCPtr<WindowProxy>> window_open_steps(StringView url, StringView target, StringView features);
struct OpenedWindow {
JS::GCPtr<Navigable> navigable;
TokenizedFeature::NoOpener no_opener { TokenizedFeature::NoOpener::No };
Navigable::WindowType window_type { Navigable::WindowType::ExistingOrNone };
};
WebIDL::ExceptionOr<OpenedWindow> window_open_steps_internal(StringView url, StringView target, StringView features);
bool has_animation_frame_callbacks() const { return m_animation_frame_callback_driver.has_callbacks(); }
DOM::Event* current_event() { return m_current_event.ptr(); }