File: bounded-sizes-reftest-ref.html

package info (click to toggle)
firefox-esr 140.3.1esr-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 4,539,016 kB
  • sloc: cpp: 7,380,478; javascript: 6,388,099; ansic: 3,710,142; python: 1,393,715; xml: 628,165; asm: 426,918; java: 184,025; sh: 65,742; makefile: 19,302; objc: 13,059; perl: 12,912; yacc: 4,583; cs: 3,846; pascal: 3,352; lex: 1,720; ruby: 1,226; exp: 762; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10
file content (61 lines) | stat: -rw-r--r-- 1,840 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE html>
<html>
<meta charset=utf-8>
<body>
  <div>
    The permission element should have some limits for the min/max-width/height:
    <ul>
    <li>min-width should be sufficient to fit the element text (depends on user agent implementation)</li>
    <li>max-width should be at most 3x min-width</li>
    <li>min-height should be sufficient to fit the element text (1em)</li>
    <li>max-height should be at most 3x min-height</li>
    <li>padding-left/top only work with width/height: auto and are at most 5em/1em</li>
    <li>padding-right/bottom are copied over from padding-left/top in this case</li>
    </ul>
  </div>

  <style>
    #id1 {
      font-size: 10px;
      height: 10px;
      border: 0px;
      /* width set via JS */
    }
    #id2 {
      font-size: 10px;
      height: 30px;
      border: 0px;
      /* width set via JS */
    }
    #id3 {
      font-size: 10px;
      color:black;
      background-color: black;
      border: 1000px solid darkmagenta;

      /* Used to compute width which will then have the padding
         artificially added in JS */
      width: fit-content;
      height: fit-content;
    }
  </style>

  <div><permission id="id1" type="geolocation"></permission></div>
  <div><permission id="id2" type="camera"></permission></div>
  <div><permission id="id3" type="microphone"></permission></div>

<script>
  let el = document.getElementById("id1");
  el.style.width = getComputedStyle(el).minWidth;

  el = document.getElementById("id2");
  el.style.width = getComputedStyle(el).maxWidth;

  el = document.getElementById("id3");
  let w = getComputedStyle(el).width;
  let h = getComputedStyle(el).height;
  el.style.width = `calc(${w} + 100px)`; // 100px is 2 * 5em;
  el.style.height = `calc(${h} + 10px)`; // 10px is 2 * 5px; (the padding set in the test)
</script>
</body>
</html>