Bug 1341642 - Update test_selectors.html for better test coverage and update test expectations r?Manishearth draft
authorNazım Can Altınova <canaltinova@gmail.com>
Fri, 17 Mar 2017 20:47:19 +0300
changeset 501209 ce198e4ac697109a4cebc1d356787acaca1a6247
parent 501208 3f79c0b87643dafef27ed44f1dca7b04ad031f05
child 549801 5b39c63ff7ad2554a47df7fcdb798695acae4d7c
push id49897
push userbmo:canaltinova@gmail.com
push dateSat, 18 Mar 2017 20:40:06 +0000
reviewersManishearth
bugs1341642
milestone55.0a1
Bug 1341642 - Update test_selectors.html for better test coverage and update test expectations r?Manishearth MozReview-Commit-ID: 54BtnYJ85PK
layout/reftests/bugs/reftest-stylo.list
layout/style/test/stylo-failures.md
layout/style/test/test_selectors.html
--- a/layout/reftests/bugs/reftest-stylo.list
+++ b/layout/reftests/bugs/reftest-stylo.list
@@ -382,17 +382,17 @@ fails == 315920-12b.html 315920-12b.html
 fails == 315920-12c.html 315920-12c.html
 fails == 315920-13a.html 315920-13a.html
 == 315920-13b.html 315920-13b.html
 fails == 315920-14.html 315920-14.html
 == 315920-15.html 315920-15.html
 fails == 315920-16.html 315920-16.html
 fails == 315920-17.html 315920-17.html
 fails == 315920-18a.html 315920-18a.html
-fails == 315920-18b.html 315920-18b.html
+== 315920-18b.html 315920-18b.html
 fails == 315920-18c.html 315920-18c.html
 fails == 315920-18d.html 315920-18d.html
 fails == 315920-18e.html 315920-18e.html
 fails == 315920-18f.html 315920-18f.html
 fails == 315920-18g.html 315920-18g.html
 == 315920-18h.html 315920-18h.html
 == 315920-18i.html 315920-18i.html
 == 315920-19.html 315920-19.html
--- a/layout/style/test/stylo-failures.md
+++ b/layout/style/test/stylo-failures.md
@@ -278,16 +278,19 @@ to mochitest command.
     * test_initial_storage.html `align-` [6]
     * ... `justify-` [6]
     * test_value_storage.html `align-` [57]
     * ... `justify-` [46]
 * @page support
   * test_bug887741_at-rules_in_declaration_lists.html [1]
   * test_page_parser.html [30]
   * test_rule_insertion.html `@page` [4]
+* Stylesheet cloning is somehow busted bug 1348481
+  * test_selectors.html `cloned correctly` [150]
+  * ... `matched clone` [195]
 * Unsupported prefixed values
   * moz-prefixed gradient functions bug 1337655
     * test_value_storage.html `-moz-linear-gradient` [322]
     * ... `-moz-radial-gradient` [309]
     * ... `-moz-repeating-` [298]
   * webkit-prefixed gradient functions servo/servo#15441
     * test_value_storage.html `-webkit-gradient` [225]
     * ... `-webkit-linear-gradient` [40]
@@ -354,19 +357,19 @@ to mochitest command.
     * test_inherit_storage.html `for property 'border-image-` [5]
     * test_initial_storage.html `for property 'border-image-` [10]
     * test_value_storage.html `(for 'border-image-` [60]
   * -moz-alt-content parsing is wrong: servo/servo#15726
     * test_property_syntax_errors.html `-moz-alt-content` [4]
   * {transform,perspective}-origin fail to parse 'center left' and 'center right' servo/servo#15750
     * test_value_storage.html `'center left'` [8]
     * ... `'center right'` [8]
-* Incorrect parsing
   * mask shorthand servo/servo#15772
     * test_property_syntax_errors.html `mask'` [76]
+  * :-moz-any with combinators in the value bug 1348487 [7]
 * Incorrect serialization
   * border-radius and -moz-outline-radius shorthand servo/servo#15169
     * test_priority_preservation.html `border-radius` [4]
     * test_value_storage.html `border-radius:` [156]
     * ... `-moz-outline-radius:` [76]
     * test_shorthand_property_getters.html `should condense to shortest possible` [6]
   * transform property servo/servo#15194
     * test_value_storage.html `'transform` [104]
@@ -388,25 +391,43 @@ to mochitest command.
     * test_shorthand_property_getters.html `should serialize to 4-value` [2]
   * test_variables.html `--weird`: name of custom property is not escaped properly servo/servo#15399 [1]
   * ... `got "--`: CSS-wide keywords in custom properties servo/servo#15401 [3]
   * image-layer values should omit some of its parts when they are initial servo/servo#15951
     * test_shorthand_property_getters.html `background` [2]
   * counter-{reset,increment} doesn't serialize none servo/servo#15977
     * test_value_storage.html `counter-reset` [2]
     * test_value_storage.html `counter-increment` [2]
+  * :not(*) doesn't serialize properly servo/servo#16017
+    * test_selectors.html `:not()` [8]
+    * ... `:not(html|)` [1]
+  * "*|a" gets serialized as "a" when it should not servo/servo#16020
+    * test_selectors.html `reserialization of *|a` [6]
+* Unsupported pseudo-elements or anon boxes
+  * :-moz-tree bits bug 1348488
+    * test_selectors.html `:-moz-tree` [10]
+  * :-moz-placeholder bug 1348490
+    * test_selectors.html `:-moz-placeholder` [1]
+  * ::-moz-color-swatch bug 1348492
+    * test_selectors.html `::-moz-color-swatch` [1]
 * Unsupported pseudo-classes
   * :default ##easy##
     * test_bug302186.html [24]
   * test_bug98997.html: pseudo-class :empty and :-moz-only-whitespace bug 1337068 [75]
