intrinsic-percent-replaced-026.html (1055B)
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=1888262"> 7 <link rel="match" href="../reference/ref-filled-green-100px-square.xht"> 8 <meta name="assert" content="This test verifies that the inner div's stretched main size (height) serves as a percentage basis for the img's height. The img can transfer its height through the aspect-ratio to the inline axis when computing its intrinsic inline size contribution. This determines the inner div's main-size (width)."> 9 10 <style> 11 .outer { 12 display: flex; 13 height: 100px; 14 } 15 .inner { 16 background: red; 17 } 18 img { 19 height: 100%; 20 } 21 </style> 22 23 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 24 <div class="outer"> 25 <div class="inner"> 26 <img src="aspect-ratio/support/200x200-green.png"> 27 </div> 28 </div>