Backed out changeset 118a2b0b07c2 for assertion failures

MozReview-Commit-ID: 2pR2sdlejqW
This commit is contained in:
Phil Ringnalda 2017-09-06 21:08:39 -07:00
Родитель b95528913e
Коммит 5921d11c6e
3 изменённых файлов: 10 добавлений и 6 удалений

Просмотреть файл

@ -2341,7 +2341,7 @@ fn static_assert() {
pub fn calculate_script_level_size(&self, parent: &Self, device: &Device) -> (Au, Au) {
use std::cmp;
let delta = self.gecko.mScriptLevel.saturating_sub(parent.gecko.mScriptLevel);
let delta = self.gecko.mScriptLevel - parent.gecko.mScriptLevel;
let parent_size = Au(parent.gecko.mSize);
let parent_unconstrained_size = Au(parent.gecko.mScriptUnconstrainedSize);

Просмотреть файл

@ -162,7 +162,7 @@ where
impl Animate for Au {
#[inline]
fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
Ok(Au::new(self.0.animate(&other.0, procedure)?))
Ok(Au(self.0.animate(&other.0, procedure)?))
}
}

Просмотреть файл

@ -6,7 +6,7 @@
//!
//! [length]: https://drafts.csswg.org/css-values/#lengths
use app_units::{Au, MAX_AU, MIN_AU};
use app_units::Au;
use cssparser::{Parser, Token, BasicParseError};
use euclid::Size2D;
use font_metrics::FontMetricsQueryResult;
@ -236,12 +236,16 @@ impl CharacterWidth {
}
}
/// Same as Gecko
const ABSOLUTE_LENGTH_MAX: i32 = (1 << 30);
const ABSOLUTE_LENGTH_MIN: i32 = - (1 << 30);
/// Helper to convert a floating point length to application units
fn to_au_round(length: CSSFloat, au_per_unit: CSSFloat) -> Au {
Au(
((length * au_per_unit) as f64)
.min(MAX_AU.0 as f64)
.max(MIN_AU.0 as f64)
(length * au_per_unit)
.min(ABSOLUTE_LENGTH_MAX as f32)
.max(ABSOLUTE_LENGTH_MIN as f32)
.round() as i32
)
}