tor-browser

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

bounded-sizes-reftest-ref.html (1840B)


      1 <!DOCTYPE html>
      2 <html>
      3 <meta charset=utf-8>
      4 <body>
      5  <div>
      6    The permission element should have some limits for the min/max-width/height:
      7    <ul>
      8    <li>min-width should be sufficient to fit the element text (depends on user agent implementation)</li>
      9    <li>max-width should be at most 3x min-width</li>
     10    <li>min-height should be sufficient to fit the element text (1em)</li>
     11    <li>max-height should be at most 3x min-height</li>
     12    <li>padding-left/top only work with width/height: auto and are at most 5em/1em</li>
     13    <li>padding-right/bottom are copied over from padding-left/top in this case</li>
     14    </ul>
     15  </div>
     16 
     17  <style>
     18    #id1 {
     19      font-size: 10px;
     20      height: 10px;
     21      border: 0px;
     22      /* width set via JS */
     23    }
     24    #id2 {
     25      font-size: 10px;
     26      height: 30px;
     27      border: 0px;
     28      /* width set via JS */
     29    }
     30    #id3 {
     31      font-size: 10px;
     32      color:black;
     33      background-color: black;
     34      border: 1000px solid darkmagenta;
     35 
     36      /* Used to compute width which will then have the padding
     37         artificially added in JS */
     38      width: fit-content;
     39      height: fit-content;
     40    }
     41  </style>
     42 
     43  <div><permission id="id1" type="geolocation"></permission></div>
     44  <div><permission id="id2" type="camera"></permission></div>
     45  <div><permission id="id3" type="microphone"></permission></div>
     46 
     47 <script>
     48  let el = document.getElementById("id1");
     49  el.style.width = getComputedStyle(el).minWidth;
     50 
     51  el = document.getElementById("id2");
     52  el.style.width = getComputedStyle(el).maxWidth;
     53 
     54  el = document.getElementById("id3");
     55  let w = getComputedStyle(el).width;
     56  let h = getComputedStyle(el).height;
     57  el.style.width = `calc(${w} + 100px)`; // 100px is 2 * 5em;
     58  el.style.height = `calc(${h} + 10px)`; // 10px is 2 * 5px; (the padding set in the test)
     59 </script>
     60 </body>
     61 </html>