mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Bug 1343753 - Add Servo_Property_IsAnimatable.
MozReview-Commit-ID: 343Md43bpij
This commit is contained in:
parent
9a3905f834
commit
51ad646c96
3 changed files with 22 additions and 0 deletions
|
@ -1686,6 +1686,9 @@ extern "C" {
|
|||
nsCSSPropertyID)
|
||||
-> RawServoAnimationValueStrong;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_Property_IsAnimatable(property: nsCSSPropertyID) -> bool;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_Property_IsDiscreteAnimatable(property: nsCSSPropertyID)
|
||||
-> bool;
|
||||
|
|
|
@ -118,6 +118,19 @@ impl TransitionProperty {
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns true if this nsCSSPropertyID is one of the animatable properties.
|
||||
#[cfg(feature = "gecko")]
|
||||
pub fn nscsspropertyid_is_animatable(property: nsCSSPropertyID) -> bool {
|
||||
match property {
|
||||
% for prop in data.longhands:
|
||||
% if prop.animatable:
|
||||
${helpers.to_nscsspropertyid(prop.ident)} => true,
|
||||
% endif
|
||||
% endfor
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
|
||||
impl ToCss for TransitionProperty {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result
|
||||
where W: fmt::Write,
|
||||
|
|
|
@ -461,6 +461,12 @@ pub extern "C" fn Servo_ComputedValues_ExtractAnimationValue(computed_values: Se
|
|||
Arc::new(AnimationValue::from_computed_values(&property_id.into(), computed_values)).into_strong()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_Property_IsAnimatable(property: nsCSSPropertyID) -> bool {
|
||||
use style::properties::animated_properties;
|
||||
animated_properties::nscsspropertyid_is_animatable(property)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_Property_IsDiscreteAnimatable(property: nsCSSPropertyID) -> bool {
|
||||
let property: TransitionProperty = property.into();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue