mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Add SVGLengthOrPercentageOrNumber for stroke-*.
We need to use enum instead of Either since we can't interpolate stroke-* between unitless length and unit length(e.g. '5' -> '10px'). This coomit make following: * Introduce SVGLengthOrPercentageOrNumber on computed and specified values. * Make SVGLengthOrPercentageOrNumber animatable. * Make stroke-dasharray not-accumulate.
This commit is contained in:
parent
6988c7424d
commit
1c574cf93b
6 changed files with 286 additions and 45 deletions
|
@ -606,6 +606,13 @@ impl From<LengthOrPercentage> for NonNegativeLengthOrPercentage {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<NonNegativeLengthOrPercentage> for LengthOrPercentage {
|
||||
#[inline]
|
||||
fn from(lop: NonNegativeLengthOrPercentage) -> LengthOrPercentage {
|
||||
lop.0
|
||||
}
|
||||
}
|
||||
|
||||
impl NonNegativeLengthOrPercentage {
|
||||
/// Get zero value.
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue