Bug 1341925 - Restrict :-moz-table-border-nonzero to UA sheet. r=dholbert
authorXidorn Quan <me@upsuper.org>
Tue, 28 Feb 2017 16:17:48 +1100
changeset 374227 d038d48f6be18cc97a3708f3c8a93e4bfb83b7c9
parent 374226 41f3d9a17672a2569e79ee96b44143a58d13098e
child 374228 5b8c22b505a48f78764e22ae720b9bda07853b33
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1341925
milestone54.0a1
Bug 1341925 - Restrict :-moz-table-border-nonzero to UA sheet. r=dholbert MozReview-Commit-ID: 9u7m1QNxXI3
layout/style/nsCSSPseudoClassList.h
layout/style/test/test_selectors.html
--- a/layout/style/nsCSSPseudoClassList.h
+++ b/layout/style/nsCSSPseudoClassList.h
@@ -115,17 +115,18 @@ CSS_PSEUDO_CLASS(mozLWThemeBrightText, "
 // -moz-lwtheme-darktext matches a document that has a bright lightweight theme
 CSS_PSEUDO_CLASS(mozLWThemeDarkText, ":-moz-lwtheme-darktext", 0, "")
 
 // Matches anything when the containing window is inactive
 CSS_PSEUDO_CLASS(mozWindowInactive, ":-moz-window-inactive", 0, "")
 
 // Matches any table elements that have a nonzero border attribute,
 // according to HTML integer attribute parsing rules.
-CSS_PSEUDO_CLASS(mozTableBorderNonzero, ":-moz-table-border-nonzero", 0, "")
+CSS_PSEUDO_CLASS(mozTableBorderNonzero, ":-moz-table-border-nonzero",
+                 CSS_PSEUDO_CLASS_ENABLED_IN_UA_SHEETS, "")
 
 // Matches HTML frame/iframe elements which are mozbrowser.
 CSS_PSEUDO_CLASS(mozBrowserFrame, ":-moz-browser-frame",
                  CSS_PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME, "")
 
 // Matches whatever the contextual reference elements are for the
 // matching operation.
 CSS_PSEUDO_CLASS(scope, ":scope", 0, "layout.css.scope-pseudo.enabled")
--- a/layout/style/test/test_selectors.html
+++ b/layout/style/test/test_selectors.html
@@ -1068,16 +1068,17 @@ function run() {
     test_unbalanced_unparseable(":-moz-handler-vulnerable-updatable");
     test_unbalanced_unparseable(":-moz-handler-vulnerable-no-update");
     test_unbalanced_unparseable(":-moz-handler-disabled");
     test_unbalanced_unparseable(":-moz-handler-blocked");
     test_unbalanced_unparseable(":-moz-handler-crashed");
 
     // We're not in a UA sheet, so this should be invalid.
     test_balanced_unparseable(":-moz-native-anonymous");
+    test_balanced_unparseable(":-moz-table-border-nonzero");
 
     // Case sensitivity of tag selectors
     function setup_cased_spans(body) {
       var data = [
         { tag: "span" },
         { tag: "sPaN" },
         { tag: "Span" },
         { tag: "SPAN" },
@@ -1202,29 +1203,16 @@ function run() {
     test_selector_in_html(":-moz-any(:link,:not(a))", any_elts,
                           bodychildset([0, 1, 2]), bodychildset([3]));
     test_selector_in_html(":-moz-any([href],input[type],input[name])", any_elts,
                           bodychildset([0, 1]), bodychildset([2, 3]));
     test_selector_in_html(":-moz-any(div,a):-moz-any([type],[href],[name])",
                           any_elts,
                           bodychildset([1, 3]), bodychildset([0, 2]));
 
-    test_selector_in_html(":-moz-table-border-nonzero",
-                          "<p></p>" +
-                          "<p border='2'></p>" +
-                          "<table border='2'></table>" +
-                          "<table border></table>" +
-                          "<table></table>" +
-                          "<table frame='border'></table>" +
-                          "<table border='0'></table>" +
-                          "<table border='0pt'></table>" +
-                          "<table border='3pt'></table>",
-                          bodychildset([2, 3, 8]),
-                          bodychildset([0, 1, 4, 5, 6, 7]));
-
     // Test that we don't tokenize an empty HASH.
     test_balanced_unparseable("#");
     test_balanced_unparseable("# ");
     test_balanced_unparseable("#, p");
     test_balanced_unparseable("# , p");
     test_balanced_unparseable("p #");
     test_balanced_unparseable("p # ");
     test_balanced_unparseable("p #, p");