OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <link href="resources/grid.css" rel="stylesheet"> |
| 3 <link href="../css-intrinsic-dimensions/resources/width-keyword-classes.css" rel
=stylesheet> |
| 4 <script src="../../resources/check-layout.js"></script> |
| 5 <script src="../../resources/js-test.js"></script> |
| 6 <style> |
| 7 body { margin: 0px; } |
| 8 |
| 9 .normalGap { grid-gap: normal; } |
| 10 |
| 11 .gridGap { grid-gap: 16px; } |
| 12 |
| 13 .gridRowColumnGaps { |
| 14 grid-row-gap: 12px; |
| 15 grid-column-gap: 23px; |
| 16 } |
| 17 |
| 18 .gridMultipleCols { grid-template-columns: 30px minmax(10px, 50px) 80px; } |
| 19 .gridMultipleRows { grid-template-rows: 90px 70px min-content; } |
| 20 .gridAutoAuto { grid-template: auto auto / auto auto; } |
| 21 .gridMultipleFixed { grid-template: [first] 15px [foo] 25px [bar] 35px [last] /
[first] 37px [foo] 57px [bar] 77px [last]; } |
| 22 .gridFixed100 { grid-template: repeat(2, 100px) / repeat(2, 100px); } |
| 23 |
| 24 .thirdRowThirdColumn { grid-area: 3 / 3; } |
| 25 .firstRowThirdColumn { grid-area: 1 / 3; } |
| 26 |
| 27 div.grid > div { font: 10px/1 Ahem; } |
| 28 |
| 29 .gridItemMargins { |
| 30 margin: 20px 30px 40px 50px; |
| 31 width: 20px; |
| 32 height: 40px; |
| 33 } |
| 34 |
| 35 </style> |
| 36 |
| 37 <body onload="checkLayout('.grid')"> |
| 38 |
| 39 <!-- Check that gutters contribute to the size of the grid containers. --> |
| 40 |
| 41 <div style="position: relative;"> |
| 42 <div class="grid normalGap gridMultipleCols fit-content" data-expected-width
="160" data-expected-height="0"></div> |
| 43 <div class="grid normalGap gridMultipleRows" style="width: 400px" data-expec
ted-width="400" data-expected-height="160"></div> |
| 44 </div> |
| 45 |
| 46 <div style="position: relative"> |
| 47 <div class="grid gridRowColumnGaps fit-content" data-expected-width="93" dat
a-expected-height="52"> |
| 48 <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" dat
a-expected-width="20" data-expected-height="10">XX</div> |
| 49 <div class="secondRowSecondColumn" data-offset-x="43" data-offset-y="22"
data-expected-width="50" data-expected-height="30">XX<br>X<br>XX XX</div> |
| 50 </div> |
| 51 </div> |
| 52 |
| 53 <div style="position: relative"> |
| 54 <div class="grid gridMultipleCols gridRowColumnGaps fit-content" data-expect
ed-width="206" data-expected-height="84"> |
| 55 <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" dat
a-expected-width="30" data-expected-height="10">XX</div> |
| 56 <div class="secondRowSecondColumn" data-offset-x="53" data-offset-y="22"
data-expected-width="50" data-expected-height="20">XX<br>XX XX</div> |
| 57 <div class="thirdRowThirdColumn" data-offset-x="126" data-offset-y="54"
data-expected-width="80" data-expected-height="30">XXXX XX<br>X<br>XX XX</div> |
| 58 </div> |
| 59 </div> |
| 60 |
| 61 <div style="position: relative"> |
| 62 <div class="grid gridMultipleRows gridRowColumnGaps fit-content" data-expect
ed-width="186" data-expected-height="214"> |
| 63 <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" dat
a-expected-width="20" data-expected-height="90">XX</div> |
| 64 <div class="secondRowSecondColumn" data-offset-x="43" data-offset-y="102
" data-expected-width="50" data-expected-height="70">XX<br>XX XX</div> |
| 65 <div class="thirdRowThirdColumn" data-offset-x="116" data-offset-y="184"
data-expected-width="70" data-expected-height="30">XXXX XX<br>X<br>XX XX</div> |
| 66 </div> |
| 67 </div> |
| 68 |
| 69 <!-- Check that gutters do not alter grid items positioning. --> |
| 70 <div style="position: relative"> |
| 71 <div class="grid gridMultipleFixed gridRowColumnGaps"> |
| 72 <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" dat
a-expected-width="15" data-expected-height="37">X X X</div> |
| 73 <div class="secondRowSecondColumn" data-offset-x="38" data-offset-y="49"
data-expected-width="25" data-expected-height="57">X X</div> |
| 74 <div class="thirdRowThirdColumn" data-offset-x="86" data-offset-y="118"
data-expected-width="35" data-expected-height="77">XXX XX X XX XX</div> |
| 75 </div> |
| 76 </div> |
| 77 |
| 78 <div style="position: relative"> |
| 79 <div class="grid gridMultipleFixed gridRowColumnGaps"> |
| 80 <div style="grid-row: 2; grid-column: -2 / -1;" data-offset-x="86" data-
offset-y="49" data-expected-width="35" data-expected-height="57">X X X</div> |
| 81 <div style="grid-row: 1 / bar; grid-column: bar" data-offset-x="86" data
-offset-y="0" data-expected-width="35" data-expected-height="106">X XX X XX XX X
X X</div> |
| 82 <div style="grid-row: -2; grid-column-end: foo" data-offset-x="0" data-o
ffset-y="118" data-expected-width="15" data-expected-height="77">X X</div> |
| 83 </div> |
| 84 </div> |
| 85 |
| 86 <!-- Check that gutters do not alter track sizing. --> |
| 87 <div style="position: relative"> |
| 88 <div class="grid gridRowColumnGaps fit-content" data-expected-width="156" da
ta-expected-height="84"> |
| 89 <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" dat
a-expected-width="20" data-expected-height="10">XX</div> |
| 90 <div class="secondRowSecondColumn" data-offset-x="43" data-offset-y="22"
data-expected-width="30" data-expected-height="20">X X<br>X X</div> |
| 91 <div class="thirdRowThirdColumn" data-offset-x="96" data-offset-y="54" d
ata-expected-width="60" data-expected-height="30">XXX XX<br>X<br>XX XX</div> |
| 92 </div> |
| 93 </div> |
| 94 |
| 95 <div style="position: relative"> |
| 96 <div class="grid gridRowColumnGaps gridMultipleCols gridMultipleRows fit-con
tent" data-expected-width="206" data-expected-height="214"> |
| 97 <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" dat
a-expected-width="30" data-expected-height="90">XX</div> |
| 98 <div class="secondRowSecondColumn" data-offset-x="53" data-offset-y="102
" data-expected-width="50" data-expected-height="70">X X<br>X X</div> |
| 99 <div class="thirdRowThirdColumn" data-offset-x="126" data-offset-y="184"
data-expected-width="80" data-expected-height="30">XXX XX<br>X<br>XX XX</div> |
| 100 </div> |
| 101 </div> |
| 102 |
| 103 <!-- Check that gutters contribute to the size of spanning items. --> |
| 104 <div style="position: relative"> |
| 105 <div class="grid gridGap gridAutoAuto constrainedContainer"> |
| 106 <div class="secondRowBothColumn" data-offset-x="0" data-offset-y="26" da
ta-expected-width="50" data-expected-height="10">XXXXX</div> |
| 107 <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" dat
a-expected-width="17" data-expected-height="10">X</div> |
| 108 <div class="firstRowSecondColumn" data-offset-x="33" data-offset-y="0" d
ata-expected-width="17" data-expected-height="10">X</div> |
| 109 </div> |
| 110 </div> |
| 111 |
| 112 <div style="position: relative"> |
| 113 <div class="grid gridMultipleFixed gridRowColumnGaps"> |
| 114 <div style="grid-row: 2; grid-column: 1 / -1;" data-offset-x="0" data-of
fset-y="49" data-expected-width="121" data-expected-height="57">XXXX X XXXX</div
> |
| 115 <div style="grid-row: first / last; grid-column-start: 2" data-offset-x=
"38" data-offset-y="0" data-expected-width="25" data-expected-height="195">X XX
X XX X</div> |
| 116 <div style="grid-row: 1 / 3; grid-column: first / bar" data-offset-x="0"
data-offset-y="0" data-expected-width="63" data-expected-height="106">XXX XX<br
>XX<br>XXXXX</div> |
| 117 </div> |
| 118 </div> |
| 119 |
| 120 <!-- Check that gutters do not interfere with margins computation. --> |
| 121 <div style="position: relative"> |
| 122 <div class="grid gridFixed100 gridGap"> |
| 123 <div class="gridItemMargins firstRowFirstColumn" data-offset-x="50" data
-offset-y="20" data-expected-width="20" data-expected-height="40"></div> |
| 124 <div class="gridItemMargins firstRowSecondColumn" data-offset-x="166" da
ta-offset-y="20" data-expected-width="20" data-expected-height="40"></div> |
| 125 <div class="gridItemMargins secondRowFirstColumn" data-offset-x="50" dat
a-offset-y="136" data-expected-width="20" data-expected-height="40"></div> |
| 126 <div class="gridItemMargins secondRowSecondColumn" data-offset-x="166" d
ata-offset-y="136" data-expected-width="20" data-expected-height="40"></div> |
| 127 </div> |
| 128 </div> |
| 129 |
| 130 <div style="position: relative"> |
| 131 <div class="grid gridFixed100 verticalRL directionRTL gridGap"> |
| 132 <div class="gridItemMargins firstRowFirstColumn" data-offset-x="166" dat
a-offset-y="136" data-expected-width="20" data-expected-height="40"></div> |
| 133 <div class="gridItemMargins firstRowSecondColumn" data-offset-x="166" da
ta-offset-y="20" data-expected-width="20" data-expected-height="40"></div> |
| 134 <div class="gridItemMargins secondRowFirstColumn" data-offset-x="50" dat
a-offset-y="136" data-expected-width="20" data-expected-height="40"></div> |
| 135 <div class="gridItemMargins secondRowSecondColumn" data-offset-x="50" da
ta-offset-y="20" data-expected-width="20" data-expected-height="40"></div> |
| 136 </div> |
| 137 </div> |
| 138 |
| 139 </body> |
OLD | NEW |