Add IsTransitionable FFI

This commit is contained in:
Brian Birtles 2017-06-15 10:20:46 +09:00
parent 479c3e4528
commit d249c61c0d
3 changed files with 22 additions and 0 deletions

View file

@ -2248,6 +2248,9 @@ extern "C" {
extern "C" {
pub fn Servo_Property_IsAnimatable(property: nsCSSPropertyID) -> bool;
}
extern "C" {
pub fn Servo_Property_IsTransitionable(property: nsCSSPropertyID) -> bool;
}
extern "C" {
pub fn Servo_Property_IsDiscreteAnimatable(property: nsCSSPropertyID)
-> bool;

View file

@ -338,6 +338,19 @@ impl From<nsCSSPropertyID> for TransitionProperty {
}
}
/// Returns true if this nsCSSPropertyID is one of the transitionable properties.
#[cfg(feature = "gecko")]
pub fn nscsspropertyid_is_transitionable(property: nsCSSPropertyID) -> bool {
match property {
% for prop in data.longhands + data.shorthands_except_all():
% if prop.transitionable:
${helpers.to_nscsspropertyid(prop.ident)} => true,
% endif
% endfor
_ => false
}
}
/// An animated property interpolation between two computed values for that
/// property.
#[derive(Clone, Debug, PartialEq)]