Further changes required by Servo

This commit is contained in:
Oriol Brufau 2023-08-11 02:03:45 +02:00 committed by Martin Robinson
parent 76847f7b45
commit 6279504ddb
2 changed files with 24 additions and 16 deletions

View file

@ -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,

View file

@ -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>
<%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);
}