mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue