Files
sousa-gecko/testing/web-platform/tests/css/css-view-transitions/composite-accumulate.html
T
Kevin Ellis 968803ade0 Bug 2038312 [wpt PR 59758] - Retarget animations on orphaned view-transition pseudo-elements, a=testonly
Automatic update from web-platform-tests
Retarget animations on orphaned view-transition pseudo-elements

Bug: 480074843
Change-Id: I84fc2918b7cbca6d6889dd9cc2a340e84259ead8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7829037
Commit-Queue: Kevin Ellis <kevers@chromium.org>
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1628528}

--

wpt-commits: 48914ef0142696a1b6cac82210a2ee4b1ed3039e
wpt-pr: 59758
2026-05-13 04:23:26 +00:00

72 lines
1.7 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="help" href="https://crbug.com/480074843">
<title>Composite accumulate</title>
</head>
<style>
body, #target {
margin: 0;
}
#target {
background-color: rebeccapurple;
height: 100px;
width: 100px;
view-transition-name: box;
}
::view-transition-group(box) {
animation-name: none;
}
:root {
view-transition-name: none;
user-select: none;
}
::view-transition {
pointer-events: none;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<div id="target"></div>
</body>
<script>
async function accumulate_translation() {
const vt = document.startViewTransition();
await vt.ready;
const anim =
document.documentElement.animate([
{ transform: `none` },
{ transform: 'translateX(100px)'}
],
{
duration: 1000,
composite: 'accumulate',
pseudoElement: '::view-transition-group(box)',
fill: 'forwards'
});
// Prevent replacement of finished animation.
anim.persist();
anim.finish();
return vt.finished;
}
promise_test(async t => {
await accumulate_translation();
await accumulate_translation();
const vt = document.startViewTransition();
await vt.ready;
requestAnimationFrame(() => {
assert_equals(getComputedStyle(document.documentElement,
'::view-transition-group(box)').transform,
'matrix(1, 0, 0, 1, 200, 0)');
});
}, 'Composite accumulate of script based animations across view transitions');
</script>
</html>