mirror of
https://github.com/servo/servo.git
synced 2025-06-25 01:24:37 +01:00
Clean up some <time> properties
This commit is contained in:
parent
38a6a3bff6
commit
b42aaf28df
2 changed files with 29 additions and 53 deletions
|
@ -403,34 +403,16 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
|
||||||
pub use super::overflow_x::{SpecifiedValue, parse, get_initial_value, computed_value};
|
pub use super::overflow_x::{SpecifiedValue, parse, get_initial_value, computed_value};
|
||||||
</%helpers:longhand>
|
</%helpers:longhand>
|
||||||
|
|
||||||
<%helpers:vector_longhand name="transition-duration"
|
${helpers.predefined_type("transition-duration",
|
||||||
need_index="True"
|
"Time",
|
||||||
animation_value_type="none"
|
"computed::Time::zero()",
|
||||||
extra_prefixes="moz webkit"
|
initial_specified_value="specified::Time::zero()",
|
||||||
spec="https://drafts.csswg.org/css-transitions/#propdef-transition-duration">
|
parse_method="parse_non_negative",
|
||||||
use values::specified::Time;
|
vector=True,
|
||||||
|
need_index=True,
|
||||||
pub use values::specified::Time as SpecifiedValue;
|
animation_value_type="none",
|
||||||
no_viewport_percentage!(SpecifiedValue);
|
extra_prefixes="moz webkit",
|
||||||
|
spec="https://drafts.csswg.org/css-transitions/#propdef-transition-duration")}
|
||||||
pub mod computed_value {
|
|
||||||
pub use values::computed::Time as T;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn get_initial_value() -> computed_value::T {
|
|
||||||
computed_value::T::zero()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn get_initial_specified_value() -> SpecifiedValue {
|
|
||||||
Time::zero()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn parse(context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue,()> {
|
|
||||||
Time::parse_non_negative(context, input)
|
|
||||||
}
|
|
||||||
</%helpers:vector_longhand>
|
|
||||||
|
|
||||||
// TODO(pcwalton): Lots more timing functions.
|
// TODO(pcwalton): Lots more timing functions.
|
||||||
<%helpers:vector_longhand name="transition-timing-function"
|
<%helpers:vector_longhand name="transition-timing-function"
|
||||||
|
@ -794,20 +776,15 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
|
||||||
impl ComputedValueAsSpecified for SpecifiedValue { }
|
impl ComputedValueAsSpecified for SpecifiedValue { }
|
||||||
</%helpers:vector_longhand>
|
</%helpers:vector_longhand>
|
||||||
|
|
||||||
<%helpers:vector_longhand name="transition-delay"
|
${helpers.predefined_type("transition-delay",
|
||||||
need_index="True"
|
"Time",
|
||||||
animation_value_type="none"
|
"computed::Time::zero()",
|
||||||
extra_prefixes="moz webkit"
|
initial_specified_value="specified::Time::zero()",
|
||||||
spec="https://drafts.csswg.org/css-transitions/#propdef-transition-delay">
|
vector=True,
|
||||||
pub use properties::longhands::transition_duration::single_value::SpecifiedValue;
|
need_index=True,
|
||||||
pub use properties::longhands::transition_duration::single_value::computed_value;
|
animation_value_type="none",
|
||||||
pub use properties::longhands::transition_duration::single_value::{get_initial_value, get_initial_specified_value};
|
extra_prefixes="moz webkit",
|
||||||
|
spec="https://drafts.csswg.org/css-transitions/#propdef-transition-duration")}
|
||||||
pub fn parse(context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
|
|
||||||
use values::specified::Time;
|
|
||||||
Time::parse(context, input)
|
|
||||||
}
|
|
||||||
</%helpers:vector_longhand>
|
|
||||||
|
|
||||||
<%helpers:vector_longhand name="animation-name"
|
<%helpers:vector_longhand name="animation-name"
|
||||||
need_index="True"
|
need_index="True"
|
||||||
|
@ -880,17 +857,16 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
|
||||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
impl ComputedValueAsSpecified for SpecifiedValue {}
|
||||||
</%helpers:vector_longhand>
|
</%helpers:vector_longhand>
|
||||||
|
|
||||||
<%helpers:vector_longhand name="animation-duration"
|
${helpers.predefined_type("animation-duration",
|
||||||
need_index="True"
|
"Time",
|
||||||
|
"computed::Time::zero()",
|
||||||
|
initial_specified_value="specified::Time::zero()",
|
||||||
|
parse_method="parse_non_negative",
|
||||||
|
vector=True,
|
||||||
|
need_index=True,
|
||||||
animation_value_type="none",
|
animation_value_type="none",
|
||||||
extra_prefixes="moz webkit"
|
extra_prefixes="moz webkit",
|
||||||
spec="https://drafts.csswg.org/css-animations/#propdef-animation-duration",
|
spec="https://drafts.csswg.org/css-transitions/#propdef-transition-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"
|
<%helpers:vector_longhand name="animation-timing-function"
|
||||||
need_index="True"
|
need_index="True"
|
||||||
|
|
|
@ -539,7 +539,7 @@ impl BorderStyle {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A time in seconds according to CSS-VALUES § 6.2.
|
/// A time in seconds according to CSS-VALUES § 6.2.
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
|
#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq, PartialOrd)]
|
||||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
pub struct Time {
|
pub struct Time {
|
||||||
seconds: CSSFloat,
|
seconds: CSSFloat,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue