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 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
|
<!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="help" href="https://www.w3.org/TR/css-values-4/#relative-lengths">
<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/css-units.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;
}
/* For lh and rlh. */
html {
line-height: 17px;
}
</style>
</head>
<body>
<p>Test passes if there is a green square and no red.</p>
<!-- Omitted units: vw, vh, vi, vb, vmin, vmax -->
<div>
<div id="red" style="position: absolute; width: 340px; height: 340px; 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>
<!-- q -->
<span style="top: 180px"><math><mspace width="203.2q"/></math></span>
<span style="top: 190px; width: 192px"></span>
<!-- ch -->
<span style="top: 200px"><math><mspace width="20ch"/></math></span>
<span style="top: 210px; width: 20ch"></span>
<!-- cap -->
<span style="top: 220px"><math><mspace width="30cap"/></math></span>
<span style="top: 230px; width: 30cap"></span>
<!-- ic -->
<span style="top: 240px"><math><mspace width="20ic"/></math></span>
<span style="top: 250px; width: 200px"></span>
<!-- rem -->
<span style="top: 260px"><math><mspace width="10rem"/></math></span>
<span style="top: 270px; width: 160px"></span>
<!-- lh -->
<span style="top: 280px"><math><mspace width="13lh" style="line-height: 15px;"/></math></span>
<span style="top: 290px; width: 195px"></span>
<!-- rlh -->
<span style="top: 300px"><math><mspace width="11rlh"/></math></span>
<span style="top: 310px; width: 187px"></span>
<!-- unitless nonzero values should be ignored -->
<span style="top: 320px"><math><mstyle mathsize="20.0"><mspace width="1em"/></mstyle></math></span>
<span style="top: 330px; width: 10px"></span>
</div>
<div id="green" style="position: absolute; width: 340px; height: 340px;">
<!-- 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>
<!-- q -->
<span style="top: 190px"><math><mspace width="203.2q"/></math></span>
<span style="top: 180px; width: 192px"></span>
<!-- ch -->
<span style="top: 210px"><math><mspace width="20ch"/></math></span>
<span style="top: 200px; width: 20ch"></span>
<!-- cap -->
<span style="top: 230px"><math><mspace width="30cap"/></math></span>
<span style="top: 220px; width: 30cap"></span>
<!-- ic -->
<span style="top: 250px"><math><mspace width="20ic"/></math></span>
<span style="top: 240px; width: 200px"></span>
<!-- rem -->
<span style="top: 270px"><math><mspace width="10rem"/></math></span>
<span style="top: 260px; width: 160px"></span>
<!-- lh -->
<span style="top: 290px"><math><mspace width="13lh" style="line-height: 15px;"/></math></span>
<span style="top: 280px; width: 195px"></span>
<!-- rlh -->
<span style="top: 310px"><math><mspace width="11rlh"/></math></span>
<span style="top: 300px; width: 187px"></span>
<!-- unitless nonzero values should be ignored -->
<span style="top: 330px"><math><mstyle mathsize="20.0"><mspace width="1em"/></mstyle></math></span>
<span style="top: 320px; width: 10px"></span>
</div>
</div>
</body>
</html>
|