Closed Bug 1988635 Opened 2 months ago Closed 20 days ago

Disable theme colors in forced-colors mode

Categories

(Toolkit :: Themes, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
146 Branch
Tracking Status
firefox146 --- fixed

People

(Reporter: jhirsch, Assigned: jhirsch)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [fidefe-profile-management])

Attachments

(1 file)

To disable theming in forced-colors mode, we will remove the theme colors from the list of colors generated by the LightweightThemeManager.

Based on the early WIP by :emilio (https://phabricator.services.mozilla.com/D260879), it looks like the spot to check for forced-colors mode and conditionally not insert theme colors will be LightweightThemeManager._setProperties, here: https://searchfox.org/firefox-main/source/toolkit/modules/LightweightThemeConsumer.sys.mjs#693

We'll want to also add a pref that wraps this change. The pref should be defaulted to true, and wrapped by a Nimbus Variable, so that we can remotely disable it if needed.

Suggested reviewers: emilio and rpl blocking, morgan non-blocking.

Component: Disability Access → Themes
Product: Firefox → Toolkit
Assignee: nobody → jhirsch
Status: NEW → ASSIGNED
Priority: -- → P1

You should be able to add some basic tests for this. You did find browser_forced_colors.js which does the right thing.

I think a test that sets a theme, verifies that the lwtheme attribute is set and so on, then forcing forced-colors with:

  await SpecialPowers.pushPrefEnv({
    set: [["ui.useAccessibilityTheme", 1]],
  });

And confirming that:

  • The web extension state thinks there's a theme, but.
  • The theme is not applied (there's no lwtheme attribute, etc).

Would be at least a decent basic test for this, wdyt?

Flags: needinfo?(jhirsch)

Sounds great, thanks!

Flags: needinfo?(jhirsch)

Hey emilio - Just a quick ni? ping to take a look at the test added to the patch. Feedback welcome 👍

Flags: needinfo?(emilio)

Looks good, thanks!

Flags: needinfo?(emilio)
Status: ASSIGNED → RESOLVED
Closed: 20 days ago
Resolution: --- → FIXED
Target Milestone: --- → 146 Branch
Regressions: 1997275
See Also: → 1997913
QA Whiteboard: [qa-triage-done-c147/b146]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: