Restrict automatic enabling of the dark theme (when in dark mode) to macOS 10.14 and above

RESOLVED FIXED in Firefox 62

Status

()

defect
P1
major
RESOLVED FIXED
Last year
Last year

People

(Reporter: spohl, Assigned: spohl)

Tracking

Trunk
mozilla63
Unspecified
macOS
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox62+ fixed, firefox63 fixed)

Details

Attachments

(3 attachments)

Apple repurposed a previously existing key ("AppleInterfaceStyle") for dark mode on 10.14 that we're observing and using to switch to the dark theme. We should make sure to restrict this to macOS 10.14 and above.
Component: Theme → Widget: Cocoa
Product: Firefox → Core
This adds nsCocoaFeatures::OnMojaveOrLater() and refactors nsCocoaFeatures to keep version-specific methods grouped together.
Attachment #8988608 - Flags: review?(haftandilian)
Only set the dark theme on 10.14+.
Attachment #8988610 - Flags: review?(haftandilian)
Attachment #8988608 - Flags: review?(haftandilian) → review+
Comment on attachment 8988610 [details] [diff] [review]
Only set dark theme on 10.14+

LGTM, but was surprised we don't need to check the value associated with the key (not part of this patch).
Attachment #8988610 - Flags: review?(haftandilian) → review+
Thanks for the reviews!

(In reply to Haik Aftandilian [:haik] from comment #3)
> Comment on attachment 8988610 [details] [diff] [review]
> Only set dark theme on 10.14+
> 
> LGTM, but was surprised we don't need to check the value associated with the
> key (not part of this patch).

The value is only ever non-null when the OS is in dark mode. Should Apple introduce additional modes in the future, we will have to be more diligent here. But even if new modes are introduced they are only expected to roll out with major macOS releases and we should have enough lead time with beta builds to respond in time.
https://hg.mozilla.org/integration/mozilla-inbound/rev/0968fa15c1319d481398f8c54996b2b3b77e0ee6
Bug 1471950: Add nsCocoaFeatures::OnMojaveOrLater(). r=haik

https://hg.mozilla.org/integration/mozilla-inbound/rev/c30383f7cf2b6211e75f3f8a34b6294dbab54711
Bug 1471950: Restrict to 10.14 and above the automatic enabling of the dark theme when the system appearance changes to dark mode. r=haik
https://hg.mozilla.org/mozilla-central/rev/0968fa15c131
https://hg.mozilla.org/mozilla-central/rev/c30383f7cf2b
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Blocks: 1466335
No longer depends on: 1466335
Approval Request Comment
[Feature/Bug causing the regression]: New OS feature introduced in macOS 10.14 (Mojave)
[User impact if declined]: This patch ensures that the automatic switching of themes, introduced in bug 1466335, is restricted to macOS 10.14 and above.
[Is this code covered by automated tests?]: Our themes are covered by tests, but the automatic switching of themes introduced in this patch is not.
[Has the fix been verified in Nightly?]: Yes
[Needs manual test from QE? If yes, steps to reproduce]: No
[List of other uplifts needed for the feature/fix]: Bug 1466335
[Is the change risky?]: No
[Why is the change risky/not risky?]: Although we touch some cross-platform code related to our themes in bug 1466335, this particular patch only restricts the changes to macOS 10.14.
[String changes made/needed]: none
Attachment #8988765 - Flags: review+
Attachment #8988765 - Flags: approval-mozilla-beta?
Comment on attachment 8988765 [details] [diff] [review]
Combined patch for beta

Seems prudent to get this coverage for the upcoming MacOS into 62. We should uplift this for beta 6.
Attachment #8988765 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.