flexbox-multi-column-1i.html (3498B)
1 <!DOCTYPE html> 2 <!-- Any copyright is dedicated to the Public Domain. 3 http://creativecommons.org/publicdomain/zero/1.0/ --> 4 <html> 5 <meta charset="utf-8"> 6 <title>CSS Flexbox Test: Fragmentation of block-size:auto multi-line column flex container with fixed block-size flex items</title> 7 <link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com"> 8 <link rel="author" title="Mozilla" href="http://www.mozilla.org/"> 9 <link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#pagination"> 10 <link rel="match" href="flexbox-multi-column-1-ref.html"> 11 <meta name="assert" content="This test verifies fragmentation of fixed block-size flex items in a block-size:auto multi-line column flex container, with various combinations of margin/border/padding, alignments, and row-gap. Also use a script to shrink multicol block-size."> 12 13 <style> 14 .multicol { 15 block-size: 80px; 16 inline-size: 190px; 17 column-width: 40px; 18 column-fill: auto; 19 column-gap: 10px; 20 border: 5px solid orange; 21 margin-block-end: 5px; /* Just to separate each sub-testcase visually. */ 22 } 23 .flexContainer { 24 display: flex; 25 flex-wrap: wrap; 26 flex-direction: column; 27 background: gray; 28 /* border-width is 0 by default; some sub-testcases will increase it. */ 29 border: 0 solid lightgray; 30 } 31 .border-padding { 32 border-block-width: 10px; 33 padding-block: 5px; 34 } 35 36 /* Note: flex items are in visual order as "CMYK": cyan, magenta, yellow, black. */ 37 header { 38 background: cyan; 39 block-size: 50px; 40 } 41 nav, article, footer { 42 inline-size: 30px; 43 } 44 nav { 45 background: magenta; 46 block-size: 25px; 47 align-self: flex-start; 48 } 49 article { 50 background: yellow; 51 block-size: 25px; 52 align-self: center; 53 } 54 footer { 55 background: black; 56 block-size: 50px; 57 align-self: flex-end; 58 } 59 60 body.multicol-children-block-size > .multicol { 61 block-size: 50px; 62 } 63 </style> 64 65 <script> 66 function runTest() { 67 document.body.offsetHeight; 68 69 /* Shrink the multicol's block-size to exercise pulling and pushing flex items 70 of an already fragmented flex container. */ 71 document.body.classList.add("multicol-children-block-size"); 72 } 73 </script> 74 75 <body onload="runTest()"> 76 <!-- Basic one without any margin/border/padding. --> 77 <div class="multicol"> 78 <div class="flexContainer"> 79 <header></header><nav></nav><article></article><footer></footer> 80 </div> 81 </div> 82 83 <!-- Test a container with margin-block-start. --> 84 <div class="multicol"> 85 <div class="flexContainer" style="margin-block-start: 25px"> 86 <header></header><nav></nav><article></article><footer></footer> 87 </div> 88 </div> 89 90 <!-- Test a container not at the top of the column/page. --> 91 <div class="multicol"> 92 <div style="block-size: 25px"></div> 93 <div class="flexContainer"> 94 <header></header><nav></nav><article></article><footer></footer> 95 </div> 96 </div> 97 98 <!-- Test a container with border and padding. --> 99 <div class="multicol"> 100 <div class="flexContainer border-padding"> 101 <header></header><nav></nav><article></article><footer></footer> 102 </div> 103 </div> 104 105 <!-- Test a container with border, padding, and row-gap. --> 106 <div class="multicol"> 107 <div class="flexContainer border-padding" style="row-gap: 5px"> 108 <header></header><nav></nav><article></article><footer></footer> 109 </div> 110 </div> 111 </body> 112 </html>