webdriver: Move navigation commands to servoshell (#37665)

- Move webdriver `GetViewportSize`, `LoadURL` and `Refresh` to
servoshell.
- Add `GoBack` and `GoFoward` commands.

Testing: Need to finish moving webdriver to servoshell then evaluate
again
Fixes: https://github.com/servo/servo/issues/37370

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
This commit is contained in:
batu_hoang 2025-06-25 20:35:13 +08:00 committed by GitHub
parent 0346a62214
commit 62a009399f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 61 additions and 98 deletions

View file

@ -33,11 +33,15 @@ pub enum WebDriverCommandMsg {
/// Get the window size.
GetWindowSize(WebViewId, IpcSender<Size2D<i32, DevicePixel>>),
/// Get the viewport size.
GetViewportSize(WebViewId, IpcSender<Size2D<f32, CSSPixel>>),
GetViewportSize(WebViewId, IpcSender<Size2D<u32, DevicePixel>>),
/// Load a URL in the top-level browsing context with the given ID.
LoadUrl(WebViewId, ServoUrl, IpcSender<WebDriverLoadStatus>),
/// Refresh the top-level browsing context with the given ID.
Refresh(WebViewId, IpcSender<WebDriverLoadStatus>),
/// Navigate the webview with the given ID to the previous page in the browsing context's history.
GoBack(WebViewId),
/// Navigate the webview with the given ID to the next page in the browsing context's history.
GoForward(WebViewId),
/// Pass a webdriver command to the script thread of the current pipeline
/// of a browsing context.
ScriptCommand(BrowsingContextId, WebDriverScriptCommand),