Closed Bug 2037167 Opened 4 months ago Closed 5 days ago

Problems with menus and Windows (High) Contrast themes

Categories

(Firefox :: Theme, defect, P2)

Firefox 150
Desktop
Windows 11
defect

Tracking

()

RESOLVED FIXED
158 Branch
Accessibility Severity s2
Tracking Status
relnote-firefox --- 158+
firefox158 --- fixed

People

(Reporter: 3be3ga, Assigned: oarnesto)

References

(Blocks 1 open bug)

Details

(Keywords: access, Whiteboard: [recomp][acorntractors])

Attachments

(13 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0

Steps to reproduce:

Install Firefox, without any changes and imports, add History and Bookmarks buttons to the toolbar, make visible Menu Bar.

Choose any Windows Contrast theme.

Open different menus (App/History/...) and hover the mouse cursor over them.

Actual results:

  1. Many menus have hovered items almost indistinguishable from the non-hovered items: App, History, Bookmarks, All tabs menu... That is because Firefox has incorrectly switched foreground and background colors for hovered items in these menus.

The main (top) and popup context menus have the correct hovered menu items.

  1. The top and popup menus always have the black panel background with dark contrast themes and the white background with light contrast themes, even with the themes that don't have a pure black/white ButtonFace color, e.g. Dusk or Desert.

Other menus like App and History have the correct background.

  1. None menu has a proper border. The App/History/... menus have a gray outline, while top and popup menus don't have any line at all.

Expected results:

  1. The hovered items in App/History/... menus should be same as the items in the top and popup menus, i.e. as they are in any other standard Windows application including File Explorer. Just switch foreground and background colors for them (Highlight and HighlightText).

  2. Top and popup menus should have ButtonFace color for background, just as other menus.

  3. Add a distinguishable border to all menus, preferably using the ButtonBorder color (or ButtonText, which seems that is always the same). Or, it could be the CanvasText color, as it could be seen in e.g. File Explorer for a new type of menus.

The panel background of most menus is white in this video, although it is actually #FFFAEF, most probably because of saving to .mp4.

This video was made on Win11 with the custom created contrast theme using the colors from Win10 theme.

Again, this video was made on Win11 with the custom created contrast theme using the colors from Win10 theme.

This is the worst case, the hovered menu items are completely indistinguishable.

Here is how menus look in File Explorer.

The Bugbug bot thinks this bug should belong to the 'Firefox::Toolbars and Customization' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Toolbars and Customization

I'm kind of surprised - has this been like this for a long time? It feels like something we should have picked up on before now.

Status: UNCONFIRMED → NEW
Component: Toolbars and Customization → Theme
Ever confirmed: true
Flags: needinfo?(emilio)
Keywords: access
OS: Unspecified → Windows 11
Hardware: Unspecified → Desktop
See Also: → 1955979

I think bug 2036938 is fixing exactly this?

Flags: needinfo?(emilio)
See Also: → 2036938

Please notice there is not one but three bugs.

Here is a video of v136:

  1. The same hovering problem with the App/History/... menus. The top/popup menus have the correct hovered items.
  2. The same problem with the background color of top/popup menu panel.
  3. The App/History/... menus have a white border with dark themes, but gray border with light themes. The top/popup menus have gray border with all themes. This is different than v150, but still didn't use system colors for border.

Here is a video of v61:

  1. The App/History menus have a different background color of hovered items, it is not system color. The All tabs menu has the correct background color for hovered items using Highlight system color, just as the top and popup menus.
  2. The top and popup menus have the correct ButtonFace color for the background of menu panel.
  3. The App/History menus have a gray border. The All tabs menu, as well as the top and popup menus have a distinguishable border using ButtonBorder system color.

The v62 is mostly the same as v61, except the All tabs menu that has the same problems as the App/History menus.

Accessibility Severity: --- → s2
See Also: → 1746502
See Also: 17465021748695

Here is a video showing how menus should look alike, using the next userChrome.css:
`
@media (forced-colors) {
/* Bookmark toolbar menu */
.toolbar-menupopup {
& :is(menu, menuitem) {
&:not([disabled])[_moz-menuactive] {
color: -moz-menuhovertext !important;
background-color: -moz-menuhover !important;
}
}
}

/* Download toolbar menu */
#downloadsListBox > richlistitem[state="1"][exists].hoveringMainArea:hover, #downloadsListBox > richlistitem.openWhenFinished.hoveringMainArea:hover, #downloadsListBox > richlistitem[verdict]:hover, #downloadsListBox > richlistitem.openWhenFinished:hover, .downloadsPanelFooterButton:hover {
color: -moz-menuhovertext !important;
background-color: -moz-menuhover !important;
}

/* App, History, All tabs menus */
:is(panelview .toolbarbutton-1, toolbarbutton.subviewbutton, .widget-overflow-list .toolbarbutton-1, .toolbaritem-combined-buttons:is(:not([cui-areatype="toolbar"]), [overflowedItem="true"]) > toolbarbutton) {
&:not([disabled]):hover {
color: -moz-menuhovertext !important;
background-color: -moz-menuhover !important;
& #fxa-menu-header-title {
color: -moz-menuhovertext !important;
}
}
}

panel[type="arrow"] {
--panel-border-color: var(--arrowpanel-color) !important;
}

/* Popups */
menupopup {
--panel-background: var(--arrowpanel-background) !important;
--panel-color: var(--arrowpanel-color) !important;
--panel-border-color: var(--arrowpanel-color) !important;
--panel-border-radius: var(--arrowpanel-border-radius) !important;
appearance: none !important;
}

/* Url menu */
[breakout-extend] > .urlbar-background {
border-color: var(--arrowpanel-color) !important;
}
}
`

I have used @media (forced-colors), so it doesn't affect the non-contrast themes.

Can someone tell me why it doesn't work when I use @media (forced-colors: active) instead? The web pages with the "active" value in that media query are displayed correctly, but not when used in userChrome.css.

Severity: -- → S2
Priority: -- → P2
See Also: → 2035905
Whiteboard: [recomp]

setting ni? per UX meeting

Flags: needinfo?(nstroud)

[note: screen recording shows testing in 155.0a1 (2026-08-11)]

Screen recording link

Hi 3be, thank you for sharing this! Above is a screen recording showing results I get, both with the Nova pref on and off. I'm unable to replicate this - are you still getting this issue?

Thank you in advance!

Flags: needinfo?(nstroud) → needinfo?(3be3ga)
Assignee: nobody → oarnesto
Status: NEW → ASSIGNED

(In reply to Natalie Stroud [:nstroud] from comment #14)

are you still getting this issue?

I am still getting the same issues with 153.0.3. They are somewhat different with the nightly 155.0a1:
1a. App, History, All tabs menus have the proper background and foreground colors for the menu items as I suggested. However, the background of the menu items is different than the background of the menu panel, which is the same as the background of the main (top) menu and the context menus.

1b. Bookmarks menu has the same foreground/background colors as the main (top) menu and the context menus.

  1. The main and context menus are still the same as before with the black background color with all dark themes.

3a. App, History, Bookmarks, All tabs menu panels have a better border color than before (although, I would prefer ButtonBorder for it instead of CanvasText color).

3b. The main and context menu panels don't have any border.

By the way, I noticed quite a wide space around the whole window next to its border, added in Nightly, that has the same color as the border itself, which is especially weird and ugly with Windows contrast themes when the program window is active. Maybe I should report it as a new issue? I just hope it will be optional when released officially.

Flags: needinfo?(3be3ga)

This is a screenshot with 153 and 155a1, the latter having an increased border around the whole window when it is active.

Whiteboard: [recomp] → [recomp][acorntractors]

I realized that my previous post about 155a1 is quite a mess with some wrong observations and I will try to clarify it. As I mentioned, there are three issues related to the Firefox menus and Windows contrast themes.

  1. Issue with hovered menu items

I was wrong stating that App, History and All tabs menus have the proper foreground colors for the hovered menu items. Actually, they have only the background color correct (Selected text, yellow on the screenshot), but their foreground color is the background color of Button text (ButtonFace, red on the screenshot). That includes also Search menu and probably all other menus having [type="arrow"].

The main (top) menu and the context menus have both the foreground and background colors of the hovered menu items correct (green on yellow on the screenshot).

  1. Issue with colors of menu panels and non-hovered menu items

a) It seems that all menu panels have the Menu background color set by --panel-background-color: Menu, which is black with all four native Windows themes.

b) The non-hovered menu items have the inconsistent colors in different menus. The main menu, Bookmarks, Search and context menus have Menu background color for the menu items (black). App, History, All tabs and other "arrow" menus have ButtonFace color (red on the screenshot).

