Bug 1386900 - Add test for parsing invalid filter values. r=xidorn
authorJosh Mattheus <josh@josmatthews.net>
Wed, 06 Sep 2017 21:25:14 +0200
changeset 660378 45084f5718b924ffcbd6a791cf3607546c47befb
parent 660377 3adbca67c67a33c46b14256b879adfdc7b207909
child 660379 492ea790f0493e82e754f18eb2b8cde3ea8946f3
child 661119 a8839a2aa29516a0d163aa765be985b16aa2d771
push id78390
push userbmo:emilio@crisal.io
push dateWed, 06 Sep 2017 23:04:15 +0000
reviewersxidorn
bugs1386900
milestone57.0a1
Bug 1386900 - Add test for parsing invalid filter values. r=xidorn MozReview-Commit-ID: FxbyxXRGmBB
layout/style/test/test_css_parse_error_smoketest.html
--- a/layout/style/test/test_css_parse_error_smoketest.html
+++ b/layout/style/test/test_css_parse_error_smoketest.html
@@ -9,16 +9,19 @@
 <body>
 <style id="testbench"></style>
 <script>
   var tests = [
     { css: "@unknown {}", error: "Unrecognized at-rule or error parsing at-rule ‘@unknown’." },
 
     { css: "x { color: invalid; }", error: "Expected color but found ‘invalid’.  Error in parsing value for ‘color’.  Declaration dropped." },
 
+    { css: "x { filter: alpha(foo); }", error: "Expected ‘none’, URL, or filter function but found ‘alpha(’.  Error in parsing value for ‘filter’.  Declaration dropped." },
+    { css: "x { filter: 5; }", error: "Expected ‘none’, URL, or filter function but found ‘5’.  Error in parsing value for ‘filter’.  Declaration dropped." },
+
     { css: "::unknown {}", error: "Unknown pseudo-class or pseudo-element ‘unknown’.  Ruleset ignored due to bad selector." },
     { css: ":unknown {}", error: "Unknown pseudo-class or pseudo-element ‘unknown’.  Ruleset ignored due to bad selector." },
     { css: "::5 {}", error: "Expected identifier for pseudo-class or pseudo-element but found ‘5’.  Ruleset ignored due to bad selector." },
     { css: ": {}", error: "Expected identifier for pseudo-class or pseudo-element but found ‘ ’.  Ruleset ignored due to bad selector." },
 
     { css: "x[a.]{}", error: "Unexpected token in attribute selector: ‘.’.  Ruleset ignored due to bad selector." },
     { css: "x[*a]{}", error: "Expected ‘|’ but found ‘a’.  Ruleset ignored due to bad selector." },
     { css: "x[a=5]{}", error: "Expected identifier or string for value in attribute selector but found ‘5’.  Ruleset ignored due to bad selector." },