From 6279504ddbda58af17fd322d40ae06793931c7e9 Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Fri, 11 Aug 2023 02:03:45 +0200 Subject: [PATCH] Further changes required by Servo --- .../style/properties/longhands/ui.mako.rs | 27 ++++++++++--------- .../style/properties/shorthands/ui.mako.rs | 13 ++++++--- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/components/style/properties/longhands/ui.mako.rs b/components/style/properties/longhands/ui.mako.rs index f28964f8819..1111fdb7253 100644 --- a/components/style/properties/longhands/ui.mako.rs +++ b/components/style/properties/longhands/ui.mako.rs @@ -111,7 +111,7 @@ ${helpers.predefined_type( "transition-duration", "Time", "computed::Time::zero()", - engines="gecko servo-2013 servo-2020", + engines="gecko servo", initial_specified_value="specified::Time::zero()", parse_method="parse_non_negative", vector=True, @@ -125,7 +125,7 @@ ${helpers.predefined_type( "transition-timing-function", "TimingFunction", "computed::TimingFunction::ease()", - engines="gecko servo-2013 servo-2020", + engines="gecko servo", initial_specified_value="specified::TimingFunction::ease()", vector=True, need_index=True, @@ -138,7 +138,7 @@ ${helpers.predefined_type( "transition-property", "TransitionProperty", "computed::TransitionProperty::all()", - engines="gecko servo-2013 servo-2020", + engines="gecko servo", initial_specified_value="specified::TransitionProperty::all()", vector=True, allow_empty="NotInitial", @@ -152,7 +152,7 @@ ${helpers.predefined_type( "transition-delay", "Time", "computed::Time::zero()", - engines="gecko servo-2013 servo-2020", + engines="gecko servo", initial_specified_value="specified::Time::zero()", vector=True, need_index=True, @@ -167,7 +167,7 @@ ${helpers.predefined_type( "animation-name", "AnimationName", "computed::AnimationName::none()", - engines="gecko servo-2013 servo-2020", + engines="gecko servo", initial_specified_value="specified::AnimationName::none()", vector=True, need_index=True, @@ -181,7 +181,7 @@ ${helpers.predefined_type( "animation-duration", "Time", "computed::Time::zero()", - engines="gecko servo-2013 servo-2020", + engines="gecko servo", initial_specified_value="specified::Time::zero()", parse_method="parse_non_negative", vector=True, @@ -197,7 +197,7 @@ ${helpers.predefined_type( "animation-timing-function", "TimingFunction", "computed::TimingFunction::ease()", - engines="gecko servo-2013 servo-2020", + engines="gecko servo", initial_specified_value="specified::TimingFunction::ease()", vector=True, need_index=True, @@ -210,7 +210,7 @@ ${helpers.predefined_type( "animation-iteration-count", "AnimationIterationCount", "computed::AnimationIterationCount::one()", - engines="gecko servo-2013 servo-2020", + engines="gecko servo", initial_specified_value="specified::AnimationIterationCount::one()", vector=True, need_index=True, @@ -224,7 +224,7 @@ ${helpers.predefined_type( ${helpers.single_keyword( "animation-direction", "normal reverse alternate alternate-reverse", - engines="gecko servo-2013 servo-2020", + engines="gecko servo", need_index=True, animation_value_type="none", vector=True, @@ -239,7 +239,7 @@ ${helpers.single_keyword( ${helpers.single_keyword( "animation-play-state", "running paused", - engines="gecko servo-2013 servo-2020", + engines="gecko servo", need_index=True, animation_value_type="none", vector=True, @@ -252,7 +252,7 @@ ${helpers.single_keyword( ${helpers.single_keyword( "animation-fill-mode", "none forwards backwards both", - engines="gecko servo-2013 servo-2020", + engines="gecko servo", need_index=True, animation_value_type="none", vector=True, @@ -267,7 +267,7 @@ ${helpers.predefined_type( "animation-delay", "Time", "computed::Time::zero()", - engines="gecko servo-2013 servo-2020", + engines="gecko servo", initial_specified_value="specified::Time::zero()", vector=True, need_index=True, @@ -281,7 +281,8 @@ ${helpers.predefined_type( "animation-timeline", "AnimationTimeline", "computed::AnimationTimeline::auto()", - engines="gecko", + engines="gecko servo", + servo_pref="layout.unimplemented", initial_specified_value="specified::AnimationTimeline::auto()", vector=True, need_index=True, diff --git a/components/style/properties/shorthands/ui.mako.rs b/components/style/properties/shorthands/ui.mako.rs index 178698edebf..e2eb8d979a0 100644 --- a/components/style/properties/shorthands/ui.mako.rs +++ b/components/style/properties/shorthands/ui.mako.rs @@ -18,7 +18,7 @@ macro_rules! try_parse_one { } <%helpers:shorthand name="transition" - engines="gecko servo-2013 servo-2020" + engines="gecko servo" extra_prefixes="moz:layout.css.prefixes.transitions webkit" sub_properties="transition-property transition-duration transition-timing-function @@ -164,7 +164,7 @@ macro_rules! try_parse_one { <%helpers:shorthand name="animation" - engines="gecko servo-2013 servo-2020" + engines="gecko servo" extra_prefixes="moz:layout.css.prefixes.animations webkit" sub_properties="animation-name animation-duration animation-timing-function animation-delay @@ -190,6 +190,13 @@ macro_rules! try_parse_one { % endfor } + fn scroll_linked_animations_enabled() -> bool { + #[cfg(feature = "gecko")] + return static_prefs::pref!("layout.css.scroll-linked-animations.enabled"); + #[cfg(feature = "servo")] + return false; + } + fn parse_one_animation<'i, 't>( context: &ParserContext, input: &mut Parser<'i, 't>, @@ -214,7 +221,7 @@ macro_rules! try_parse_one { try_parse_one!(context, input, fill_mode, animation_fill_mode); try_parse_one!(context, input, play_state, animation_play_state); try_parse_one!(context, input, name, animation_name); - if static_prefs::pref!("layout.css.scroll-linked-animations.enabled") { + if scroll_linked_animations_enabled() { try_parse_one!(context, input, timeline, animation_timeline); }