mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
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:
parent
5cf662fb97
commit
c27388cb81
5 changed files with 36 additions and 183 deletions
|
@ -21,7 +21,7 @@ use properties::longhands::transform::computed_value::ComputedMatrix;
|
|||
use properties::longhands::transform::computed_value::ComputedOperation as TransformOperation;
|
||||
use properties::longhands::transform::computed_value::T as TransformList;
|
||||
use values::computed::{Angle, LengthOrPercentageOrAuto, LengthOrPercentageOrNone};
|
||||
use values::computed::{LengthAndPercentage, LengthOrPercentage, Length, Time};
|
||||
use values::computed::{LengthOrPercentage, Length, Time};
|
||||
use values::CSSFloat;
|
||||
use cssparser::{RGBA, Color};
|
||||
|
||||
|
@ -506,17 +506,6 @@ impl Interpolate for LengthOrPercentage {
|
|||
}
|
||||
}
|
||||
|
||||
impl Interpolate for LengthAndPercentage {
|
||||
#[inline]
|
||||
fn interpolate(&self, other: &LengthAndPercentage, time: f32)
|
||||
-> Option<LengthAndPercentage> {
|
||||
Some(LengthAndPercentage {
|
||||
length: self.length.interpolate(&other.length, time).unwrap(),
|
||||
percentage: self.percentage.interpolate(&other.percentage, time).unwrap(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl Interpolate for LengthOrPercentageOrAuto {
|
||||
#[inline]
|
||||
fn interpolate(&self, other: &LengthOrPercentageOrAuto, time: f32)
|
||||
|
@ -795,8 +784,8 @@ fn build_identity_transform_list(list: &Vec<TransformOperation>) -> Vec<Transfor
|
|||
result.push(TransformOperation::Skew(0.0, 0.0));
|
||||
}
|
||||
&TransformOperation::Translate(..) => {
|
||||
result.push(TransformOperation::Translate(LengthAndPercentage::zero(),
|
||||
LengthAndPercentage::zero(),
|
||||
result.push(TransformOperation::Translate(LengthOrPercentage::zero(),
|
||||
LengthOrPercentage::zero(),
|
||||
Au(0)));
|
||||
}
|
||||
&TransformOperation::Scale(..) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue