Skip to content

Truly independent web browser

LibWeb: Parse animation-range and its longhands

Andreas Kling5399ca7f0b9d
diff --git a/Libraries/LibWeb/CSS/Keywords.json b/Libraries/LibWeb/CSS/Keywords.json
index 612941514c6..f70922178b1 100644
--- a/Libraries/LibWeb/CSS/Keywords.json
+++ b/Libraries/LibWeb/CSS/Keywords.json
@@ -204,6 +204,8 @@
"emoji",
"enabled",
"end",
+ "entry",
+ "entry-crossing",
"ethiopic-halehame-am",
"ethiopic-halehame-ti-er",
"ethiopic-halehame-ti-et",
@@ -213,6 +215,8 @@
"ew-resize",
"exclude",
"exclusion",
+ "exit",
+ "exit-crossing",
"expanded",
"extends",
"extra-condensed",
diff --git a/Libraries/LibWeb/CSS/Properties.json b/Libraries/LibWeb/CSS/Properties.json
index 1462ba2d899..d71defb68e3 100644
--- a/Libraries/LibWeb/CSS/Properties.json
+++ b/Libraries/LibWeb/CSS/Properties.json
@@ -305,7 +305,9 @@
"animation-fill-mode",
"animation-play-state",
"animation-name",
- "animation-timeline"
+ "animation-timeline",
+ "animation-range-start",
+ "animation-range-end"
]
},
"animation-composition": {
@@ -422,6 +424,33 @@
"paused"
]
},
+ "animation-range": {
+ "affects-layout": false,
+ "initial": "normal",
+ "multiplicity": "coordinating-list",
+ "longhands": [
+ "animation-range-start",
+ "animation-range-end"
+ ]
+ },
+ "animation-range-end": {
+ "style-group": "AnimationValues",
+ "affects-layout": false,
+ "animation-type": "none",
+ "inherited": false,
+ "initial": "normal",
+ "requires-computation": "cascaded-value",
+ "multiplicity": "coordinating-list"
+ },
+ "animation-range-start": {
+ "style-group": "AnimationValues",
+ "affects-layout": false,
+ "animation-type": "none",
+ "inherited": false,
+ "initial": "normal",
+ "requires-computation": "cascaded-value",
+ "multiplicity": "coordinating-list"
+ },
"animation-timeline": {
"style-group": "AnimationValues",
"affects-layout": false,
diff --git a/Libraries/LibWeb/Rust/src/css/computed_value_types.rs b/Libraries/LibWeb/Rust/src/css/computed_value_types.rs
index 7aff901699a..8b2f80d4ff1 100644
--- a/Libraries/LibWeb/Rust/src/css/computed_value_types.rs
+++ b/Libraries/LibWeb/Rust/src/css/computed_value_types.rs
@@ -441,6 +441,8 @@ pub struct AnimationValues {
pub animation_fill_mode: ComputedStyleValueHandle,
pub animation_iteration_count: ComputedStyleValueHandle,
pub animation_play_state: ComputedStyleValueHandle,
+ pub animation_range_start: ComputedStyleValueHandle,
+ pub animation_range_end: ComputedStyleValueHandle,
pub animation_timeline: ComputedStyleValueHandle,
pub animation_timing_function: ComputedStyleValueHandle,
pub scroll_timeline_name: ComputedStyleValueHandle,
diff --git a/Libraries/LibWeb/Rust/src/css/computed_values.rs b/Libraries/LibWeb/Rust/src/css/computed_values.rs
index dac3544a77e..03b60cb2ef3 100644
--- a/Libraries/LibWeb/Rust/src/css/computed_values.rs
+++ b/Libraries/LibWeb/Rust/src/css/computed_values.rs
@@ -660,6 +660,8 @@ impl_computed_payload_clone_and_eq!(AnimationValues {
animation_fill_mode,
animation_iteration_count,
animation_play_state,
+ animation_range_start,
+ animation_range_end,
animation_timeline,
animation_timing_function,
scroll_timeline_name,
@@ -2159,6 +2161,8 @@ pub(crate) fn group_field_descriptors(group: usize) -> &'static [GroupFieldDescr
ANIMATION_ITERATION_COUNT => RequireInitialValue,
ANIMATION_PLAY_STATE => RequireInitialValue,
ANIMATION_TIMELINE => RequireInitialValue,
+ ANIMATION_RANGE_START => RequireInitialValue,
+ ANIMATION_RANGE_END => RequireInitialValue,
ANIMATION_TIMING_FUNCTION => RequireInitialValue,
SCROLL_TIMELINE_NAME => RequireInitialValue,
SCROLL_TIMELINE_AXIS => RequireInitialValue,
@@ -3235,6 +3239,8 @@ impl AnimationValues {
animation_iteration_count: initial(property_id::ANIMATION_ITERATION_COUNT),
animation_play_state: initial(property_id::ANIMATION_PLAY_STATE),
animation_timeline: initial(property_id::ANIMATION_TIMELINE),
+ animation_range_start: initial(property_id::ANIMATION_RANGE_START),
+ animation_range_end: initial(property_id::ANIMATION_RANGE_END),
animation_timing_function: initial(property_id::ANIMATION_TIMING_FUNCTION),
scroll_timeline_name: initial(property_id::SCROLL_TIMELINE_NAME),
scroll_timeline_axis: initial(property_id::SCROLL_TIMELINE_AXIS),
diff --git a/Libraries/LibWeb/Rust/src/css/parser/value_parser.rs b/Libraries/LibWeb/Rust/src/css/parser/value_parser.rs
index 213dc6ecf1e..547bf3c1448 100644
--- a/Libraries/LibWeb/Rust/src/css/parser/value_parser.rs
+++ b/Libraries/LibWeb/Rust/src/css/parser/value_parser.rs
@@ -3408,9 +3408,151 @@ fn parse_view_timeline_inset_property(
})
}
+// https://drafts.csswg.org/scroll-animations-1/#typedef-timeline-range-name
+fn parse_timeline_range_name(value: &ComponentValue) -> Option<u16> {
+ let keyword = keyword_from_ascii_case_insensitive(value.ident()?)?;
+ matches!(
+ keyword,
+ keyword::COVER
+ | keyword::CONTAIN
+ | keyword::ENTRY
+ | keyword::EXIT
+ | keyword::ENTRY_CROSSING
+ | keyword::EXIT_CROSSING
+ | keyword::SCROLL
+ )
+ .then_some(keyword)
+}
+
+/// One edge of an animation attachment range: `normal | <length-percentage> | <timeline-range-name>
+/// <length-percentage>?`, consumed from `tokens`. A range name's offset is left out when it is the default for the
+/// edge: 0% for a start, 100% for an end.
+fn parse_animation_range_edge(
+ context: &ParseContext,
+ property: u16,
+ tokens: &mut TokenStream<'_>,
+ default_offset: f64,
+) -> Option<StyleValueData> {
+ tokens.discard_whitespace();
+ if !tokens.has_next_token() {
+ return None;
+ }
+ if let Some(normal) = parse_specific_keyword(tokens.next_token(), &[keyword::NORMAL]) {
+ tokens.discard_a_token();
+ return Some(normal);
+ }
+ let Some(name) = parse_timeline_range_name(tokens.next_token()) else {
+ return parse_length_percentage_from_stream(
+ context,
+ property,
+ tokens,
+ NumericRange::INFINITE,
+ NumericRange::INFINITE,
+ );
+ };
+ tokens.discard_a_token();
+ let mut after_name = tokens.clone();
+ let offset = parse_length_percentage_from_stream(
+ context,
+ property,
+ &mut after_name,
+ NumericRange::INFINITE,
+ NumericRange::INFINITE,
+ );
+ let name = StyleValueData::Keyword { keyword: name };
+ let Some(offset) = offset else {
+ return Some(name);
+ };
+ *tokens = after_name;
+ if matches!(offset, StyleValueData::Percentage { value } if value == default_offset) {
+ return Some(name);
+ }
+ Some(value_list(vec![name, offset], 0, false))
+}
+
+// https://drafts.csswg.org/scroll-animations-1/#animation-range-start
+// https://drafts.csswg.org/scroll-animations-1/#animation-range-end
+fn parse_animation_range_longhand(context: &ParseContext, property: u16, values: &[ComponentValue]) -> ParseOutcome {
+ let default_offset = if property == property_id::ANIMATION_RANGE_START {
+ 0.0
+ } else {
+ 100.0
+ };
+ let edges = values
+ .split(ComponentValue::is_comma)
+ .map(|item| {
+ let mut tokens = TokenStream::new(item);
+ let edge = parse_animation_range_edge(context, property, &mut tokens, default_offset)?;
+ tokens.discard_whitespace();
+ (!tokens.has_next_token()).then_some(edge)
+ })
+ .collect::<Option<Vec<_>>>();
+ edges.map_or(ParseOutcome::Invalid, |edges| {
+ ParseOutcome::Parsed(shared_style_value(value_list(edges, 1, true)))
+ })
+}
+
+// https://drafts.csswg.org/scroll-animations-1/#animation-range
+// [ <'animation-range-start'> <'animation-range-end'>? ]#
+// If <'animation-range-end'> is omitted and <'animation-range-start'> includes a <timeline-range-name> component, then
+// animation-range-end is set to that same <timeline-range-name> and 100%. Otherwise, any omitted longhand is set to
+// its initial value.
+fn parse_animation_range_shorthand(context: &ParseContext, values: &[ComponentValue]) -> ParseOutcome {
+ let mut starts = Vec::new();
+ let mut ends = Vec::new();
+ for item in values.split(ComponentValue::is_comma) {
+ let mut tokens = TokenStream::new(item);
+ let Some(start) = parse_animation_range_edge(context, property_id::ANIMATION_RANGE_START, &mut tokens, 0.0)
+ else {
+ return ParseOutcome::Invalid;
+ };
+ tokens.discard_whitespace();
+ let end = if tokens.has_next_token() {
+ let Some(end) = parse_animation_range_edge(context, property_id::ANIMATION_RANGE_END, &mut tokens, 100.0)
+ else {
+ return ParseOutcome::Invalid;
+ };
+ tokens.discard_whitespace();
+ if tokens.has_next_token() {
+ return ParseOutcome::Invalid;
+ }
+ end
+ } else {
+ match animation_range_edge_name(&start) {
+ Some(name) => StyleValueData::Keyword { keyword: name },
+ None => StyleValueData::Keyword {
+ keyword: keyword::NORMAL,
+ },
+ }
+ };
+ starts.push(start);
+ ends.push(end);
+ }
+ ParseOutcome::Parsed(shared_style_value(shorthand_value(
+ property_id::ANIMATION_RANGE,
+ vec![property_id::ANIMATION_RANGE_START, property_id::ANIMATION_RANGE_END],
+ vec![value_list(starts, 1, true), value_list(ends, 1, true)],
+ )))
+}
+
+/// The <timeline-range-name> of an animation range edge, if it has one.
+pub(crate) fn animation_range_edge_name(edge: &StyleValueData) -> Option<u16> {
+ match edge {
+ StyleValueData::Keyword { keyword } if *keyword != keyword::NORMAL => Some(*keyword),
+ StyleValueData::ValueList { values, .. } => match values.as_slice().first()?.data() {
+ StyleValueData::Keyword { keyword } => Some(*keyword),
+ _ => None,
+ },
+ _ => None,
+ }
+}
+
fn parse_long_tail_property(context: &ParseContext, property: u16, values: &[ComponentValue]) -> ParseOutcome {
match property {
property_id::ANIMATION_TIMELINE => parse_animation_timeline_property(context, values),
+ property_id::ANIMATION_RANGE_START | property_id::ANIMATION_RANGE_END => {
+ parse_animation_range_longhand(context, property, values)
+ }
property_id::COLOR_SCHEME => parse_color_scheme_property(context, values),
property_id::CONTENT => parse_content_property(context, values),
property_id::CURSOR => parse_cursor_property(context, values),
@@ -5483,7 +5625,11 @@ fn parse_animation_transition_shorthand(
property_id::ANIMATION_PLAY_STATE,
property_id::ANIMATION_NAME,
][..],
- Some(property_id::ANIMATION_TIMELINE),
+ &[
+ property_id::ANIMATION_TIMELINE,
+ property_id::ANIMATION_RANGE_START,
+ property_id::ANIMATION_RANGE_END,
+ ][..],
),
property_id::TRANSITION => (
&[
@@ -5493,7 +5639,7 @@ fn parse_animation_transition_shorthand(
property_id::TRANSITION_DELAY,
property_id::TRANSITION_BEHAVIOR,
][..],
- None,
+ &[][..],
),
_ => return ParseOutcome::NotHandled,
};
@@ -5535,7 +5681,7 @@ fn parse_animation_transition_shorthand(
.into_iter()
.map(|values| value_list(values, 1, true))
.collect::<Vec<_>>();
- if let Some(reset_only) = reset_only {
+ for &reset_only in reset_only {
sub_properties.push(reset_only);
let Some(initial) = parse_initial_longhand(context, reset_only) else {
return ParseOutcome::Invalid;
@@ -5762,6 +5908,9 @@ fn parse_css_value_after_substitution_scan(
if !matches!(outcome, ParseOutcome::NotHandled) {
return outcome;
}
+ if property_id == property_id::ANIMATION_RANGE {
+ return parse_animation_range_shorthand(context, values);
+ }
let outcome = parse_animation_transition_shorthand(context, property_id, values);
if !matches!(outcome, ParseOutcome::NotHandled) {
return outcome;
diff --git a/Libraries/LibWeb/Rust/src/css/serialize.rs b/Libraries/LibWeb/Rust/src/css/serialize.rs
index bba68e58aea..4a549996a4d 100644
--- a/Libraries/LibWeb/Rust/src/css/serialize.rs
+++ b/Libraries/LibWeb/Rust/src/css/serialize.rs
@@ -3173,6 +3173,7 @@ fn serialize_shorthand(
// Shorthands requiring per-layer coordination or grammar disambiguation.
if [
property_id::ANIMATION,
+ property_id::ANIMATION_RANGE,
property_id::BACKGROUND,
property_id::BORDER,
property_id::BACKGROUND_POSITION,
diff --git a/Libraries/LibWeb/Rust/src/css/serialize/shorthand.rs b/Libraries/LibWeb/Rust/src/css/serialize/shorthand.rs
index 3c321317d56..dca9eff251d 100644
--- a/Libraries/LibWeb/Rust/src/css/serialize/shorthand.rs
+++ b/Libraries/LibWeb/Rust/src/css/serialize/shorthand.rs
@@ -179,7 +179,15 @@ pub(super) fn serialize(
let StyleValueData::Shorthand { sub_properties, .. } = whole else {
unreachable!("Shorthand style values retain values of the expected type");
};
- let reset_only = |id| property == property_id::ANIMATION && id == property_id::ANIMATION_TIMELINE;
+ let reset_only = |id| {
+ property == property_id::ANIMATION
+ && matches!(
+ id,
+ property_id::ANIMATION_TIMELINE
+ | property_id::ANIMATION_RANGE_START
+ | property_id::ANIMATION_RANGE_END
+ )
+ };
let required = |id| {
(property == property_id::SCROLL_TIMELINE && id == property_id::SCROLL_TIMELINE_NAME)
|| (property == property_id::VIEW_TIMELINE && id == property_id::VIEW_TIMELINE_NAME)
@@ -256,6 +264,38 @@ pub(super) fn serialize(
}
}
}
+ // https://drafts.csswg.org/scroll-animations-1/#animation-range
+ property_id::ANIMATION_RANGE => {
+ let starts = get(property_id::ANIMATION_RANGE_START);
+ let ends = get(property_id::ANIMATION_RANGE_END);
+ let count = layer_count(starts);
+ if layer_count(ends) != count {
+ return;
+ }
+ for entry in 0..count {
+ if entry != 0 {
+ sink.push_ascii(", ");
+ }
+ let start = layer(starts, entry);
+ let end = layer(ends, entry);
+ write(sink, start, mode);
+ // The end is left out where the shorthand would set it from the start: to the start's range name at
+ // 100%, or to normal, which a bare 100% is equivalent to.
+ let implied_end = match crate::css::parser::value_parser::animation_range_edge_name(start) {
+ Some(name) => matches!(end, StyleValueData::Keyword { keyword } if *keyword == name),
+ None => matches!(
+ end,
+ StyleValueData::Keyword {
+ keyword: keyword::NORMAL
+ } | StyleValueData::Percentage { value: 100.0 }
+ ),
+ };
+ if !implied_end {
+ sink.push_ascii(" ");
+ write(sink, end, mode);
+ }
+ }
+ }
property_id::BACKGROUND_POSITION => {
let x = get(property_id::BACKGROUND_POSITION_X);
let y = get(property_id::BACKGROUND_POSITION_Y);
diff --git a/Libraries/LibWeb/Rust/src/css/style/publication.rs b/Libraries/LibWeb/Rust/src/css/style/publication.rs
index 01e99e7c87a..d1fe5afa8d7 100644
--- a/Libraries/LibWeb/Rust/src/css/style/publication.rs
+++ b/Libraries/LibWeb/Rust/src/css/style/publication.rs
@@ -5191,6 +5191,8 @@ fn property_declares_css_animations(property: u16) -> bool {
| prop::ANIMATION_ITERATION_COUNT
| prop::ANIMATION_NAME
| prop::ANIMATION_PLAY_STATE
+ | prop::ANIMATION_RANGE_END
+ | prop::ANIMATION_RANGE_START
| prop::ANIMATION_TIMELINE
| prop::ANIMATION_TIMING_FUNCTION
)
diff --git a/Libraries/LibWeb/Rust/src/css/style_compute.rs b/Libraries/LibWeb/Rust/src/css/style_compute.rs
index c0f1247bca5..82a23541f53 100644
--- a/Libraries/LibWeb/Rust/src/css/style_compute.rs
+++ b/Libraries/LibWeb/Rust/src/css/style_compute.rs
@@ -2506,6 +2506,61 @@ fn canonicalize_border_shape(value: &StyleValueData) -> Option<Arc<StyleValueDat
}))
}
+/// https://drafts.csswg.org/scroll-animations-1/#animation-range-start
+/// A computed range edge leaves out the progress after a range name when it is the default for the edge: 0% for a
+/// start, 100% for an end. Returns `None` when the value is already canonical.
+#[allow(clippy::arc_with_non_send_sync)]
+fn canonicalize_animation_range(value: &StyleValueData, default_offset: f64) -> Option<Arc<StyleValueData>> {
+ // A calculation that resolves to the default percentage, with no length part, is left out too.
+ let is_percentage_of = |offset: &StyleValueData, percentage: f64| match offset {
+ StyleValueData::Percentage { value } => *value == percentage,
+ StyleValueData::Calculated { .. } => {
+ let offset = crate::css::computed_value_views::LengthPercentageRef::over(offset);
+ offset.to_px(CssPixels::default()) == CssPixels::default()
+ && offset.to_px(CssPixels::from_integer(100)).to_double() == percentage
+ }
+ _ => false,
+ };
+ let canonical_edge = |edge: &StyleValueData| match edge {
+ StyleValueData::ValueList { values, .. } => match values.as_slice() {
+ [name, offset] if is_percentage_of(offset.data(), default_offset) => Some(name.clone_retained()),
+ _ => None,
+ },
+ _ => None,
+ };
+ let StyleValueData::ValueList {
+ values,
+ separator,
+ collapsible,
+ } = value
+ else {
+ return None;
+ };
+ // A list of edges is comma separated; a lone edge with a range name and an offset is a space separated pair.
+ if *separator == 0 {
+ return canonical_edge(value).map(|edge| Arc::new(edge.data().clone()));
+ }
+ let mut changed = false;
+ let edges = values
+ .as_slice()
+ .iter()
+ .map(|edge| match canonical_edge(edge.data()) {
+ Some(canonical) => {
+ changed = true;
+ canonical
+ }
+ None => edge.clone_retained(),
+ })
+ .collect();
+ changed.then(|| {
+ Arc::new(StyleValueData::ValueList {
+ values: RetainedStyleValueDataList::from_retained_values(edges),
+ separator: *separator,
+ collapsible: *collapsible,
+ })
+ })
+}
+
// https://drafts.csswg.org/css-contain-2/#contain-property
#[allow(clippy::arc_with_non_send_sync)]
fn collapse_containment_list(value: &StyleValueData) -> Option<Arc<StyleValueData>> {
@@ -4237,6 +4292,28 @@ pub(crate) unsafe fn drive_property_computation(
None => NativeValue::Unsupported,
}
}
+ (None, prop::ANIMATION_RANGE_START | prop::ANIMATION_RANGE_END) => {
+ let resolution_context =
+ length_resolution_context.expect("animation-range must compute with a resolution context");
+ let default_offset = if inherited_property_id == prop::ANIMATION_RANGE_START {
+ 0.0
+ } else {
+ 100.0
+ };
+ match absolutize_value(value_data, resolution_context, current_effective_color_scheme, results) {
+ Some(crate::css::absolutize::Absolutized::Unchanged) => {
+ canonicalize_animation_range(value_data, default_offset)
+ .map_or(NativeValue::Unchanged, NativeValue::StyleValue)
+ }
+ Some(crate::css::absolutize::Absolutized::Changed(new_value)) => {
+ match canonicalize_animation_range(new_value.data(), default_offset) {
+ Some(canonical) => NativeValue::StyleValue(canonical),
+ None => NativeValue::StyleValue(new_value.into_arc()),
+ }
+ }
+ None => NativeValue::Unsupported,
+ }
+ }
(_, prop::CONTAIN) => match collapse_containment_list(value_data) {
Some(value) => NativeValue::StyleValue(value),
None => NativeValue::Unchanged,
diff --git a/Libraries/LibWeb/Rust/src/css/table_group_builder.rs b/Libraries/LibWeb/Rust/src/css/table_group_builder.rs
index 45f68fc6ed7..de7c4534483 100644
--- a/Libraries/LibWeb/Rust/src/css/table_group_builder.rs
+++ b/Libraries/LibWeb/Rust/src/css/table_group_builder.rs
@@ -3158,6 +3158,8 @@ fn build_animation_group(
payload.animation_iteration_count = retained(property_id::ANIMATION_ITERATION_COUNT);
payload.animation_play_state = retained(property_id::ANIMATION_PLAY_STATE);
payload.animation_timeline = retained(property_id::ANIMATION_TIMELINE);
+ payload.animation_range_start = retained(property_id::ANIMATION_RANGE_START);
+ payload.animation_range_end = retained(property_id::ANIMATION_RANGE_END);
payload.animation_timing_function = retained(property_id::ANIMATION_TIMING_FUNCTION);
payload.scroll_timeline_name = retained(property_id::SCROLL_TIMELINE_NAME);
payload.scroll_timeline_axis = retained(property_id::SCROLL_TIMELINE_AXIS);
diff --git a/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt b/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt
index 050f7192c23..a4c022e2354 100644
--- a/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt
+++ b/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt
@@ -94,6 +94,8 @@ All properties associated with getComputedStyle(document.body):
"animation-iteration-count",
"animation-name",
"animation-play-state",
+ "animation-range-end",
+ "animation-range-start",
"animation-timeline",
"animation-timing-function",
"appearance",
diff --git a/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt b/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt
index 34613fab332..e58ca2ae5fe 100644
--- a/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt
+++ b/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt
@@ -212,6 +212,12 @@ All supported properties and their default values exposed from CSSStylePropertie
'animation-name': 'none'
'animationPlayState': 'running'
'animation-play-state': 'running'
+'animationRange': 'normal'
+'animation-range': 'normal'
+'animationRangeEnd': 'normal'
+'animation-range-end': 'normal'
+'animationRangeStart': 'normal'
+'animation-range-start': 'normal'
'animationTimeline': 'auto'
'animation-timeline': 'auto'
'animationTimingFunction': 'ease'
diff --git a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt
index 061b731bc24..7e568860317 100644
--- a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt
+++ b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt
@@ -92,6 +92,8 @@ animation-fill-mode: none
animation-iteration-count: 1
animation-name: none
animation-play-state: running
+animation-range-end: normal
+animation-range-start: normal
animation-timeline: auto
animation-timing-function: ease
appearance: none
@@ -108,7 +110,7 @@ background-position-x: 0%
background-position-y: 0%
background-repeat: repeat
background-size: auto
-block-size: 1430px
+block-size: 1456px
border-block-end-color: rgb(0, 0, 0)
border-block-end-style: none
border-block-end-width: 0px
@@ -210,7 +212,7 @@ grid-row-start: auto
grid-template-areas: none
grid-template-columns: none
grid-template-rows: none
-height: 2756px
+height: 2782px
inline-size: 784px
inset-block-end: auto
inset-block-start: auto
@@ -336,7 +338,7 @@ top: auto
touch-action: auto
transform: none
transform-box: view-box
-transform-origin: 392px 2197px
+transform-origin: 392px 2210px
transform-style: flat
transition-behavior: normal
transition-delay: 0s
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-end-computed.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-end-computed.txt
new file mode 100644
index 00000000000..ab269d6fb9f
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-end-computed.txt
@@ -0,0 +1,34 @@
+Harness status: OK
+
+Found 29 tests
+
+29 Pass
+Pass Property animation-range-end value 'initial'
+Pass Property animation-range-end value 'normal'
+Pass Property animation-range-end value 'cover 0%'
+Pass Property animation-range-end value 'cover 100%'
+Pass Property animation-range-end value 'COVER 0%'
+Pass Property animation-range-end value 'COVER 100%'
+Pass Property animation-range-end value 'cover 120%'
+Pass Property animation-range-end value '0'
+Pass Property animation-range-end value '120%'
+Pass Property animation-range-end value '0%'
+Pass Property animation-range-end value '100%'
+Pass Property animation-range-end value '120px'
+Pass Property animation-range-end value 'cover 42%'
+Pass Property animation-range-end value 'cover -42%'
+Pass Property animation-range-end value 'contain 42%'
+Pass Property animation-range-end value 'exit 42%'
+Pass Property animation-range-end value 'exit calc(41% + 1%)'
+Pass Property animation-range-end value 'exit-crossing 42%'
+Pass Property animation-range-end value 'exit 1%, cover 2%, contain 0%'
+Pass Property animation-range-end value 'exit 1%, cover 2%, contain 100%'
+Pass Property animation-range-end value 'entry 42px'
+Pass Property animation-range-end value 'entry-crossing 42px'
+Pass Property animation-range-end value 'contain calc(10% + 10px)'
+Pass Property animation-range-end value 'entry 1em'
+Pass Property animation-range-end value 'exit calc(1em + 10px)'
+Pass Property animation-range-end value 'cover'
+Pass Property animation-range-end value 'contain'
+Pass Property animation-range-end value 'entry'
+Pass Property animation-range-end value 'exit'
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-end-invalid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-end-invalid.txt
new file mode 100644
index 00000000000..9dbb85dcd18
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-end-invalid.txt
@@ -0,0 +1,19 @@
+Harness status: OK
+
+Found 14 tests
+
+14 Pass
+Pass e.style['animation-range-end'] = "infinite" should not set the property value
+Pass e.style['animation-range-end'] = "1s 2s" should not set the property value
+Pass e.style['animation-range-end'] = "1s / 2s" should not set the property value
+Pass e.style['animation-range-end'] = "peek 50%" should not set the property value
+Pass e.style['animation-range-end'] = "50% contain" should not set the property value
+Pass e.style['animation-range-end'] = "50% cover" should not set the property value
+Pass e.style['animation-range-end'] = "50% entry" should not set the property value
+Pass e.style['animation-range-end'] = "50% enter" should not set the property value
+Pass e.style['animation-range-end'] = "50% exit" should not set the property value
+Pass e.style['animation-range-end'] = "contain contain" should not set the property value
+Pass e.style['animation-range-end'] = "none" should not set the property value
+Pass e.style['animation-range-end'] = "cover 50% enter 50%" should not set the property value
+Pass e.style['animation-range-end'] = "normal 10px" should not set the property value
+Pass e.style['animation-range-end'] = "normal foo" should not set the property value
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-end-valid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-end-valid.txt
new file mode 100644
index 00000000000..a00a98ba464
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-end-valid.txt
@@ -0,0 +1,29 @@
+Harness status: OK
+
+Found 24 tests
+
+24 Pass
+Pass e.style['animation-range-end'] = "normal" should set the property value
+Pass e.style['animation-range-end'] = "cover 0%" should set the property value
+Pass e.style['animation-range-end'] = "cover 100%" should set the property value
+Pass e.style['animation-range-end'] = "cover 120%" should set the property value
+Pass e.style['animation-range-end'] = "cover 42%" should set the property value
+Pass e.style['animation-range-end'] = "0" should set the property value
+Pass e.style['animation-range-end'] = "120%" should set the property value
+Pass e.style['animation-range-end'] = "120px" should set the property value
+Pass e.style['animation-range-end'] = "cover -42%" should set the property value
+Pass e.style['animation-range-end'] = "contain 42%" should set the property value
+Pass e.style['animation-range-end'] = "exit 42%" should set the property value
+Pass e.style['animation-range-end'] = "exit 1%, cover 2%, contain 0%" should set the property value
+Pass e.style['animation-range-end'] = "exit 1%, cover 2%, contain 100%" should set the property value
+Pass e.style['animation-range-end'] = "exit-crossing 42%" should set the property value
+Pass e.style['animation-range-end'] = "entry 42px" should set the property value
+Pass e.style['animation-range-end'] = "entry-crossing 42px" should set the property value
+Pass e.style['animation-range-end'] = "contain calc(10px + 10%)" should set the property value
+Pass e.style['animation-range-end'] = "entry 1em" should set the property value
+Pass e.style['animation-range-end'] = "exit calc(1em + 10px)" should set the property value
+Pass e.style['animation-range-end'] = "entry 42%" should set the property value
+Pass e.style['animation-range-end'] = "cover" should set the property value
+Pass e.style['animation-range-end'] = "contain" should set the property value
+Pass e.style['animation-range-end'] = "entry" should set the property value
+Pass e.style['animation-range-end'] = "exit" should set the property value
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-shorthand-end-zero-offset.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-shorthand-end-zero-offset.txt
new file mode 100644
index 00000000000..71e8f9c5cd2
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-shorthand-end-zero-offset.txt
@@ -0,0 +1,11 @@
+Harness status: OK
+
+Found 6 tests
+
+6 Pass
+Pass e.style['animation-range'] = "normal cover 0%" should set the property value
+Pass e.style['animation-range'] = "entry 0% exit 0%" should set the property value
+Pass e.style['animation-range'] = "cover 50% exit 0%" should set the property value
+Pass e.style['animation-range'] = "normal cover 100%" should set the property value
+Pass e.style['animation-range'] = "entry 0% exit 100%" should set the property value
+Pass e.style['animation-range'] = "normal exit 50%" should set the property value
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-shorthand.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-shorthand.txt
new file mode 100644
index 00000000000..e337f43b95d
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-shorthand.txt
@@ -0,0 +1,138 @@
+Harness status: OK
+
+Found 133 tests
+
+133 Pass
+Pass e.style['animation-range'] = "normal" should set the property value
+Pass e.style['animation-range'] = "normal normal" should set the property value
+Pass e.style['animation-range'] = "cover" should set the property value
+Pass e.style['animation-range'] = "contain" should set the property value
+Pass e.style['animation-range'] = "entry" should set the property value
+Pass e.style['animation-range'] = "entry-crossing" should set the property value
+Pass e.style['animation-range'] = "exit" should set the property value
+Pass e.style['animation-range'] = "exit-crossing" should set the property value
+Pass e.style['animation-range'] = "entry, exit" should set the property value
+Pass e.style['animation-range'] = "0% 100%" should set the property value
+Pass e.style['animation-range'] = "entry 0% entry 100%" should set the property value
+Pass e.style['animation-range'] = "entry-crossing 0% entry-crossing 100%" should set the property value
+Pass e.style['animation-range'] = "exit 0% exit 100%" should set the property value
+Pass e.style['animation-range'] = "exit-crossing 0% exit-crossing 100%" should set the property value
+Pass e.style['animation-range'] = "cover 0% cover 100%" should set the property value
+Pass e.style['animation-range'] = "contain 0% contain 100%" should set the property value
+Pass e.style['animation-range'] = "entry calc(10% - 10%) entry calc(50% + 50%)" should set the property value
+Pass e.style['animation-range'] = "cover 50%" should set the property value
+Pass e.style['animation-range'] = "contain 50%" should set the property value
+Pass e.style['animation-range'] = "entry 50%" should set the property value
+Pass e.style['animation-range'] = "entry-crossing 50%" should set the property value
+Pass e.style['animation-range'] = "exit 50%" should set the property value
+Pass e.style['animation-range'] = "exit-crossing 50%" should set the property value
+Pass e.style['animation-range'] = "entry 50px exit 100px" should set the property value
+Pass e.style['animation-range'] = "exit calc(10% + 50px)" should set the property value
+Pass e.style['animation-range'] = "entry 50% exit 50%" should set the property value
+Pass e.style['animation-range'] = "cover 50% entry 50%, contain 50% exit 50%" should set the property value
+Pass e.style['animation-range'] = "50% exit 50%" should set the property value
+Pass e.style['animation-range'] = "normal 100px" should set the property value
+Pass e.style['animation-range'] = "100px" should set the property value
+Pass e.style['animation-range'] = "100px normal" should set the property value
+Pass e.style['animation-range'] = "10% normal" should set the property value
+Pass e.style['animation-range'] = "entry normal" should set the property value
+Pass Property animation-range value 'normal'
+Pass Property animation-range value 'normal normal'
+Pass Property animation-range value 'cover'
+Pass Property animation-range value 'contain'
+Pass Property animation-range value 'entry'
+Pass Property animation-range value 'entry-crossing'
+Pass Property animation-range value 'exit'
+Pass Property animation-range value 'exit-crossing'
+Pass Property animation-range value 'entry, exit'
+Pass Property animation-range value '0% 100%'
+Pass Property animation-range value 'entry 0% entry 100%'
+Pass Property animation-range value 'entry-crossing 0% entry-crossing 100%'
+Pass Property animation-range value 'exit 0% exit 100%'
+Pass Property animation-range value 'exit-crossing 0% exit-crossing 100%'
+Pass Property animation-range value 'cover 0% cover 100%'
+Pass Property animation-range value 'contain 0% contain 100%'
+Pass Property animation-range value 'entry calc(10% - 10%) entry calc(50% + 50%)'
+Pass Property animation-range value 'cover 50%'
+Pass Property animation-range value 'contain 50%'
+Pass Property animation-range value 'entry 50%'
+Pass Property animation-range value 'entry-crossing 50%'
+Pass Property animation-range value 'exit 50%'
+Pass Property animation-range value 'exit-crossing 50%'
+Pass Property animation-range value 'entry 50px exit 100px'
+Pass Property animation-range value 'exit calc(10% + 50px)'
+Pass Property animation-range value 'entry 50% exit 50%'
+Pass Property animation-range value 'cover 50% entry 50%, contain 50% exit 50%'
+Pass Property animation-range value 'entry 10em exit 20em'
+Pass Property animation-range value '10em exit 20em'
+Pass Property animation-range value 'normal 100px'
+Pass Property animation-range value '100px'
+Pass Property animation-range value '100px normal'
+Pass Property animation-range value '10% normal'
+Pass Property animation-range value 'entry normal'
+Pass Property animation-range value '10% calc(70% + 10% * sign(100em - 1px))'
+Pass e.style['animation-range'] = "entry 50% 0s" should not set the property value
+Pass e.style['animation-range'] = "0s entry 50%" should not set the property value
+Pass e.style['animation-range'] = "1s" should not set the property value
+Pass e.style['animation-range'] = "-1s" should not set the property value
+Pass e.style['animation-range'] = "1s 2s" should not set the property value
+Pass e.style['animation-range'] = "1s, 2s" should not set the property value
+Pass e.style['animation-range'] = "1s 2s, 3s" should not set the property value
+Pass e.style['animation-range'] = "1s, 2s 3s" should not set the property value
+Pass e.style['animation-range'] = "1s, 2s, 3s" should not set the property value
+Pass e.style['animation-range'] = "1s 2s 3s" should not set the property value
+Pass e.style['animation-range'] = "0s, 1s 2s 3s" should not set the property value
+Pass e.style['animation-range'] = "1s / 2s" should not set the property value
+Pass e.style['animation-range'] = "1s, 2px" should not set the property value
+Pass e.style['animation-range'] = "#ff0000" should not set the property value
+Pass e.style['animation-range'] = "red" should not set the property value
+Pass e.style['animation-range'] = "thing" should not set the property value
+Pass e.style['animation-range'] = "thing 0%" should not set the property value
+Pass e.style['animation-range'] = "thing 42%" should not set the property value
+Pass e.style['animation-range'] = "thing 100%" should not set the property value
+Pass e.style['animation-range'] = "thing 100px" should not set the property value
+Pass e.style['animation-range'] = "100% thing" should not set the property value
+Pass e.style['animation-range'] = "normal foo normal 100%" should not set the property value
+Pass e.style['animation-range'] = "normal normal 100%" should not set the property value
+Pass e.style['animation-range'] = "normal" should set animation-range-end
+Pass e.style['animation-range'] = "normal" should set animation-range-start
+Pass e.style['animation-range'] = "normal" should not set unrelated longhands
+Pass e.style['animation-range'] = "normal normal" should set animation-range-end
+Pass e.style['animation-range'] = "normal normal" should set animation-range-start
+Pass e.style['animation-range'] = "normal normal" should not set unrelated longhands
+Pass e.style['animation-range'] = "normal entry 100%" should set animation-range-end
+Pass e.style['animation-range'] = "normal entry 100%" should set animation-range-start
+Pass e.style['animation-range'] = "normal entry 100%" should not set unrelated longhands
+Pass e.style['animation-range'] = "normal entry 10%" should set animation-range-end
+Pass e.style['animation-range'] = "normal entry 10%" should set animation-range-start
+Pass e.style['animation-range'] = "normal entry 10%" should not set unrelated longhands
+Pass e.style['animation-range'] = "cover" should set animation-range-end
+Pass e.style['animation-range'] = "cover" should set animation-range-start
+Pass e.style['animation-range'] = "cover" should not set unrelated longhands
+Pass e.style['animation-range'] = "contain" should set animation-range-end
+Pass e.style['animation-range'] = "contain" should set animation-range-start
+Pass e.style['animation-range'] = "contain" should not set unrelated longhands
+Pass e.style['animation-range'] = "contain 100% contain 0%" should set animation-range-end
+Pass e.style['animation-range'] = "contain 100% contain 0%" should set animation-range-start
+Pass e.style['animation-range'] = "contain 100% contain 0%" should not set unrelated longhands
+Pass e.style['animation-range'] = "entry 10% exit 20%" should set animation-range-end
+Pass e.style['animation-range'] = "entry 10% exit 20%" should set animation-range-start
+Pass e.style['animation-range'] = "entry 10% exit 20%" should not set unrelated longhands
+Pass e.style['animation-range'] = "entry calc(10% + 10px) exit 20px" should set animation-range-end
+Pass e.style['animation-range'] = "entry calc(10% + 10px) exit 20px" should set animation-range-start
+Pass e.style['animation-range'] = "entry calc(10% + 10px) exit 20px" should not set unrelated longhands
+Pass e.style['animation-range'] = "entry, exit" should set animation-range-end
+Pass e.style['animation-range'] = "entry, exit" should set animation-range-start
+Pass e.style['animation-range'] = "entry, exit" should not set unrelated longhands
+Pass e.style['animation-range'] = "entry 0%, exit" should set animation-range-end
+Pass e.style['animation-range'] = "entry 0%, exit" should set animation-range-start
+Pass e.style['animation-range'] = "entry 0%, exit" should not set unrelated longhands
+Pass e.style['animation-range'] = "exit calc(10% + 50px)" should set animation-range-end
+Pass e.style['animation-range'] = "exit calc(10% + 50px)" should set animation-range-start
+Pass e.style['animation-range'] = "exit calc(10% + 50px)" should not set unrelated longhands
+Pass e.style['animation-range'] = "100px" should set animation-range-end
+Pass e.style['animation-range'] = "100px" should set animation-range-start
+Pass e.style['animation-range'] = "100px" should not set unrelated longhands
+Pass e.style['animation-range'] = "10%" should set animation-range-end
+Pass e.style['animation-range'] = "10%" should set animation-range-start
+Pass e.style['animation-range'] = "10%" should not set unrelated longhands
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-start-computed.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-start-computed.txt
new file mode 100644
index 00000000000..681eb6e90b5
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-start-computed.txt
@@ -0,0 +1,35 @@
+Harness status: OK
+
+Found 30 tests
+
+30 Pass
+Pass Property animation-range-start value 'initial'
+Pass Property animation-range-start value 'normal'
+Pass Property animation-range-start value 'cover 0px'
+Pass Property animation-range-start value 'cover 0%'
+Pass Property animation-range-start value 'cover 100%'
+Pass Property animation-range-start value 'COVER 0%'
+Pass Property animation-range-start value 'COVER 100%'
+Pass Property animation-range-start value 'cover 120%'
+Pass Property animation-range-start value 'cover 42%'
+Pass Property animation-range-start value '0'
+Pass Property animation-range-start value '120%'
+Pass Property animation-range-start value '0%'
+Pass Property animation-range-start value '100%'
+Pass Property animation-range-start value '120px'
+Pass Property animation-range-start value 'cover -42%'
+Pass Property animation-range-start value 'contain 42%'
+Pass Property animation-range-start value 'exit 42%'
+Pass Property animation-range-start value 'exit calc(41% + 1%)'
+Pass Property animation-range-start value 'exit 1%, cover 2%, contain 0%'
+Pass Property animation-range-start value 'exit 1%, cover 2%, contain 100%'
+Pass Property animation-range-start value 'exit-crossing 42%'
+Pass Property animation-range-start value 'entry 42px'
+Pass Property animation-range-start value 'entry-crossing 42px'
+Pass Property animation-range-start value 'contain calc(10% + 10px)'
+Pass Property animation-range-start value 'entry 1em'
+Pass Property animation-range-start value 'exit calc(1em + 10px)'
+Pass Property animation-range-start value 'cover'
+Pass Property animation-range-start value 'contain'
+Pass Property animation-range-start value 'entry'
+Pass Property animation-range-start value 'exit'
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-start-invalid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-start-invalid.txt
new file mode 100644
index 00000000000..fb79d7ff977
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-start-invalid.txt
@@ -0,0 +1,16 @@
+Harness status: OK
+
+Found 11 tests
+
+11 Pass
+Pass e.style['animation-range-start'] = "peek 50%" should not set the property value
+Pass e.style['animation-range-start'] = "50% contain" should not set the property value
+Pass e.style['animation-range-start'] = "50% cover" should not set the property value
+Pass e.style['animation-range-start'] = "50% entry" should not set the property value
+Pass e.style['animation-range-start'] = "50% enter" should not set the property value
+Pass e.style['animation-range-start'] = "50% exit" should not set the property value
+Pass e.style['animation-range-start'] = "contain contain" should not set the property value
+Pass e.style['animation-range-start'] = "none" should not set the property value
+Pass e.style['animation-range-start'] = "cover 50% enter 50%" should not set the property value
+Pass e.style['animation-range-start'] = "normal 10px" should not set the property value
+Pass e.style['animation-range-start'] = "normal foo" should not set the property value
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-start-valid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-start-valid.txt
new file mode 100644
index 00000000000..523635f34c5
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-range-start-valid.txt
@@ -0,0 +1,31 @@
+Harness status: OK
+
+Found 26 tests
+
+26 Pass
+Pass e.style['animation-range-start'] = "normal" should set the property value
+Pass e.style['animation-range-start'] = "cover 0px" should set the property value
+Pass e.style['animation-range-start'] = "cover 0%" should set the property value
+Pass e.style['animation-range-start'] = "cover 100%" should set the property value
+Pass e.style['animation-range-start'] = "cover 120%" should set the property value
+Pass e.style['animation-range-start'] = "cover 42%" should set the property value
+Pass e.style['animation-range-start'] = "0" should set the property value
+Pass e.style['animation-range-start'] = "120%" should set the property value
+Pass e.style['animation-range-start'] = "120px" should set the property value
+Pass e.style['animation-range-start'] = "cover -42%" should set the property value
+Pass e.style['animation-range-start'] = "contain 42%" should set the property value
+Pass e.style['animation-range-start'] = "exit 42%" should set the property value
+Pass e.style['animation-range-start'] = "exit 1%, cover 2%, contain 0%" should set the property value
+Pass e.style['animation-range-start'] = "exit 1%, cover 2%, contain 100%" should set the property value
+Pass e.style['animation-range-start'] = "exit-crossing 42%" should set the property value
+Pass e.style['animation-range-start'] = "entry 42px" should set the property value
+Pass e.style['animation-range-start'] = "entry-crossing 42px" should set the property value
+Pass e.style['animation-range-start'] = "contain calc(10px + 10%)" should set the property value
+Pass e.style['animation-range-start'] = "entry 1em" should set the property value
+Pass e.style['animation-range-start'] = "exit calc(1em + 10px)" should set the property value
+Pass e.style['animation-range-start'] = "entry 42%" should set the property value
+Pass e.style['animation-range-start'] = "cover" should set the property value
+Pass e.style['animation-range-start'] = "contain" should set the property value
+Pass e.style['animation-range-start'] = "entry" should set the property value
+Pass e.style['animation-range-start'] = "exit" should set the property value
+Pass e.style['animation-range-start'] = "cover calc(sign(100em - 1px) * 1%)" should set the property value
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-shorthand.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-shorthand.txt
index e1fef8dd279..213b2c283bd 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-shorthand.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-shorthand.txt
@@ -2,8 +2,7 @@ Harness status: OK
Found 36 tests
-30 Pass
-6 Fail
+36 Pass
Pass e.style['animation'] = "anim paused both reverse 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-delay
Pass e.style['animation'] = "anim paused both reverse 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-direction
Pass e.style['animation'] = "anim paused both reverse 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-duration
@@ -11,8 +10,8 @@ Pass e.style['animation'] = "anim paused both reverse 4 1s -3s cubic-bezier(0, -
Pass e.style['animation'] = "anim paused both reverse 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-iteration-count
Pass e.style['animation'] = "anim paused both reverse 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-name
Pass e.style['animation'] = "anim paused both reverse 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-play-state
-Fail e.style['animation'] = "anim paused both reverse 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-range-end
-Fail e.style['animation'] = "anim paused both reverse 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-range-start
+Pass e.style['animation'] = "anim paused both reverse 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-range-end
+Pass e.style['animation'] = "anim paused both reverse 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-range-start
Pass e.style['animation'] = "anim paused both reverse 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-timeline
Pass e.style['animation'] = "anim paused both reverse 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-timing-function
Pass e.style['animation'] = "anim paused both reverse 4 1s -3s cubic-bezier(0, -2, 1, 3)" should not set unrelated longhands
@@ -23,8 +22,8 @@ Pass e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0,
Pass e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-iteration-count
Pass e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-name
Pass e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-play-state
-Fail e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-range-end
-Fail e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-range-start
+Pass e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-range-end
+Pass e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-range-start
Pass e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-timeline
Pass e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set animation-timing-function
Pass e.style['animation'] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should not set unrelated longhands
@@ -35,8 +34,8 @@ Pass e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused bot
Pass e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-iteration-count
Pass e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-name
Pass e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-play-state
-Fail e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-range-end
-Fail e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-range-start
+Pass e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-range-end
+Pass e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-range-start
Pass e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-timeline
Pass e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should set animation-timing-function
-Pass e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should not set unrelated longhands
+Pass e.style['animation'] = "4 1s -3s cubic-bezier(0, -2, 1, 3), anim paused both reverse" should not set unrelated longhands
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt
index ca241c399c6..5ceaff48432 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt
@@ -1,8 +1,8 @@
Harness status: OK
-Found 329 tests
+Found 331 tests
-325 Pass
+327 Pass
4 Fail
Pass accent-color
Pass border-collapse
@@ -91,6 +91,8 @@ Pass animation-fill-mode
Pass animation-iteration-count
Pass animation-name
Pass animation-play-state
+Pass animation-range-end
+Pass animation-range-start
Pass animation-timeline
Pass animation-timing-function
Pass appearance
diff --git a/Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/animation-shorthand.txt b/Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/animation-shorthand.txt
index 60d98b4b148..1e0f879ef0c 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/animation-shorthand.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/animation-shorthand.txt
@@ -2,8 +2,7 @@ Harness status: OK
Found 27 tests
-21 Pass
-6 Fail
+27 Pass
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim" should set the property value
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim initial" should not set the property value
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim 2000" should not set the property value
@@ -18,16 +17,16 @@ Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-iteration-count
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-name
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-play-state
-Fail e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-range-end
-Fail e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-range-start
+Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-range-end
+Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-range-start
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-timeline
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-timing-function
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should not set unrelated longhands
Pass Animation shorthand can not represent non-initial timelines (specified)
Pass Animation shorthand can not represent non-initial timelines (computed)
-Fail Animation shorthand can not represent non-initial animation-range-start (specified)
-Fail Animation shorthand can not represent non-initial animation-range-start (computed)
-Fail Animation shorthand can not represent non-initial animation-range-end (specified)
-Fail Animation shorthand can not represent non-initial animation-range-end (computed)
+Pass Animation shorthand can not represent non-initial animation-range-start (specified)
+Pass Animation shorthand can not represent non-initial animation-range-start (computed)
+Pass Animation shorthand can not represent non-initial animation-range-end (specified)
+Pass Animation shorthand can not represent non-initial animation-range-end (computed)
Pass Animation shorthand can not be represented with same list length (specified)
Pass Animation shorthand can be represented with same list length (computed)
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-end-computed.html b/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-end-computed.html
new file mode 100644
index 00000000000..6ca5a0842d8
--- /dev/null
+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-end-computed.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<link rel="help" href="https://drafts.csswg.org/scroll-animations-1/#propdef-animation-range">
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="../../../css/support/computed-testcommon.js"></script>
+<div id="target" style="font-size:10px;"></div>
+<script>
+test_computed_value("animation-range-end", "initial", "normal");
+test_computed_value("animation-range-end", "normal");
+test_computed_value("animation-range-end", "cover 0%");
+test_computed_value("animation-range-end", "cover 100%", "cover");
+test_computed_value("animation-range-end", "COVER 0%", "cover 0%");
+test_computed_value("animation-range-end", "COVER 100%", "cover");
+test_computed_value("animation-range-end", "cover 120%");
+test_computed_value("animation-range-end", "0", "0px");
+test_computed_value("animation-range-end", "120%");
+test_computed_value("animation-range-end", "0%");
+test_computed_value("animation-range-end", "100%");
+test_computed_value("animation-range-end", "120px");
+test_computed_value("animation-range-end", "cover 42%");
+test_computed_value("animation-range-end", "cover -42%");
+test_computed_value("animation-range-end", "contain 42%");
+test_computed_value("animation-range-end", "exit 42%");
+test_computed_value("animation-range-end", "exit calc(41% + 1%)", "exit 42%");
+test_computed_value("animation-range-end", "exit-crossing 42%");
+test_computed_value("animation-range-end", "exit 1%, cover 2%, contain 0%");
+test_computed_value("animation-range-end", "exit 1%, cover 2%, contain 100%", "exit 1%, cover 2%, contain");
+test_computed_value("animation-range-end", "entry 42px");
+test_computed_value("animation-range-end", "entry-crossing 42px");
+
+test_computed_value("animation-range-end", "contain calc(10% + 10px)");
+test_computed_value("animation-range-end", "entry 1em", "entry 10px");
+test_computed_value("animation-range-end", "exit calc(1em + 10px)", "exit 20px");
+test_computed_value("animation-range-end", "cover");
+test_computed_value("animation-range-end", "contain");
+test_computed_value("animation-range-end", "entry");
+test_computed_value("animation-range-end", "exit");
+</script>
diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-end-invalid.html b/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-end-invalid.html
new file mode 100644
index 00000000000..bc1fb90d04b
--- /dev/null
+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-end-invalid.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<link rel="help" href="https://drafts.csswg.org/scroll-animations-1/#propdef-animation-range">
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="../../../css/support/parsing-testcommon.js"></script>
+<script>
+test_invalid_value("animation-range-end", "infinite");
+test_invalid_value("animation-range-end", "1s 2s");
+test_invalid_value("animation-range-end", "1s / 2s");
+
+test_invalid_value("animation-range-end", "peek 50%");
+test_invalid_value("animation-range-end", "50% contain");
+test_invalid_value("animation-range-end", "50% cover");
+test_invalid_value("animation-range-end", "50% entry");
+test_invalid_value("animation-range-end", "50% enter");
+test_invalid_value("animation-range-end", "50% exit");
+test_invalid_value("animation-range-end", "contain contain");
+test_invalid_value("animation-range-end", "none");
+test_invalid_value("animation-range-end", "cover 50% enter 50%");
+test_invalid_value("animation-range-end", "normal 10px");
+test_invalid_value("animation-range-end", "normal foo");
+</script>
diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-end-valid.html b/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-end-valid.html
new file mode 100644
index 00000000000..2150113c02b
--- /dev/null
+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-end-valid.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<link rel="help" href="https://drafts.csswg.org/scroll-animations-1/#propdef-animation-range">
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="../../../css/support/parsing-testcommon.js"></script>
+<script>
+// https://drafts.csswg.org/scroll-animations-1/#view-timelines-ranges
+test_valid_value("animation-range-end", "normal");
+test_valid_value("animation-range-end", "cover 0%");
+test_valid_value("animation-range-end", "cover 100%", "cover");
+test_valid_value("animation-range-end", "cover 120%");
+test_valid_value("animation-range-end", "cover 42%");
+test_valid_value("animation-range-end", "0", "0px");
+test_valid_value("animation-range-end", "120%");
+test_valid_value("animation-range-end", "120px");
+test_valid_value("animation-range-end", "cover -42%");
+test_valid_value("animation-range-end", "contain 42%");
+test_valid_value("animation-range-end", "exit 42%");
+test_valid_value("animation-range-end", "exit 1%, cover 2%, contain 0%");
+test_valid_value("animation-range-end", "exit 1%, cover 2%, contain 100%", "exit 1%, cover 2%, contain");
+test_valid_value("animation-range-end", "exit-crossing 42%");
+test_valid_value("animation-range-end", "entry 42px");
+test_valid_value("animation-range-end", "entry-crossing 42px");
+test_valid_value("animation-range-end", "contain calc(10px + 10%)", "contain calc(10% + 10px)");
+test_valid_value("animation-range-end", "entry 1em");
+test_valid_value("animation-range-end", "exit calc(1em + 10px)");
+test_valid_value("animation-range-end", "entry 42%");
+test_valid_value("animation-range-end", "cover");
+test_valid_value("animation-range-end", "contain");
+test_valid_value("animation-range-end", "entry");
+test_valid_value("animation-range-end", "exit");
+</script>
diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-shorthand-end-zero-offset.html b/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-shorthand-end-zero-offset.html
new file mode 100644
index 00000000000..2a10e0bcf5c
--- /dev/null
+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-shorthand-end-zero-offset.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<title>animation-range shorthand serialization preserves a 0% end offset</title>
+<link rel="help" href="https://drafts.csswg.org/scroll-animations-1/#propdef-animation-range">
+<link rel="help" href="https://drafts.csswg.org/cssom/#serialize-a-css-value">
+<meta name="assert" content="A 0% offset on animation-range-end is not the end default (100%) and must be preserved when serializing the animation-range shorthand.">
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="../../../css/support/parsing-testcommon.js"></script>
+<div id="target" style="font-size:10px"></div>
+<script>
+// The omittable default offset is 0% for animation-range-start and 100% for
+// animation-range-end. So a 0% offset on the END is meaningful and must round-trip.
+// The collapse-to-bare-name path only fires when the end's range name differs from
+// the start's, which is the case these tests exercise.
+
+// Bug cases: end has a 0% offset and a different range name than the start.
+test_valid_value("animation-range", "normal cover 0%");
+test_valid_value("animation-range", "entry 0% exit 0%", "entry exit 0%");
+test_valid_value("animation-range", "cover 50% exit 0%");
+
+// Control: 100% IS the end default, so it correctly collapses to the bare name.
+test_valid_value("animation-range", "normal cover 100%", "normal cover");
+test_valid_value("animation-range", "entry 0% exit 100%", "entry exit");
+
+// Control: a non-default end offer is kept (passes regardless of the bug).
+test_valid_value("animation-range", "normal exit 50%");
+</script>
diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-shorthand.html b/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-shorthand.html
new file mode 100644
index 00000000000..97babc000cb
--- /dev/null
+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-shorthand.html
@@ -0,0 +1,185 @@
+<!DOCTYPE html>
+<title>animation-range shorthand</title>
+<link rel="help" href="https://drafts.csswg.org/scroll-animations-1/#propdef-animation-range">
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="../../../css/support/shorthand-testcommon.js"></script>
+<script src="../../../css/support/parsing-testcommon.js"></script>
+<script src="../../../css/support/computed-testcommon.js"></script>
+<div id="target" style="font-size:10px"></div>
+<script>
+test_valid_value("animation-range", "normal");
+test_valid_value("animation-range", "normal normal", "normal");
+test_valid_value("animation-range", "cover");
+test_valid_value("animation-range", "contain");
+test_valid_value("animation-range", "entry");
+test_valid_value("animation-range", "entry-crossing");
+test_valid_value("animation-range", "exit");
+test_valid_value("animation-range", "exit-crossing");
+test_valid_value("animation-range", "entry, exit");
+
+test_valid_value("animation-range", "0% 100%", "0%");
+test_valid_value("animation-range", "entry 0% entry 100%", "entry");
+test_valid_value("animation-range", "entry-crossing 0% entry-crossing 100%",
+ "entry-crossing");
+test_valid_value("animation-range", "exit 0% exit 100%", "exit");
+test_valid_value("animation-range", "exit-crossing 0% exit-crossing 100%",
+ "exit-crossing");
+test_valid_value("animation-range", "cover 0% cover 100%", "cover");
+test_valid_value("animation-range", "contain 0% contain 100%", "contain");
+test_valid_value("animation-range",
+ "entry calc(10% - 10%) entry calc(50% + 50%)", "entry calc(0%) entry calc(100%)");
+test_valid_value("animation-range", "cover 50%");
+test_valid_value("animation-range", "contain 50%");
+test_valid_value("animation-range", "entry 50%");
+test_valid_value("animation-range", "entry-crossing 50%");
+test_valid_value("animation-range", "exit 50%");
+test_valid_value("animation-range", "exit-crossing 50%");
+test_valid_value("animation-range", "entry 50px exit 100px");
+test_valid_value("animation-range", "exit calc(10% + 50px)");
+
+test_valid_value("animation-range", "entry 50% exit 50%");
+test_valid_value("animation-range",
+ "cover 50% entry 50%, contain 50% exit 50%");
+test_valid_value("animation-range", "50% exit 50%");
+test_valid_value("animation-range", "normal 100px");
+test_valid_value("animation-range", "100px");
+test_valid_value("animation-range", "100px normal", "100px");
+test_valid_value("animation-range", "10% normal", "10%");
+test_valid_value("animation-range", "entry normal");
+
+test_computed_value("animation-range", "normal");
+test_computed_value("animation-range", "normal normal", "normal");
+test_computed_value("animation-range", "cover");
+test_computed_value("animation-range", "contain");
+test_computed_value("animation-range", "entry");
+test_computed_value("animation-range", "entry-crossing");
+test_computed_value("animation-range", "exit");
+test_computed_value("animation-range", "exit-crossing");
+test_computed_value("animation-range", "entry, exit");
+
+test_computed_value("animation-range", "0% 100%", "0%");
+test_computed_value("animation-range", "entry 0% entry 100%", "entry");
+test_computed_value("animation-range", "entry-crossing 0% entry-crossing 100%",
+ "entry-crossing");
+test_computed_value("animation-range", "exit 0% exit 100%", "exit");
+test_computed_value("animation-range", "exit-crossing 0% exit-crossing 100%",
+ "exit-crossing");
+test_computed_value("animation-range", "cover 0% cover 100%", "cover");
+test_computed_value("animation-range", "contain 0% contain 100%", "contain");
+test_computed_value("animation-range",
+ "entry calc(10% - 10%) entry calc(50% + 50%)", "entry");
+test_computed_value("animation-range", "cover 50%");
+test_computed_value("animation-range", "contain 50%");
+test_computed_value("animation-range", "entry 50%");
+test_computed_value("animation-range", "entry-crossing 50%");
+test_computed_value("animation-range", "exit 50%");
+test_computed_value("animation-range", "exit-crossing 50%");
+test_computed_value("animation-range", "entry 50px exit 100px");
+test_computed_value("animation-range", "exit calc(10% + 50px)");
+
+test_computed_value("animation-range", "entry 50% exit 50%");
+test_computed_value("animation-range",
+ "cover 50% entry 50%, contain 50% exit 50%");
+
+test_computed_value("animation-range", "entry 10em exit 20em", "entry 100px exit 200px");
+test_computed_value("animation-range", "10em exit 20em", "100px exit 200px");
+test_computed_value("animation-range", "normal 100px");
+test_computed_value("animation-range", "100px");
+test_computed_value("animation-range", "100px normal", "100px");
+test_computed_value("animation-range", "10% normal", "10%");
+test_computed_value("animation-range", "entry normal");
+test_computed_value("animation-range", "10% calc(70% + 10% * sign(100em - 1px))", "10% 80%");
+
+test_invalid_value("animation-range", "entry 50% 0s", "entry 50%");
+test_invalid_value("animation-range", "0s entry 50%");
+test_invalid_value("animation-range", "1s");
+test_invalid_value("animation-range", "-1s");
+test_invalid_value("animation-range", "1s 2s");
+test_invalid_value("animation-range", "1s, 2s");
+test_invalid_value("animation-range", "1s 2s, 3s");
+test_invalid_value("animation-range", "1s, 2s 3s");
+test_invalid_value("animation-range", "1s, 2s, 3s");
+test_invalid_value("animation-range", "1s 2s 3s");
+test_invalid_value("animation-range", "0s, 1s 2s 3s");
+test_invalid_value("animation-range", "1s / 2s");
+test_invalid_value("animation-range", "1s, 2px");
+test_invalid_value("animation-range", "#ff0000");
+test_invalid_value("animation-range", "red");
+test_invalid_value("animation-range", "thing");
+test_invalid_value("animation-range", "thing 0%");
+test_invalid_value("animation-range", "thing 42%");
+test_invalid_value("animation-range", "thing 100%");
+test_invalid_value("animation-range", "thing 100px");
+test_invalid_value("animation-range", "100% thing");
+test_invalid_value("animation-range", "normal foo normal 100%");
+test_invalid_value("animation-range", "normal normal 100%");
+
+test_shorthand_value('animation-range', 'normal', {
+ 'animation-range-start': 'normal',
+ 'animation-range-end': 'normal',
+});
+
+test_shorthand_value('animation-range', 'normal normal', {
+ 'animation-range-start': 'normal',
+ 'animation-range-end': 'normal',
+});
+
+test_shorthand_value('animation-range', 'normal entry 100%', {
+ 'animation-range-start': 'normal',
+ 'animation-range-end': 'entry',
+});
+
+test_shorthand_value('animation-range', 'normal entry 10%', {
+ 'animation-range-start': 'normal',
+ 'animation-range-end': 'entry 10%',
+});
+
+test_shorthand_value('animation-range', 'cover', {
+ 'animation-range-start': 'cover',
+ 'animation-range-end': 'cover',
+});
+
+test_shorthand_value('animation-range', 'contain', {
+ 'animation-range-start': 'contain',
+ 'animation-range-end': 'contain',
+});
+
+test_shorthand_value('animation-range', 'contain 100% contain 0%', {
+ 'animation-range-start': 'contain 100%',
+ 'animation-range-end': 'contain 0%',
+});
+
+test_shorthand_value('animation-range', 'entry 10% exit 20%', {
+ 'animation-range-start': 'entry 10%',
+ 'animation-range-end': 'exit 20%',
+});
+
+test_shorthand_value('animation-range', 'entry calc(10% + 10px) exit 20px', {
+ 'animation-range-start': 'entry calc(10% + 10px)',
+ 'animation-range-end': 'exit 20px',
+});
+
+test_shorthand_value('animation-range', 'entry, exit', {
+ 'animation-range-start': 'entry, exit',
+ 'animation-range-end': 'entry, exit',
+});
+
+test_shorthand_value('animation-range', 'entry 0%, exit', {
+ 'animation-range-start': 'entry, exit',
+ 'animation-range-end': 'entry, exit',
+});
+
+test_shorthand_value('animation-range', 'exit calc(10% + 50px)', {
+ 'animation-range-start': 'exit calc(10% + 50px)',
+ 'animation-range-end': 'exit',
+});
+test_shorthand_value('animation-range', '100px', {
+ 'animation-range-start': '100px',
+ 'animation-range-end': 'normal',
+});
+test_shorthand_value('animation-range', '10%', {
+ 'animation-range-start': '10%',
+ 'animation-range-end': 'normal',
+});
+</script>
diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-start-computed.html b/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-start-computed.html
new file mode 100644
index 00000000000..775e8bb0f27
--- /dev/null
+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-start-computed.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<link rel="help" href="https://drafts.csswg.org/scroll-animations-1/#propdef-animation-range">
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="../../../css/support/computed-testcommon.js"></script>
+<div id="target" style="font-size:10px;"></div>
+<script>
+test_computed_value("animation-range-start", "initial", "normal");
+test_computed_value("animation-range-start", "normal");
+test_computed_value("animation-range-start", "cover 0px");
+test_computed_value("animation-range-start", "cover 0%", "cover");
+test_computed_value("animation-range-start", "cover 100%");
+test_computed_value("animation-range-start", "COVER 0%", "cover");
+test_computed_value("animation-range-start", "COVER 100%", "cover 100%");
+test_computed_value("animation-range-start", "cover 120%");
+test_computed_value("animation-range-start", "cover 42%");
+test_computed_value("animation-range-start", "0", "0px");
+test_computed_value("animation-range-start", "120%");
+test_computed_value("animation-range-start", "0%");
+test_computed_value("animation-range-start", "100%");
+test_computed_value("animation-range-start", "120px");
+test_computed_value("animation-range-start", "cover -42%");
+test_computed_value("animation-range-start", "contain 42%");
+test_computed_value("animation-range-start", "exit 42%");
+test_computed_value("animation-range-start", "exit calc(41% + 1%)", "exit 42%");
+test_computed_value("animation-range-start", "exit 1%, cover 2%, contain 0%", "exit 1%, cover 2%, contain");
+test_computed_value("animation-range-start", "exit 1%, cover 2%, contain 100%");
+test_computed_value("animation-range-start", "exit-crossing 42%");
+test_computed_value("animation-range-start", "entry 42px");
+test_computed_value("animation-range-start", "entry-crossing 42px");
+test_computed_value("animation-range-start", "contain calc(10% + 10px)");
+test_computed_value("animation-range-start", "entry 1em", "entry 10px");
+test_computed_value("animation-range-start", "exit calc(1em + 10px)", "exit 20px");
+test_computed_value("animation-range-start", "cover");
+test_computed_value("animation-range-start", "contain");
+test_computed_value("animation-range-start", "entry");
+test_computed_value("animation-range-start", "exit");
+</script>
diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-start-invalid.html b/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-start-invalid.html
new file mode 100644
index 00000000000..cc1a44d1839
--- /dev/null
+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-start-invalid.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<link rel="help" href="https://drafts.csswg.org/scroll-animations-1/#propdef-animation-range">
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="../../../css/support/parsing-testcommon.js"></script>
+<script>
+test_invalid_value("animation-range-start", "peek 50%");
+test_invalid_value("animation-range-start", "50% contain");
+test_invalid_value("animation-range-start", "50% cover");
+test_invalid_value("animation-range-start", "50% entry");
+test_invalid_value("animation-range-start", "50% enter");
+test_invalid_value("animation-range-start", "50% exit");
+test_invalid_value("animation-range-start", "contain contain");
+test_invalid_value("animation-range-start", "none");
+test_invalid_value("animation-range-start", "cover 50% enter 50%");
+test_invalid_value("animation-range-start", "normal 10px");
+test_invalid_value("animation-range-start", "normal foo");
+</script>
diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-start-valid.html b/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-start-valid.html
new file mode 100644
index 00000000000..86a1a7f5e71
--- /dev/null
+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/animation-range-start-valid.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<link rel="help" href="https://drafts.csswg.org/scroll-animations-1/#propdef-animation-range">
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="../../../css/support/parsing-testcommon.js"></script>
+<script>
+// https://drafts.csswg.org/scroll-animations-1/#view-timelines-ranges
+test_valid_value("animation-range-start", "normal");
+test_valid_value("animation-range-start", "cover 0px");
+test_valid_value("animation-range-start", "cover 0%", "cover");
+test_valid_value("animation-range-start", "cover 100%");
+test_valid_value("animation-range-start", "cover 120%");
+test_valid_value("animation-range-start", "cover 42%");
+test_valid_value("animation-range-start", "0", "0px");
+test_valid_value("animation-range-start", "120%");
+test_valid_value("animation-range-start", "120px");
+test_valid_value("animation-range-start", "cover -42%");
+test_valid_value("animation-range-start", "contain 42%");
+test_valid_value("animation-range-start", "exit 42%");
+test_valid_value("animation-range-start", "exit 1%, cover 2%, contain 0%", "exit 1%, cover 2%, contain");
+test_valid_value("animation-range-start", "exit 1%, cover 2%, contain 100%");
+test_valid_value("animation-range-start", "exit-crossing 42%");
+test_valid_value("animation-range-start", "entry 42px");
+test_valid_value("animation-range-start", "entry-crossing 42px");
+test_valid_value("animation-range-start", "contain calc(10px + 10%)", "contain calc(10% + 10px)");
+test_valid_value("animation-range-start", "entry 1em");
+test_valid_value("animation-range-start", "exit calc(1em + 10px)");
+test_valid_value("animation-range-start", "entry 42%");
+test_valid_value("animation-range-start", "cover");
+test_valid_value("animation-range-start", "contain");
+test_valid_value("animation-range-start", "entry");
+test_valid_value("animation-range-start", "exit");
+test_valid_value("animation-range-start", "cover calc(sign(100em - 1px) * 1%)", "cover calc(1% * sign(100em - 1px))");
+</script>