Closed Bug 1341925 Opened 7 years ago Closed 7 years ago

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

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: xidorn, Assigned: xidorn)

References

(Blocks 1 open bug)

Details

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

Attachments

(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: https://www.google.com/search?q=%22moz-table-border-nonzero%22
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.

https://reviewboard.mozilla.org/r/115954/#review117600

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 xquan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d038d48f6be1
Restrict :-moz-table-border-nonzero to UA sheet. r=dholbert
https://hg.mozilla.org/mozilla-central/rev/d038d48f6be1
Status: NEW → RESOLVED
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:

https://developer.mozilla.org/en-US/Firefox/Releases/54#CSS
You need to log in before you can comment on or make changes to this bug.