wpt / css / css-view-transitions / nested / nested-parent-changes-transform.html

Status: PASS | Duration: 6ms | Subtests: 1/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi

/css/css-view-transitions/nested/nested-parent-changes-transform.html

<!doctype html>
<html class=reftest-wait>
<title>Nested View Transitions: child only has old and parent changes transform</title>
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-2/">
<link rel="match" href="green-rect-ref.html">
<script src="/common/reftest-wait.js"></script>
<script src="resources/compute-test.js"></script>
<script src="/dom/events/scrolling/scroll_support.js"></script>

<style>
:root { view-transition-name: none; }

.container {
  width: 100px;
  height: 100px;
  position: relative;
  background: red;

  view-transition-name: container;
  view-transition-group: contain;
}

.container.shifted {
  top: 150px;
}

.contained {
  width: 100px;
  height: 100px;
  background: green;

  view-transition-name: contained;
}

.hidden {
  display: none;
}

::view-transition-group(*) {
  animation-play-state: paused;
}

::view-transition-old(*) {
  animation: unset;
  opacity: 1;
}

::view-transition-new(*) {
  animation: unset;
  opacity: 0;
}

</style>

<div id=container class=container>
  <div id=contained class=contained></div>
</div>

<script>
function runTest() {
  document.startViewTransition(() => {
    container.classList.add("shifted");
    contained.classList.add("hidden");
  }).ready.then(takeScreenshot);
}

onload = () => waitForCompositorReady().then(runTest);
</script>

/css/css-view-transitions/nested/green-rect-ref.html

<!doctype html>
<html>
<title>Nested View Transitions: green rect (ref)</title>
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-2/">

<style>
div {
  width: 100px;
  height: 100px;
  background: green;
}
</style>

<div></div>
</html>