summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/mathml/relations/css-styling/lengths-1.html
blob: 896f08d111907e62a23a146299ab20a8a5260c09 (plain)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>MathML lengths</title>
<link rel="help" href="https://w3c.github.io/mathml-core/#css-styling">
<link rel="help" href="https://w3c.github.io/mathml-core/#types-for-mathml-attribute-values">
<link rel="help" href="https://w3c.github.io/mathml-core/#legacy-mathml-style-attributes">
<link rel="help" href="https://w3c.github.io/mathml-core/#space-mspace">
<link rel="match" href="lengths-1-ref.html"/>
<meta name="assert" content="Verify whether the different units are accepted for MathML lengths.">
<style>
  @font-face {
    font-family: TestFont;
    src: url("/fonts/math/xheight500.woff");
  }
  span, math {
    font-family: TestFont;
    font-size: 10px; /* 1em = 10px, 1ex is about 5px */
  }
  span {
    position: absolute;
    display: inline-block;
    height: 10px;
  }
  #red > span {
    background: red;
  }
  #green > span {
    background: green;
  }
</style>
</head>
<body>
  <p>Test passes if there is a green square and no red.</p>
  <div>
    <div id="red" style="position: absolute; width: 200px; height: 200px; background: green;">
      <!-- px -->
      <span style="top: 0px"><math><mspace width="200px"/></math></span>
      <span style="top: 10px; width: 200px"></span>

      <!-- cm -->
      <span style="top: 20px"><math><mspace width="5.08cm"/></math></span>
      <span style="top: 30px; width: 192px"></span>

      <!-- em -->
      <span style="top: 40px"><math><mspace width="20em"/></math></span>
      <span style="top: 50px; width: 200px"></span>

      <!-- ex -->
      <span style="top: 60px"><math><mspace width="30ex"/></math></span>
      <span style="top: 70px; width: 30ex"></span>

      <!-- in -->
      <span style="top: 80px"><math><mspace width="2in"/></math></span>
      <span style="top: 90px; width: 192px"></span>

      <!-- mm -->
      <span style="top: 100px"><math><mspace width="50.8mm"/></math></span>
      <span style="top: 110px; width: 192px"></span>

      <!-- pc -->
      <span style="top: 120px"><math><mspace width="12.5pc"/></math></span>
      <span style="top: 130px; width: 200px"></span>

      <!-- pt -->
      <span style="top: 140px"><math><mspace width="150pt"/></math></span>
      <span style="top: 150px; width: 200px"></span>

      <!-- % -->
      <span style="top: 160px"><math><mstyle mathsize="2000%"><mspace width="1em"/></mstyle></math></span>
      <span style="top: 170px; width: 200px"></span>

      <!-- unitless nonzero values should be ignored -->
      <span style="top: 180px"><math><mstyle mathsize="20.0"><mspace width="1em"/></mstyle></math></span>
      <span style="top: 190px; width: 10px"></span>
    </div>

    <div id="green" style="position: absolute; width: 200px; height: 200px;">
      <!-- px -->
      <span style="top: 10px"><math><mspace width="200px"/></math></span>
      <span style="top: 0px; width: 200px"></span>

      <!-- cm -->
      <span style="top: 30px"><math><mspace width="5.08cm"/></math></span>
      <span style="top: 20px; width: 192px"></span>

      <!-- em -->
      <span title="em" style="top: 50px"><math><mspace width="20em"/></math></span>
      <span title="em" style="top: 40px; width: 200px"></span>

      <!-- ex -->
      <span title="ex" style="top: 70px"><math><mspace width="30ex"/></math></span>
      <span title="ex" style="top: 60px; width: 30ex"></span>

      <!-- in -->
      <span style="top: 90px"><math><mspace width="2in"/></math></span>
      <span style="top: 80px; width: 192px"></span>

      <!-- mm -->
      <span style="top: 110px"><math><mspace width="50.8mm"/></math></span>
      <span style="top: 100px; width: 192px"></span>

      <!-- pc -->
      <span style="top: 130px"><math><mspace width="12.5pc"/></math></span>
      <span style="top: 120px; width: 200px"></span>

      <!-- pt -->
      <span style="top: 150px"><math><mspace width="150pt"/></math></span>
      <span style="top: 140px; width: 200px"></span>

      <!-- % -->
      <span style="top: 170px"><math><mstyle mathsize="2000%"><mspace width="1em"/></mstyle></math></span>
      <span style="top: 160px; width: 200px"></span>

      <!-- unitless nonzero values should be ignored -->
      <span style="top: 190px"><math><mstyle mathsize="20.0"><mspace width="1em"/></mstyle></math></span>
      <span style="top: 180px; width: 10px"></span>
    </div>
  </div>
</body>
</html>