Change transforms to use LengthOrPercentage.

This simplifies an upcoming PR to support serializing transform values for css style declarations.

Related to issue #6643.
This commit is contained in:
Glenn Watson 2015-07-28 09:42:05 +10:00
parent 5cf662fb97
commit c27388cb81
5 changed files with 36 additions and 183 deletions

View file

@ -13,7 +13,7 @@ use std::cmp::{max, min};
use std::fmt;
use style::computed_values::transform::ComputedMatrix;
use style::properties::ComputedValues;
use style::values::computed::{LengthAndPercentage, LengthOrPercentageOrAuto};
use style::values::computed::LengthOrPercentageOrAuto;
use style::values::computed::{LengthOrPercentageOrNone, LengthOrPercentage};
use util::geometry::Au;
use util::logical_geometry::LogicalMargin;
@ -439,15 +439,3 @@ impl ToGfxMatrix for ComputedMatrix {
}
}
}
pub trait ToAu {
fn to_au(&self, containing_size: Au) -> Au;
}
impl ToAu for LengthAndPercentage {
#[inline]
fn to_au(&self, containing_size: Au) -> Au {
self.length + Au::from_f32_px(self.percentage * containing_size.to_f32_px())
}
}