summaryrefslogtreecommitdiffstats
path: root/widget/Theme.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'widget/Theme.cpp')
-rw-r--r--widget/Theme.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/widget/Theme.cpp b/widget/Theme.cpp
index 1fcd3d4bc3..15bf68ec01 100644
--- a/widget/Theme.cpp
+++ b/widget/Theme.cpp
@@ -296,6 +296,9 @@ std::pair<sRGBColor, sRGBColor> Theme::ComputeButtonColors(
bool isHovered = aState.HasState(ElementState::HOVER);
nscolor backgroundColor = [&] {
+ if (aState.HasState(ElementState::AUTOFILL)) {
+ return aColors.SystemNs(StyleSystemColor::MozAutofillBackground);
+ }
if (isDisabled) {
return aColors.SystemNs(StyleSystemColor::MozButtondisabledface);
}
@@ -308,12 +311,6 @@ std::pair<sRGBColor, sRGBColor> Theme::ComputeButtonColors(
return aColors.SystemNs(StyleSystemColor::Buttonface);
}();
- if (aState.HasState(ElementState::AUTOFILL)) {
- backgroundColor = NS_ComposeColors(
- backgroundColor,
- aColors.SystemNs(StyleSystemColor::MozAutofillBackground));
- }
-
const sRGBColor borderColor =
ComputeBorderColor(aState, aColors, OutlineCoversBorder::Yes);
return std::make_pair(sRGBColor::FromABGR(backgroundColor), borderColor);
@@ -323,18 +320,15 @@ std::pair<sRGBColor, sRGBColor> Theme::ComputeTextfieldColors(
const ElementState& aState, const Colors& aColors,
OutlineCoversBorder aOutlineCoversBorder) {
nscolor backgroundColor = [&] {
+ if (aState.HasState(ElementState::AUTOFILL)) {
+ return aColors.SystemNs(StyleSystemColor::MozAutofillBackground);
+ }
if (aState.HasState(ElementState::DISABLED)) {
return aColors.SystemNs(StyleSystemColor::MozDisabledfield);
}
return aColors.SystemNs(StyleSystemColor::Field);
}();
- if (aState.HasState(ElementState::AUTOFILL)) {
- backgroundColor = NS_ComposeColors(
- backgroundColor,
- aColors.SystemNs(StyleSystemColor::MozAutofillBackground));
- }
-
const sRGBColor borderColor =
ComputeBorderColor(aState, aColors, aOutlineCoversBorder);
return std::make_pair(sRGBColor::FromABGR(backgroundColor), borderColor);