Support putting UA style rules behind a pref

RESOLVED DUPLICATE of bug 677302

Status

()

Core
CSS Parsing and Computation
RESOLVED DUPLICATE of bug 677302
4 years ago
4 years ago

People

(Reporter: jwatt, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

It would be really useful if rules in UA style sheets like forms.css could be guarded by a bool pref. I'd be happy with non-live "just read the pref once at parse time" type support. I imagine this would take the form of an @-rule that would look something like this:

@-moz-bool-pref dom.forms.number {
  /* overwrite style for input[type=number] in a way that would be really
     bad if the pref is turned off
  */
}

The main motivating factor for me right now is that I need the new styling for tests that run with the pref turned on, but having the styling turned on when the pref is off for regular Nightly users results in number controls not showing at all for them.

Of course this all depends on prefs having being read _before_ UA style sheets are parsed, but hopefully that is the case!

I've not looked at the parser code yet, but if anyone who knows the CSS parser has any comments on the above, or pointers to what to change in the code, they'd be very welcome. :)
I think I previously reviewed a patch to add an @-rule to do this, but I suspect it may not have landed.
I guess the previous effort was bug 677302, which hadn't quite gotten to the stage of code review,.
Ah, thanks, David.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 677302
You need to log in before you can comment on or make changes to this bug.