flex-factor-sum-less-than-1-001.html (4041B)
1 <!DOCTYPE html> 2 <html> 3 <title>CSS Grid Layout Test: flex factor sum smaller than 1.</title> 4 <link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-grid/#algo-find-fr-size"> 6 <link rel="help" href="https://drafts.csswg.org/css-grid-1/#fr-unit"> 7 <link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=520477"> 8 <link rel="stylesheet" href="/css/support/grid.css"> 9 <meta name="assert" content="Test that resolving auto tracks on grid items works properly even when the flex factor sum is less than 1." /> 10 11 <style> 12 .onlyColumnFractionFlexFactors { 13 grid-template-columns: minmax(0, 0.1fr) minmax(0, 0.2fr) minmax(0, 0.3fr); 14 grid-template-rows: 50px; 15 width: 100px; 16 } 17 .onlyRowFractionFlexFactors { 18 grid-template-columns: 50px; 19 grid-template-rows: minmax(0, 0.1fr) minmax(0, 0.2fr) minmax(0, 0.3fr); 20 width: 50px; 21 height: 100px; 22 } 23 .fixedAndfractionFlexFactors { 24 grid-template-columns: 50px minmax(0, 0.2fr) 30px; 25 grid-template-rows: minmax(0, 0.1fr) 50px minmax(0, 0.3fr); 26 width: 100px; 27 height: 100px; 28 } 29 .zeroValueFlexFactor { 30 grid-template-columns: .0fr .2fr .3fr; 31 grid-template-rows: 50px; 32 width: 100px; 33 } 34 .firstRowThirdColumn { 35 background-color: yellow; 36 grid-column: 3; 37 grid-row: 1; 38 } 39 .secondRowThirdColumn { 40 background-color: yellow; 41 grid-column: 3; 42 grid-row: 2; 43 } 44 .thirdRowFirstColumn { 45 background-color: brown; 46 grid-column: 1; 47 grid-row: 3; 48 } 49 .thirdRowThirdColumn { 50 background-color: magenta; 51 grid-column: 3; 52 grid-row: 3; 53 } 54 </style> 55 56 <script src="/resources/testharness.js"></script> 57 <script src="/resources/testharnessreport.js"></script> 58 <script src="/resources/check-layout-th.js"></script> 59 60 <body onload="checkLayout('.grid');"> 61 62 <div style="position: relative;"> 63 <div class="grid onlyColumnFractionFlexFactors"> 64 <div class="firstRowFirstColumn" data-expected-width="10" data-expected-height="50"></div> 65 <div class="firstRowSecondColumn" data-expected-width="20" data-expected-height="50"></div> 66 <div class="firstRowThirdColumn" data-expected-width="30" data-expected-height="50"></div> 67 </div> 68 </div> 69 70 <div style="position: relative;"> 71 <div class="grid onlyRowFractionFlexFactors"> 72 <div class="firstRowFirstColumn" data-expected-width="50" data-expected-height="10"></div> 73 <div class="secondRowFirstColumn" data-expected-width="50" data-expected-height="20"></div> 74 <div class="thirdRowFirstColumn" data-expected-width="50" data-expected-height="30"></div> 75 </div> 76 </div> 77 78 <div style="position: relative;"> 79 <div class="grid zeroValueFlexFactor"> 80 <div class="firstRowFirstColumn" data-expected-width="0" data-expected-height="50"></div> 81 <div class="firstRowSecondColumn" data-expected-width="20" data-expected-height="50"></div> 82 <div class="firstRowThirdColumn" data-expected-width="30" data-expected-height="50"></div> 83 </div> 84 </div> 85 86 <div style="position: relative;"> 87 <div class="grid fixedAndfractionFlexFactors"> 88 <div class="firstRowFirstColumn" data-expected-width="50" data-expected-height="5"></div> 89 <div class="firstRowSecondColumn" data-expected-width="4" data-expected-height="5"></div> 90 <div class="firstRowThirdColumn" data-expected-width="30" data-expected-height="5"></div> 91 <div class="secondRowFirstColumn" data-expected-width="50" data-expected-height="50"></div> 92 <div class="secondRowSecondColumn" data-expected-width="4" data-expected-height="50"></div> 93 <div class="secondRowThirdColumn" data-expected-width="30" data-expected-height="50"></div> 94 <div class="thirdRowFirstColumn" data-expected-width="50" data-expected-height="15"></div> 95 <div class="thirdRowSecondColumn" data-expected-width="4" data-expected-height="15"></div> 96 <div class="thirdRowThirdColumn" data-expected-width="30" data-expected-height="15"></div> 97 </div> 98 </div> 99 100 </body> 101 </html>