tor-browser

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

grid-template-rows-computed-withcontent.html (4457B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 <meta charset="utf-8">
      5 <title>CSS Grid Layout Test: getComputedStyle().gridTemplateRows</title>
      6 <link rel="help" href="https://drafts.csswg.org/css-grid-1/#propdef-grid-template-rows">
      7 <meta name="assert" content="grid-template-rows computed value is the keyword none or a computed track list.">
      8 <script src="/resources/testharness.js"></script>
      9 <script src="/resources/testharnessreport.js"></script>
     10 <script src="/css/support/computed-testcommon.js"></script>
     11 <style>
     12  #target {
     13    display: grid;
     14    font-size: 40px;
     15    min-width: 200px;
     16    width: 300px;
     17    max-width: 400px;
     18    min-height: 500px;
     19    height: 600px;
     20    max-height: 700px;
     21  }
     22  #child {
     23    min-width: 20px;
     24    width: 30px;
     25    max-width: 40px;
     26    min-height: 50px;
     27    height: 60px;
     28    max-height: 70px;
     29  }
     30 </style>
     31 </head>
     32 <body>
     33 <div id="container">
     34  <div id="target">
     35    <div id="child"></div>
     36  </div>
     37 </div>
     38 <script>
     39 test_computed_value("grid-template-rows", 'none', '600px'); // "none" without #child
     40 
     41 // track-size <fixed-breadth> = <length-percentage> | <flex> | min-content | max-content | auto
     42 test_computed_value("grid-template-rows", '20%', '120px'); // 20% * height
     43 test_computed_value("grid-template-rows", 'calc(-0.5em + 10px)', '0px');
     44 test_computed_value("grid-template-rows", 'calc(0.5em + 10px)', '30px');
     45 test_computed_value("grid-template-rows", 'calc(30% + 40px)', '220px'); // 30% * height + 40px
     46 test_computed_value("grid-template-rows", '5fr', '600px'); // height
     47 test_computed_value("grid-template-rows", 'min-content', '60px');
     48 test_computed_value("grid-template-rows", 'max-content', '60px');
     49 test_computed_value("grid-template-rows", 'auto', '600px'); // height
     50 
     51 // track-size minmax( <inflexible-breadth> , <track-breadth> )
     52 test_computed_value("grid-template-rows", 'minmax(10px, auto)', '600px'); // height
     53 test_computed_value("grid-template-rows", 'minmax(20%, max-content)', '120px'); // 20% * height
     54 test_computed_value("grid-template-rows", 'minmax(min-content, calc(-0.5em + 10px))', '60px');
     55 test_computed_value("grid-template-rows", 'minmax(auto, 0)', '60px');
     56 
     57 // track-size fit-content( <length-percentage> )
     58 test_computed_value("grid-template-rows", 'fit-content(70px)', '60px');
     59 test_computed_value("grid-template-rows", 'fit-content(20%)', '60px');
     60 test_computed_value("grid-template-rows", 'fit-content(calc(-0.5em + 10px))', '60px');
     61 
     62 // <track-repeat> = repeat( [ <positive-integer> ] , [ <line-names>? <track-size> ]+ <line-names>? )
     63 test_computed_value("grid-template-rows", 'repeat(1, 10px)', '10px');
     64 test_computed_value("grid-template-rows", 'repeat(1, [one two] 20%)', '[one two] 120px');
     65 test_computed_value("grid-template-rows", 'repeat(2, minmax(10px, auto))', '325px 275px');
     66 
     67 test_computed_value("grid-template-rows", 'repeat(2, fit-content(20%) [three four] 30px 40px [five six])',
     68                    '60px [three four] 30px 40px [five six] 0px [three four] 30px 40px [five six]');
     69 
     70 // <track-list> = [ <line-names>? [ <track-size> | <track-repeat> ] ]+ <line-names>?
     71 test_computed_value("grid-template-rows", 'min-content repeat(5, minmax(10px, auto))',
     72                    '60px 108px 108px 108px 108px 108px');
     73 test_computed_value("grid-template-rows", '[] 150px [] 1fr []', '150px 450px');
     74 
     75 // <auto-repeat> = repeat( [ auto-fill | auto-fit ] , [ <line-names>? <fixed-size> ]+ <line-names>? )
     76 test_computed_value("grid-template-rows", 'repeat(auto-fill, 200px)', '200px 200px 200px');
     77 test_computed_value("grid-template-rows", 'repeat(auto-fit, [one] 20%)',
     78                    '[one] 120px [one] 0px [one] 0px [one] 0px [one] 0px');
     79 test_computed_value("grid-template-rows", 'repeat(auto-fill, minmax(100px, 5fr) [two])',
     80                    '100px [two] 100px [two] 100px [two] 100px [two] 100px [two] 100px [two]');
     81 test_computed_value("grid-template-rows", 'repeat(auto-fit, [three] minmax(max-content, 6em) [four])',
     82                    '[three] 240px [four three] 0px [four]');
     83 
     84 // <auto-track-list> =
     85 // [ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>?
     86 // <auto-repeat>
     87 // [ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>?
     88 
     89 test_computed_value("grid-template-rows", '[one] repeat(2, minmax(50px, auto)) [two] 30px [three] repeat(auto-fill, 10px) 40px [four five] repeat(2, minmax(200px, auto)) [six]',
     90                    '[one] 50px 50px [two] 30px [three] 10px 10px 10px 40px [four five] 200px 200px [six]');
     91 </script>
     92 </body>
     93 </html>