LibWeb+WebContent: Handle user prompts that open during script execution

If a dialog is opened while a script is executing, we must give control
back to the WebDriver client. The script must also continue executing
though, so once it completes, we ignore its result.
This commit is contained in:
Timothy Flynn 2024-10-31 20:23:36 -04:00 committed by Andreas Kling
commit 1be67faab7
Notes: github-actions[bot] 2024-11-02 10:10:50 +00:00
3 changed files with 38 additions and 43 deletions

View file

@ -254,8 +254,6 @@ JS::ThrowCompletionOr<JS::Value> execute_a_function_body(HTML::BrowsingContext c
// https://w3c.github.io/webdriver/#dfn-execute-a-function-body
JS::ThrowCompletionOr<JS::Value> execute_a_function_body(HTML::Window const& window, ByteString const& body, ReadonlySpan<JS::Value> parameters, JS::GCPtr<JS::Object> environment_override_object)
{
// FIXME: If at any point during the algorithm a user prompt appears, immediately return Completion { [[Type]]: normal, [[Value]]: null, [[Target]]: empty }, but continue to run the other steps of this algorithm in parallel.
auto& realm = window.realm();
// 2. Let environment settings be the environment settings object for window.