2 <html lang=
"en" xmlns=
"http://www.w3.org/1999/xhtml">
4 https://bugzilla.mozilla.org/show_bug.cgi?id=721920
7 <title>Test for Bug
721920</title>
8 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8"/>
9 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
11 <style type=
"text/css">
13 svg text
{ word-spacing: 1em; }
18 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=721920">Mozilla Bug
721920</a>
20 <svg xmlns=
"http://www.w3.org/2000/svg" width=
"400" height=
"300">
22 <text id=
"s0" y=
"40" style=
"font-size: 0">汉字
</text>
23 <text id=
"s4" y=
"80" style=
"font-size: 4px">汉字
</text>
24 <text id=
"s12" y=
"120" style=
"font-size: 12px">汉字
</text>
25 <text id=
"s28" y=
"160" style=
"font-size: 28px">汉字
</text>
29 <div id=
"content" style=
"display: none">
33 <script class=
"testbody" type=
"text/javascript">
36 /** Test for Bug
721920 **/
38 SimpleTest.waitForExplicitFinish();
41 document.getElementById(
"s0"),
42 document.getElementById(
"s4"),
43 document.getElementById(
"s12"),
44 document.getElementById(
"s28"),
48 // The computed font size actually *doesn't* currently reflect the
49 // minimum font size preference, but things in em units do. Hence
50 // why we use word-spacing here.
51 // test_bug401046.html uses margin-bottom instead, but there's an
52 // SVG bug that prevents that working in SVG (bug
728723).
53 return getComputedStyle(elts[idx],
"").wordSpacing;
56 SpecialPowers.pushPrefEnv({
"clear": [[
"font.minimum-size.zh-CN"]]}, step1);
59 is(fs(
0),
"0px",
"at min font size 0, 0px should compute to 0px");
60 is(fs(
1),
"4px",
"at min font size 0, 4px should compute to 4px");
61 is(fs(
2),
"12px",
"at min font size 0, 12px should compute to 12px");
62 is(fs(
3),
"28px",
"at min font size 0, 28px should compute to 28px");
64 SpecialPowers.pushPrefEnv({
"set": [[
"font.minimum-size.zh-CN",
7]]}, step2);
68 is(fs(
0),
"0px",
"at min font size 7, 0px should compute to 0px");
69 is(fs(
1),
"7px",
"at min font size 7, 4px should compute to 7px");
70 is(fs(
2),
"12px",
"at min font size 7, 12px should compute to 12px");
71 is(fs(
3),
"28px",
"at min font size 7, 28px should compute to 28px");
73 SpecialPowers.pushPrefEnv({
"set": [[
"font.minimum-size.zh-CN",
18]]}, step3);
77 is(fs(
0),
"0px",
"at min font size 18, 0px should compute to 0px");
78 is(fs(
1),
"18px",
"at min font size 18, 4px should compute to 18px");
79 is(fs(
2),
"18px",
"at min font size 18, 12px should compute to 18px");
80 is(fs(
3),
"28px",
"at min font size 18, 28px should compute to 28px");
82 SpecialPowers.pushPrefEnv({
"clear": [[
"font.minimum-size.zh-CN"]]}, SimpleTest.finish);