The foreground colors of menu items are quite inconsistent and I observed three different ones. The main menu, Bookmarks and context menus have MenuText foreground color (white on the screenshot). The Search menu has CanvasText color (cyan on the screenshot). App, History, All tabs and other "arrow" menus have ButtonText color (pink on the screenshot).

  1. Issue with borders of menu panels

The main menu and the context menu panels don't have border. Other menus have border with MenuText color (white on the screenshot).

In my opinion, using Menu and MenuText colors with contrast themes should be avoided because they cannot be customized by the average users through the Settings dialog box, but only within the registry or by editing the theme files. Which could be a problem for majority of users since they can create their own themes only by editing the existing four native ones using the Settings dialog.

Also, as far as I know, the native Windows applications like File Explorer have menus with ButtonFace and some menus with Canvas background, but none of them have Menu background color.

Attachment #9629015 - Attachment description: WIP: Bug 2037167 - Fix menu styles in Windows HCM r=#reusable-components-reviewers-rotation → Bug 2037167 - Fix menu styles in Windows HCM r=#reusable-components-reviewers-rotation
Attachment #9629015 - Attachment description: Bug 2037167 - Fix menu styles in Windows HCM r=#reusable-components-reviewers-rotation → WIP: Bug 2037167 - Fix menu styles in Windows HCM r=#reusable-components-reviewers-rotation
Attachment #9629015 - Attachment description: WIP: Bug 2037167 - Fix menu styles in Windows HCM r=#reusable-components-reviewers-rotation → Bug 2037167 - Fix menu styles in Windows HCM r=#reusable-components-reviewers-rotation
Attachment #9629015 - Attachment description: Bug 2037167 - Fix menu styles in Windows HCM r=#reusable-components-reviewers-rotation → WIP: Bug 2037167 - Fix menu styles in Windows HCM r=#reusable-components-reviewers-rotation
Attachment #9629015 - Attachment description: WIP: Bug 2037167 - Fix menu styles in Windows HCM r=#reusable-components-reviewers-rotation → Bug 2037167 - Fix menu styles in Windows HCM r=#reusable-components-reviewers-rotation
Status: ASSIGNED → RESOLVED
Closed: 5 days ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch

:oarnesto did you want to nominate this for the 158 release notes?

Flags: needinfo?(oarnesto)

:diannaS Sure, what do I need to do on my end?

Flags: needinfo?(oarnesto)

Just change the relnote flag to ? and fill out the comment. I will take care of the rest. (https://wiki.mozilla.org/Release_Management/Release_Notes_Nomination#How_to_nominate_a_bug_for_release_notes_addition?)

Flags: needinfo?(oarnesto)

Release Note Request
[Why is this notable]: Windows users using custom HCM themes were previously unable to customize menu background and menu text colors easily through the OS Settings dialog. Mapping Menu and MenuText to the appropriate value (Window and WindowText) allows this now, as well as brings visual consistency to menus in the chrome.
[Suggested wording]: Menus such as the List all tabs menu, the Settings menu, and Unified Search menu are now visually consistent in Windows HCM. The user is now able to customize menu background color and text color when creating a custom theme in Windows Settings by setting Background and Text, respectively.

relnote-firefox: --- → ?
Flags: needinfo?(oarnesto)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: