mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Add IsTransitionable FFI
This commit is contained in:
parent
479c3e4528
commit
d249c61c0d
3 changed files with 22 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue