Bug 1341925 - Restrict :-moz-table-border-nonzero to UA sheet. r?dholbert
MozReview-Commit-ID: 9u7m1QNxXI3
--- 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");