mirror of
https://github.com/servo/servo.git
synced 2025-08-23 22:35:33 +01:00
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:
parent
2ff7cb5a37
commit
3d57c22e9c
133 changed files with 686 additions and 596 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue