Bug 1733413 - Force light color-scheme for non-native-theme docs for now. r=mstange

In the future we need to remove this patch, implement dark form
controls, and probably make those tests pass some other way (like
forcing the chrome color-scheme to match content for those tests or
something). Otherwise they are really expected to fail on a Firefox dark
theme.

But this is a somewhat-easy fix for now.

Differential Revision: https://phabricator.services.mozilla.com/D127473
This commit is contained in:
Emilio Cobos Álvarez 2021-10-04 18:39:37 +00:00
parent 80c02069eb
commit 046514dd62

View File

@ -1072,6 +1072,12 @@ LookAndFeel::ColorScheme LookAndFeel::ColorSchemeForChrome() {
static LookAndFeel::ColorScheme ColorSchemeForDocument(
const dom::Document& aDoc, bool aContentSupportsDark) {
if (aDoc.ShouldAvoidNativeTheme()) {
// The non-native theme doesn't know how to draw dark form controls yet, so
// let's force light colors for now.
return LookAndFeel::ColorScheme::Light;
}
if (nsContentUtils::IsChromeDoc(&aDoc)) {
return LookAndFeel::ColorSchemeForChrome();
}