Bug 1341925 - Restrict :-moz-table-border-nonzero to UA sheet. r?dholbert draft
authorXidorn Quan <me@upsuper.org>
Tue, 28 Feb 2017 16:17:48 +1100
changeset 490357 ea5d3f2177dc243da77e0a387257e4230162cc00
parent 489866 bb906e721c81334a58c0da46ffe12f1dafba208e
child 547232 900ec9f623a90c413eb4f523cc9607c521586b15
push id47069
push userxquan@mozilla.com
push dateTue, 28 Feb 2017 05:18:46 +0000
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");