wpt / css / css-view-transitions / scoped / scroller-with-child.html

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

/css/css-view-transitions/scoped/scroller-with-child.html

<!DOCTYPE html>
<html class=reftest-wait>
<head>
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-2/">
<link rel="match" href="scroller-with-child-ref.html">
<script src="/common/reftest-wait.js"></script>
<script src="/web-animations/testcommon.js"></script>
<style>

body { margin: 20px; font: 18pt monospace; line-height: 30px; }
#scope { overflow: auto; contain: layout; padding: 20px;
  width: 200px; height: 100px; border: 20px solid #acf;
  view-transition-group: normal; }
#part { view-transition-name: foo;
  background: #fea; padding: 10px; border: 4px solid orange;
  width: 150px; height: 180px; margin: 20px 0 0 90px; }
#scope::view-transition-group(*) { animation-play-state: paused; }
#scope::view-transition-new(*) { animation: unset; opacity: 1; }
#scope::view-transition-old(*) { animation: unset; opacity: 0; }

</style>
</head>
<body>
<div id=scope>Hello
  <div id=part>child</div>
</div>
<script>

failIfNot(scope.startViewTransition, "Missing element.startViewTransition");

async function runTest() {
  scope.scrollBy(40, 24);
  await waitForCompositorReady();
  const t = scope.startViewTransition(() => {
    scope.firstChild.nodeValue = "World";
    part.style.background = "#fac";
  });
  await t.ready;
  takeScreenshot();
}
onload = () => runTest();

</script>
</body>
</html>

/css/css-view-transitions/scoped/scroller-with-child-ref.html

<!DOCTYPE html>
<html>
<head>
<style>

body { margin: 20px; font: 18pt monospace; line-height: 30px; }
#scope { overflow: auto; contain: layout; padding: 20px;
  width: 200px; height: 100px; border: 20px solid #acf; }
#part-hide { padding: 10px; visibility: hidden;
  border: 4px solid orange; width: 150px; height: 180px;
  margin: 20px 0 0 90px; }
#part { position: absolute; top: 66px; will-change: transform;
  background: #fac; padding: 10px; border: 4px solid orange;
  width: 150px; height: 180px; margin: 20px 0 0 90px; }

</style>
</head>
<body>
<div id=scope>World
  <div id=part-hide></div>
</div>
<!-- TODO(crbug.com/468277656): The child currently pops out of the
     scope's clip; this will be addressed by the nesting proposal in:
     https://github.com/w3c/csswg-drafts/issues/12324 -->
<div id=part>child</div>
<script>

scope.scrollBy(40, 24);

</script>
</body>
</html>