toolbarbuttons.inc.css is only included @1x

NEW
Unassigned

Status

()

5 years ago
3 years ago

People

(Reporter: MattN, Unassigned)

Tracking

29 Branch
Points:
---
Bug Flags:
firefox-backlog +

Firefox Tracking Flags

(Not tracked)

Details

toolbarbuttons.inc.css is only included @1x which is not how we normally roll. It was done as a potential perf. improvement but it has bitten a few of us when we assume that styles inside that file would apply to toolbarbuttons (hence the name) and then find out later that those styles aren't applied on @2x.

Example: bug 979747 comment 14

Some possible solutions:
* Always include the stylesheet and move some duplication caused by this implementation back into toolbarbuttons.inc.css.
* Rename the file to be toolbarbuttons@1x.inc.css (include @1x).
Flags: firefox-backlog+
I'd prefer solution #1, but I don't remember the implications on perf off-hand. Mike, you probably do ;)
Flags: needinfo?(mconley)
Took me some time to dig back and find out why I originally wrote it this way. I think it was in response to this comment from Dao:

https://bugzilla.mozilla.org/show_bug.cgi?id=875488#c58

I think it was less about perf, and more about having fewer redundant rules / overridden rules.

I'm fine having the redundancy there, but maybe Dao wants to weigh in.
Flags: needinfo?(mconley) → needinfo?(dao)
If you're asking whether we should go back to the patch I r-'d, then that seems worse than the problem this bug was filed for.

If we can always use this file without messing up the selectors, doing that might make sense.

However, just renaming the file seems like a very cheap way to avoid the confusion. When renaming it, it might also make sense to be more explicit about this file being about icon regions rather than toolbar buttons in general.

Medium- or longer-term I'd like to think of the @2x stuff as a hack that we should overcome, as it doesn't scale well as we need to support more resolutions at least on Windows and probably Linux. Ideally we should use SVG. Other than that, maybe we could automate the creation of the high-DPI rules, i.e. have one canonical source for the regions and multiply them with a script at build time.
Flags: needinfo?(dao)
You need to log in before you can comment on or make changes to this bug.