stylo: Calculate font-size keywords based on base size

MozReview-Commit-ID: Ff6kt8RLChI
This commit is contained in:
Manish Goregaokar 2017-03-17 19:48:20 -07:00 committed by Manish Goregaokar
parent 0aceddd47b
commit fddddc9711
7 changed files with 130 additions and 27 deletions

View file

@ -33,6 +33,14 @@ const AU_PER_Q: CSSFloat = AU_PER_MM / 4.;
const AU_PER_PT: CSSFloat = AU_PER_IN / 72.;
const AU_PER_PC: CSSFloat = AU_PER_PT * 12.;
/// Same as Gecko's AppUnitsToIntCSSPixels
///
/// Converts app units to integer pixel values,
/// rounding during the conversion
pub fn au_to_int_px(au: f32) -> i32 {
(au / AU_PER_PX).round() as i32
}
#[derive(Clone, PartialEq, Copy, Debug)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
/// A font relative length.