gecko-dev/layout/reftests/flexbox/flexbox-minSize-vert-1.xhtml

74 строки
2.3 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 honor the flexbox-specific behavior of the
new "min-height: auto" value that was introduced in the flexbox spec.
We check that flex items can't shrink below their min-content height,
unless we explicitly reduce their min-height with e.g. "min-height: 0".
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
div.flexbox {
height: 140px;
display: flex;
flex-direction: column;
margin-right: 5px;
font-size: 8px;
border: 1px dotted black;
float: left;
}
div.flexbox > * {
margin-bottom: 20px;
border: 1px dashed green;
background: lightblue;
width: 40px;
}
div.smallSize { height: 5px; }
div.smallFlexBasis { flex-basis: 2px; }
div.zeroMinHeight { min-height: 0; }
</style>
</head>
<body>
<!-- Check that we use the min-content height as a lower-bound when sizing
flex items. -->
<div class="flexbox">
<div>a b</div>
<div class="smallSize">a b</div>
<div class="smallFlexBasis">a b</div>
</div>
<!-- ... EVEN if our flex container is small and we're overflowing. -->
<div class="flexbox smallSize">
<div>a b</div>
<div class="smallSize">a b</div>
<div class="smallFlexBasis">a b</div>
</div>
<!-- Test that "min-height: 0" on flex items will keep us from clamping to
the min-content height. (So we can now actually honor small 'height'
and 'flex-basis' values.) -->
<div class="flexbox">
<div class="zeroMinHeight">a b</div>
<div class="zeroMinHeight smallSize">a b</div>
<div class="zeroMinHeight smallFlexBasis">a b</div>
</div>
<!-- ... and similarly, when we have a small flex container and we trigger
shrinking behavior, flex items with "min-height: 0" are allowed to
shrink past their min-content height. -->
<div class="flexbox smallSize">
<div class="zeroMinHeight">a b</div>
<div class="zeroMinHeight smallSize">a b</div>
<div class="zeroMinHeight smallFlexBasis">a b</div>
</div>
</body>
</html>