mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Refactor how calc() clamping is done on computed values (fixes #15296)
This commit is contained in:
parent
f935f2da01
commit
d0b9bd9c64
13 changed files with 173 additions and 154 deletions
|
@ -24,7 +24,7 @@ impl From<CalcLengthOrPercentage> for nsStyleCoord_CalcValue {
|
|||
fn from(other: CalcLengthOrPercentage) -> nsStyleCoord_CalcValue {
|
||||
let has_percentage = other.percentage.is_some();
|
||||
nsStyleCoord_CalcValue {
|
||||
mLength: other.length.0,
|
||||
mLength: other.length().0,
|
||||
mPercent: other.percentage.unwrap_or(0.0),
|
||||
mHasPercent: has_percentage,
|
||||
}
|
||||
|
@ -38,10 +38,7 @@ impl From<nsStyleCoord_CalcValue> for CalcLengthOrPercentage {
|
|||
} else {
|
||||
None
|
||||
};
|
||||
CalcLengthOrPercentage {
|
||||
length: Au(other.mLength),
|
||||
percentage: percentage,
|
||||
}
|
||||
Self::new(Au(other.mLength), percentage)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue