Closed Bug 1889931 Opened 2 months ago Closed 17 days ago

Collect native CSS system-colors

Categories

(Core :: Privacy: Anti-Tracking, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: tschuster, Assigned: tschuster)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

There are a number of CSS system-colors that we query from the operating system and might be modified by the user's theming options (Especially on Linux/GTK).

We have a list of all system-colors (typedef as ColorID in C++) define in Rust here: SystemColor. Furthermore we have a list of system colors which we have hardcoded values for (so called stand-ins?): sNonNativeThemeStandinColors.

However we don't always use those hard-coded stand-ins, the most interesting condition is the check for high-contrast mode: aPrefs.NonNativeThemeShouldBeHighContrast(). I am not sure if we already collect this value. At first brush it seems different to prefers-contrast.

Unless I made a mistake, I think we expose 66 colors. We probably don't need to collect all of them, but just those that are more commonly customized like Accentcolor.

Most of those are not exposed, actually, the Headerbar colors for example are not parsed in content. The IME and attention colors are also not parsed due to this #[css(skip)] here.

Nice, thanks emilio. I think that just leave us with:

Accentcolor
Accentcolortext
Canvas
Canvastext
Highlight
Highlighttext
Mark
Marktext
MozCellhighlight
MozCellhighlighttext
MozDialog
MozDialogtext
MozEventreerow
MozMenubarhovertext
MozMenuhover
MozMenuhovertext
MozOddtreerow
Selecteditem
Selecteditemtext

The Moz* ones we can probably unexpose from content at this point.

The Mark / MarkText ones are hard-coded already.

Canvas / CanvasText are prefable / settable from the color dialog in settings, but the defaults are also hard-coded in practice.

So that leaves Accentcolor, Highlight, and SelectedItem, which are all generally derived from the accent color.

Assignee: nobody → tschuster
Pushed by tschuster@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3cc2f2927636
Collect native CSS system-colors. r=emilio,tjr
Status: NEW → RESOLVED
Closed: 17 days ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: