tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

contain-paint-dynamic-002.html (1284B)


      1 <!DOCTYPE html>
      2 <html class="reftest-wait">
      3 <meta charset="utf-8">
      4 <title>Dynamic change to paint containment</title>
      5 <link rel="help" href="https://drafts.csswg.org/css-contain/#contain-property">
      6 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1765615">
      7 <meta name="assert" content="Verify paint containment is properly updated after dynamic change to the contain property.">
      8 <link rel="match" href="contain-paint-dynamic-002-ref.html">
      9 
     10 <script src="/common/reftest-wait.js"></script>
     11 <script src="/common/rendering-utils.js"></script>
     12 
     13 <style>
     14  #container {
     15      width: 100px;
     16      height: 100px;
     17      background: green;
     18  }
     19  #overflowing {
     20      width: 400px;
     21      height: 100px;
     22  }
     23  .square {
     24      display: inline-block;
     25      width: 50px;
     26      height: 50px;
     27      margin: 5px;
     28  }
     29  .red {
     30      background: red;
     31  }
     32 </style>
     33 
     34 <body>
     35  <p>PASS if you see a green square and no red.</p>
     36  <div id="container">
     37    <div id="overflowing"><div class="square"></div><div class="square"></div><div class="red square"></div></div>
     38  </div>
     39  <script>
     40    window.addEventListener("TestRendered", async () => {
     41        container.style.contain = "paint";
     42        await waitForAtLeastOneFrame();
     43        takeScreenshot();
     44    });
     45  </script>
     46 </body>
     47 </html>