gecko/layout/reftests/flexbox/flexbox-minSize-horiz-1.xhtml

72 lines
2.2 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!--
This test checks that we correctly handle flex items with an explicit
"min-width: -moz-min-content".
We check that such flex items can't shrink below their min-content width,
unless we explicitly reduce their min-width with e.g. "min-width: 0".
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
div.flexbox {
width: 200px;
display: flex;
margin-bottom: 5px;
font-size: 8px;
border: 1px dotted black;
}
div.flexbox > * {
margin-right: 20px;
border: 1px dashed green;
background: lightblue;
height: 40px;
min-width: -moz-min-content;
}
div.smallSize { width: 5px; }
div.smallFlexBasis { flex-basis: 2px; }
div.zeroMinWidth { min-width: 0; }
</style>
</head>
<body>
<!-- Check that we honor "min-width: min-content" as a lower-bound when
sizing flex items. -->
<div class="flexbox">
<div>abc d e f</div>
<div class="smallSize">abc d e f</div>
<div class="smallFlexBasis">abc d e f</div>
</div>
<!-- ... EVEN if our flex container is small and we're overflowing. -->
<div class="flexbox smallSize">
<div>abc d e f</div>
<div class="smallSize">abc d e f</div>
<div class="smallFlexBasis">abc d e f</div>
</div>
<!-- Test that we don't clamp when we've got "min-width: 0" on our
flex items, though. -->
<div class="flexbox">
<div class="zeroMinWidth">abc d e f</div>
<div class="zeroMinWidth smallSize">abc d e f</div>
<div class="zeroMinWidth smallFlexBasis">abc d e f</div>
</div>
<!-- ... and similarly, when we have a small flex container and we trigger
shrinking behavior, flex items with "min-width: 0" are allowed to
shrink past their min-content width. -->
<div class="flexbox smallSize">
<div class="zeroMinWidth">abc d e f</div>
<div class="zeroMinWidth smallSize">abc d e f</div>
<div class="zeroMinWidth smallFlexBasis">abc d e f</div>
</div>
</body>
</html>