diff options
-rw-r--r-- | Cargo.lock | 22 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | components/canvas/backend.rs | 31 | ||||
-rw-r--r-- | components/canvas/raqote_backend.rs | 46 | ||||
-rw-r--r-- | components/webdriver_server/actions.rs | 29 | ||||
-rw-r--r-- | components/webdriver_server/lib.rs | 4 |
6 files changed, 58 insertions, 76 deletions
diff --git a/Cargo.lock b/Cargo.lock index fb0e0679b69..363ca82cfb7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1065,7 +1065,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ "lazy_static", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -2032,7 +2032,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2559,7 +2559,7 @@ dependencies = [ "gobject-sys", "libc", "system-deps", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4001,7 +4001,7 @@ checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ "hermit-abi 0.5.0", "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4254,7 +4254,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a793df0d7afeac54f95b471d3af7f0d4fb975699f972341a4b76988d49cdf0c" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -6182,7 +6182,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -7550,7 +7550,7 @@ dependencies = [ "getrandom", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -8537,11 +8537,11 @@ dependencies = [ [[package]] name = "webdriver" -version = "0.51.0" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "310ce9d3648c5ff1915ca7dd09c44eabb7eb17f9ff4a6e7e5f4a902c8d1e269f" +checksum = "91d53921e1bef27512fa358179c9a22428d55778d2c2ae3c5c37a52b82ce6e92" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bytes", "cookie 0.16.2", "http 0.2.12", @@ -8907,7 +8907,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 52f84878e14..4045a0ffcb9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -164,7 +164,7 @@ unicode-segmentation = "1.12.0" url = "2.5" urlpattern = "0.3" uuid = { version = "1.12.1", features = ["v4"] } -webdriver = "0.51.0" +webdriver = "0.53.0" webgpu_traits = { path = "components/shared/webgpu" } webpki-roots = "0.26" webrender = { git = "https://github.com/servo/webrender", branch = "0.67", features = ["capture"] } diff --git a/components/canvas/backend.rs b/components/canvas/backend.rs index 53acbea8b8d..7e348fbc9b9 100644 --- a/components/canvas/backend.rs +++ b/components/canvas/backend.rs @@ -134,7 +134,18 @@ pub(crate) trait GenericPathBuilder<B: Backend> { start_angle: f32, end_angle: f32, anticlockwise: bool, - ); + ) { + Self::ellipse( + self, + origin, + radius, + radius, + 0., + start_angle, + end_angle, + anticlockwise, + ); + } fn bezier_curve_to( &mut self, control_point1: &Point2D<f32>, @@ -212,7 +223,23 @@ pub(crate) trait GenericPathBuilder<B: Backend> { large_arc: bool, sweep: bool, end_point: Point2D<f32>, - ); + ) { + let Some(start) = self.get_current_point() else { + return; + }; + + let arc = lyon_geom::SvgArc { + from: start, + to: end_point, + radii: lyon_geom::vector(radius_x, radius_y), + x_rotation: lyon_geom::Angle::degrees(rotation_angle), + flags: lyon_geom::ArcFlags { large_arc, sweep }, + }; + + arc.for_each_quadratic_bezier(&mut |q| { + self.quadratic_curve_to(&q.ctrl, &q.to); + }); + } fn finish(&mut self) -> B::Path; } diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs index efe0ffd05b8..ecf780c36d5 100644 --- a/components/canvas/raqote_backend.rs +++ b/components/canvas/raqote_backend.rs @@ -680,26 +680,6 @@ impl PathBuilder { } impl GenericPathBuilder<RaqoteBackend> for PathBuilder { - fn arc( - &mut self, - origin: Point2D<f32>, - radius: f32, - start_angle: f32, - end_angle: f32, - anticlockwise: bool, - ) { - <PathBuilder as GenericPathBuilder<RaqoteBackend>>::ellipse( - self, - origin, - radius, - radius, - 0., - start_angle, - end_angle, - anticlockwise, - ); - } - fn bezier_curve_to( &mut self, control_point1: &Point2D<f32>, @@ -720,32 +700,6 @@ impl GenericPathBuilder<RaqoteBackend> for PathBuilder { self.0.as_mut().unwrap().close(); } - fn svg_arc( - &mut self, - radius_x: f32, - radius_y: f32, - rotation_angle: f32, - large_arc: bool, - sweep: bool, - end_point: Point2D<f32>, - ) { - let Some(start) = self.get_current_point() else { - return; - }; - - let arc = lyon_geom::SvgArc { - from: start, - to: end_point, - radii: lyon_geom::vector(radius_x, radius_y), - x_rotation: lyon_geom::Angle::degrees(rotation_angle), - flags: lyon_geom::ArcFlags { large_arc, sweep }, - }; - - arc.for_each_quadratic_bezier(&mut |q| { - self.quadratic_curve_to(&q.ctrl, &q.to); - }); - } - fn get_current_point(&mut self) -> Option<Point2D<f32>> { let path = self.finish(); self.0 = Some(path.clone().into()); diff --git a/components/webdriver_server/actions.rs b/components/webdriver_server/actions.rs index 842d9f0dbc2..43dd0e183dc 100644 --- a/components/webdriver_server/actions.rs +++ b/components/webdriver_server/actions.rs @@ -36,8 +36,8 @@ pub(crate) enum InputSourceState { pub(crate) struct PointerInputState { subtype: PointerType, pressed: HashSet<u64>, - x: i64, - y: i64, + x: f64, + y: f64, } impl PointerInputState { @@ -49,8 +49,8 @@ impl PointerInputState { PointerType::Touch => PointerType::Touch, }, pressed: HashSet::new(), - x: 0, - y: 0, + x: 0.0, + y: 0.0, } } } @@ -394,7 +394,8 @@ impl Handler { PointerOrigin::Viewport => (x_offset, y_offset), PointerOrigin::Pointer => (start_x + x_offset, start_y + y_offset), PointerOrigin::Element(ref web_element) => { - self.get_element_origin_relative_coordinates(web_element)? + let point = self.get_element_origin_relative_coordinates(web_element)?; + (point.0 as f64, point.1 as f64) }, }; @@ -425,10 +426,10 @@ impl Handler { &mut self, source_id: &str, duration: u64, - start_x: i64, - start_y: i64, - target_x: i64, - target_y: i64, + start_x: f64, + start_y: f64, + target_x: f64, + target_y: f64, tick_start: Instant, ) { let session = self.session.as_mut().unwrap(); @@ -456,8 +457,8 @@ impl Handler { (target_x, target_y) } else { ( - (duration_ratio * (target_x - start_x) as f64) as i64 + start_x, - (duration_ratio * (target_y - start_y) as f64) as i64 + start_y, + duration_ratio * (target_x - start_x) + start_x, + duration_ratio * (target_y - start_y) + start_y, ) }; @@ -524,7 +525,7 @@ impl Handler { }; // Step 5 - 6 - self.check_viewport_bound(x, y)?; + self.check_viewport_bound(x as _, y as _)?; // Step 7 - 8 let Some(delta_x) = action.deltaX else { @@ -632,7 +633,7 @@ impl Handler { ); } - fn check_viewport_bound(&self, x: i64, y: i64) -> Result<(), ErrorStatus> { + fn check_viewport_bound(&self, x: f64, y: f64) -> Result<(), ErrorStatus> { let (sender, receiver) = ipc::channel().unwrap(); let cmd_msg = WebDriverCommandMsg::GetWindowSize(self.session.as_ref().unwrap().webview_id, sender); @@ -644,7 +645,7 @@ impl Handler { Ok(response) => response, Err(WebDriverError { error, .. }) => return Err(error), }; - if x < 0 || x as f32 > viewport_size.width || y < 0 || y as f32 > viewport_size.height { + if x < 0.0 || x > viewport_size.width.into() || y < 0.0 || y > viewport_size.height.into() { Err(ErrorStatus::MoveTargetOutOfBounds) } else { Ok(()) diff --git a/components/webdriver_server/lib.rs b/components/webdriver_server/lib.rs index ad5b4e736a9..5735594b058 100644 --- a/components/webdriver_server/lib.rs +++ b/components/webdriver_server/lib.rs @@ -1626,8 +1626,8 @@ impl Handler { let pointer_move_action = PointerMoveAction { duration: None, origin: PointerOrigin::Element(WebElement(element_id)), - x: 0, - y: 0, + x: 0.0, + y: 0.0, ..Default::default() }; |