mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
script: Improve webdriver_handler::get_element_in_view_center_point
(#38058)
1. Some rounding was wrongly used which can be a source of inaccuracy. 2. Use `window.InnerWidth` instead of `body.ClientWidth` according to spec. Testing: Many new passing cases. Fixes: Part of #38042. --------- Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
parent
f13311a00e
commit
8877adccf2
8 changed files with 63 additions and 69 deletions
|
@ -1875,7 +1875,7 @@ impl Handler {
|
|||
fn handle_element_click(&mut self, element: &WebElement) -> WebDriverResult<WebDriverResponse> {
|
||||
let (sender, receiver) = ipc::channel().unwrap();
|
||||
|
||||
// Steps 1 - 7
|
||||
// Steps 1 - 7 + Step 8 for <option>
|
||||
let cmd = WebDriverScriptCommand::ElementClick(element.to_string(), sender);
|
||||
self.browsing_context_script_command(cmd, VerifyBrowsingContextIsOpen::Yes)?;
|
||||
|
||||
|
@ -1883,7 +1883,7 @@ impl Handler {
|
|||
Ok(element_id) => match element_id {
|
||||
Some(element_id) => {
|
||||
let id = Uuid::new_v4().to_string();
|
||||
|
||||
// Step 8 for elements other than <option>
|
||||
// Step 8.1
|
||||
self.session_mut()?.input_state_table.borrow_mut().insert(
|
||||
id.clone(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue