mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
WebDriver Chore: use enum instead of compile time constant for browsing_context_script_command
(#37940)
This reduces unnecessary generated code and binary size. See https://github.com/servo/servo/pull/37712#discussion_r2171957828 Testing: No Behaviour change --------- Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This commit is contained in:
parent
e64bc6d282
commit
68ec88465e
2 changed files with 66 additions and 56 deletions
|
@ -20,7 +20,7 @@ use webdriver::actions::{
|
|||
use webdriver::command::ActionsParameters;
|
||||
use webdriver::error::{ErrorStatus, WebDriverError};
|
||||
|
||||
use crate::{Handler, WebElement, wait_for_script_response};
|
||||
use crate::{Handler, VerifyBrowsingContextIsOpen, WebElement, wait_for_script_response};
|
||||
|
||||
// Interval between wheelScroll and pointerMove increments in ms, based on common vsync
|
||||
static POINTERMOVE_INTERVAL: u64 = 17;
|
||||
|
@ -738,8 +738,9 @@ impl Handler {
|
|||
web_element: &WebElement,
|
||||
) -> Result<(i64, i64), ErrorStatus> {
|
||||
let (sender, receiver) = ipc::channel().unwrap();
|
||||
self.browsing_context_script_command::<false>(
|
||||
self.browsing_context_script_command(
|
||||
WebDriverScriptCommand::GetElementInViewCenterPoint(web_element.to_string(), sender),
|
||||
VerifyBrowsingContextIsOpen::No,
|
||||
)
|
||||
.unwrap();
|
||||
let response = match wait_for_script_response(receiver) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue