tor-browser

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

dynamic-change-inline-size-002.html (1390B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>CSS Test: Dynamic change to the inline-size of a block container</title>
      4 <link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
      5 <link rel="author" title="Mozilla" href="https://www.mozilla.org/">
      6 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1731653">
      7 <link rel="stylesheet" href="/fonts/ahem.css">
      8 <link rel="match" href="../reference/ref-filled-green-100px-square.xht">
      9 <meta name="assert" content="This test verifies that the dynamic change to the block container's inline-size triggers the reflow of its children">
     10 
     11 <style>
     12 #block {
     13  inline-size: 100px;
     14  block-size: 100px;
     15  font: 50px/1 Ahem;
     16  color: green;
     17  word-break: break-all;
     18 }
     19 
     20 #block > div {
     21  /* The following inline-size and padding will give the div a border-box
     22     inline-size of 100px, both before and after this test's dynamic
     23     modification. */
     24  inline-size: 50%;
     25  padding-right: calc(100px - 50%);
     26  background: red;
     27 }
     28 </style>
     29 
     30 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
     31 <div id="block">
     32  <div>XXXX</div>
     33 </div>
     34 
     35 <script>
     36 /* Make sure the layout is up-to-date, which is essential to trigger the bug. */
     37 document.documentElement.offsetHeight;
     38 
     39 /* Change the block's inline-size to trigger incremental reflow. */
     40 document.getElementById("block").style.inlineSize = "200px";
     41 </script>