Bug 1226301. Remove Shumway from b2gdroid nightly builds. r=fabrice
[gecko.git] / layout / mathml / tests / test_opentype-radical.html
blobb073eb35865dcb3f8876dbfb662232dca326c93b
1 <!doctype html>
2 <html>
3 <head>
4 <title>Open Type MATH - radical</title>
5 <script type="application/javascript"
6 src="/tests/SimpleTest/SimpleTest.js"></script>
7 <script type="application/javascript"
8 src="/tests/SimpleTest/EventUtils.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
10 <meta charset="utf-8"/>
11 <style type="text/css">
12 math {
13 font-size: 10px;
15 @font-face {
16 font-family: radical-1;
17 src: url(/tests/fonts/math/radical-1.otf);
19 @font-face {
20 font-family: radical-2;
21 src: url(/tests/fonts/math/radical-2.otf);
23 @font-face {
24 font-family: radical-3;
25 src: url(/tests/fonts/math/radical-3.otf);
27 @font-face {
28 font-family: radical-4;
29 src: url(/tests/fonts/math/radical-4.otf);
31 @font-face {
32 font-family: radical-5;
33 src: url(/tests/fonts/math/radical-5.otf);
35 @font-face {
36 font-family: radical-6;
37 src: url(/tests/fonts/math/radical-6.otf);
39 @font-face {
40 font-family: radical-7;
41 src: url(/tests/fonts/math/radical-7.otf);
43 </style>
44 <script type="text/javascript">
45 SimpleTest.waitForExplicitFinish();
47 var epsilon = 5;
48 function almostEqual(x, y) { return Math.abs(x - y) < epsilon; }
50 function getBox(aId) {
51 return document.getElementById(aId).getBoundingClientRect();
54 function doTest() {
55 ok(almostEqual(getBox("inner1").top -
56 getBox("outer1").top, 5*10) &&
57 almostEqual(getBox("inner2").top -
58 getBox("outer2").top, 5*10) &&
59 almostEqual(getBox("inner3").top -
60 getBox("outer3").top, 5*10),
61 "Bad RadicalRuleThickness");
63 ok(almostEqual(getBox("inner4").top -
64 getBox("outer4").top, (7+1)*10) &&
65 almostEqual(getBox("inner5").top -
66 getBox("outer5").top, (7+1)*10) &&
67 almostEqual(getBox("inner6").top -
68 getBox("outer6").top, (7+1)*10),
69 "Bad RadicalExtraAscender");
71 ok(almostEqual(getBox("inner7").top -
72 getBox("outer7").top, (3+1)*10) &&
73 almostEqual(getBox("inner7").top -
74 getBox("outer8").top, (3+1)*10) &&
75 almostEqual(getBox("inner8").top -
76 getBox("outer9").top, (3+1)*10),
77 "Bad RadicalVerticalGap");
79 ok(almostEqual(getBox("inner10").top -
80 getBox("outer10").top, (9+1)*10) &&
81 almostEqual(getBox("inner11").top -
82 getBox("outer11").top, (9+1)*10) &&
83 almostEqual(getBox("inner12").top -
84 getBox("outer12").top, (9+1)*10),
85 "Bad RadicalDisplayStyleVerticalGap");
87 ok(almostEqual(getBox("base5").bottom - getBox("index5").bottom,
88 (getBox("base5").bottom - getBox("root5").top) * .25),
89 "Bad RadicalDegreeBottomRaisePercent")
91 ok(almostEqual(getBox("index6").left - getBox("root6").left, 10 * 5),
92 "Bad RadicalKernBeforeDegree")
94 ok(almostEqual(getBox("base7").left -
95 getBox("index7").right, 10 * (7+1)),
96 "Bad RadicalKernAfterDegree")
98 SimpleTest.finish();
100 </script>
101 </head>
102 <body onload="doTest()">
104 <a target="_blank"
105 href="https://bugzilla.mozilla.org/show_bug.cgi?id=961365">
106 Mozilla Bug 961365
107 </a>
109 <p id="display"></p>
112 <math style="font-family: radical-1;">
113 <msqrt id="outer1" mathbackground="green">
114 <mspace id="inner1" width="1em" height="1em" mathbackground="red"/>
115 </msqrt>
116 <menclose id="outer2" notation="radical" mathbackground="green">
117 <mspace id="inner2" width="1em" height="1em" mathbackground="red"/>
118 </menclose>
119 <mroot id="outer3" mathbackground="green">
120 <mspace id="inner3" width="1em" height="1em" mathbackground="red"/>
121 <mspace/>
122 </mroot>
123 </math>
124 </p>
126 <math style="font-family: radical-2;">
127 <msqrt id="outer4" mathbackground="green">
128 <mspace id="inner4" width="1em" height="1em" mathbackground="red"/>
129 </msqrt>
130 <menclose id="outer5" notation="radical" mathbackground="green">
131 <mspace id="inner5" width="1em" height="1em" mathbackground="red"/>
132 </menclose>
133 <mroot id="outer6" mathbackground="green">
134 <mspace id="inner6" width="1em" height="1em" mathbackground="red"/>
135 <mspace/>
136 </mroot>
137 </math>
138 </p>
140 <math style="font-family: radical-3;">
141 <msqrt id="outer7" mathbackground="green">
142 <mspace id="inner7" width="1em" height="1em" mathbackground="red"/>
143 </msqrt>
144 <menclose id="outer8" notation="radical" mathbackground="green">
145 <mspace id="inner8" width="1em" height="1em" mathbackground="red"/>
146 </menclose>
147 <mroot id="outer9" mathbackground="green">
148 <mspace id="inner9" width="1em" height="1em" mathbackground="red"/>
149 <mspace/>
150 </mroot>
151 </math>
152 </p>
154 <math style="font-family: radical-4;" displaystyle="true">
155 <msqrt id="outer10" mathbackground="green">
156 <mspace id="inner10" width="1em" height="1em" mathbackground="red"/>
157 </msqrt>
158 <menclose id="outer11" notation="radical" mathbackground="green">
159 <mspace id="inner11" width="1em" height="1em" mathbackground="red"/>
160 </menclose>
161 <mroot id="outer12" mathbackground="green">
162 <mspace id="inner12" width="1em" height="1em" mathbackground="red"/>
163 <mspace/>
164 </mroot>
165 </math>
166 </p>
169 <math style="font-family: radical-5;">
170 <mroot id="root5" mathbackground="green">
171 <mspace id="base5" width="1em" height="10em" mathbackground="red"/>
172 <mspace id="index5" width="1em" height="1em" mathbackground="blue"/>
173 </mroot>
174 </math>
175 </p>
178 <math style="font-family: radical-6;">
179 <mroot id="root6" mathbackground="green">
180 <mspace id="base6" width="1em" height="10em" mathbackground="red"/>
181 <mspace id="index6" width="1em" height="1em" mathbackground="blue"/>
182 </mroot>
183 </math>
184 </p>
187 <math style="font-family: radical-7;">
188 <mroot id="root7" mathbackground="green">
189 <mspace id="base7" width="1em" height="10em" mathbackground="red"/>
190 <mspace id="index7" width="1em" height="1em" mathbackground="blue"/>
191 </mroot>
192 </math>
193 </p>
195 </body>
196 </html>