4 https://bugzilla.mozilla.org/show_bug.cgi?id=401046
7 <title>Test for Bug
401046</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 #display span
{ margin-bottom: 1em; }
18 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=401046">Mozilla Bug
401046</a>
19 <p id=
"display" lang=
"zh-Hans">
20 <span id=
"s0" style=
"font-size: 0">汉字
</span>
21 <span id=
"s4" style=
"font-size: 4px">汉字
</span>
22 <span id=
"s12" style=
"font-size: 12px">汉字
</span>
23 <span id=
"s28" style=
"font-size: 28px">汉字
</span>
25 <div id=
"content" style=
"display: none">
29 <script class=
"testbody" type=
"text/javascript">
31 /** Test for Bug
401046 **/
33 SimpleTest.waitForExplicitFinish();
36 document.getElementById(
"s0"),
37 document.getElementById(
"s4"),
38 document.getElementById(
"s12"),
39 document.getElementById(
"s28")
43 // The computed font size actually *doesn't* currently reflect the
44 // minimum font size preference, but things in em units do. Not sure
45 // if this is how it ought to be...
46 return getComputedStyle(elts[idx],
"").marginBottom;
49 SpecialPowers.pushPrefEnv({'clear': [['font.minimum-size.zh-CN']]}, step1);
52 is(fs(
0),
"0px",
"at min font size 0, 0px should compute to 0px");
53 is(fs(
1),
"4px",
"at min font size 0, 4px should compute to 4px");
54 is(fs(
2),
"12px",
"at min font size 0, 12px should compute to 12px");
55 is(fs(
3),
"28px",
"at min font size 0, 28px should compute to 28px");
57 SpecialPowers.pushPrefEnv({'set': [['font.minimum-size.zh-CN',
7]]}, step2);
61 is(fs(
0),
"0px",
"at min font size 7, 0px should compute to 0px");
62 is(fs(
1),
"7px",
"at min font size 7, 4px should compute to 7px");
63 is(fs(
2),
"12px",
"at min font size 7, 12px should compute to 12px");
64 is(fs(
3),
"28px",
"at min font size 7, 28px should compute to 28px");
66 SpecialPowers.pushPrefEnv({'set': [['font.minimum-size.zh-CN',
18]]}, step3);
70 is(fs(
0),
"0px",
"at min font size 18, 0px should compute to 0px");
71 is(fs(
1),
"18px",
"at min font size 18, 4px should compute to 18px");
72 is(fs(
2),
"18px",
"at min font size 18, 12px should compute to 18px");
73 is(fs(
3),
"28px",
"at min font size 18, 28px should compute to 28px");
75 SpecialPowers.pushPrefEnv({'clear': [['font.minimum-size.zh-CN']]}, SimpleTest.finish);