fune/testing/web-platform/tests/scroll-animations/css/named-range-keyframes-with-document-timeline.tentative.html
Mehdi Kazemi 199de09292 Bug 1806842 [wpt PR 37627] - Drop named range keyframes when flag is off, a=testonly
Automatic update from web-platform-tests
Drop named range keyframes when flag is off

And in ProcessKeyframesRule, drop the keyframe when you have named range keyframe and (timeline is not available or it's not a ViewTimeline).

Bug: 1401362
Change-Id: Ia4a3de3a10469c488cdf95d62ae78ef1f378d58d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4117410
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Mehdi Kazemi <mehdika@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1086349}

--

wpt-commits: 1169bbe31489fa0da88f093718730f242ef3b0e0
wpt-pr: 37627
2023-01-05 09:08:20 +00:00

54 lines
1.4 KiB
HTML

<!DOCTYPE html>
<html>
<meta charset="utf-8">
<title>Named range keyframe offset when you have a document timeline</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/web-animations/testcommon.js"></script>
<script src="support/testcommon.js"></script>
<style>
@keyframes fade-in-animation {
from { opacity: 0 }
enter 0% { opacity: 0 }
enter 100% { opacity: 1 }
exit 0% { opacity: 1 }
exit 100% { opacity: 0 }
to { opacity: 1 }
}
#subject {
background-color: blue;
height: 200px;
width: 200px;
animation: linear both fade-in-animation;
animation-duration: 0.1s;
animation-play-state: paused;
}
</style>
<body onload="runTests()">
<div id="subject"></div>
</body>
<script type="text/javascript">
setup(assert_implements_animation_timeline);
function runTests() {
promise_test(async t => {
const anim = subject.getAnimations()[0];
anim.currentTime = -1;
assert_equals(getComputedStyle(subject).opacity, "0",
'unexpected value in the before phase');
anim.currentTime = 50;
assert_equals(getComputedStyle(subject).opacity, "0.5",
'unexpected value in the middle of the animation');
anim.currentTime = 100;
assert_equals(getComputedStyle(subject).opacity, "1",
'unexpected value in the after phase');
});
}
</script>
</html>