grid-fragmentation-006.html (3769B)
1 <!DOCTYPE HTML> 2 <!-- 3 Any copyright is dedicated to the Public Domain. 4 http://creativecommons.org/publicdomain/zero/1.0/ 5 --> 6 <html><head> 7 <meta charset="utf-8"> 8 <title>CSS Grid Test: Fragmentation of height:auto grid, not top-of-page, item break-inside:avoid</title> 9 <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1144096"> 10 <link rel="help" href="https://drafts.csswg.org/css-grid/#pagination"> 11 <link rel="match" href="grid-fragmentation-006-ref.html"> 12 <style type="text/css"> 13 html,body { 14 color:black; background-color:white; font-size:16px; padding:0; margin:0; 15 } 16 body { overflow:hidden; } 17 18 .columns { 19 position:relative; 20 -ms-columns: 5; 21 -webkit-columns: 5; 22 columns: 5; 23 -ms-column-fill: auto; 24 -webkit-column-fill: auto; 25 column-fill: auto; 26 border: 2px solid salmon; 27 margin-bottom: 5px; 28 } 29 30 .grid { 31 display: grid; 32 grid-template-columns: 30px 30px 30px; 33 grid-auto-rows: 30px; 34 grid-gap: 12px; 35 border:5px solid; 36 align-content: space-evenly; 37 } 38 span { background:lime; border:1px solid black; } 39 x { display:block; height:20px; } 40 .avoid-break { page-break-inside:avoid; break-inside:avoid; } 41 42 i { display:block; height:10px; margin-top:7px; background:blue; } 43 </style> 44 </head> 45 <body> 46 47 <div class="columns" style="height: 110px/*trigger IsInlineBreakBefore() for the item*/"> 48 <div style="padding-top:30px; background:grey"> 49 <div class="grid"> 50 <span class="avoid-break"><i></i><i></i><i></i><i></i><i></i><i></i><x></x></span> 51 </div> 52 </div></div> 53 54 <div class="columns" style="height: 70px/*item will be INCOMPLETE*/"> 55 <div style="background:grey"> 56 <div class="grid"> 57 <span class="avoid-break"><i></i><i></i><i></i><i></i><i></i><i></i><x></x></span> 58 </div> 59 </div></div> 60 61 <div class="columns" style="height: 100px/*item will be INCOMPLETE*/"> 62 <div style="background:grey"> 63 <div class="grid"> 64 <span class="avoid-break" style="grid-row:span 2"><i></i><i></i><i></i><i></i><i></i><i></i><x></x></span> 65 </div> 66 </div></div> 67 68 <!-- bug 1415301 69 <div class="columns" style="height: 140px/*trigger IsInlineBreakBefore() for the item*/"> 70 <div style="padding-top:30px; background:grey"> 71 <div class="grid"> 72 <span style="grid-row:span 3"><x></x></span> 73 <span class="avoid-break" style="grid-row:span 2"><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><x></x></span></div> 74 </div></div> 75 --> 76 77 <div class="columns" style="height: 100px/*trigger IsInlineBreakBefore() for the item*/"> 78 <div style="padding-top:1px; background:grey"> 79 <div class="grid" style="grid-auto-rows: 50px;"> 80 <span class="avoid-break" style="grid-row:span 2; height:60px"><i></i><i></i><i></i><x></x></span> 81 </div> 82 </div></div> 83 84 <div class="columns" style="height: 100px/*trigger IsInlineBreakBefore() for the item*/"> 85 <div style="padding-top:1px; background:grey"> 86 <div class="grid" style="grid-auto-rows: 50px; height:116px;"> 87 <span class="avoid-break" style="grid-row:span 2; height:60px"><i></i><i></i><i></i><x></x></span> 88 </div> 89 </div></div> 90 91 <div class="columns" style="height: 100px/*trigger IsInlineBreakBefore() for the item*/"> 92 <div style="padding-top:1px; background:grey"> 93 <div class="grid" style="grid-auto-rows: 50px; height:116px; grid-gap:0;"> 94 <span class="avoid-break" style="grid-row:span 2; height:60px"><i></i><i></i><i></i><x></x></span> 95 </div> 96 </div></div> 97 98 <div class="columns" style="height: 100px/*trigger IsInlineBreakBefore() for the item*/"> 99 <div style="padding-top:1px; background:grey"> 100 <div class="grid" style="grid-auto-rows: 50px; height:116px; grid-gap:0;"> 101 <span style="height:100px; background:pink"><x></x></span> 102 <span class="avoid-break" style="grid-row:span 2; height:60px"><i></i><i></i><i></i><x></x></span> 103 </div> 104 </div></div> 105 106 107 </body> 108 </html>