Bug 458861. Validate TrueType headers before activating downloaded font. r=roc, sr...
[wine-gecko.git] / layout / style / test / test_initial_storage.html
blobac85197ffcc5b2f495b6432af77a49224baf0310
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=375363
5 -->
6 <head>
7 <title>Test for parsing, storage, and serialization of CSS '-moz-initial'</title>
8 <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
9 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
10 <script type="text/javascript" src="property_database.js"></script>
11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
12 </head>
13 <body>
14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=375363">Mozilla Bug 375363</a>
15 <p id="display"></p>
16 <div id="content" style="display: none">
18 <div id="testnode"></div>
20 </div>
21 <pre id="test">
22 <script class="testbody" type="text/javascript">
24 /** Test for parsing, storage, and serialization of CSS '-moz-initial' **/
26 var gDeclaration = document.getElementById("testnode").style;
28 var gKnownFails2 = {
29 "-moz-border-end": true,
30 "-moz-border-radius": true,
31 "-moz-border-start": true,
32 "-moz-column-rule": true,
33 "-moz-outline-radius": true,
34 "background": true,
35 "border": true,
36 "border-bottom": true,
37 "border-left": true,
38 "border-right": true,
39 "border-top": true,
40 "cue": true,
41 "font": true,
42 "list-style": true,
43 "outline": true,
44 "pause": true
47 function test_property(property)
49 var info = gCSSProperties[property];
51 function check_initial(sproperty) {
52 var sinfo = gCSSProperties[sproperty];
53 var val = gDeclaration.getPropertyValue(sproperty);
54 is(val, "", "value of '" + sproperty + "' before we do anything");
55 if (sinfo.domProp) {
56 is(val, gDeclaration[sinfo.domProp],
57 "consistency between decl.getPropertyValue('" + sproperty + "') and decl." + sinfo.domProp);
60 check_initial(property);
61 if ("subproperties" in info)
62 for (var idx in info.subproperties)
63 check_initial(info.subproperties[idx]);
65 gDeclaration.setProperty(property, "-moz-initial", "");
67 function check_set(sproperty) {
68 var sinfo = gCSSProperties[sproperty];
69 val = gDeclaration.getPropertyValue(sproperty);
70 is(val, "-moz-initial",
71 "-moz-initial reported back for property '" + sproperty + "'");
72 if (sinfo.domProp) {
73 is(val, gDeclaration[sinfo.domProp],
74 "consistency between decl.getPropertyValue('" + sproperty +
75 "') and decl." + sinfo.domProp);
78 check_set(property);
79 if ("subproperties" in info)
80 for (var idx in info.subproperties)
81 check_set(info.subproperties[idx]);
83 // We don't care particularly about the whitespace or the placement of
84 // semicolons, but for simplicity we'll test the current behavior.
85 var cssTextFunc = is;
86 if (property in gKnownFails2)
87 cssTextFunc = todo_is;
88 cssTextFunc(gDeclaration.cssText, property + ": -moz-initial;",
89 "declaration should serialize to exactly what went in (for -moz-initial)");
91 gDeclaration.removeProperty(property);
93 function check_final(sproperty) {
94 var sinfo = gCSSProperties[sproperty];
95 var val = gDeclaration.getPropertyValue(sproperty);
96 is(val, "", "value of '" + sproperty + "' after removal of value");
97 if (sinfo.domProp) {
98 is(val, gDeclaration[sinfo.domProp],
99 "consistency between decl.getPropertyValue('" + sproperty + "') and decl." + sinfo.domProp);
102 check_final(property);
103 if ("subproperties" in info)
104 for (var idx in info.subproperties)
105 check_final(info.subproperties[idx]);
108 for (var prop in gCSSProperties)
109 test_property(prop);
111 </script>
112 </pre>
113 </body>
114 </html>