<!DOCTYPE html>
<meta name="timeout" content="long">
<html dir="rtl" class=reftest-wait>
<title>Shared transitions: outgoing viewport has a left side vertucal scrollbar</title>
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-2/">
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/7859">
<link rel="author" href="mailto:[email protected]">
<link rel="match" href="rtl-vertical-scrollbar-ref.html">
<script src="/common/reftest-wait.js"></script>
<meta name=fuzzy content="0-40;0-20000">
<style>
html {
background-color: lightpink;
overflow: hidden;
}
.root {
/* Draw a checkerboard pattern to make sure the snapshot is captured at the
* full size, rather than scaled. */
background-image:
linear-gradient(45deg, #000 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #000 75%),
linear-gradient(45deg, transparent 75%, #000 75%),
linear-gradient(45deg, #000 25%, lightgreen 25%);
background-size: 200px 200px;
background-position: 0 0, 0 0, -100px -100px, 100px 100px;
width: 700px;
height: 1000px;
}
.shared {
position: fixed;
left: 100px;
top: 20px;
height: 500px;
width: 100px;
background-color: deepskyblue;
contain: paint;
view-transition-name: sharedelement;
}
/* We're verifying what we capture, so just display the old contents for 5 minutes. */
html::view-transition-new(*) { animation: unset; opacity: 0; }
html::view-transition-old(*) {
animation-duration: 300s;
animation-timing-function: steps(1, end);
}
html::view-transition-group(*) {
animation-duration: 300s;
animation-timing-function: steps(1, end);
}
</style>
<div class="root"></div>
<div class="shared"></div>
<script>
// Ensure a root snapshot captured on a page with scrollbars uses the full
// viewport size (including scrollbars). Areas obscured by scrollbars should be
// filled with background and content; the snapshot should not be scaled-to-fit.
async function runTest() {
document.startViewTransition(() => {
document.documentElement.style.overflow = "unset";
requestAnimationFrame(
() => requestAnimationFrame(
() => requestAnimationFrame(takeScreenshot)));
});
}
onload = () => {
if (window.internals) {
window.internals.settings.setPlaceRTLScrollbarsOnLeftSideInMainFrame(true);
}
requestAnimationFrame(() => requestAnimationFrame(runTest));
}
</script>