Skip to content

Commit

Permalink
Move nscssproperty_id_is_animatable together with the other animatabl…
Browse files Browse the repository at this point in the history
…e-related code

Now we have AnimatableLonghand (to do with animatability) and
TransitionProperty (to do with transitionability), we should move
nscssproperty_id_is_animatable to be part of the former group.
  • Loading branch information
birtles committed Jun 15, 2017
1 parent e74f779 commit 479c3e4
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions components/style/properties/helpers/animated_properties.mako.rs
Expand Up @@ -163,6 +163,19 @@ impl<'a> From<AnimatableLonghand> for PropertyDeclarationId<'a> {
}
}

/// 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 + data.shorthands_except_all():
% if prop.animatable:
${helpers.to_nscsspropertyid(prop.ident)} => true,
% endif
% endfor
_ => false
}
}

/// A given transition property, that is either `All`, a transitionable longhand property,
/// a shorthand with at least one transitionable longhand component, or an unsupported property.
// NB: This needs to be here because it needs all the longhands generated
Expand Down Expand Up @@ -266,19 +279,6 @@ 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 + data.shorthands_except_all():
% 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,
Expand Down

0 comments on commit 479c3e4

Please sign in to comment.