mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Synchronize dispatch_actions
in WebDriver (#36932)
Implement missing synchronization in `dispatch_actions` of `WebDriver`. https://w3c.github.io/webdriver/#dispatching-actions > The user agent event loop has spun enough times to process the DOM events generated by the last invocation of the >[dispatch tick actions](https://w3c.github.io/webdriver/#dfn-dispatch-tick-actions) steps. - Add a way for `ScriptThread` to notify `WebDriver` about the completion of input commands. - Add a `webdriver_id` field for `InputEvent`. `ScriptThread` uses it to distinguish WebDriver events and sends notification. Tests: `./mach test-wpt --product servodriver -r tests\wpt\tests\webdriver\tests\classic\element_click\events.py` pass if `hit_testing` pass. Check [issue](https://github.com/servo/servo/issues/36676#issuecomment-2882917136) cc: @xiaochengh --------- Signed-off-by: batu_hoang <longvatrong111@gmail.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
3a527d784b
commit
f52fa9b672
13 changed files with 471 additions and 140 deletions
|
@ -24,6 +24,9 @@ use webrender_api::units::DeviceIntSize;
|
|||
|
||||
use crate::{MouseButton, MouseButtonAction};
|
||||
|
||||
#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
|
||||
pub struct WebDriverMessageId(pub usize);
|
||||
|
||||
/// Messages to the constellation originating from the WebDriver server.
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub enum WebDriverCommandMsg {
|
||||
|
@ -41,9 +44,23 @@ pub enum WebDriverCommandMsg {
|
|||
/// Act as if keys were pressed or release in the browsing context with the given ID.
|
||||
KeyboardAction(BrowsingContextId, KeyboardEvent),
|
||||
/// Act as if the mouse was clicked in the browsing context with the given ID.
|
||||
MouseButtonAction(WebViewId, MouseButtonAction, MouseButton, f32, f32),
|
||||
MouseButtonAction(
|
||||
WebViewId,
|
||||
MouseButtonAction,
|
||||
MouseButton,
|
||||
f32,
|
||||
f32,
|
||||
WebDriverMessageId,
|
||||
IpcSender<WebDriverCommandResponse>,
|
||||
),
|
||||
/// Act as if the mouse was moved in the browsing context with the given ID.
|
||||
MouseMoveAction(WebViewId, f32, f32),
|
||||
MouseMoveAction(
|
||||
WebViewId,
|
||||
f32,
|
||||
f32,
|
||||
WebDriverMessageId,
|
||||
IpcSender<WebDriverCommandResponse>,
|
||||
),
|
||||
/// Act as if the mouse wheel is scrolled in the browsing context given the given ID.
|
||||
WheelScrollAction(WebViewId, f32, f32, f64, f64),
|
||||
/// Set the window size.
|
||||
|
@ -188,6 +205,11 @@ pub enum WebDriverFrameId {
|
|||
Parent,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct WebDriverCommandResponse {
|
||||
pub id: WebDriverMessageId,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub enum WebDriverLoadStatus {
|
||||
Complete,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue