Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-view-transitions/fractional-translation-from-position.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class=reftest-wait>
<title>View transitions: fractional translation from position</title>
<link rel="author" href="mailto:khushalsagar@chromium.org">
<link rel="match" href="fractional-translation-from-position-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<script src="/common/reftest-wait.js"></script>
<style>
body {
width: 100vw;
height: 100vh;
background: grey;
font: 12px/1 Ahem;
}
#target {
width: 100px;
height: 100px;
position: fixed;
top: 100.52px;
left: 100.37px;
view-transition-name: target;
contain: layout;
}
/* Keep the animation running for 30s to screenshot pseudo DOM */
::view-transition-new(root), ::view-transition-old(root) {
animation-duration: 30s;
}
::view-transition-new(target) {
opacity: 1;
animation: unset;
}
::view-transition-old(target) {
opacity: 0;
animation: unset;
}
</style>
<div id=target>
Here is some text which should not be blurry.
</div>
<script>
failIfNot(document.startViewTransition, "Missing document.startViewTransition");
function runTest() {
document.startViewTransition(() => {
requestAnimationFrame(() => requestAnimationFrame(takeScreenshot));
});
}
onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest));
</script>