dynamic-isize-change-002.html (1379B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Flexbox Test: Dynamic change to the inline-size of a row flex 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=1700580"> 7 <link rel="match" href="../reference/ref-filled-green-100px-square.xht"> 8 <meta name="assert" content="This test verifies that the dynamic change to the flex container's inline-size triggers the reflow for flex items with percentage padding."> 9 10 <style> 11 #flexbox { 12 display: flex; 13 inline-size: 50px; 14 block-size: 100px; 15 background: red; 16 } 17 18 #flexbox > div { 19 box-sizing: border-box; 20 21 /* The following flex-basis and padding will give our flex item a content-box 22 inline-size of 25px, both before and after this test's dynamic change. */ 23 flex-basis: 100%; 24 padding-right: calc(100% - 25px); 25 background: green; 26 } 27 </style> 28 29 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 30 <div id="flexbox"> 31 <div></div> 32 </div> 33 34 <script> 35 /* Make sure the layout is up-to-date, which is essential to trigger the bug. */ 36 document.documentElement.offsetHeight; 37 38 /* Change the flexbox's inline-size to trigger incremental reflow. */ 39 document.getElementById("flexbox").style.inlineSize = "100px"; 40 </script>