Bug 458861. Validate TrueType headers before activating downloaded font. r=roc, sr...
[wine-gecko.git] / layout / style / test / test_compute_data_with_start_struct.html
blob05b1628858fdcc945ba2b058b6e732ec92a7d3ca
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Test for correct handling of aStartStruct parameter to nsRuleNode::Compute*Data</title>
5 <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
6 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
7 <script type="text/javascript" src="property_database.js"></script>
8 <style type="text/css" id="stylesheet"></style>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
10 </head>
11 <body>
12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=216456">Mozilla Bug 216456</a>
13 <p id="display">
14 <span id="base"></span>
15 <span id="test"></span>
16 </p>
17 <div id="content" style="display: none">
19 </div>
20 <pre id="test">
21 <script class="testbody" type="text/javascript">
23 function xfail_computecheck(prop, roundnum) {
24 return false;
27 function xfail_test(prop, roundnum) {
28 return false;
31 var gStyleSheet = document.getElementById("stylesheet").sheet;
32 var gRule1 = gStyleSheet.cssRules[gStyleSheet.insertRule("#base, #test {}", gStyleSheet.cssRules.length)];
33 var gRule2 = gStyleSheet.cssRules[gStyleSheet.insertRule("#test {}", gStyleSheet.cssRules.length)];
35 var gBase = getComputedStyle(document.getElementById("base"), "");
36 var gTest = getComputedStyle(document.getElementById("test"), "");
38 function round(lower_set, higher_set, roundnum) {
40 for (var prop in gCSSProperties) {
41 var info = gCSSProperties[prop];
42 if (info.backend_only || info.subproperties || info.get_computed)
43 continue;
44 gRule1.style.setProperty(prop, info[lower_set][0], "");
45 gRule2.style.setProperty(prop, info[higher_set][0], "");
48 for (var prop in gCSSProperties) {
49 var info = gCSSProperties[prop];
50 if (info.backend_only || info.subproperties || info.get_computed)
51 continue;
53 if ("prerequisites" in info) {
54 for (var prereq in info.prerequisites) {
55 gRule2.style.setProperty(prereq, info.prerequisites[prereq], "");
59 gBase.getPropertyValue(prop);
60 var higher_set_val = gTest.getPropertyValue(prop);
61 gRule2.style.setProperty(prop, info[lower_set][0], "");
62 var lower_set_val = gTest.getPropertyValue(prop);
63 (xfail_computecheck(prop, roundnum) ? todo_isnot : isnot)(higher_set_val, lower_set_val, "initial and other values of " + prop + " are different");
64 gRule2.style.removeProperty(prop);
65 (xfail_test(prop, roundnum) ? todo_is : is)(gTest.getPropertyValue(prop), lower_set_val, prop + " is not touched when its value comes from aStartStruct");
67 gRule2.style.setProperty(prop, info[higher_set][0], "");
68 if ("prerequisites" in info) {
69 for (var prereq in info.prerequisites) {
70 gRule2.style.setProperty(prereq, gCSSProperties[prereq][higher_set][0], "");
76 round("other_values", "initial_values", 1);
77 round("initial_values", "other_values", 2);
79 </script>
80 </pre>
81 </body>
82 </html>