+  * :-moz-locale-dir
+    * test_selectors.html `:-moz-locale-dir` [15]
+  * :-moz-lwtheme-*
+    * test_selectors.html `:-moz-lwtheme` [3]
+  * :-moz-window-inactive bug 1348489
+    * test_selectors.html `:-moz-window-inactive` [2]
   * :-moz-{first,last}-node
-    * test_selectors.html `:-moz-` [4]
-    * ... `unexpected rule index` [2]
-  * :placeholder-shown
-    * test_selectors.html `TypeError` [1]
+    * test_selectors.html `:-moz-` [13]
+    * ... `unexpected rule index` [5]
+  * :dir
+    * test_selectors.html `:dir` [10]
 * issues arround font shorthand servo/servo#15032 servo/servo#15036
   * test_bug377947.html [2]
   * test_value_storage.html `'font'` [144]
   * test_shorthand_property_getters.html `font shorthand` [2]
   * test_system_font_serialization.html [10]
 * test_value_storage.html `font-size: calc(`: clamp negative value servo/servo#15296 [3]
 * rounding issue
   * test_value_storage.html `33.5833px` [2]
--- a/layout/style/test/test_selectors.html
+++ b/layout/style/test/test_selectors.html
@@ -52,17 +52,17 @@ function run() {
         }
         if (!namespaces) {
             namespaces = "";
         }
         style_text.data = namespaces + selector + "{ z-index: " + zi + " }";
 
         var idx = style_text.parentNode.sheet.cssRules.length - 1;
         if (namespaces == "") {
-            is(idx, 0, "unexpected rule index");
+            is(idx, 0, "unexpected rule index for " + selector);
         }
         if (idx < 0 ||
             style_text.parentNode.sheet.cssRules[idx].type !=
                 CSSRule.STYLE_RULE)
         {
             ok(false, "selector " + selector + " could not be parsed");
             return;
         }
@@ -101,19 +101,24 @@ function run() {
             var e = should_not_match[i];
             is(ifwin.getComputedStyle(e).zIndex, "auto",
                "element in " + body_contents + " did not match " + ser1 +
                " which is the reserialization of " + selector);
         }
 
         // But when we serialize the serialized result, we should get
         // the same text.
-        var ser2 = style_text.parentNode.sheet.cssRules[idx].selectorText;
-        is(ser2, ser1, "parse+serialize of selector \"" + selector +
-                       "\" is idempotent");
+        isnot(style_text.parentNode.sheet.cssRules[idx], undefined,
+              "parse of selector \"" + ser1 + "\" failed");
+
+        if (style_text.parentNode.sheet.cssRules[idx] !== undefined) {
+            var ser2 = style_text.parentNode.sheet.cssRules[idx].selectorText;
+            is(ser2, ser1, "parse+serialize of selector \"" + selector +
+                           "\" is idempotent");
+        }
 
         ifdoc.body.innerHTML = "";
         style_text.data = "";
 
         // And now test that when we clone the style sheet, we end up
         // with the same selector (serializes to same string, and
         // matches the same things).
         zi = ++gCounter;
@@ -1184,16 +1189,17 @@ function run() {
     test_balanced_unparseable(":-moz-any()");
     test_balanced_unparseable(":-moz-any(div p)");
     test_balanced_unparseable(":-moz-any(div ~ p)");
     test_balanced_unparseable(":-moz-any(div~p)");
     test_balanced_unparseable(":-moz-any(div + p)");
     test_balanced_unparseable(":-moz-any(div+p)");
     test_balanced_unparseable(":-moz-any(div > p)");
     test_balanced_unparseable(":-moz-any(div>p)");
+    test_balanced_unparseable(":-moz-any('foo')");
     test_parseable(":-moz-any(div, p)");
     test_parseable(":-moz-any( div , p  )");
     test_parseable(":-moz-any(div,p)");
     test_parseable(":-moz-any(div)");
     test_parseable(":-moz-any(div,p,:link,span:focus)");
     test_parseable(":-moz-any(:active,:focus)");
     test_parseable(":-moz-any(:active,:link:focus)");
     test_balanced_unparseable(":-moz-any(div,:nonexistentpseudo)");
@@ -1242,16 +1248,19 @@ function run() {
     // CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE (none of which are
     // unprefixed).
     test_parseable("::-moz-color-swatch:hover");
     test_balanced_unparseable("::-moz-color-swatch:not(.foo)");
     test_balanced_unparseable("::-moz-color-swatch:first-child");
     test_balanced_unparseable("::-moz-color-swatch:hover#foo");
     test_balanced_unparseable(".foo::after:not(.bar) ~ h3");
 
+    test_parseable(":-moz-broken");
+    test_parseable(":-moz-loading");
+
     run_deferred_tests();
 }
 
 var deferred_tests = [];
 
 function defer_clonedoc_tests(docurl, onloadfunc)
 {
     deferred_tests.push( { docurl: docurl, onloadfunc: onloadfunc } );