tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

grid-content-alignment-overflow-001.html (13788B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 <title>CSS Grid Layout Test: content alignment and overflow alignment.</title>
      5 <link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com">
      6 <link rel="help" href="https://drafts.csswg.org/css-grid/#alignment">
      7 <link rel="help" href="https://drafts.csswg.org/css-align-3/#overflow-values">
      8 <link rel="help" href="https://drafts.csswg.org/css-align-3/#distribution-values">
      9 <link rel="help" href="https://drafts.csswg.org/css-align-3/#content-distribution">
     10 <link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=376823">
     11 <link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=249451">
     12 <link rel="stylesheet" href="/css/support/grid.css">
     13 <link rel="stylesheet" href="/css/support/alignment.css">
     14 <link rel="stylesheet" href="/css/support/width-keyword-classes.css">
     15 <meta name="assert" content="Test that the overflow alignment mode is applied correctly for content alignment properties." />
     16 
     17 <style>
     18 body {
     19  margin: 0;
     20 }
     21 
     22 .container {
     23  position: relative;
     24  float: left;
     25 }
     26 
     27 .grid {
     28  grid-template-columns: 50px 50px;
     29  grid-template-rows: 100px 100px;
     30 }
     31 
     32 .contentSizedTracks {
     33  grid-template:  max-content 100px / max-content 50px;
     34 }
     35 
     36 .overflowWidth {
     37  width: 60px;
     38  height: 300px;
     39 }
     40 
     41 .overflowHeight {
     42  width: 200px;
     43  height: 150px;
     44 }
     45 
     46 .item1 {
     47  width: 50px;
     48  height: 150px;
     49 }
     50 
     51 .item2 {
     52  width: 150px;
     53  height: 100px;
     54 }
     55 
     56 .minSize {
     57  min-width: 300px;
     58  min-height: 400px;
     59 }
     60 
     61 .maxSize {
     62  max-width: 100px;
     63  max-height: 100px;
     64 }
     65 </style>
     66 
     67 <script src="/resources/testharness.js"></script>
     68 <script src="/resources/testharnessreport.js"></script>
     69 <script src="/resources/check-layout-th.js"></script>
     70 </head>
     71 
     72 <body onload="checkLayout('.grid')">
     73 
     74 <div class="container" style="margin-bottom: 50px; margin-right: 25px;">
     75  <div class="grid overflowWidth contentCenter" data-expected-width="60" data-expected-height="300">
     76    <div class="firstRowFirstColumn" data-offset-x="-20" data-offset-y="50" data-expected-width="50" data-expected-height="100"></div>
     77    <div class="secondRowFirstColumn" data-offset-x="-20" data-offset-y="150" data-expected-width="50" data-expected-height="100"></div>
     78    <div class="firstRowSecondColumn" data-offset-x="30" data-offset-y="50" data-expected-width="50" data-expected-height="100"></div>
     79    <div class="secondRowSecondColumn" data-offset-x="30" data-offset-y="150" data-expected-width="50" data-expected-height="100"></div>
     80  </div>
     81 </div>
     82 <div>Grid container width of 60px not enough for 2 column tracks of 50px.<br> Content-Alignment: <b>center</b> and Overflow-Alignment: <b>default</b></div>
     83 
     84 <br clear="all">
     85 
     86 <div class="container" style="margin-bottom: 50px; margin-right: 25px;">
     87  <div class="grid overflowHeight contentCenterUnsafe" data-expected-width="200" data-expected-height="150">
     88    <div class="firstRowFirstColumn" data-offset-x="50" data-offset-y="-25" data-expected-width="50" data-expected-height="100"></div>
     89    <div class="secondRowFirstColumn" data-offset-x="50" data-offset-y="75" data-expected-width="50" data-expected-height="100"></div>
     90    <div class="firstRowSecondColumn" data-offset-x="100" data-offset-y="-25" data-expected-width="50" data-expected-height="100"></div>
     91    <div class="secondRowSecondColumn" data-offset-x="100" data-offset-y="75" data-expected-width="50" data-expected-height="100"></div>
     92  </div>
     93 </div>
     94 <div>Grid container height of 150px not enough for 2 row tracks of 100px.<br> Content-Alignment: <b>center</b> and Overflow-Alignment: <b>unsafe</b></div>
     95 
     96 <br clear="all">
     97 
     98 <div class="container" style="margin-bottom: 50px; margin-right: 25px;">
     99  <div class="grid overflowWidth contentCenterSafe" data-expected-width="60" data-expected-height="300">
    100    <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="50" data-expected-width="50" data-expected-height="100"></div>
    101    <div class="secondRowFirstColumn" data-offset-x="0" data-offset-y="150" data-expected-width="50" data-expected-height="100"></div>
    102    <div class="firstRowSecondColumn" data-offset-x="50" data-offset-y="50" data-expected-width="50" data-expected-height="100"></div>
    103    <div class="secondRowSecondColumn" data-offset-x="50" data-offset-y="150" data-expected-width="50" data-expected-height="100"></div>
    104  </div>
    105 </div>
    106 <div>Grid container width of 60px not enough for 2 column tracks of 50px.<br> Content-Alignment: <b>center</b> and Overflow-Alignment: <b>safe</b></div>
    107 
    108 <br clear="all">
    109 
    110 <div class="container" style="margin-bottom: 75px; margin-right: 25px;">
    111  <div class="grid overflowHeight contentCenterSafe" data-expected-width="200" data-expected-height="150">
    112    <div class="firstRowFirstColumn" data-offset-x="50" data-offset-y="0" data-expected-width="50" data-expected-height="100"></div>
    113    <div class="secondRowFirstColumn" data-offset-x="50" data-offset-y="100" data-expected-width="50" data-expected-height="100"></div>
    114    <div class="firstRowSecondColumn" data-offset-x="100" data-offset-y="0" data-expected-width="50" data-expected-height="100"></div>
    115    <div class="secondRowSecondColumn" data-offset-x="100" data-offset-y="100" data-expected-width="50" data-expected-height="100"></div>
    116  </div>
    117 </div>
    118 <div>Grid container height of 150px not enough for 2 row tracks of 100px.<br> Content-Alignment: <b>center</b> and Overflow-Alignment: <b>safe</b></div>
    119 
    120 <br clear="all">
    121 
    122 <div class="container" style="margin-bottom: 50px; margin-right: 25px;">
    123  <div class="grid overflowWidth contentEnd" data-expected-width="60" data-expected-height="300">
    124    <div class="firstRowFirstColumn" data-offset-x="-40" data-offset-y="100" data-expected-width="50" data-expected-height="100"></div>
    125    <div class="secondRowFirstColumn" data-offset-x="-40" data-offset-y="200" data-expected-width="50" data-expected-height="100"></div>
    126    <div class="firstRowSecondColumn" data-offset-x="10" data-offset-y="100" data-expected-width="50" data-expected-height="100"></div>
    127    <div class="secondRowSecondColumn" data-offset-x="10" data-offset-y="200" data-expected-width="50" data-expected-height="100"></div>
    128  </div>
    129 </div>
    130 <div>Grid container width of 60px not enough for 2 column tracks of 50px.<br> Content-Alignment: <b>end</b> and Overflow-Alignment: <b>default</b></div>
    131 
    132 <br clear="all">
    133 
    134 <div class="container" style="margin-bottom: 50px; margin-right: 25px;">
    135  <div class="grid overflowHeight contentEndUnsafe" data-expected-width="200" data-expected-height="150">
    136    <div class="firstRowFirstColumn" data-offset-x="100" data-offset-y="-50" data-expected-width="50" data-expected-height="100"></div>
    137    <div class="secondRowFirstColumn" data-offset-x="100" data-offset-y="50" data-expected-width="50" data-expected-height="100"></div>
    138    <div class="firstRowSecondColumn" data-offset-x="150" data-offset-y="-50" data-expected-width="50" data-expected-height="100"></div>
    139    <div class="secondRowSecondColumn" data-offset-x="150" data-offset-y="50" data-expected-width="50" data-expected-height="100"></div>
    140  </div>
    141 </div>
    142 <div>Grid container height of 150px not enough for 2 row tracks of 100px.<br> Content-Alignment: <b>end</b> and Overflow-Alignment: <b>unsafe</b></div>
    143 
    144 <br clear="all">
    145 
    146 <div class="container" style="margin-bottom: 50px; margin-right: 25px;">
    147  <div class="grid overflowWidth contentEndSafe" data-expected-width="60" data-expected-height="300">
    148    <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="100" data-expected-width="50" data-expected-height="100"></div>
    149    <div class="secondRowFirstColumn" data-offset-x="0" data-offset-y="200" data-expected-width="50" data-expected-height="100"></div>
    150    <div class="firstRowSecondColumn" data-offset-x="50" data-offset-y="100" data-expected-width="50" data-expected-height="100"></div>
    151    <div class="secondRowSecondColumn" data-offset-x="50" data-offset-y="200" data-expected-width="50" data-expected-height="100"></div>
    152  </div>
    153 </div>
    154 <div>Grid container width of 60px not enough for 2 column tracks of 50px.<br> Content-Alignment: <b>end</b> and Overflow-Alignment: <b>safe</b></div>
    155 
    156 <br clear="all">
    157 
    158 <div class="container" style="margin-bottom: 75px; margin-right: 25px;">
    159  <div class="grid overflowHeight contentEndSafe" data-expected-width="200" data-expected-height="150">
    160    <div class="firstRowFirstColumn" data-offset-x="100" data-offset-y="0" data-expected-width="50" data-expected-height="100"></div>
    161    <div class="secondRowFirstColumn" data-offset-x="100" data-offset-y="100" data-expected-width="50" data-expected-height="100"></div>
    162    <div class="firstRowSecondColumn" data-offset-x="150" data-offset-y="0" data-expected-width="50" data-expected-height="100"></div>
    163    <div class="secondRowSecondColumn" data-offset-x="150" data-offset-y="100" data-expected-width="50" data-expected-height="100"></div>
    164  </div>
    165 </div>
    166 <div>Grid container height of 150px not enough for 2 row tracks of 100px.<br> Content-Alignment: <b>end</b> and Overflow-Alignment: <b>safe</b></div>
    167 
    168 <br clear="all">
    169 
    170 <div class="container" style="margin-bottom: 50px; margin-right: 25px;">
    171  <div class="grid fit-content contentEndUnsafe" data-expected-width="100" data-expected-height="200">
    172    <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="100"></div>
    173    <div class="secondRowFirstColumn" data-offset-x="0" data-offset-y="100" data-expected-width="50" data-expected-height="100"></div>
    174    <div class="firstRowSecondColumn" data-offset-x="50" data-offset-y="0" data-expected-width="50" data-expected-height="100"></div>
    175    <div class="secondRowSecondColumn" data-offset-x="50" data-offset-y="100" data-expected-width="50" data-expected-height="100"></div>
    176  </div>
    177 </div>
    178 <div>Grid container indefinite size using fit-content, hence no possible overflow.<br> Content-Alignment: <b>end</b> and Overflow-Alignment: <b>unsafe</b></div>
    179 
    180 <br clear="all">
    181 
    182 <div class="container" style="margin-bottom: 200px; margin-right: 25px;">
    183  <div class="grid fit-content contentCenterUnsafe" data-expected-width="100" data-expected-height="200">
    184    <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="50" data-expected-height="100"></div>
    185    <div class="secondRowFirstColumn" data-offset-x="0" data-offset-y="100" data-expected-width="50" data-expected-height="100"></div>
    186    <div class="firstRowSecondColumn" data-offset-x="50" data-offset-y="0" data-expected-width="50" data-expected-height="100"></div>
    187    <div class="secondRowSecondColumn" data-offset-x="50" data-offset-y="100" data-expected-width="50" data-expected-height="100"></div>
    188  </div>
    189 </div>
    190 <div>Grid container indefinite size using fit-content, hence no possible overflow.<br> Content-Alignment: <b>center</b> and Overflow-Alignment: <b>unsafe</b></div>
    191 
    192 <br clear="all">
    193 
    194 <div class="container" style="margin-bottom: 100px; margin-right: 25px;">
    195  <div class="grid contentSizedTracks fit-content maxSize contentEndUnsafe" data-expected-width="100" data-expected-height="100">
    196    <div class="item1 firstRowSecondColumn" data-offset-x="50" data-offset-y="-150" data-expected-width="50" data-expected-height="150"></div>
    197    <div class="item2 secondRowFirstColumn" data-offset-x="-100" data-offset-y="0" data-expected-width="150" data-expected-height="100"></div>
    198  </div>
    199 </div>
    200 <div>Grid container indefinite size using fit-content, but max-size constraints implies that the content-sized tracks overflow.<br> Content-Alignment: <b>end</b> and Overflow-Alignment: <b>unsafe</b></div>
    201 
    202 <br clear="all">
    203 
    204 <div class="container" style="margin-bottom: 100px; margin-right: 75px;">
    205  <div class="grid contentSizedTracks fit-content maxSize contentCenterUnsafe" data-expected-width="100" data-expected-height="100">
    206    <div class="item1 firstRowSecondColumn" data-offset-x="100" data-offset-y="-75" data-expected-width="50" data-expected-height="150"></div>
    207    <div class="item2 secondRowFirstColumn" data-offset-x="-50" data-offset-y="75" data-expected-width="150" data-expected-height="100"></div>
    208  </div>
    209 </div>
    210 <div>Grid container indefinite size using fit-content, but max-size constraints implies that the content-sized tracks overflow.<br> Content-Alignment: <b>center</b> and Overflow-Alignment: <b>unsafe</b></div>
    211 
    212 <br clear="all">
    213 
    214 <div class="container" style="margin-bottom: 50px; margin-right: 25px;">
    215  <div class="grid contentSizedTracks fit-content minSize contentEndUnsafe" data-expected-width="300" data-expected-height="400">
    216    <div class="item1 firstRowSecondColumn" data-offset-x="250" data-offset-y="150" data-expected-width="50" data-expected-height="150"></div>
    217    <div class="item2 secondRowFirstColumn" data-offset-x="100" data-offset-y="300" data-expected-width="150" data-expected-height="100"></div>
    218  </div>
    219 </div>
    220 <div>Grid container indefinite size using fit-content, but min-size constraints implies that the content-sized tracks don't overflow.<br> Content-Alignment: <b>end</b> and Overflow-Alignment: <b>unsafe</b></div>
    221 
    222 <br clear="all">
    223 
    224 <div class="container" style="margin-right: 25px;">
    225  <div class="grid contentSizedTracks fit-content minSize contentCenterUnsafe" data-expected-width="300" data-expected-height="400">
    226    <div class="item1 firstRowSecondColumn" data-offset-x="200" data-offset-y="75" data-expected-width="50" data-expected-height="150"></div>
    227    <div class="item2 secondRowFirstColumn" data-offset-x="50" data-offset-y="225" data-expected-width="150" data-expected-height="100"></div>
    228  </div>
    229 </div>
    230 <div>Grid container indefinite size using fit-content, but min-size constraints implies that the content-sized tracks don't overflow.<br> Content-Alignment: <b>center</b> and Overflow-Alignment: <b>unsafe</b></div>
    231 
    232 <br clear="all">
    233 
    234 </body>
    235 </html>