wpt / css / css-view-transitions / capture-with-visibility-mixed-descendants.html

Status: FAIL | Duration: 45ms | Subtests: 0/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi

/css/css-view-transitions/capture-with-visibility-mixed-descendants.html

<!doctype html>
<html class=reftest-wait>
<title>View transitions: visibility hidden/visible descendants</title>
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/">
<link rel="author" href="mailto:vmpstr@chromium.org">
<link rel="match" href="capture-with-visibility-mixed-descendants-ref.html">
<meta name=fuzzy content="maxDifference=0-5; totalPixels=0-500">
<script src="/common/reftest-wait.js"></script>

<style>
:root {
  scrollbar-width: none;
}
.target {
  width: 100px;
  height: 100px;
  view-transition-name: target;
  background: blue;
}
.invisible {
  top: 200px;
  left: 200px;
  width: 500px;
  height: 500px;
  position: relative;
  background: red;
  visibility: hidden;
}
.visible {
  background: green;
  width: 10px;
  height: 10px;
  visibility: visible;
}

::view-transition-group(root) {
  visibility: hidden;
  animation-duration: 500s;
}

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

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

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

::view-transition {
  background: pink;
}
</style>

<div class=target>
  <div class=invisible><div class=visible></div></div>
</div>

<script>
failIfNot(document.startViewTransition, "Missing document.startViewTransition");

function runTest() {
  const transition = document.startViewTransition();
  transition.ready.then(takeScreenshot);
}

onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest));
</script>

/css/css-view-transitions/capture-with-visibility-mixed-descendants-ref.html

<!doctype html>
<html>
<title>View transitions: visibility hidden/visible descendants (ref)</title>
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/">
<link rel="author" href="mailto:vmpstr@chromium.org">

<style>
:root {
  scrollbar-width: none;
}
body {
  background: pink;
}
.target {
  width: 100px;
  height: 100px;
  view-transition-name: target;
  background: blue;
}
.invisible {
  top: 200px;
  left: 200px;
  width: 500px;
  height: 500px;
  position: relative;
  background: red;
  visibility: hidden;
}
.visible {
  background: green;
  width: 10px;
  height: 10px;
  visibility: visible;
}

</style>

<div class=target>
  <div class=invisible><div class=visible></div></div>
</div>