Update euclid.

There are a few canvas2d-related dependencies that haven't updated, but they
only use euclid internally so that's not blocking landing the rest of the
changes.

Given the size of this patch, I think it's useful to get this landed as-is.
This commit is contained in:
Emilio Cobos Álvarez 2019-07-22 12:49:39 +02:00
parent 2ff7cb5a37
commit 3d57c22e9c
133 changed files with 686 additions and 596 deletions

View file

@ -10,7 +10,7 @@ name = "script_tests"
path = "lib.rs"
[dependencies]
euclid = "0.19"
euclid = "0.20"
keyboard-types = "0.4.3"
script = {path = "../../../components/script"}
servo_url = {path = "../../../components/url"}

View file

@ -13,7 +13,7 @@ doctest = false
byteorder = "1.0"
app_units = "0.7"
cssparser = "0.25"
euclid = "0.19"
euclid = "0.20"
html5ever = "0.23"
rayon = "1"
serde_json = "1.0"

View file

@ -3,8 +3,8 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use cssparser::SourceLocation;
use euclid::TypedScale;
use euclid::TypedSize2D;
use euclid::Scale;
use euclid::Size2D;
use selectors::parser::{AncestorHashes, Selector};
use servo_arc::Arc;
use servo_atoms::Atom;
@ -214,8 +214,8 @@ fn test_insert() {
fn mock_stylist() -> Stylist {
let device = Device::new(
MediaType::screen(),
TypedSize2D::new(0f32, 0f32),
TypedScale::new(1.0),
Size2D::new(0f32, 0f32),
Scale::new(1.0),
);
Stylist::new(device, QuirksMode::NoQuirks)
}

View file

@ -3,8 +3,8 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use cssparser::{Parser, ParserInput};
use euclid::TypedScale;
use euclid::TypedSize2D;
use euclid::Scale;
use euclid::Size2D;
use servo_arc::Arc;
use servo_config::set_pref;
use servo_url::ServoUrl;
@ -113,8 +113,8 @@ macro_rules! viewport_length {
fn empty_viewport_rule() {
let device = Device::new(
MediaType::screen(),
TypedSize2D::new(800., 600.),
TypedScale::new(1.0),
Size2D::new(800., 600.),
Scale::new(1.0),
);
test_viewport_rule("@viewport {}", &device, |declarations, css| {
@ -140,8 +140,8 @@ macro_rules! assert_decl_eq {
fn simple_viewport_rules() {
let device = Device::new(
MediaType::screen(),
TypedSize2D::new(800., 600.),
TypedScale::new(1.0),
Size2D::new(800., 600.),
Scale::new(1.0),
);
test_viewport_rule(
@ -308,8 +308,8 @@ fn simple_meta_viewport_contents() {
fn cascading_within_viewport_rule() {
let device = Device::new(
MediaType::screen(),
TypedSize2D::new(800., 600.),
TypedScale::new(1.0),
Size2D::new(800., 600.),
Scale::new(1.0),
);
// normal order of appearance
@ -448,8 +448,8 @@ fn multiple_stylesheets_cascading() {
set_pref!(layout.viewport.enabled, true);
let device = Device::new(
MediaType::screen(),
TypedSize2D::new(800., 600.),
TypedScale::new(1.0),
Size2D::new(800., 600.),
Scale::new(1.0),
);
let shared_lock = SharedRwLock::new();
let stylesheets = vec![
@ -538,8 +538,8 @@ fn constrain_viewport() {
};
}
let initial_viewport = TypedSize2D::new(800., 600.);
let device = Device::new(MediaType::screen(), initial_viewport, TypedScale::new(1.0));
let initial_viewport = Size2D::new(800., 600.);
let device = Device::new(MediaType::screen(), initial_viewport, Scale::new(1.0));
let mut input = ParserInput::new("");
assert_eq!(
ViewportConstraints::maybe_new(&device, from_css!(input), QuirksMode::NoQuirks),
@ -596,13 +596,13 @@ fn constrain_viewport() {
})
);
let initial_viewport = TypedSize2D::new(200., 150.);
let device = Device::new(MediaType::screen(), initial_viewport, TypedScale::new(1.0));
let initial_viewport = Size2D::new(200., 150.);
let device = Device::new(MediaType::screen(), initial_viewport, Scale::new(1.0));
let mut input = ParserInput::new("width: 320px auto");
assert_eq!(
ViewportConstraints::maybe_new(&device, from_css!(input), QuirksMode::NoQuirks),
Some(ViewportConstraints {
size: TypedSize2D::new(320., 240.),
size: Size2D::new(320., 240.),
initial_zoom: PinchZoomFactor::new(1.),
min_zoom: None,