chromium/third_party/blink/web_tests/compositing/iframes/connect-compositing-iframe2.html

<!DOCTYPE html>

<html>
<head>
  <script src="../../resources/run-after-layout-and-paint.js"></script>
  <style type="text/css" media="screen">
    iframe {
        border: 10px solid black;
        padding: 5px;
        margin: 20px;
        height: 150px;
        width: 300px;
        -webkit-box-shadow: 0 0 20px black;
        will-change: transform;
    }
    
    .overlay {
      position: absolute;
      width: 50px;
      height: 50px;
      top: 5px;
      left: 5px;
      background-color: rgba(0, 0, 0, 0.2);
    }
    .composited {
      will-change: transform;
    }
  </style>
  <script type="text/javascript" charset="utf-8">
    if (window.testRunner) {
        testRunner.dumpAsText();
        testRunner.waitUntilDone();
    }

    function doTest()
    {
      runAfterLayoutAndPaint(function() {
        document.getElementById('iframe').className = 'composited';

        if (window.testRunner) {
          document.getElementById('layers').innerText = internals.layerTreeAsText(document);
          testRunner.notifyDone();
        }
      });
    }
    
    window.addEventListener('load', doTest, false);
  </script>
</head>
<body>

    <!-- Test with already-composited iframe, and iframe contents becoming composited. -->
    <iframe id="iframe" src="resources/composited-subframe.html"></iframe>
    
    <div class="overlay">
    </div>

    <pre id="layers">Layer tree appears here in DRT.</pre>
</body>
</html>