Bug 458861. Validate TrueType headers before activating downloaded font. r=roc, sr...
[wine-gecko.git] / layout / style / test / test_bug377947.html
blob7c5256e0ef7b2c26da93569b3fa2da7c4ca3795a
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=377947
5 -->
6 <head>
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" />
11 </head>
12 <body>
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=377947">Mozilla Bug 377947</a>
14 <p id="display"></p>
15 <div id="content" style="display: none">
17 </div>
18 <pre id="test">
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");
45 s.listStyle="none";
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");
54 var all_but_one = {
55 "font-family": "serif",
56 "font-style": "normal",
57 "font-variant": "normal",
58 "font-weight": "bold",
59 "font-size": "small",
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");
80 s.font="menu";
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");
87 </script>
88 </pre>
89 </body>
90 </html>