8000 VT: End the transition only if animation is not running or paused · rniwa/web-platform-tests@8ff38c5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8ff38c5

Browse files
vmpstrchromium-wpt-export-bot
authored andcommitted
VT: End the transition only if animation is not running or paused
Instead of effect IsCurrent, the spec says we should check animation run state and whether it's running or paused. This change aligns with the spec R=khushalsagar@chromium.org Fixed: 1392138 Change-Id: I7dcc316ee5c2d20b1e824e7a21a8f4a5859a8ee3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4150115 Commit-Queue: Vladimir Levin <vmpstr@chromium.org> Reviewed-by: Khushal Sagar <khushalsagar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1090996}
1 parent fe30ab2 commit 8ff38c5

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<!DOCTYPE html>
2+
<title>View transitions: pause animation and set current time to the end</title>
3+
<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/">
4+
<link rel="author" href="mailto:vmpstr@chromium.org">
5+
6+
<script src="/resources/testharness.js"></script>
7+
<script src="/resources/testharnessreport.js"></script>
8+
9+
<style>
10+
:root { view-transition-name: unset; }
11+
#target {
12+
width: 100px;
13+
height: 100px;
14+
contain: layout;
15+
view-transition-name: target;
16+
}
17+
.one {
18+
background: blue;
19+
}
20+
.two {
21+
background: green;
22+
}
23+
</style>
24+
25+
<div id=target class=one></div>
26+
27+
<script>
28+
promise_test(async (t) => {
29+
return new Promise((resolve, reject) => {
30+
let transition = document.startViewTransition(() => {
31+
target.classList.replace("one", "two");
32+
});
33+
34+
transition.finished.then(() => reject("transition unexpectedly finished"));
35+
transition.ready.then(() => {
36+
document.getAnimations().forEach((animation) => {
37+
animation.pause();
38+
animation.currentTime = 1000;
39+
});
40+
step_timeout(resolve, 500);
41+
});
42+
});
43+
}, "view transition is not over if animations are paused");
44+
</script>
45+

0 commit comments

Comments
 (0)
0