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">
16 font-family: radical-1
;
17 src: url
(/tests
/fonts
/math
/radical-1
.otf
);
20 font-family: radical-2
;
21 src: url
(/tests
/fonts
/math
/radical-2
.otf
);
24 font-family: radical-3
;
25 src: url
(/tests
/fonts
/math
/radical-3
.otf
);
28 font-family: radical-4
;
29 src: url
(/tests
/fonts
/math
/radical-4
.otf
);
32 font-family: radical-5
;
33 src: url
(/tests
/fonts
/math
/radical-5
.otf
);
36 font-family: radical-6
;
37 src: url
(/tests
/fonts
/math
/radical-6
.otf
);
40 font-family: radical-7
;
41 src: url
(/tests
/fonts
/math
/radical-7
.otf
);
44 <script type=
"text/javascript">
45 SimpleTest
.waitForExplicitFinish();
48 function almostEqual(x
, y
) { return Math
.abs(x
- y
) < epsilon
; }
50 function getBox(aId
) {
51 return document
.getElementById(aId
).getBoundingClientRect();
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")
102 <body onload=
"doTest()">
105 href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=961365">
112 <math style=
"font-family: radical-1;">
113 <msqrt id=
"outer1" mathbackground=
"green">
114 <mspace id=
"inner1" width=
"1em" height=
"1em" mathbackground=
"red"/>
116 <menclose id=
"outer2" notation=
"radical" mathbackground=
"green">
117 <mspace id=
"inner2" width=
"1em" height=
"1em" mathbackground=
"red"/>
119 <mroot id=
"outer3" mathbackground=
"green">
120 <mspace id=
"inner3" width=
"1em" height=
"1em" mathbackground=
"red"/>
126 <math style=
"font-family: radical-2;">
127 <msqrt id=
"outer4" mathbackground=
"green">
128 <mspace id=
"inner4" width=
"1em" height=
"1em" mathbackground=
"red"/>
130 <menclose id=
"outer5" notation=
"radical" mathbackground=
"green">
131 <mspace id=
"inner5" width=
"1em" height=
"1em" mathbackground=
"red"/>
133 <mroot id=
"outer6" mathbackground=
"green">
134 <mspace id=
"inner6" width=
"1em" height=
"1em" mathbackground=
"red"/>
140 <math style=
"font-family: radical-3;">
141 <msqrt id=
"outer7" mathbackground=
"green">
142 <mspace id=
"inner7" width=
"1em" height=
"1em" mathbackground=
"red"/>
144 <menclose id=
"outer8" notation=
"radical" mathbackground=
"green">
145 <mspace id=
"inner8" width=
"1em" height=
"1em" mathbackground=
"red"/>
147 <mroot id=
"outer9" mathbackground=
"green">
148 <mspace id=
"inner9" width=
"1em" height=
"1em" mathbackground=
"red"/>
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"/>
158 <menclose id=
"outer11" notation=
"radical" mathbackground=
"green">
159 <mspace id=
"inner11" width=
"1em" height=
"1em" mathbackground=
"red"/>
161 <mroot id=
"outer12" mathbackground=
"green">
162 <mspace id=
"inner12" width=
"1em" height=
"1em" mathbackground=
"red"/>
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"/>
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"/>
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"/>