intrinsic-percent-replaced-027.html (1230B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com"> 4 <link rel="author" title="Mozilla" href="https://www.mozilla.org/"> 5 <link rel="help" href="https://drafts.csswg.org/css-sizing-3/#intrinsic-sizes"> 6 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1931491"> 7 <link rel="match" href="../reference/ref-filled-green-100px-square.xht"> 8 <meta name="assert" content="This test verifies that the inner flex container's main-size (height) serves as a percentage basis for its descendants. The canvas can transfer its height through the aspect-ratio to the inline axis when computing its intrinsic inline size contribution. This determines the .test div's intrinsic inline size."> 9 10 <style> 11 .outer { 12 display: flex; 13 flex-direction: column; 14 } 15 .inner { 16 display: flex; 17 width: 100px; 18 height: 100px; 19 } 20 .test { 21 aspect-ratio: 1 / 1; 22 height: 100%; 23 background: red; 24 } 25 .test > canvas { 26 height: 100%; 27 background: green; 28 } 29 </style> 30 31 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 32 <div class="outer"> 33 <div class="inner"> 34 <div class="test"> 35 <canvas width="200" height="200"></canvas> 36 </div> 37 </div> 38 </div>