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/paint-holding-in-iframe-named-element.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class="reftest-wait">
<title>View transitions: display old paint of an iframe with a captured element during update callback</title>
<link rel="match" href="paint-holding-in-iframe-named-element-ref.html">
<script src="/common/reftest-wait.js"></script>
<script src="/common/rendering-utils.js"></script>
<style>
.old {
border: 5px solid black;
}
.new {
border: 5px solid orange;
}
</style>
<iframe id="inner" class="old" srcdoc="
<style>
#named {
view-transition-name: named;
width: 100px;
height: 50px;
background: yellow;
}
</style>
<body>
<div id='named'>Old</div>
</body>
"></iframe>
<script>
async function runTest() {
await waitForAtLeastOneFrame();
let contentDocument = inner.contentDocument;
contentDocument.body.style.background = "blue";
contentDocument.startViewTransition(async () => {
contentDocument.body.style.background = "green";
let named = contentDocument.getElementById("named");
named.style.background = "purple";
named.innerText = "New";
inner.classList.toggle('old');
inner.classList.toggle('new');
takeScreenshot();
return new Promise((resolve) => {});
});
}
onload = runTest;
</script>
</html>