Bug 1352669 - Address failing CSS parser error tests. r=emilio
authorJosh Matthews <josh@joshmatthews.net>
Mon, 10 Jul 2017 16:24:00 -0400
changeset 368174 81adbdebbfe38cfb2264c7adc6748c32936a41db
parent 368173 28e303771cc05441ca0312ed951a80e19c8fd898
child 368175 e3e948f381b5003792d2281f450035b26a9efc90
push id32158
push usercbook@mozilla.com
push dateTue, 11 Jul 2017 10:48:59 +0000
treeherdermozilla-central@5e2692f8a367 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1352669
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1352669 - Address failing CSS parser error tests. r=emilio MozReview-Commit-ID: KfcpLYLIIve
layout/style/test/stylo-failures.md
layout/style/test/test_bug413958.html
layout/style/test/test_parser_diagnostics_unprintables.html
--- a/layout/style/test/stylo-failures.md
+++ b/layout/style/test/stylo-failures.md
@@ -33,19 +33,16 @@ to mochitest command.
   * "layout.css.prefixes.device-pixel-ratio-webkit" support bug 1366956
     * test_media_queries.html `-device-pixel-ratio` [27]
     * test_webkit_device_pixel_ratio.html [3]
   * test_media_queries_dynamic.html `restyle`: bug 1357461 [4]
   * test_media_queries_dynamic_xbl.html: xbl support bug 1290276 [1]
 * Animation support:
   * SMIL Animation
     * test_restyles_in_smil_animation.html [2]
-* console support bug 1352669
-  * test_bug413958.html `monitorConsole` [3]
-  * test_parser_diagnostics_unprintables.html [550]
 * @namespace support:
   * test_namespace_rule.html: bug 1355715 [6]
 * test_font_feature_values_parsing.html: \@font-feature-values support bug 1355721 [107]
 * Grid support bug 1341802
   * test_grid_computed_values.html [4]
   * test_grid_container_shorthands.html [65]
   * test_grid_item_shorthands.html [23]
   * test_grid_shorthand_serialization.html [28]
--- a/layout/style/test/test_bug413958.html
+++ b/layout/style/test/test_bug413958.html
@@ -34,28 +34,29 @@ var tests = [
             .setAttribute("style", "width:200;color:black");
   },
   function() {
     var s = document.getElementById("setStyleProp").style;
     s.width = "200";
     s.color = "black";
   },
 ];
+const isStylo = SpecialPowers.getBoolPref('layout.css.servo.enabled', false);
 var results = [
   [ { errorMessage: /Unknown property \u2018nosuchprop\u2019/,
-      lineNumber: 1, columnNumber: 14,
+      lineNumber: 1, columnNumber: isStylo ? 4 : 14,
       sourceLine: "#s1{nosuchprop:auto; color:black}" },
     { errorMessage: /Unknown property \u2018nosuchprop\u2019/,
-      lineNumber: 2, columnNumber: 14, sourceLine:
+      lineNumber: 2, columnNumber: isStylo ? 4 : 14, sourceLine:
       "#s2{nosuchprop:auto; color:black}invalid?sel{}#s3{color:black}" },
     { errorMessage: /Ruleset ignored due to bad selector/,
-      lineNumber: 2, columnNumber: 40, sourceLine:
+      lineNumber: 2, columnNumber: isStylo ? 33 : 40, sourceLine:
       "#s2{nosuchprop:auto; color:black}invalid?sel{}#s3{color:black}" } ],
   [ { errorMessage: /parsing value for \u2018width\u2019/,
-      lineNumber: 0, columnNumber: 6,
+      lineNumber: 0, columnNumber: isStylo ? 0 : 6,
       sourceLine: "width:200;color:black" } ],
   [ { errorMessage: /parsing value for \u2018width\u2019/,
       lineNumber: 0, columnNumber: 0,
       sourceLine: "200" } ],
 ];
 var curTest = -1;
 
 function doTest() {
--- a/layout/style/test/test_parser_diagnostics_unprintables.html
+++ b/layout/style/test/test_parser_diagnostics_unprintables.html
@@ -18,17 +18,17 @@
 // That's not the point of the test, though; the point is only that
 // *that text* is properly escaped.
 
 // There is one "pattern" for each code path through the error reporter
 // that might need to escape some kind of user-supplied text.
 // Each "pattern" is tested once with each of the "substitution"s below:
 // <t>, <i>, and <s> are replaced by the t:, i:, and s: fields of
 // each substitution object in turn.
-const patterns = [
+let patterns = [
   // REPORT_UNEXPECTED_P (only ever used in contexts where identifier-like
   // escaping is appropriate)
   { i: "<t>|x{}",                 o: "prefix \u2018<i>\u2019" },
   // REPORT_UNEXPECTED_TOKEN with:
   // _Ident
   { i: "@namespace fnord <t>;",    o: "within @namespace: \u2018<i>\u2019" },
   // _Ref
   { i: "@namespace fnord #<t>;",   o: "within @namespace: \u2018#<i>\u2019" },
@@ -37,22 +37,30 @@ const patterns = [
   // _Dimension
   { i: "@namespace fnord 14<t>;",  o: "within @namespace: \u201814<i>\u2019" },
   // _AtKeyword
   { i: "x{@<t>: }",        o: "declaration but found \u2018@<i>\u2019." },
   // _String
   { i: "x{ '<t>'}" ,       o: "declaration but found \u2018'<s>'\u2019." },
   // _Bad_String
   { i: "x{ '<t>\n}",      o: "declaration but found \u2018'<s>\u2019." },
-  // _URL
-  { i: "x{ url('<t>')}",   o: "declaration but found \u2018url('<s>')\u2019." },
-  // _Bad_URL
-  { i: "x{ url('<t>'.)}" , o: "declaration but found \u2018url('<s>'\u2019." }
 ];
 
+const isStylo = SpecialPowers.getBoolPref('layout.css.servo.enabled', false);
+
+// Stylo's CSS parser only reports the 'url(' token, not the actual bad URL.
+if (!isStylo) {
+  patterns.push(
+    // _URL
+    { i: "x{ url('<t>')}",   o: "declaration but found \u2018url('<s>')\u2019." })
+  patterns.push(
+    // _Bad_URL
+    { i: "x{ url('<t>'.)}" , o: "declaration but found \u2018url('<s>'\u2019." });
+}
+
 // Blocks of characters to test, and how they should be escaped when
 // they appear in identifiers and string constants.
 const substitutions = [
   // ASCII printables that _can_ normally appear in identifiers,
   // so should of course _not_ be escaped.
   { t: "-_0123456789",               i: "-_0123456789",
                                      s: "-_0123456789" },
   { t: "abcdefghijklmnopqrstuvwxyz", i: "abcdefghijklmnopqrstuvwxyz",