Add Servo_AnimationValue_Transform which creates an AnimationValue of transform.

This commit is contained in:
Boris Chiou 2017-10-27 21:06:20 +02:00
parent f02bd01add
commit 1f5551c397
4 changed files with 46 additions and 12 deletions

View file

@ -3097,18 +3097,32 @@ fn static_assert() {
}
}
pub fn clone_transform(&self) -> longhands::transform::computed_value::T {
use properties::longhands::transform::computed_value;
if self.gecko.mSpecifiedTransform.mRawPtr.is_null() {
return computed_value::T(None);
return longhands::transform::computed_value::T(None);
}
let list = unsafe { (*self.gecko.mSpecifiedTransform.to_safe().get()).mHead.as_ref() };
let result = list.map(|list| {
list.into_iter()
.map(|value| Self::clone_single_transform_function(value))
.collect()
});
computed_value::T(result)
Self::clone_transform_from_list(list)
}
pub fn clone_transform_from_list(list: Option< &structs::root::nsCSSValueList>)
-> longhands::transform::computed_value::T {
let result = match list {
Some(list) => {
let vec: Vec<_> = list
.into_iter()
.filter_map(|value| {
// Handle none transform.
if value.is_none() {
None
} else {
Some(Self::clone_single_transform_function(value))
}
})
.collect();
if !vec.is_empty() { Some(vec) } else { None }
},
_ => None,
};
longhands::transform::computed_value::T(result)
}
${impl_transition_time_value('delay', 'Delay')}