Rework webdriver session (#38225)

Reimplement webdriver session for better match to spec:

- Add `create_session`:
[spec](https://www.w3.org/TR/webdriver2/#dfn-create-a-session)
- Refactor `handle_new_session`
- Replace `PageLoadStrategy` string by enum

---------

Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
This commit is contained in:
batu_hoang 2025-07-28 18:14:14 +08:00 committed by GitHub
parent ae69646371
commit f5ee72f89a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 314 additions and 202 deletions

View file

@ -27,7 +27,7 @@ impl ServoCapabilities {
set_window_rect: true,
strict_file_interactability: false,
accept_proxy: false,
accept_custom: false,
accept_custom: true,
}
}
}
@ -59,7 +59,13 @@ impl BrowserCapabilities for ServoCapabilities {
Ok(self.set_window_rect)
}
fn strict_file_interactability(&mut self, _: &Capabilities) -> WebDriverResult<bool> {
fn strict_file_interactability(&mut self, value: &Capabilities) -> WebDriverResult<bool> {
if let Some(Value::Bool(strict_file_interactability)) =
value.get("strictFileInteractability")
{
self.strict_file_interactability = *strict_file_interactability;
}
Ok(self.strict_file_interactability)
}