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

@ -127,6 +127,8 @@ pub enum WebDriverCommandMsg {
IpcSender<Result<(), ()>>,
),
GetAlertText(WebViewId, IpcSender<Result<String, ()>>),
AddLoadStatusSender(WebViewId, IpcSender<WebDriverLoadStatus>),
RemoveLoadStatusSender(WebViewId),
}
#[derive(Debug, Deserialize, Serialize)]
@ -202,6 +204,7 @@ pub enum WebDriverScriptCommand {
GetTitle(IpcSender<String>),
/// Match the element type before sending the event for webdriver `element send keys`.
WillSendKeys(String, String, bool, IpcSender<Result<bool, ErrorStatus>>),
IsDocumentReadyStateComplete(IpcSender<bool>),
}
#[derive(Clone, Debug, Deserialize, Serialize)]