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/layered-capture/border-offset.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class=reftest-wait>
<title>Borders should not affect snapshot position</title>
<link rel="match" href="border-offset-ref.tentative.html">
<script src="/common/reftest-wait.js"></script>
<script src="resources/compute-test.js"></script>
<style>
* {
box-sizing: border-box;
}
html {
view-transition-name: none;
}
body {
margin: 0;
}
div {
width: 100px;
height: 100px;
position: absolute;
}
.parent {
view-transition-name: parent;
border: 10px solid black;
background: green;
}
.child {
top: 20px;
left: 20px;
width: 40px;
height: 40px;
background: yellow;
border: 2px dashed blue;
}
::view-transition-old(*),
::view-transition-new(*),
::view-transition-group(*) {
animation-play-state: paused;
}
::view-transition-group(parent) {
overflow: clip;
}
</style>
<body>
<div class="parent">
<div class="child"></div>
</div>
<script>
const transition = document.startViewTransition(() => {
document.documentElement.classList.add("vt-new");
});
transition.ready.then(() => takeScreenshot());
</script>
</body>