<!DOCTYPE html>
<html class=reftest-wait>
<title>Shared transitions: object-view-box with larger clip-path</title>
<link rel="help" href="https://github.com/WICG/shared-element-transitions">
<link rel="author" href="mailto:vmpstr@chromium.org">
<link rel="match" href="old-content-object-view-box-clip-path-reference-ref.html">
<script src="/common/reftest-wait.js"></script>
<style>
.target {
  color: red;
  width: 100px;
  height: 100px;
  contain: paint;
  overflow-clip-margin: 1000px;
  position: relative;
  top: 50px;
  left: 50px;
}
.child {
  width: 123px;
  height: 150px;
  background: lightblue;
  position: relative;
  top: -10px;
  left: -20px;
}
.grandchild {
  width: 25px;
  height: 25px;
  position: relative;
  top: 20px;
  left: 40px;
  background: green;
}
#one {
  page-transition-tag: target-one;
  clip-path: url(#clip1);
}
#two {
  page-transition-tag: target-two;
  clip-path: url(#clip2)
}

html::page-transition-container(target-one),
html::page-transition-container(target-two) { animation-duration: 300s; }
html::page-transition-incoming-image(target-one),
html::page-transition-incoming-image(target-two) { animation: unset; opacity: 0; height: 100%; }
html::page-transition-outgoing-image(target-one),
html::page-transition-outgoing-image(target-two) {
  animation: unset;
  opacity: 1;
  /* clip overflow, and verify inner contents only */
  overflow: hidden;
  height: 100%;
}

html::page-transition-container(root) { animation: unset; opacity: 0; }
html::page-transition { background: lightpink; }
</style>

<div id=one class=target>
  <div class=child>
    <div class=grandchild></div>
  </div>
</div>
<div style="height: 20px;"></div>
<div id=two class=target>
  <div class=child>
    <div class=grandchild></div>
  </div>
</div>

<svg>
  <defs>
    <clipPath id="clip1">
      <rect x="10" y="20" width="70" height="50" />
    </clipPath>
    <clipPath id="clip2">
      <rect x="-10" y="20" width="130" height="50" />
    </clipPath>
  </defs>
</svg>

<script>
async function runTest() {
  document.createDocumentTransition().start(() =>
    requestAnimationFrame(() => requestAnimationFrame(takeScreenshot)));
}
onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest));
</script>