Use typed coordinates.

We use Size2D and Point2D across compositing, constellation and script,
losing the type of pixels we use (DevicePixel, DeviceIndepententPixel
or CSSPixel) along the way, which might lead to bugs like
window.outerHeight not taking into account the page zoom (using
DeviceIndepententPixel instead of CSSPixel).
This commit is contained in:
Paul Rouget 2018-03-01 07:41:00 +01:00
parent b93f153ed5
commit ac4614d6ce
10 changed files with 122 additions and 102 deletions

View file

@ -27,7 +27,7 @@ extern crate webdriver;
mod keys;
use euclid::Size2D;
use euclid::TypedSize2D;
use hyper::method::Method::{self, Post};
use image::{DynamicImage, ImageFormat, RgbImage};
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
@ -418,7 +418,7 @@ impl Handler {
Nullable::Value(v) => v,
Nullable::Null => 0,
};
let size = Size2D::new(width as u32, height as u32);
let size = TypedSize2D::new(width as u32, height as u32);
let top_level_browsing_context_id = self.session()?.top_level_browsing_context_id;
let cmd_msg = WebDriverCommandMsg::SetWindowSize(top_level_browsing_context_id, size, sender.clone());