Implement setting position through webdriver for headed window (#38209)

Previously, we pretend we are able to set position in response. Now we
can really do it.

Testing: Able to set position accurately when tested locally.
Fixes: Task 5 of #37804.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
Euclid Ye 2025-07-23 02:26:37 +08:00 committed by GitHub
parent cff48d4910
commit 4ff6b1d4a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 64 additions and 36 deletions

View file

@ -16,7 +16,7 @@ use keyboard_types::KeyboardEvent;
use keyboard_types::webdriver::Event as WebDriverInputEvent;
use pixels::RasterImage;
use serde::{Deserialize, Serialize};
use servo_geometry::{DeviceIndependentIntRect, DeviceIndependentIntSize, DeviceIndependentPixel};
use servo_geometry::DeviceIndependentIntRect;
use servo_url::ServoUrl;
use style_traits::CSSPixel;
use webdriver::common::{WebElement, WebFrame, WebWindow};
@ -132,11 +132,11 @@ pub enum WebDriverCommandMsg {
// expect one response from constellation for each tick actions.
Option<WebDriverMessageId>,
),
/// Set the window size.
SetWindowSize(
/// Set the outer window rectangle.
SetWindowRect(
WebViewId,
DeviceIndependentIntSize,
IpcSender<Size2D<i32, DeviceIndependentPixel>>,
DeviceIndependentIntRect,
IpcSender<DeviceIndependentIntRect>,
),
/// Take a screenshot of the viewport.
TakeScreenshot(