OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <link href="resources/grid.css" rel="stylesheet"> |
| 5 <script src="../../resources/check-layout.js"></script> |
| 6 <style> |
| 7 body { |
| 8 margin: 0; |
| 9 } |
| 10 |
| 11 .grid { |
| 12 grid-template-columns: 100px 100px; |
| 13 grid-template-rows: 200px 200px; |
| 14 width: -webkit-fit-content; |
| 15 } |
| 16 |
| 17 .cell { |
| 18 width: 10px; |
| 19 height: 20px; |
| 20 } |
| 21 |
| 22 .alignSelfStretch { |
| 23 align-self: stretch; |
| 24 } |
| 25 |
| 26 .alignSelfStart { |
| 27 align-self: start; |
| 28 } |
| 29 |
| 30 .alignSelfEnd { |
| 31 align-self: end; |
| 32 } |
| 33 |
| 34 .alignSelfCenter { |
| 35 align-self: center; |
| 36 } |
| 37 |
| 38 .alignSelfRight { |
| 39 align-self: right; |
| 40 } |
| 41 |
| 42 .alignSelfLeft { |
| 43 align-self: left; |
| 44 } |
| 45 |
| 46 .alignSelfFlexStart { |
| 47 align-self: flex-start; |
| 48 } |
| 49 |
| 50 .alignSelfFlexEnd { |
| 51 align-self: flex-end; |
| 52 } |
| 53 |
| 54 .alignSelfSelfStart { |
| 55 align-self: self-start; |
| 56 } |
| 57 |
| 58 .alignSelfSelfEnd { |
| 59 align-self: self-end; |
| 60 } |
| 61 |
| 62 |
| 63 </style> |
| 64 </head> |
| 65 <body onload="checkLayout('.grid')"> |
| 66 |
| 67 <p>This test checks that the align-self property is applied correctly.</p> |
| 68 |
| 69 <div style="position: relative" class="constrainedContainer"> |
| 70 <div class="grid" data-expected-width="200" data-expected-height="400"> |
| 71 <div class="alignSelfStretch firstRowFirstColumn" data-offset-x="0" data-off
set-y="0" data-expected-width="100" data-expected-height="0"></div> |
| 72 <div class="cell alignSelfStart firstRowSecondColumn" data-offset-x="100" da
ta-offset-y="0" data-expected-width="10" data-expected-height="20"></div> |
| 73 <div class="cell alignSelfEnd firstRowSecondColumn" data-offset-x="100" data
-offset-y="180" data-expected-width="10" data-expected-height="20"></div> |
| 74 <div class="cell alignSelfCenter secondRowFirstColumn" data-offset-x="0" dat
a-offset-y="290" data-expected-width="10" data-expected-height="20"></div> |
| 75 <div class="cell alignSelfRight secondRowSecondColumn" data-offset-x="100" d
ata-offset-y="200" data-expected-width="10" data-expected-height="20"></div> |
| 76 <div class="cell alignSelfLeft secondRowSecondColumn" data-offset-x="100" da
ta-offset-y="200" data-expected-width="10" data-expected-height="20"></div> |
| 77 </div> |
| 78 |
| 79 |
| 80 <div style="position: relative" class="constrainedContainer"> |
| 81 <div class="grid" data-expected-width="200" data-expected-height="400"> |
| 82 <div class="cell alignSelfFlexEnd firstRowFirstColumn" data-offset-x="0" dat
a-offset-y="0" data-expected-width="10" data-expected-height="20"></div> |
| 83 <div class="cell alignSelfFlexStart firstRowSecondColumn" data-offset-x="100
" data-offset-y="0" data-expected-width="10" data-expected-height="20"></div> |
| 84 <div class="cell alignSelfSelfStart secondRowFirstColumn" data-offset-x="0"
data-offset-y="200" data-expected-width="10" data-expected-height="20"></div> |
| 85 <div class="cell alignSelfSelfEnd secondRowSecondColumn" data-offset-x="100"
data-offset-y="380" data-expected-width="10" data-expected-height="20"></div> |
| 86 </div> |
| 87 |
| 88 |
| 89 <!-- Vertical writing mode. --> |
| 90 <div style="position: relative" class="constrainedContainer"> |
| 91 <div class="grid verticalRL" data-expected-width="400" data-expected-height="200
"> |
| 92 <!-- FIXME: Why is offset-x 400? --> |
| 93 <div class="alignSelfStretch firstRowFirstColumn" data-offset-x="400" data-o
ffset-y="0" data-expected-width="0" data-expected-height="100"></div> |
| 94 <div class="cell alignSelfStart firstRowSecondColumn" data-offset-x="390" da
ta-offset-y="100" data-expected-width="10" data-expected-height="20"></div> |
| 95 <div class="cell alignSelfEnd firstRowSecondColumn" data-offset-x="200" data
-offset-y="100" data-expected-width="10" data-expected-height="20"></div> |
| 96 <div class="cell alignSelfCenter secondRowFirstColumn" data-offset-x="95" da
ta-offset-y="0" data-expected-width="10" data-expected-height="20"></div> |
| 97 <div class="cell alignSelfRight secondRowSecondColumn" data-offset-x="0" dat
a-offset-y="100" data-expected-width="10" data-expected-height="20"></div> |
| 98 <div class="cell alignSelfLeft secondRowSecondColumn" data-offset-x="190" da
ta-offset-y="100" data-expected-width="10" data-expected-height="20"></div> |
| 99 </div> |
| 100 |
| 101 <div style="position: relative" class="constrainedContainer"> |
| 102 <div class="grid verticalLR" data-expected-width="400" data-expected-height="200
"> |
| 103 <div class="cell alignSelfFlexEnd firstRowFirstColumn" data-offset-x="0" dat
a-offset-y="0" data-expected-width="10" data-expected-height="20"></div> |
| 104 <div class="cell alignSelfFlexStart firstRowSecondColumn" data-offset-x="0"
data-offset-y="100" data-expected-width="10" data-expected-height="20"></div> |
| 105 <div class="cell alignSelfSelfStart secondRowFirstColumn" data-offset-x="200
" data-offset-y="0" data-expected-width="10" data-expected-height="20"></div> |
| 106 <div class="cell alignSelfSelfEnd secondRowSecondColumn" data-offset-x="390"
data-offset-y="100" data-expected-width="10" data-expected-height="20"></div> |
| 107 </div> |
| 108 </div> |
| 109 |
| 110 <!-- RTL direction. --> |
| 111 <div style="position: relative" class="constrainedContainer"> |
| 112 <div class="grid directionRTL" data-expected-width="200" data-expected-height="4
00"> |
| 113 <div class="alignSelfStretch firstRowFirstColumn" data-offset-x="0" data-off
set-y="0" data-expected-width="100" data-expected-height="0"></div> |
| 114 <div class="cell alignSelfStart firstRowSecondColumn" data-offset-x="100" da
ta-offset-y="0" data-expected-width="10" data-expected-height="20"></div> |
| 115 <div class="cell alignSelfEnd firstRowSecondColumn" data-offset-x="100" data
-offset-y="180" data-expected-width="10" data-expected-height="20"></div> |
| 116 <div class="cell alignSelfCenter secondRowFirstColumn" data-offset-x="0" dat
a-offset-y="290" data-expected-width="10" data-expected-height="20"></div> |
| 117 <div class="cell alignSelfRight secondRowSecondColumn" data-offset-x="100" d
ata-offset-y="200" data-expected-width="10" data-expected-height="20"></div> |
| 118 <div class="cell alignSelfLeft secondRowSecondColumn" data-offset-x="100" da
ta-offset-y="200" data-expected-width="10" data-expected-height="20"></div> |
| 119 </div> |
| 120 |
| 121 <div style="position: relative" class="constrainedContainer"> |
| 122 <div class="grid directionRTL" data-expected-width="200" data-expected-height="4
00"> |
| 123 <div class="cell alignSelfFlexEnd firstRowFirstColumn" data-offset-x="0" dat
a-offset-y="0" data-expected-width="10" data-expected-height="20"></div> |
| 124 <div class="cell alignSelfFlexStart firstRowSecondColumn" data-offset-x="100
" data-offset-y="0" data-expected-width="10" data-expected-height="20"></div> |
| 125 <div class="cell alignSelfSelfStart secondRowFirstColumn" data-offset-x="0"
data-offset-y="200" data-expected-width="10" data-expected-height="20"></div> |
| 126 <div class="cell alignSelfSelfEnd secondRowSecondColumn" data-offset-x="100"
data-offset-y="380" data-expected-width="10" data-expected-height="20"></div> |
| 127 </div> |
| 128 </div> |
| 129 |
| 130 <!-- RTL direction with opposite directions grid container vs grid item. --> |
| 131 <div style="position: relative" class="constrainedContainer"> |
| 132 <div class="grid" data-expected-width="200" data-expected-height="400"> |
| 133 <div class="alignSelfStretch firstRowFirstColumn directionRTL" data-offset-x
="0" data-offset-y="0" data-expected-width="100" data-expected-height="0"></div> |
| 134 <div class="cell alignSelfStart firstRowSecondColumn directionRTL" data-offs
et-x="100" data-offset-y="0" data-expected-width="10" data-expected-height="20">
</div> |
| 135 <div class="cell alignSelfEnd firstRowSecondColumn directionRTL" data-offset
-x="100" data-offset-y="180" data-expected-width="10" data-expected-height="20">
</div> |
| 136 <div class="cell alignSelfCenter secondRowFirstColumn directionRTL" data-off
set-x="0" data-offset-y="290" data-expected-width="10" data-expected-height="20"
></div> |
| 137 <div class="cell alignSelfRight secondRowSecondColumn directionRTL" data-off
set-x="100" data-offset-y="200" data-expected-width="10" data-expected-height="2
0"></div> |
| 138 <div class="cell alignSelfLeft secondRowSecondColumn directionRTL" data-offs
et-x="100" data-offset-y="200" data-expected-width="10" data-expected-height="20
"></div> |
| 139 </div> |
| 140 |
| 141 <div style="position: relative" class="constrainedContainer"> |
| 142 <div class="grid" data-expected-width="200" data-expected-height="400"> |
| 143 <div class="cell alignSelfFlexEnd firstRowFirstColumn directionRTL" data-off
set-x="0" data-offset-y="0" data-expected-width="10" data-expected-height="20"><
/div> |
| 144 <div class="cell alignSelfFlexStart firstRowSecondColumn directionRTL" data-
offset-x="100" data-offset-y="0" data-expected-width="10" data-expected-height="
20"></div> |
| 145 <div class="cell alignSelfSelfStart secondRowFirstColumn directionRTL" data-
offset-x="0" data-offset-y="200" data-expected-width="10" data-expected-height="
20"></div> |
| 146 <div class="cell alignSelfSelfEnd secondRowSecondColumn directionRTL" data-o
ffset-x="100" data-offset-y="380" data-expected-width="10" data-expected-height=
"20"></div> |
| 147 </div> |
| 148 </div> |
| 149 |
| 150 </body> |
| 151 </html> |
OLD | NEW |