webdriver: Element click waits for navigation complete (#37935)

Step 11 in https://w3c.github.io/webdriver/#dfn-element-click

> [Try](https://w3c.github.io/webdriver/#dfn-try) to [wait for
navigation to
complete](https://w3c.github.io/webdriver/#dfn-wait-for-navigation-to-complete)
with session.

This fixes issue in which element_click triggers navigation, but
incoming commands still interact with old page.

Testing:
https://github.com/longvatrong111/servo/actions/runs/16175767947
https://github.com/longvatrong111/servo/actions/runs/16175770044

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
This commit is contained in:
batu_hoang 2025-07-15 14:51:05 +08:00 committed by GitHub
parent ff02fdad6d
commit f155c95e1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 137 additions and 63 deletions

View file

@ -2499,6 +2499,13 @@ impl ScriptThread {
reply,
can_gc,
),
WebDriverScriptCommand::IsDocumentReadyStateComplete(response_sender) => {
webdriver_handlers::handle_try_wait_for_document_navigation(
&documents,
pipeline_id,
response_sender,
)
},
_ => (),
}
}