OLD | NEW |
1 // Requires custom-filter-parsing-common.js. | 1 // Requires custom-filter-parsing-common.js. |
2 | 2 |
3 description("Test at-rule parsing for @-webkit-filter."); | 3 description("Test at-rule parsing for @-webkit-filter."); |
4 | 4 |
5 // These have to be global for the test helpers to see them. | 5 // These have to be global for the test helpers to see them. |
6 var cssRule, declaration; | 6 var cssRule, declaration; |
7 | 7 |
8 function testFilterAtRule(description, rule, expectedValue, expectedProperties) | 8 function testFilterAtRule(description, rule, expectedValue, expectedProperties) |
9 { | 9 { |
10 debug("\n" + description + "\n" + rule); | 10 debug("\n" + description + "\n" + rule); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 testFilterAtRule("Empty rule, no extra whitespace.", | 66 testFilterAtRule("Empty rule, no extra whitespace.", |
67 "@-webkit-filter my-filter{}", | 67 "@-webkit-filter my-filter{}", |
68 "@-webkit-filter my-filter { }"); | 68 "@-webkit-filter my-filter { }"); |
69 testFilterAtRule("Rule with arbitrary properties.", | 69 testFilterAtRule("Rule with arbitrary properties.", |
70 "@-webkit-filter my-filter { width: 100px; height: 100px; }", | 70 "@-webkit-filter my-filter { width: 100px; height: 100px; }", |
71 "@-webkit-filter my-filter { width: 100px; height: 100px; }", | 71 "@-webkit-filter my-filter { width: 100px; height: 100px; }", |
72 {width: "100px", height: "100px"}); | 72 {width: "100px", height: "100px"}); |
73 testFilterAtRule("Empty rule, missing closing brace.", | 73 testFilterAtRule("Empty rule, missing closing brace.", |
74 "@-webkit-filter my-filter {", | 74 "@-webkit-filter my-filter {", |
75 "@-webkit-filter my-filter { }"); | 75 "@-webkit-filter my-filter { }"); |
| 76 testFilterAtRule("Empty rule, comment separators", |
| 77 "@-webkit-filter/**/my-filter/**/{ }", |
| 78 "@-webkit-filter my-filter { }"); |
| 79 testFilterAtRule("Empty rule, comment+space separators", |
| 80 "@-webkit-filter/**/ my-filter/**/ { }", |
| 81 "@-webkit-filter my-filter { }"); |
| 82 testFilterAtRule("Empty rule, space+comment separators", |
| 83 "@-webkit-filter /**/my-filter /**/{ }", |
| 84 "@-webkit-filter my-filter { }"); |
| 85 testFilterAtRule("Empty rule, space+comment+space separators", |
| 86 "@-webkit-filter /**/ my-filter /**/ { }", |
| 87 "@-webkit-filter my-filter { }"); |
76 | 88 |
77 heading("Nested filter at-rule tests."); | 89 heading("Nested filter at-rule tests."); |
78 testNestedRules("Nested rule.", | 90 testNestedRules("Nested rule.", |
79 "@-webkit-filter parent-filter { @-webkit-filter child-filter { } }", | 91 "@-webkit-filter parent-filter { @-webkit-filter child-filter { } }", |
80 { | 92 { |
81 cssText: "@-webkit-filter parent-filter { }", | 93 cssText: "@-webkit-filter parent-filter { }", |
82 ruleType: CSSRule.WEBKIT_FILTER_RULE, | 94 ruleType: CSSRule.WEBKIT_FILTER_RULE, |
83 constructorName: "WebKitCSSFilterRule" | 95 constructorName: "WebKitCSSFilterRule" |
84 }); | 96 }); |
85 testNestedRules("Twice nested rule.", | 97 testNestedRules("Twice nested rule.", |
(...skipping 15 matching lines...) Expand all Loading... |
101 { | 113 { |
102 cssText: "@media screen { \n @-webkit-filter child-filter { }\n}", | 114 cssText: "@media screen { \n @-webkit-filter child-filter { }\n}", |
103 ruleType: CSSRule.MEDIA_RULE, | 115 ruleType: CSSRule.MEDIA_RULE, |
104 constructorName: "CSSMediaRule", | 116 constructorName: "CSSMediaRule", |
105 }, | 117 }, |
106 { | 118 { |
107 cssText: "@-webkit-filter child-filter { }", | 119 cssText: "@-webkit-filter child-filter { }", |
108 ruleType: CSSRule.WEBKIT_FILTER_RULE, | 120 ruleType: CSSRule.WEBKIT_FILTER_RULE, |
109 constructorName: "WebKitCSSFilterRule", | 121 constructorName: "WebKitCSSFilterRule", |
110 }); | 122 }); |
OLD | NEW |