Add / fix get_initial_specified_value for animation longhands
MozReview-Commit-ID: HOapAVuOMYX
--- a/servo/components/style/properties/longhand/box.mako.rs
+++ b/servo/components/style/properties/longhand/box.mako.rs
@@ -455,16 +455,21 @@
pub use values::computed::Time as T;
}
#[inline]
pub fn get_initial_value() -> Time {
Time(0.0)
}
+ #[inline]
+ pub fn get_initial_specified_value() -> SpecifiedValue {
+ SpecifiedValue(0.0)
+ }
+
pub fn parse(context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue,()> {
Time::parse(context, input)
}
</%helpers:vector_longhand>
// TODO(pcwalton): Lots more timing functions.
<%helpers:vector_longhand name="transition-timing-function"
need_index="True"
@@ -722,17 +727,17 @@
#[inline]
pub fn get_initial_value() -> computed_value::T {
ease()
}
#[inline]
pub fn get_initial_specified_value() -> SpecifiedValue {
- ToComputedValue::from_computed_value(&ease())
+ SpecifiedValue::Keyword(FunctionKeyword::Ease)
}
pub fn parse(context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue,()> {
SpecifiedValue::parse(context, input)
}
</%helpers:vector_longhand>
<%helpers:vector_longhand name="transition-property"
@@ -848,16 +853,17 @@
<%helpers:vector_longhand name="animation-duration"
need_index="True"
animatable="False",
extra_prefixes="moz webkit"
spec="https://drafts.csswg.org/css-animations/#propdef-animation-duration",
allowed_in_keyframe_block="False">
pub use properties::longhands::transition_duration::single_value::computed_value;
+ pub use properties::longhands::transition_duration::single_value::get_initial_specified_value;
pub use properties::longhands::transition_duration::single_value::{get_initial_value, parse};
pub use properties::longhands::transition_duration::single_value::SpecifiedValue;
</%helpers:vector_longhand>
<%helpers:vector_longhand name="animation-timing-function"
need_index="True"
animatable="False",
extra_prefixes="moz webkit"
@@ -916,17 +922,22 @@
}
}
}
no_viewport_percentage!(SpecifiedValue);
#[inline]
pub fn get_initial_value() -> computed_value::T {
- computed_value::T::Number(1.0)
+ get_initial_specified_value()
+ }
+
+ #[inline]
+ pub fn get_initial_specified_value() -> SpecifiedValue {
+ SpecifiedValue::Number(1.0)
}
#[inline]
pub fn parse(context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
SpecifiedValue::parse(context, input)
}
impl ComputedValueAsSpecified for SpecifiedValue {}
@@ -968,16 +979,17 @@
<%helpers:vector_longhand name="animation-delay"
need_index="True"
animatable="False",
extra_prefixes="moz webkit",
spec="https://drafts.csswg.org/css-animations/#propdef-animation-delay",
allowed_in_keyframe_block="False">
pub use properties::longhands::transition_duration::single_value::computed_value;
+ pub use properties::longhands::transition_duration::single_value::get_initial_specified_value;
pub use properties::longhands::transition_duration::single_value::{get_initial_value, parse};
pub use properties::longhands::transition_duration::single_value::SpecifiedValue;
</%helpers:vector_longhand>
<%helpers:longhand products="gecko" name="scroll-snap-points-y" animatable="False"
spec="Nonstandard (https://www.w3.org/TR/2015/WD-css-snappoints-1-20150326/#scroll-snap-points)">
use std::fmt;
use style_traits::ToCss;