4 https://bugzilla.mozilla.org/show_bug.cgi?id=377947
7 <title>Test for Bug
377947</title>
8 <script type=
"text/javascript" src=
"/MochiKit/MochiKit.js"></script>
9 <script type=
"text/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=377947">Mozilla Bug
377947</a>
15 <div id=
"content" style=
"display: none">
19 <script class=
"testbody" type=
"text/javascript">
21 /** Test for Bug
377947 **/
24 * In particular, test that CSSStyleDeclaration.getPropertyValue doesn't
25 * return values for shorthands when some of the subproperties are not
26 * specified (a change that wasn't all that related to the main point of
27 * the bug). And also test that the internal system-font property added
28 * in bug
377947 doesn't interfere with that.
31 var s = document.getElementById(
"display").style;
33 is(s.getPropertyValue(
"list-style"),
"",
34 "list-style shorthand should start off empty");
35 s.
listStyleType=
"disc";
36 s.
listStyleImage=
"none";
37 is(s.getPropertyValue(
"list-style"),
"",
38 "list-style shorthand should be empty when some subproperties specified");
39 s.
listStylePosition=
"inside";
40 isnot(s.getPropertyValue(
"list-style"),
"",
41 "list-style shorthand should produce value when all subproperties set");
42 s.removeProperty(
"list-style");
43 is(s.getPropertyValue(
"list-style"),
"",
44 "list-style shorthand be empty after removal");
46 isnot(s.getPropertyValue(
"list-style"),
"",
47 "list-style shorthand should produce value when shorthand set");
48 s.removeProperty(
"list-style");
49 is(s.getPropertyValue(
"list-style"),
"",
50 "list-style shorthand be empty after removal");
52 is(s.getPropertyValue(
"font"),
"",
53 "font shorthand should start off empty");
55 "font-family":
"serif",
56 "font-style":
"normal",
57 "font-variant":
"normal",
58 "font-weight":
"bold",
60 "font-size-adjust":
"0.45",
61 "font-stretch":
"normal"
63 for (var prop in all_but_one) {
64 s.setProperty(prop, all_but_one[prop],
"");
66 is(s.getPropertyValue(
"font"),
"",
67 "font shorthand should be empty when some subproperties specified");
68 s.setProperty(
"line-height",
"1.5",
"");
69 isnot(s.getPropertyValue(
"font"),
"",
70 "font shorthand should produce value when all subproperties set");
71 s.removeProperty(
"font");
72 is(s.getPropertyValue(
"font"),
"",
73 "font shorthand be empty after removal");
74 s.
font=
"medium serif";
75 isnot(s.getPropertyValue(
"font"),
"",
76 "font shorthand should produce value when shorthand set");
77 s.removeProperty(
"font");
78 is(s.getPropertyValue(
"font"),
"",
79 "font shorthand be empty after removal");
81 isnot(s.getPropertyValue(
"font"),
"",
82 "font shorthand should produce value when shorthand (system font) set");
83 s.removeProperty(
"font");
84 is(s.getPropertyValue(
"font"),
"",
85 "font shorthand be empty after removal");