fune/testing/web-platform/tests/css/css-animations/inheritance.html
Anders Hartvoll Ruud 131c9ea3fd Bug 1838305 [wpt PR 40528] - [scroll-animations] Resolve auto to 0s for time-based animations, a=testonly
Automatic update from web-platform-tests
[scroll-animations] Resolve auto to 0s for time-based animations

CL:4497757 made the initial value of animation-duration auto,
but unfortunately reporting this auto value through getComputedStyle
broke existing web content (Issue 1452130).

Hence, hence the CSSWG opted to define a resolved value for
animation-duration, which converts auto to 0s unless we have some
non-default value for animation-timeline. This CL implements that
change.

This CL also contains a second change: reset-only sub-properties
of the 'animation' shorthand are now correctly set to their
initial value, or not some repeated amount of their initial value.
This change was necessary to prevent e.g. "animation: a1, a2"
from expanding to "animation-timeline: auto, auto", which would
disable the auto-to-0s conversion behavior.

Finally, note that the computedStyleMap (Typed OM) does not return
resolved values, but computed values. Hence it must not be affected
by the auto-to-0s conversion. To ensure this, an "override"
was added for kAnimationDuration in ComputedStyleUtils::
ComputedPropertyValue.

Bug: 1452130
Change-Id: I021ac68b61b83cd96962c56dab24043a19e99c5f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4607459
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1157426}

--

wpt-commits: f9048ac795492ddb638196dfb4002a6aba7ef830
wpt-pr: 40528
2023-06-21 14:35:01 +00:00

28 lines
1.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Inheritance of CSS Animations properties</title>
<link rel="help" href="https://drafts.csswg.org/css-animations/#property-index">
<meta name="assert" content="Properties inherit or not according to the spec.">
<meta name="assert" content="Properties have initial values according to the spec.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/inheritance-testcommon.js"></script>
</head>
<body>
<div id="container">
<div id="target"></div>
</div>
<script>
assert_not_inherited('animation-delay', '0s', '2s');
assert_not_inherited('animation-direction', 'normal', 'reverse');
assert_not_inherited('animation-duration', '0s', '3s');
assert_not_inherited('animation-fill-mode', 'none', 'forwards');
assert_not_inherited('animation-iteration-count', '1', '4');
assert_not_inherited('animation-name', 'none', 'spinner');
assert_not_inherited('animation-play-state', 'running', 'paused');
assert_not_inherited('animation-timing-function', 'ease', 'linear');
</script>
</body>
</html>