зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1702756 - Move some hardcoded colors out of native code. r=mstange
No reason that code needs to be there. The findbar modal highlight stuff is not being worked on and it was unclear to me why it needed a fission check, so I removed that special case. The findbar code can customize the colors with Selection.setColors anyways, which is a better fix. Depends on D110673 Differential Revision: https://phabricator.services.mozilla.com/D110674
This commit is contained in:
Родитель
883276f35f
Коммит
9e4fe964d6
|
@ -691,6 +691,21 @@ pref("accessibility.browsewithcaret_shortcut.enabled", true);
|
|||
pref("ui.scrollToClick", 0);
|
||||
#endif
|
||||
|
||||
// These are some selection-related colors which have no per platform
|
||||
// implementation.
|
||||
#if !defined(XP_MACOSX)
|
||||
pref("ui.textSelectBackgroundDisabled", "#b0b0b0");
|
||||
#endif
|
||||
// This makes the selection stand out when typeaheadfind is on.
|
||||
// Used with nsISelectionController::SELECTION_ATTENTION
|
||||
pref("ui.textSelectBackgroundAttention", "#38d878");
|
||||
// This makes the matched text stand out when findbar highlighting is on.
|
||||
// Used with nsISelectionController::SELECTION_FIND
|
||||
pref("ui.textHighlightBackground", "#ef0fff");
|
||||
// The foreground color for the matched text in findbar highlighting
|
||||
// Used with nsISelectionController::SELECTION_FIND
|
||||
pref("ui.textHighlightForeground", "#ffffff");
|
||||
|
||||
// We want the ability to forcibly disable platform a11y, because
|
||||
// some non-a11y-related components attempt to bring it up. See bug
|
||||
// 538530 for details about Windows; we have a pref here that allows it
|
||||
|
|
|
@ -789,42 +789,6 @@ nsresult nsXPLookAndFeel::GetColorValue(ColorID aID,
|
|||
}
|
||||
}
|
||||
|
||||
// There are no system color settings for these, so set them manually
|
||||
#ifndef XP_MACOSX
|
||||
if (aID == ColorID::TextSelectBackgroundDisabled) {
|
||||
// This is used to gray out the selection when it's not focused
|
||||
// Used with nsISelectionController::SELECTION_DISABLED
|
||||
aResult = NS_RGB(0xb0, 0xb0, 0xb0);
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (aID == ColorID::TextSelectBackgroundAttention) {
|
||||
if (StaticPrefs::findbar_modalHighlight() && !mozilla::FissionAutostart()) {
|
||||
aResult = NS_RGBA(0, 0, 0, 0);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// This makes the selection stand out when typeaheadfind is on
|
||||
// Used with nsISelectionController::SELECTION_ATTENTION
|
||||
aResult = NS_RGB(0x38, 0xd8, 0x78);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aID == ColorID::TextHighlightBackground) {
|
||||
// This makes the matched text stand out when findbar highlighting is on
|
||||
// Used with nsISelectionController::SELECTION_FIND
|
||||
aResult = NS_RGB(0xef, 0x0f, 0xff);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aID == ColorID::TextHighlightForeground) {
|
||||
// The foreground color for the matched text in findbar highlighting
|
||||
// Used with nsISelectionController::SELECTION_FIND
|
||||
aResult = NS_RGB(0xff, 0xff, 0xff);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aUseStandinsForNativeColors) {
|
||||
aResult = GetStandinForNativeColor(aID);
|
||||
return NS_OK;
|
||||
|
|
Загрузка…
Ссылка в новой задаче