dynamic-change-simplified-layout.html (1284B)
1 <!DOCTYPE html> 2 <link rel="match" href="../reference/ref-filled-green-100px-square.xht" /> 3 <link rel="author" title="Google LLC" href="http://www.google.com" /> 4 <link rel="help" href="https://drafts.csswg.org/css-flexbox/#cross-sizing" /> 5 <link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=992010" /> 6 <title>Tests that certain dynamic changes don't lead to a flex item being sized as shrink to fit when it should stretch in the cross axis</title> 7 8 <style> 9 #flex { 10 display: flex; 11 flex-direction: column; 12 flex-wrap: wrap; 13 position: absolute; 14 top: 20px; 15 width: 100px; 16 } 17 18 #it1 { 19 background: green; 20 flex: none; 21 height: 100px; 22 min-height: 0; 23 position: relative; 24 } 25 26 #child { 27 position: absolute; 28 top: 0; 29 left: 0; 30 } 31 </style> 32 33 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 34 35 <div style="position: relative;"> 36 <div id="flex"> 37 <div id="it1" style=""><div id="child"></div></div> 38 <div id="it2"></div> 39 </div> 40 </div> 41 42 <script> 43 var flex = document.getElementById("flex"); 44 flex.offsetWidth; 45 var it2 = document.getElementById("it2"); 46 it2.style.width = "50px"; 47 flex.offsetWidth; 48 flex.style.top = "0px"; 49 var child = document.getElementById("child"); 50 child.style.top = "1px"; 51 flex.offsetWidth; 52 </script>