intrinsic-percent-replaced-012.html (1157B)
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=1231059"> 7 <link rel="match" href="../reference/ref-filled-green-100px-square-only.html"> 8 <meta name="assert" content="This test verifies that the inner div's padding is resolved against the outer div's width when computing its max-content width."> 9 10 <style> 11 .outer { 12 width: 25px; 13 height: 50px; 14 } 15 .inner { 16 box-sizing: border-box; 17 width: max-content; 18 height: 100%; 19 padding-top: 100%; /* 25px */ 20 background: green; 21 } 22 canvas { 23 height: 100%; 24 } 25 </style> 26 27 <p>Test passes if there is a filled green square.</p> 28 <div class="outer"> 29 <div class="inner"> 30 <!-- display:block on <canvas> exercises a different code path in Firefox. --> 31 <canvas width="40" height="10" style="display: block;"></canvas> 32 </div> 33 </div> 34 <div class="outer"> 35 <div class="inner"> 36 <canvas width="40" height="10"></canvas> 37 </div> 38 </div>