Auto merge of #23827 - emilio:gecko-sync, r=emilio,manishearth

style: Sync changes from mozilla-central, and update euclid

See individual commits for details.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23827)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-07-23 18:42:00 -04:00 committed by GitHub
commit 8f7440f368
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
175 changed files with 1481 additions and 1441 deletions

View file

@ -14,7 +14,7 @@ use crate::values::computed::CSSPixelLength;
use crate::values::computed::Resolution;
use crate::Atom;
use app_units::Au;
use euclid::Size2D;
use euclid::default::Size2D;
fn viewport_size(device: &Device) -> Size2D<Au> {
if let Some(pc) = device.pres_context() {

View file

@ -16,8 +16,8 @@ use crate::values::{CustomIdent, KeyframesName};
use app_units::Au;
use app_units::AU_PER_PX;
use cssparser::RGBA;
use euclid::Size2D;
use euclid::TypedScale;
use euclid::default::Size2D;
use euclid::Scale;
use servo_arc::Arc;
use std::fmt;
use std::sync::atomic::{AtomicBool, AtomicIsize, AtomicUsize, Ordering};
@ -247,20 +247,20 @@ impl Device {
}
/// Returns the device pixel ratio.
pub fn device_pixel_ratio(&self) -> TypedScale<f32, CSSPixel, DevicePixel> {
pub fn device_pixel_ratio(&self) -> Scale<f32, CSSPixel, DevicePixel> {
let pc = match self.pres_context() {
Some(pc) => pc,
None => return TypedScale::new(1.),
None => return Scale::new(1.),
};
let override_dppx = pc.mOverrideDPPX;
if override_dppx > 0.0 {
return TypedScale::new(override_dppx);
return Scale::new(override_dppx);
}
let au_per_dpx = pc.mCurAppUnitsPerDevPixel as f32;
let au_per_px = AU_PER_PX as f32;
TypedScale::new(au_per_px / au_per_dpx)
Scale::new(au_per_px / au_per_dpx)
}
/// Returns whether document colors are enabled.