mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Bug 1360144 - make stroke-{*} animatable for stylo. r=boris
This part includes making stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, and stroke-dasharray animatable. For properties that already implemented Interpolate trait and clone() for glue code, we can just make them animatable by replacing the animation_value_type with proper type name. So, set animation_value_type to 'discrete' for stroke-linecap and stroke-linejoin. Set animation_value_type to 'ComputedValue' for stroke-miterlimit and stroke-opacity. As to stroke-dasharray, we need to implement Interpolate trait and glue codes for it.
This commit is contained in:
parent
896a920ff5
commit
729b4f7901
3 changed files with 28 additions and 5 deletions
|
@ -621,6 +621,8 @@ pub trait Interpolate: Sized {
|
|||
/// https://drafts.csswg.org/css-transitions/#animtype-repeatable-list
|
||||
pub trait RepeatableListInterpolate: Interpolate {}
|
||||
|
||||
impl RepeatableListInterpolate for Either<f32, LengthOrPercentage> {}
|
||||
|
||||
impl<T: RepeatableListInterpolate> Interpolate for SmallVec<[T; 1]> {
|
||||
fn interpolate(&self, other: &Self, progress: f64) -> Result<Self, ()> {
|
||||
use num_integer::lcm;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue