mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
style: Clamp to non-negative value after doing interpolation for circle(), ellipse(), and inset().
Replace LengthOrPercentage with NonNegativeLengthOrPercentage on ShapeRadius, Circle, Ellipse. And derive ToAnimatedValue for ShapeSource and its related types, so we clamp its interpolated results into non-negative values. (i.e. The radius of circle()/ellipse() and the border-radius of inset().) Note: We may get negative values when using a negative easing function, so the clamp is necessary to avoid the incorrect result or any undefined behavior. Differential Revision: https://phabricator.services.mozilla.com/D14654
This commit is contained in:
parent
627559546d
commit
f0f3eb3194
10 changed files with 110 additions and 27 deletions
|
@ -286,7 +286,9 @@ impl GeckoStyleCoordConvertible for ComputedShapeRadius {
|
|||
None
|
||||
}
|
||||
},
|
||||
_ => LengthOrPercentage::from_gecko_style_coord(coord).map(ShapeRadius::Length),
|
||||
_ => {
|
||||
GeckoStyleCoordConvertible::from_gecko_style_coord(coord).map(ShapeRadius::Length)
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue