Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-break/flexbox/single-line-row-flex-fragmentation-042-print.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
<link rel="match" href="single-line-row-flex-fragmentation-042-print-ref.html">
<style>
@page { size: 5in 3in; margin: 0.5in; }
body { margin: 0; }
.flexbox {
display: flex;
border: 0.25in solid black;
font-size: 0.25in;
}
.item {
contain: size;
box-sizing: border-box;
border: 4px solid purple;
width: 25%;
height: 0.5in;
}
</style>
<!-- This div makes the flexbox not at the top of first page. -->
<div style="height: 0.25in; background: gray;"></div>
<div class="flexbox">
<div class="item" style="margin-top: 1in;">1</div>
<div class="item">2</div>
<!-- Due to fragmentation, item 3 is being pushed down and placed at the top
of page 2, enlarging the flex container's block-size. Observe item 3
and item 4's block-end edges. Before fragmentation, both are at the
same level; after fragmentation, item 3's block-end edge becomes lower
than item 4's, and making item 4's block-end edge no longer touch the
flex container's content-box block-end edge.-->
<div class="item" style="margin-top: 1in; height: 1in;">3</div>
<div class="item" style="align-self: flex-end;">4</div>
</div>
<div style="height: 0.25in; background: gray;"></div>
</html>