Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<title>CSS Flexbox: Proper min-width intrinsic size with display: flex</title>
<meta name="assert" content="This test checks that min-width intrinsic size still applies if a fixed width is set.">
<style>
.min-content {
width: 10px;
min-width: min-content;
outline: 2px solid;
display: flex;
flex-wrap: wrap;
}
.max-content {
width: 10px;
min-width: max-content;
outline: 2px solid;
display: flex;
flex-wrap: wrap;
}
.fit-content {
width: 10px;
min-width: fit-content;
outline: 2px solid;
display: flex;
flex-wrap: wrap;
}
.child {
width: 20px;
height: 20px;
background-color: pink;
}
div {
display: inline-block;
line-height: 0;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<body onload="checkLayout('body > div')">
<div id=log></div>
<div class="min-content" data-expected-width=20>
<div class="child"></div><div class="child"></div>
</div>
<div class="max-content" data-expected-width=40>
<div class="child"></div><div class="child"></div>
</div>
<div class="fit-content" data-expected-width=40>
<div class="child"></div><div class="child"></div>
</div>
<div style="width: 30px">
<div class="fit-content" data-expected-width=30>
<div class="child"></div><div class="child"></div>
</div>
</div>
<div style="width: 10px">
<div class="fit-content" data-expected-width=20>
<div class="child"></div><div class="child"></div>
</div>
</div>
</body>