Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-view-transitions/scoped/display-inline-block.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<!-- TODO update link -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Scoped view transition with inline block</title>
</head>
<style>
#target {
display: inline-block;
view-transition-name: target;
}
::view-transition-group(target),
::view-transition-old(target) {
animation: unset;
}
@keyframes colorize {
to { opacity: 0.5; }
}
::view-transition-new(target) {
animation: colorize 1s paused steps(1, jump-start);
}
</style>
<script src="/web-animations/testcommon.js"></script>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<p><span id="target">Hello</span> World</p>
</body>
<script>
promise_test(async t => {
const vt = target.startViewTransition();
await vt.ready;
await Promise.all(document.getAnimations().map(a => a.ready));
const style =
getComputedStyle(target, '::view-transition-new(target)');
assert_equals(style.opacity, '0.5', 'Opacity animation is in effect');
}, 'Scoped view transition on an inline-block element');
</script>
</html>