tor-browser

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

grid-column-gap-001.html (3168B)


      1 <!DOCTYPE HTML>
      2 <!--
      3     Any copyright is dedicated to the Public Domain.
      4     http://creativecommons.org/publicdomain/zero/1.0/
      5 -->
      6 <html><head>
      7  <meta charset="utf-8">
      8  <title>CSS Grid Test: 'grid-column-gap'</title>
      9  <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1176792">
     10  <link rel="help" href="http://dev.w3.org/csswg/css-grid/#gutters">
     11  <link rel="match" href="grid-column-gap-001-ref.html">
     12  <style type="text/css">
     13 html,body {
     14  color:black; background-color:white; font-size:16px; padding:0; margin:0;
     15 }
     16 
     17 .grid {
     18  display: grid;
     19  grid-auto-columns: minmax(1px,auto);
     20  grid-template-rows: 0px 7px;
     21  border: 2px solid black;
     22  float: left;
     23  margin-right: 20px;
     24 }
     25 
     26 .grid :last-child { background:grey; }
     27 .grid :nth-child(2) { background:pink; }
     28 
     29 x { background: lime; height:7px; }
     30 
     31  </style>
     32 </head>
     33 <body>
     34 
     35 <script>
     36 document.body.style.display = "none";
     37 var justify = [
     38   "stretch",
     39   // FIXME: When https://github.com/w3c/csswg-drafts/issues/1002 is implemented.
     40   // "stretch end",
     41   // "stretch center",
     42   // "stretch safe end",
     43   // "stretch unsafe end",
     44   "safe start",
     45   "safe end",
     46   "safe center",
     47   "unsafe start",
     48   "unsafe end",
     49   "unsafe center",
     50   "space-between",
     51   // FIXME: https://github.com/w3c/csswg-drafts/issues/1002
     52   // "space-between end",
     53   // "space-between start",
     54   // "space-between safe end",
     55   // "space-between unsafe end",
     56   "space-around",
     57   // FIXME: https://github.com/w3c/csswg-drafts/issues/1002
     58   // "space-around center",
     59   // "space-around right",
     60   // "space-around safe right",
     61   // "space-around left",
     62   "space-evenly",
     63   // FIXME: https://github.com/w3c/csswg-drafts/issues/1002
     64   // "space-evenly flex-end",
     65   // "space-evenly safe flex-end",
     66   // "space-evenly unsafe flex-start",
     67   // "space-evenly right",
     68 ];
     69 var cols = [ "0", "1", "2", "3", "8", "9" ];
     70 var widths = [ "0", "1", "5", "6" ];
     71 var gaps = [ "1", "2" ];
     72 for (var j = 0; j < justify.length; ++j) {
     73  // document.body.appendChild(document.createTextNode(justify[j])); // for debugging
     74  var chunk = document.createElement('div');
     75  chunk.setAttribute("style", "border:1px solid; padding:2px 10px; overflow:hidden");
     76  for (var c = 0; c < cols.length; ++c) {
     77    for (var w = 0; w < widths.length; ++w) {
     78      // set this to true if you want to see all tests
     79      var run_test = widths[w] < cols[c] || cols[c] == 0 || cols[c] == 1;
     80      if (run_test) {
     81        for (var g = 0; g < gaps.length; ++g) {
     82          var grid = document.createElement('div');
     83          grid.style.width = widths[w]+"px";
     84          grid.style.gridColumnGap = gaps[g]+"px";
     85          grid.className = "grid";
     86          grid.style.justifyContent = justify[j];
     87          var span = document.createElement('span');
     88          span.style.gridColumn = "1 / span " + cols[c];
     89          grid.appendChild(span);
     90          for (var x = 0; x < cols[c]; ++x) {
     91            grid.appendChild(document.createElement('x'));
     92          }
     93          chunk.appendChild(grid);
     94        }
     95      }
     96    }
     97  }
     98  document.body.appendChild(chunk);
     99 }
    100 document.body.style.display = "";
    101 </script>
    102 
    103 </body>
    104 </html>