Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!DOCTYPE html>
<title>View transitions: basic cross-document navigation</title>
<link rel="author" href="mailto:bokan@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
@view-transition {
navigation: auto;
}
</style>
<script>
const params = new URLSearchParams(location.search);
const mode = params.get("mode") || "test";
switch (mode) {
case "test":
promise_test(async t => {
const event = await new Promise(resolve => {
window.did_reveal = e => { resolve(e) };
const popup = window.open("?mode=popup");
t.add_cleanup(() => popup.close());
});
assert_equals(event.viewTransition, null, "ViewTransition must not be triggered.");
});
break;
case "popup":
if (location.hash == '#loaded') {
onpagereveal = e => window.opener.did_reveal(e);
} else {
onload = () => requestAnimationFrame(() => requestAnimationFrame(() => {
location.hash = 'loaded';
location.reload();
}));
}
break;
}
</script>