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:
Mantaroh Yoshinaga 2017-07-12 13:37:53 +09:00
parent 6988c7424d
commit 1c574cf93b
6 changed files with 286 additions and 45 deletions

View file

@ -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]