mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Rename Au methods with f32/f64 instead of frac32/frac/subpx
This commit is contained in:
parent
32d5e24922
commit
8b522f2e7d
23 changed files with 99 additions and 99 deletions
|
@ -203,8 +203,8 @@ pub fn parse_media_query_list(input: &mut Parser) -> MediaQueryList {
|
|||
|
||||
impl MediaQueryList {
|
||||
pub fn evaluate(&self, device: &Device) -> bool {
|
||||
let viewport_size = Size2D(Au::from_frac32_px(device.viewport_size.width.get()),
|
||||
Au::from_frac32_px(device.viewport_size.height.get()));
|
||||
let viewport_size = Size2D(Au::from_f32_px(device.viewport_size.width.get()),
|
||||
Au::from_f32_px(device.viewport_size.height.get()));
|
||||
|
||||
// Check if any queries match (OR condition)
|
||||
self.media_queries.iter().any(|mq| {
|
||||
|
|
|
@ -3313,8 +3313,8 @@ pub mod longhands {
|
|||
return Err(())
|
||||
}
|
||||
let (tx, ty) =
|
||||
(specified::Length::Absolute(Au::from_frac32_px(values[4])),
|
||||
specified::Length::Absolute(Au::from_frac32_px(values[5])));
|
||||
(specified::Length::Absolute(Au::from_f32_px(values[4])),
|
||||
specified::Length::Absolute(Au::from_f32_px(values[5])));
|
||||
let (tx, ty) =
|
||||
(specified::LengthAndPercentage::from_length(tx),
|
||||
specified::LengthAndPercentage::from_length(ty));
|
||||
|
|
|
@ -187,7 +187,7 @@ pub mod specified {
|
|||
pub fn to_computed_value(&self, viewport_size: Size2D<Au>) -> Au {
|
||||
macro_rules! to_unit {
|
||||
($viewport_dimension:expr) => {
|
||||
$viewport_dimension.to_frac32_px() / 100.0
|
||||
$viewport_dimension.to_f32_px() / 100.0
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -201,7 +201,7 @@ pub mod specified {
|
|||
&ViewportPercentageLength::Vmax(length) =>
|
||||
length * to_unit!(cmp::max(viewport_size.width, viewport_size.height)),
|
||||
};
|
||||
Au::from_frac32_px(value)
|
||||
Au::from_f32_px(value)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -236,7 +236,7 @@ pub mod specified {
|
|||
impl ToCss for Length {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
match self {
|
||||
&Length::Absolute(length) => write!(dest, "{}px", length.to_frac32_px()),
|
||||
&Length::Absolute(length) => write!(dest, "{}px", length.to_f32_px()),
|
||||
&Length::FontRelative(length) => length.to_css(dest),
|
||||
&Length::ViewportPercentage(length) => length.to_css(dest),
|
||||
&Length::ServoCharacterWidth(_)
|
||||
|
@ -1114,7 +1114,7 @@ pub mod computed {
|
|||
|
||||
fn mul(self, scalar: CSSFloat) -> LengthAndPercentage {
|
||||
LengthAndPercentage {
|
||||
length: Au::from_frac32_px(self.length.to_frac32_px() * scalar),
|
||||
length: Au::from_f32_px(self.length.to_f32_px() * scalar),
|
||||
percentage: self.percentage * scalar,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue