grid-self-baseline-not-applied-if-sizing-cyclic-dependency-003.html (5014B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Grid Layout Test: Self-Baseline alignment and sizing cyclic dependency</title> 4 <link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-grid-1/#alignment"> 6 <link rel="help" href="https://drafts.csswg.org/css-grid-1/#column-align"> 7 <link rel="help" href="https://drafts.csswg.org/css-grid-1/#row-align"> 8 <link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-items"> 9 <link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-justify-items"> 10 <link rel="help" href="https://drafts.csswg.org/css-align-3/#baseline-alignment"> 11 <link rel="help" href="https://drafts.csswg.org/css-align-3/#valdef-justify-self-baseline"> 12 <link rel="stylesheet" href="/css/support/grid.css"> 13 <link rel="stylesheet" href="../../support/alignment.css"> 14 <!-- https://github.com/w3c/csswg-drafts/issues/3046 --> 15 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 16 <style> 17 .grid { 18 position: relative; 19 display: inline-grid; 20 background: grey; 21 text-orientation: sideways; 22 font: 15px/1 Ahem; 23 } 24 .row { grid: minmax(0px, 1fr) / auto 50px 100px } 25 .column { grid: auto 50px 100px / minmax(0px, 1fr); } 26 .item1 { 27 font-size: 30px; 28 background: blue; 29 } 30 .item2 { 31 font-size: 20px; 32 background: red; 33 } 34 .item3 { 35 font-size: 80px; 36 background: green; 37 } 38 .height50 { height: 50px; } 39 .relativeHeight { height: 50%; } 40 .relativeWidth { width: 50%; } 41 </style> 42 <script src="/resources/testharness.js"></script> 43 <script src="/resources/testharnessreport.js"></script> 44 <script src="/resources/check-layout-th.js"></script> 45 <script type="text/javascript"> 46 setup({ explicit_done: true }); 47 </script> 48 <body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })"> 49 50 <!-- NOTE: previously this test was asserting some "cyclic" behaviour where an item would switch baseline alignment participation - this is no longer the case per spec. --> 51 <pre>flex row</pre> 52 <div class="grid row alignItemsBaseline"> 53 <div class="item1 verticalLR" data-offset-x="0" data-offset-y="34" data-expected-width="30" data-expected-height="30">É</div> 54 <div class="item2" data-offset-x="30" data-offset-y="48" data-expected-width="50" data-expected-height="20">É</div> 55 <div class="item3" data-offset-x="80" data-offset-y="0" data-expected-width="100" data-expected-height="80">É</div> 56 </div> 57 58 <pre>flex row</pre> 59 <div class="grid row alignItemsBaseline"> 60 <div class="item1 relativeHeight" data-offset-x="0" data-offset-y="56" data-expected-width="30" data-expected-height="43">É</div> 61 <div class="item2" data-offset-x="30" data-offset-y="64" data-expected-width="50" data-expected-height="20">É</div> 62 <div class="item3 verticalLR" data-offset-x="80" data-offset-y="0" data-expected-width="100" data-expected-height="80">É</div> 63 </div> 64 65 <pre>flex row</pre> 66 <div class="grid row alignItemsBaseline"> 67 <div class="item1 relativeHeight" data-offset-x="0" data-offset-y="40" data-expected-width="30" data-expected-height="40">É</div> 68 <div class="item2 verticalLR" data-offset-x="30" data-offset-y="44" data-expected-width="50" data-expected-height="20">É</div> 69 <div class="item3" data-offset-x="80" data-offset-y="0" data-expected-width="100" data-expected-height="80">É</div> 70 </div> 71 72 <pre>flex column - all items share a baseline group</pre> 73 <div class="grid column justifyItemsBaseline"> 74 <div class="item1" data-offset-x="16" data-offset-y="0" data-expected-width="30" data-expected-height="30">É</div> 75 <div class="item2 verticalLR" data-offset-x="12" data-offset-y="30" data-expected-width="20" data-expected-height="50">É</div> 76 <div class="item3 verticalLR" data-offset-x="0" data-offset-y="80" data-expected-width="80" data-expected-height="100">É</div> 77 </div> 78 79 <pre>flex column - all items share a baseline group</pre> 80 <div class="grid column justifyItemsBaseline"> 81 <div class="item1 relativeWidth height50" data-offset-x="0" data-offset-y="0" data-expected-width="40" data-expected-height="50">É</div> 82 <div class="item2 verticalLR" data-offset-x="12" data-offset-y="50" data-expected-width="20" data-expected-height="50">É</div> 83 <div class="item3 verticalLR" data-offset-x="0" data-offset-y="100" data-expected-width="80" data-expected-height="100">É</div> 84 </div> 85 86 <pre>flex column - all items share a baseline group</pre> 87 <div class="grid column justifyItemsBaseline"> 88 <div class="item1 relativeWidth height50" data-offset-x="0" data-offset-y="0" data-expected-width="40" data-expected-height="50">É</div> 89 <div class="item2" data-offset-x="16" data-offset-y="50" data-expected-width="20" data-expected-height="50">É</div> 90 <div class="item3 verticalLR" data-offset-x="0" data-offset-y="100" data-expected-width="80" data-expected-height="100">É</div> 91 </div> 92 93 </body>