Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / layout / style / test / test_bug319381.html
blob8ed87f86363aafca92bd1f4c25ebc383b8a3864e
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=319381
5 -->
6 <head>
7 <title>Test for Bug 319381</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=319381">Mozilla Bug 319381</a>
14 <p id="display"></p>
15 <div id="content" style="display: none">
16 <div id="t"></div>
17 </div>
18 <pre id="test">
19 <script class="testbody" type="text/javascript">
21 /** Test for Bug 319381 **/
23 function c() {
24 return document.defaultView.getComputedStyle($('t'), "").
25 getPropertyValue("overflow");
28 function cval() {
29 return document.defaultView.getComputedStyle($('t'), "").
30 getPropertyCSSValue("overflow");
33 var vals = ["visible", "hidden", "auto", "scroll"];
34 var mozVals = ["-moz-scrollbars-vertical", "-moz-scrollbars-horizontal"];
35 var i, j;
37 for (i = 0; i < vals.length; ++i) {
38 $('t').style.overflow = vals[i];
39 is($('t').style.overflow, vals[i], "Roundtrip");
40 is(c(), vals[i], "Simple property set");
41 isnot(cval(), null, "Simple property as CSSValue");
44 $('t').style.overflow = mozVals[0];
45 is($('t').style.getPropertyValue("overflow-y"), "scroll", "Roundtrip");
46 is($('t').style.getPropertyValue("overflow-x"), "hidden", "Roundtrip");
47 is($('t').style.overflow, "", "Shorthand read directly");
48 is(c(), "", "Shorthand computed");
49 is(cval(), null, "Shorthand as CSSValue");
51 $('t').style.overflow = mozVals[1];
52 is($('t').style.getPropertyValue("overflow-x"), "scroll", "Roundtrip");
53 is($('t').style.getPropertyValue("overflow-y"), "hidden", "Roundtrip");
54 is($('t').style.overflow, "", "Shorthand read directly");
55 is(c(), "", "Shorthand computed");
56 is(cval(), null, "Shorthand as CSSValue");
58 for (i = 0; i < vals.length; ++i) {
59 for (j = 0; j < vals.length; ++j) {
60 $('t').setAttribute("style",
61 "overflow-x: " + vals[i] + "; overflow-y: " + vals[j]);
62 is($('t').style.getPropertyValue("overflow-x"), vals[i], "Roundtrip");
63 is($('t').style.getPropertyValue("overflow-y"), vals[j], "Roundtrip");
65 if (i == j) {
66 is($('t').style.overflow, vals[i], "Shorthand serialization");
67 } else {
68 is($('t').style.overflow, "", "Shorthand serialization");
71 // "visible" overflow-x and overflow-y become "auto" in computed style if
72 // the other direction is not also "visible".
73 if (i == j || (vals[i] == "visible" && vals[j] == "auto")) {
74 is(c(), vals[j], "Shorthand computation");
75 isnot(cval(), null, "Shorthand computation as CSSValue");
76 } else if (vals[j] == "visible" && vals[i] == "auto") {
77 is(c(), vals[i], "Shorthand computation");
78 isnot(cval(), null, "Shorthand computation as CSSValue");
79 } else {
80 is(c(), "", "Shorthand computation");
81 is(cval(), null, "Shorthand computation as CSSValue");
86 </script>
87 </pre>
88 </body>
89 </html>