Closed Bug 1702879 Opened 4 years ago Closed 4 years ago

Make native theme drawing respect per-window ColorScheme, if widget.macos.respect-system-appearance is true

Categories

(Core :: Widget: Cocoa, defect)

All
macOS
defect

Tracking

()

VERIFIED FIXED
89 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox87 --- unaffected
firefox88 --- unaffected
firefox89 --- verified

People

(Reporter: mstange, Assigned: mstange)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [mac:darkmode][mac:mr1])

Attachments

(6 files)

Attached image screenshot

Steps to reproduce:

  1. Set widget.macos.respect-system-appearance to true.
  2. Set macOS to Light Mode and Firefox to the dark Firefox theme.
  3. Enable high-contrast mode in the system accessibility preferences.
  4. Look at the buttons at the bottom of Firefox toolbar customization.

Expected results:
The controls should have a dark background so that the text on them is readable.

Actual results:
Unreadable controls with white-on-white text.

The problem is that CSS system colors now respect the Firefox theme, but -moz-default-appearance rendering does not. The latter is what I want to fix in this bug.

Keywords: regression
Regressed by: 1700294
Has Regression Range: --- → yes

This also removes the 10.14+ check, so that on 10.12 & 10.13 we always set
currentAppearance to aqua. This preserves RenderWithCoreUI's behavior.

Depends on D110763

Pushed by mstange@themasta.com: https://hg.mozilla.org/integration/autoland/rev/a71a8f085944 Remove GetAppAppearance() and choose the nsNativeThemeCocoa appearance in one place only. r=emilio https://hg.mozilla.org/integration/autoland/rev/e723ea00bd84 Add LookAndFeel::ColorSchemeForDocument so that it can be called from nsNativeThemeCocoa. r=emilio https://hg.mozilla.org/integration/autoland/rev/1ec31daa1ae0 Respect the document's ColorScheme when drawing native themed widgets. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch

Set release status flags based on info from the regressing bug 1700294

Flags: qe-verify+
Attached image contrast macos.png

Tried reproducing the issue but had no luck in doing so. Tried with Firefox 89.0a1 (2021-04-03 and 04-01) with the OS theme set to light, pref widget.macos.respect-system-appearance to true and Firefox theme set to Dark on macOS 10.15.7 (see attachment on how it is for me).

Is there something that needs to be done to reproduce it Markus?

Flags: needinfo?(mstange.moz)

I talked with @csasca and I can reproduce the issue by following STR from comment 0 on macOS 11.3.1 M1 mini with Firefox 89.0a1 (20210403214826).
The issue is verified fixed with Firefox 89.0b10 (20210509185840) on the same platform. The buttons are visible after using STR from comment 0. However, I observed that about pages are no longer readable when verifying this bug. Is this a known issue? Thank you!

(In reply to Catalin Sasca, QA [:csasca] from comment #7)

Tried reproducing the issue but had no luck in doing so. Tried with Firefox 89.0a1 (2021-04-03 and 04-01) with the OS theme set to light, pref widget.macos.respect-system-appearance to true and Firefox theme set to Dark on macOS 10.15.7 (see attachment on how it is for me).

I'm not sure why it wouldn't reproduce on macOS 10.15.7 with the 2021-04-03 build. With the pref set, the text in these buttons should be white, but in your screenshot the text is black.

(In reply to Alexandru Trif, QA [:atrif] from comment #8)

Created attachment 9221106 [details]
I talked with @csasca and I can reproduce the issue by following STR from comment 0 on macOS 11.3.1 M1 mini with Firefox 89.0a1 (20210403214826).
The issue is verified fixed with Firefox 89.0b10 (20210509185840) on the same platform. The buttons are visible after using STR from comment 0.

Ok, good.

However, I observed that about pages are no longer readable when verifying this bug. Is this a known issue? Thank you!

Yes, this is bug 1710164.

Flags: needinfo?(mstange.moz)

Thank you, Markus! Closing this per comments above.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: