4 https://bugzilla.mozilla.org/show_bug.cgi?id=319381
7 <title>Test for Bug
319381</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
12 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=319381">Mozilla Bug
319381</a>
14 <div id=
"content" style=
"display: none">
18 <script class=
"testbody" type=
"text/javascript">
20 /** Test for Bug
319381 **/
23 return document.defaultView.getComputedStyle($('t')).
24 getPropertyValue(
"overflow");
27 var vals = [
"visible",
"hidden",
"auto",
"scroll"];
28 var mozVals = [
"-moz-scrollbars-vertical",
"-moz-scrollbars-horizontal"];
31 for (i =
0; i < vals.length; ++i) {
32 $('t').style.overflow = vals[i];
33 is($('t').style.overflow, vals[i],
"Roundtrip");
34 is(c(), vals[i],
"Simple property set");
37 for (i =
0; i < vals.length; ++i) {
38 for (j =
0; j < vals.length; ++j) {
39 $('t').setAttribute(
"style",
40 "overflow-x: " + vals[i] +
"; overflow-y: " + vals[j]);
41 is($('t').style.getPropertyValue(
"overflow-x"), vals[i],
"Roundtrip");
42 is($('t').style.getPropertyValue(
"overflow-y"), vals[j],
"Roundtrip");
45 is($('t').style.overflow, vals[i],
"Shorthand serialization");
47 is($('t').style.overflow, vals[i] +
" " + vals[j],
"Shorthand serialization");
50 //
"visible" overflow-x and overflow-y become
"auto" in computed style if
51 // the other direction is not also
"visible".
52 if (i == j || (vals[i] ==
"visible" && vals[j] ==
"auto")) {
53 is(c(), vals[j],
"Shorthand computation");
54 } else if (vals[j] ==
"visible" && vals[i] ==
"auto") {
55 is(c(), vals[i],
"Shorthand computation");
57 let x = vals[i] ==
"visible" ?
"auto" : vals[i];
58 let y = vals[j] ==
"visible" ?
"auto" : vals[j];
59 is(c(), x +
" " + y,
"Shorthand computation");