Backed out 2 changesets (bug 1728187) for causing reftest failures on backplate-select-001.html. CLOSED TREE

Backed out changeset 3a8197599a5c (bug 1728187)
Backed out changeset d26328903485 (bug 1728187)
This commit is contained in:
Iulian Moraru 2021-09-11 04:08:21 +03:00
Родитель 1121a4ab66
Коммит ebdc13da8f
5 изменённых файлов: 39 добавлений и 32 удалений

Просмотреть файл

@ -1,11 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>reference: a black box to test the prefers-contrast media query</title>
<style>
div {
width: 100px;
height: 100px;
outline: 2px solid black;
}
<title>reference: a black box to test the prefers-contrast media
query</title>
<style type="text/css">
div {
width: 100px;
height: 100px;
outline: 2px solid black;
}
</style>
<div></div>
</head>
<body>
<div></div>
</body>
</html>

Просмотреть файл

@ -49,8 +49,8 @@ pref(browser.display.document_color_use,2) == background-transparent-form-contro
# prefers-contrast media query:
# Forced colors affects prefers-contrast.
== prefers-contrast-001.html prefers-contrast-black-ref.html
# Forced colors doesn't affect prefers-contrast.
!= prefers-contrast-001.html prefers-contrast-black-ref.html
# high should match when an accessibility theme is used
test-pref(ui.windowForeground,"black") test-pref(ui.windowBackground,"white") test-pref(ui.useAccessibilityTheme,1) == prefers-contrast-001.html prefers-contrast-black-ref.html

Просмотреть файл

@ -37,11 +37,11 @@ struct PreferenceSheet {
bool mUseDocumentColors = true;
// Whether the non-native theme should use system colors for widgets.
// We only do that if we are overriding the document colors. Otherwise it
// causes issues when pages only override some of the system colors,
// specially in dark themes mode.
// We only do that if we have a high-contrast theme _and_ we are overriding
// the document colors. Otherwise it causes issues when pages only override
// some of the system colors, specially in dark themes mode.
bool NonNativeThemeShouldUseSystemColors() const {
return !mUseDocumentColors;
return mUseAccessibilityTheme && !mUseDocumentColors;
}
void Load(bool aIsChrome);

Просмотреть файл

@ -257,20 +257,16 @@ StylePrefersColorScheme Gecko_MediaFeatures_PrefersColorScheme(
return aDocument->PrefersColorScheme();
}
// Neither Linux, Windows, nor Mac have a way to indicate that low contrast is
// preferred so we use the presence of an accessibility theme or forced colors
// as a signal.
StylePrefersContrast Gecko_MediaFeatures_PrefersContrast(
const Document* aDocument) {
if (nsContentUtils::ShouldResistFingerprinting(aDocument)) {
return StylePrefersContrast::NoPreference;
}
// Neither Linux, Windows, nor Mac have a way to indicate that low contrast is
// preferred so we use the presence of an accessibility theme as a signal.
if (!!LookAndFeel::GetInt(LookAndFeel::IntID::UseAccessibilityTheme, 0)) {
return StylePrefersContrast::More;
}
if (!PreferenceSheet::PrefsFor(*aDocument).mUseDocumentColors) {
return StylePrefersContrast::More;
}
return StylePrefersContrast::NoPreference;
}

Просмотреть файл

@ -70,6 +70,8 @@ function pushPrefEnvAndWait(args, cb) {
pushPrefEnvAndWait({'set': [['browser.display.document_color_use', 1]]}, part1);
var transparentBackgroundColor;
var inputBackgroundColor, inputColor, inputBorderTopColor;
var inputBorderRightColor, inputBorderLeftColor, inputBorderBottomColor;
function part1()
{
@ -104,7 +106,7 @@ function part1()
isnot(cs5.borderRightColor, cs2.borderRightColor,
"border-inline-end-color applies");
isnot(cs5.borderLeftColor, cs2.borderLeftColor,
"border-inline-start-color applies");
"border-inline-start-color applies");
isnot(cs6.borderRightColor, cs2.borderRightColor,
"border-inline-start-color applies");
isnot(cs6.borderLeftColor, cs2.borderLeftColor,
@ -122,14 +124,15 @@ function part1()
"border-bottom-color applies");
isnot(cs8.borderImageSource, cs9.borderImageSource, "border-image-source applies");
transparentBackgroundColor = cs2.backgroundColor;
inputBackgroundColor = cs4.backgroundColor;
inputColor = cs4.color;
inputBorderTopColor = cs4.borderTopColor;
inputBorderRightColor = cs4.borderRightColor;
inputBorderLeftColor = cs4.borderLeftColor;
inputBorderBottomColor = cs4.borderBottomColor;
pushPrefEnvAndWait({'set': [['browser.display.document_color_use', 2]]}, part2);
}
function systemColor(c) {
let {r, g, b, a} = SpecialPowers.wrap(window).InspectorUtils.colorToRGBA(c, document);
return a != 1 ? `rgba(${r}, ${g}, ${b}, ${a})` : `rgb(${r}, ${g}, ${b})`;
}
function part2()
{
isnot(cs1.backgroundColor, cs2.backgroundColor, "background-color transparency preserved (opaque)");
@ -165,14 +168,14 @@ function part2()
"border-left-color is blocked");
is(cs3.borderBottomColor, cs4.borderBottomColor,
"border-bottom-color is blocked");
is(cs4.backgroundColor, systemColor("ButtonFace"), "background-color not broken on inputs");
is(cs4.color, systemColor("ButtonText"), "color not broken on inputs");
is(cs4.borderTopColor, systemColor("ThreeDLightShadow"), "border-top-color not broken on inputs");
is(cs4.borderRightColor, systemColor("ThreeDLightShadow"),
is(cs4.backgroundColor, inputBackgroundColor, "background-color not broken on inputs");
is(cs4.color, inputColor, "color not broken on inputs");
is(cs4.borderTopColor, inputBorderTopColor, "border-top-color not broken on inputs");
is(cs4.borderRightColor, inputBorderRightColor,
"border-right-color not broken on inputs");
is(cs4.borderLeftColor, systemColor("ThreeDLightShadow"),
is(cs4.borderLeftColor, inputBorderLeftColor,
"border-left-color not broken on inputs");
is(cs4.borderBottomColor, systemColor("ThreeDLightShadow"),
is(cs4.borderBottomColor, inputBorderBottomColor,
"border-bottom-color not broken on inputs");
is(cs8.borderImageSource, cs9.borderImageSource, "border-image-source is blocked");