tor-browser

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

contain-paint-dynamic-003.html (1310B)


      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-003-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      contain: paint;
     19  }
     20  #overflowing {
     21      width: 400px;
     22      height: 100px;
     23  }
     24  .square {
     25      display: inline-block;
     26      width: 50px;
     27      height: 50px;
     28      margin: 5px;
     29  }
     30  .green {
     31      background: green;
     32  }
     33 </style>
     34 
     35 <body>
     36  <p>PASS if you see <em>two</em> green squares.</p>
     37  <div id="container">
     38    <div id="overflowing"><div class="square"></div><div class="square"></div><div class="red square"></div></div>
     39  </div>
     40  <script>
     41    window.addEventListener("TestRendered", async () => {
     42        container.style.contain = "none";
     43        await waitForAtLeastOneFrame();
     44        takeScreenshot();
     45    });
     46  </script>
     47 </body>
     48 </html>