зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1720012: Respect system colors checkbox independent of HCM r=emilio
Previously, we only respected the user's system colors preference in the case that a user (a) was not using a high contrast theme or (b) was using the high contrast theme supplied by firefox (FF-HCM). Any OS-level HCM forced system colors and rendered the checkbox non-functional. We also previously computed visited link color via foreground/background composition, but this is only necessary on Windows HCM where the theme fails to specify a visited link color. Differential Revision: https://phabricator.services.mozilla.com/D119814
This commit is contained in:
Родитель
72570f3a98
Коммит
d2e0092207
|
@ -89,13 +89,18 @@ void PreferenceSheet::Prefs::Load(bool aIsChrome) {
|
|||
mUseAccessibilityTheme = UseAccessibilityTheme(aIsChrome);
|
||||
|
||||
const bool useStandins = nsContentUtils::UseStandinsForNativeColors();
|
||||
// Users should be able to choose to use system colors or preferred colors
|
||||
// when HCM is disabled, and in both OS-level HCM and FF-level HCM.
|
||||
// To make this possible, we don't consider UseDocumentColors and
|
||||
// mUseAccessibilityTheme when computing the following bool.
|
||||
const bool usePrefColors = !useStandins && !aIsChrome &&
|
||||
!mUseAccessibilityTheme &&
|
||||
!StaticPrefs::browser_display_use_system_colors();
|
||||
if (usePrefColors) {
|
||||
GetColor("browser.display.background_color", mColors.mDefaultBackground);
|
||||
GetColor("browser.display.foreground_color", mColors.mDefault);
|
||||
GetColor("browser.anchor_color", mColors.mLink);
|
||||
GetColor("browser.active_color", mColors.mActiveLink);
|
||||
GetColor("browser.visited_color", mColors.mVisitedLink);
|
||||
} else {
|
||||
using ColorID = LookAndFeel::ColorID;
|
||||
const auto standins = LookAndFeel::UseStandins(useStandins);
|
||||
|
@ -131,13 +136,10 @@ void PreferenceSheet::Prefs::Load(bool aIsChrome) {
|
|||
} else {
|
||||
// Otherwise we keep the default visited link color
|
||||
}
|
||||
}
|
||||
|
||||
if (mUseAccessibilityTheme && !useStandins) {
|
||||
mColors.mActiveLink = mColors.mLink;
|
||||
} else {
|
||||
GetColor("browser.active_color", mColors.mActiveLink);
|
||||
GetColor("browser.visited_color", mColors.mVisitedLink);
|
||||
if (mUseAccessibilityTheme) {
|
||||
mColors.mActiveLink = mColors.mLink;
|
||||
}
|
||||
}
|
||||
|
||||
GetColor("browser.display.focus_text_color", mColors.mFocusText);
|
||||
|
|
Загрузка…
Ссылка в новой задаче