aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2017-06-15 11:46:40 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2017-06-15 13:08:31 +0200
commitad79a19587053d3daff7d9eae58a7cf72ebe9d4d (patch)
treee1409aac9e5d0cb17dc38983fbb11478caa7247f
parent51a4481388f08b98d96f1858ad8854fa8121d35d (diff)
downloadservo-ad79a19587053d3daff7d9eae58a7cf72ebe9d4d.tar.gz
servo-ad79a19587053d3daff7d9eae58a7cf72ebe9d4d.zip
Derive ToCss for TransitionProperty
-rw-r--r--components/style/properties/helpers/animated_properties.mako.rs21
1 files changed, 2 insertions, 19 deletions
diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs
index d10ded92245..6e787cafaa3 100644
--- a/components/style/properties/helpers/animated_properties.mako.rs
+++ b/components/style/properties/helpers/animated_properties.mako.rs
@@ -31,8 +31,7 @@ use selectors::parser::SelectorParseError;
use smallvec::SmallVec;
use std::cmp;
#[cfg(feature = "gecko")] use std::collections::HashMap;
-use std::fmt;
-use style_traits::{ToCss, ParseError};
+use style_traits::ParseError;
use super::ComputedValues;
use values::{Auto, CSSFloat, CustomIdent, Either};
use values::computed::{Angle, LengthOrPercentageOrAuto, LengthOrPercentageOrNone};
@@ -178,8 +177,8 @@ pub fn nscsspropertyid_is_animatable(property: nsCSSPropertyID) -> bool {
/// 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
// beforehand.
-#[derive(Clone, Debug, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
+#[derive(Clone, Debug, Eq, Hash, PartialEq, ToCss)]
pub enum TransitionProperty {
/// All, any transitionable property changing should generate a transition.
All,
@@ -278,22 +277,6 @@ impl TransitionProperty {
}
}
-impl ToCss for TransitionProperty {
- fn to_css<W>(&self, dest: &mut W) -> fmt::Result
- where W: fmt::Write,
- {
- match *self {
- TransitionProperty::All => dest.write_str("all"),
- % for prop in data.longhands + data.shorthands_except_all():
- % if prop.transitionable:
- TransitionProperty::${prop.camel_case} => dest.write_str("${prop.name}"),
- % endif
- % endfor
- TransitionProperty::Unsupported(ref ident) => ident.to_css(dest),
- }
- }
-}
-
/// Convert to nsCSSPropertyID.
#[cfg(feature = "gecko")]
#[allow(non_upper_case_globals)]