tor-browser

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

contain-layout-019.html (1050B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>CSS Containment Test: Layout containment inside a fit-content element</title>
      4 <link rel="help" href="https://crbug.com/1268449">
      5 <link rel="help" href="https://drafts.csswg.org/css-contain-1/#containment-layout">
      6 <link rel="match" href="../reference/ref-filled-green-100px-square.xht">
      7 <meta name=assert
      8    content="Layout containment inside a fit-content element should update size when the content is changed">
      9 <style>
     10    #contain-parent {
     11        width: fit-content;
     12    }
     13 
     14    #contain-layout {
     15        contain: layout;
     16        background: green;
     17    }
     18 
     19    #content {
     20        width: 50px;
     21        height: 100px;
     22    }
     23 </style>
     24 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
     25 <div id="contain-parent">
     26    <div id="contain-layout">
     27        <div id="content"></div>
     28    </div>
     29 </div>
     30 
     31 <script>
     32 window.requestAnimationFrame(() => {
     33    document.body.offsetTop;
     34    document.getElementById('content').style.width = '100px';
     35    document.body.offsetTop;
     36 });
     37 </script>