4 https://bugzilla.mozilla.org/show_bug.cgi?id=779917
7 <title>Test for Bug
779917</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=779917">Mozilla Bug
779917</a>
14 <div id=
"content" style=
"display: none">
18 <script type=
"application/javascript">
20 /** Test for Bug
779917 **/
24 var passingConditions = [
28 "(color: green !important)",
29 "(color: rainbow) or (color: green)",
30 "(color: green) or (color: rainbow)",
31 "(color: green) and (color: blue)",
32 "(color: rainbow) or (color: iridescent) or (color: green)",
33 "(color: red) and (color: green) and (color: blue)",
35 "not (color: rainbow)",
36 "not (not (color: green))",
37 "(unknown:) or (color: green)",
38 "(unknown) or (color: green)",
40 "(color:) or (color: green)",
42 "not ({ something @with [ balanced ] brackets })",
43 "an-extension(of some kind) or (color: green)",
45 "( Font: 20px serif ! Important) ",
46 "(color: /* comment */ green)",
47 "(/* comment */ color: green)",
48 "(color: green /* comment */)",
49 "(color: green) /* comment */",
50 "/* comment */ (color: green)",
51 "(color /* comment */: green)",
52 "(color: green) /* unclosed comment",
54 "(((((((color: green",
55 "(font-family: 'Helvetica"
58 var failingConditions = [
60 "(color: rainbow) and (color: green)",
61 "(color: blue) and (color: rainbow)",
62 "(color: green) and (color: green) or (color: green)",
63 "(color: green) or (color: green) and (color: green)",
64 "not not (color: green)",
65 "not (color: rainbow) and not (color: iridescent)",
66 "not (color: rainbow) or (color: green)",
67 "(not (color: rainbow) or (color: green))",
69 "not ({ something @with (unbalanced brackets })",
70 "(color: green) or an-extension(that is [unbalanced)",
71 "not(unknown: unknown)",
72 "(color: green) or(color: blue)",
74 "(font-family: 'Helvetica\n",
75 "(font-family: 'Helvetica\n')",
80 var passingDeclarations = [
84 [
"color",
"green /* comment */"],
85 [
"color",
"/* comment */ green"],
86 [
"color",
"green /* unclosed comment"],
87 [
"font",
"16px serif"],
88 [
"font",
"16px /* comment */ serif"],
89 [
"font",
"16px\nserif"],
90 [
"color",
"\\0067reen"]
93 var failingDeclarations = [
96 [
"color",
"green green"],
97 [
"color",
"green !important"],
98 [
"\\0063olor",
"green"],
99 [
"/* comment */color",
"green"],
100 [
"color/* comment */",
"green"],
101 [
"font-family",
"'Helvetica\n"],
102 [
"font-family",
"'Helvetica\n'"],
105 [
"unknown",
"unknown"],
110 passingConditions.forEach(function(aCondition) {
111 is(CSS.supports(aCondition), true,
"CSS.supports returns true for passing condition \"" + aCondition + "\
"");
114 failingConditions.forEach(function(aCondition) {
115 is(CSS.supports(aCondition), false,
"CSS.supports returns false for failing condition \"" + aCondition + "\
"");
118 passingDeclarations.forEach(function(aDeclaration) {
119 is(CSS.supports(aDeclaration[
0], aDeclaration[
1]), true,
"CSS.supports returns true for supported declaration \"" + aDeclaration.join(":
") + "\
"");
122 failingDeclarations.forEach(function(aDeclaration) {
123 is(CSS.supports(aDeclaration[
0], aDeclaration[
1]), false,
"CSS.supports returns false for unsupported declaration \"" + aDeclaration.join(":
") + "\
"");
129 SimpleTest.waitForExplicitFinish();