mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Replace Au with CSSPixelLength in CalcLengthOrPercentage.
We replace Au with CSSPixelLength for the length part of computed::CalcLengthOrPercentage. Therefore, it would be easier to use CSSPixelLength for all other LengthOrPercentage{*} types.
This commit is contained in:
parent
a949e2a057
commit
535c1e3c6f
13 changed files with 99 additions and 117 deletions
|
@ -29,7 +29,7 @@ impl From<CalcLengthOrPercentage> for nsStyleCoord_CalcValue {
|
|||
fn from(other: CalcLengthOrPercentage) -> nsStyleCoord_CalcValue {
|
||||
let has_percentage = other.percentage.is_some();
|
||||
nsStyleCoord_CalcValue {
|
||||
mLength: other.unclamped_length().0,
|
||||
mLength: other.unclamped_length().to_i32_au(),
|
||||
mPercent: other.percentage.map_or(0., |p| p.0),
|
||||
mHasPercent: has_percentage,
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ impl From<nsStyleCoord_CalcValue> for CalcLengthOrPercentage {
|
|||
} else {
|
||||
None
|
||||
};
|
||||
Self::new(Au(other.mLength), percentage)
|
||||
Self::new(Au(other.mLength).into(), percentage)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue