Closed Bug 1341925 Opened 7 years ago Closed 7 years ago

Restrict :-moz-table-border-nonzero pseudo-class to UA stylesheet


(Core :: CSS Parsing and Computation, defect)

Not set



Tracking Status
firefox54 --- fixed


(Reporter: xidorn, Assigned: xidorn)


(Blocks 1 open bug)


(Keywords: dev-doc-complete, site-compat)


(1 file)

Searching our codebase, it is something that is only used in our UA stylesheet html.css. No chrome usage and addon usage at all. Searching the web also returns no result indicating anyone is using it on their page.

Apparently this isn't something useful for authors.

So I purpose that we restrict this pseudo-class to UA stylesheet.
Adding relevant keywords just in case.
You probably mean nonzero, not non-zero. Search results:
Summary: Restrict :-moz-table-border-non-zero pseudo-class to UA stylesheet → Restrict :-moz-table-border-nonzero pseudo-class to UA stylesheet
(I have no idea how I could misspell it... Yes, it is :-moz-table-border-nonzero, good catch.)
Blocks: 1341956
If we want to continue testing the behavior of this pseudo-class like what we currently do in test_selectors.html, we would need to use nsStyleSheetService to inject UA sheet, which needs some work.
Comment on attachment 8841865 [details]
Bug 1341925 - Restrict :-moz-table-border-nonzero to UA sheet.

r=me with one request:

::: layout/style/nsCSSPseudoClassList.h:124
(Diff revision 1)
>  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, "")

I want to be sure we have tests that ensure we aren't fully-disabling this pseudoclass (and that we don't accidentally do that in the future).  For example: I suspect we could (or might already) test this using a "!=" reftest that compares <table> vs <table border>.  Or something like that.

So: before landing, please make sure our usages of this pseudoclass are tested -- e.g. you might do a Try run with this pseudo-class *fully disabled* in UA sheets (maybe by using CSS_PSEUDO_CLASS_ENABLED_IN_CHROME instead of IN_UA_SHEETS in the line that you're modifying).  And hopefully some tests will fail in that Try run -- but if none do, please add test(s) that would.
Attachment #8841865 - Flags: review?(dholbert) → review+
Assignee: nobody → xidorn+moz
Pushed by
Restrict :-moz-table-border-nonzero to UA sheet. r=dholbert
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
We never documented this on MDN; I've added a note to the Fx 54 release notes:
You need to log in before you can comment on or make changes to this bug.