Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<html class="reftest-wait">
<meta charset="utf-8">
<title>Scoped view transition on a MathML root element</title>
<link rel="match" href="scope-green-box-ref.html">
<script src="/common/reftest-wait.js"></script>
<script src="/web-animations/testcommon.js"></script>
<style>
.backing {
width: 120px;
height: 80px;
background: blue;
}
.scope {
display: block math;
width: 120px;
height: 80px;
background: yellow;
view-transition-name: target;
}
.scope::view-transition {
background: green;
}
.scope::view-transition-group(*) {
animation-play-state: paused;
opacity: 0;
}
</style>
<!-- Blue backing is exposed if the captured scope's transition overlay is missing. -->
<div class="backing">
<math class="scope"><mfrac><mi>x</mi><mn>2</mn></mfrac></math>
</div>
<script>
failIfNot(Element.prototype.startViewTransition,
"Missing Element.prototype.startViewTransition");
onload = () => reftestPromise(async () => {
await waitForCompositorReady();
const transitions = Array.from(document.querySelectorAll(".scope"),
scope => scope.startViewTransition());
await Promise.all(transitions.map(transition => transition.ready));
await Promise.all(document.getAnimations().map(animation => animation.ready));
takeScreenshot();
});
</script>
</html>