Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<meta charset="utf-8">
<link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html">
<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.">
<style>
.outer {
width: 25px;
height: 50px;
}
.inner {
box-sizing: border-box;
width: max-content;
height: 100%;
padding-top: 100%; /* 25px */
background: green;
}
canvas {
height: 100%;
}
</style>
<p>Test passes if there is a filled green square.</p>
<div class="outer">
<div class="inner">
<!-- display:block on <canvas> exercises a different code path in Firefox. -->
<canvas width="40" height="10" style="display: block;"></canvas>
</div>
</div>
<div class="outer">
<div class="inner">
<canvas width="40" height="10"></canvas>
</div>
</div>