Bug 1735800 - Undo the workaround from bug 1733413 (and simplify relevant tests). r=mstange

We know how to paint dark stuff now. Change the tests so that we use a
light color-scheme on chrome documents that we compare against content
documents, and simplify some code now that the non-native theme is
everywhere.

Differential Revision: https://phabricator.services.mozilla.com/D128485
This commit is contained in:
Emilio Cobos Álvarez 2021-10-14 17:13:15 +00:00
Родитель d6f7757ddb
Коммит 0b7cfe2afa
5 изменённых файлов: 26 добавлений и 46 удалений

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

@ -7,28 +7,15 @@ div.input-color-swatch {
box-sizing: border-box;
border: 1px solid grey;
display: block;
background-color:#000000; /* default color for input type color */
background-color: #000000; /* default color for input type color */
height: 20px; /* for a real ::-moz-color-swatch, its 100% height computes to
the widget-supplied min-height (32px) minus padding
(4px each side) minus border (2px each side) */
}
button.input-color {
width: 64px;
height: 23px;
}
@supports -moz-bool-pref("widget.non-native-theme.enabled") {
/* The non-native theme has different widget-supplied padding values
* for <input type="color"> and <button> -- `4px 4px 4px 4px` for the
* former, and `1px 4px 1px 4px` for the latter. So we size the
* references elements a bit differently to account for this.
*/
button.input-color {
min-height: 32px; /* widget-supplied min-height */
padding: 4px; /* widget-supplied padding */
}
div.input-color-swatch {
height: 20px; /* for a real ::-moz-color-swatch, its 100% height computes to
the widget-supplied min-height (32px) minus padding
(4px each side) minus border (2px each side) */
}
min-height: 32px; /* widget-supplied min-height */
padding: 4px; /* widget-supplied padding */
}

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

@ -1,3 +1,5 @@
:root { color-scheme: light }
vbox, hbox {
margin-top: 8px;
margin-left: 8px;

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

@ -2,6 +2,8 @@
<meta charset=utf-8>
<title>Test for logical properties of button in the UA stylesheet</title>
<style>
:root { color-scheme: light }
.v-rl { writing-mode: vertical-rl; }
.ltr, .rtl, .v-rl { border: 1px solid blue; }
.a { -moz-appearance: none; }
@ -18,20 +20,17 @@
padding: 8px 1px;
}
@supports -moz-bool-pref("widget.non-native-theme.enabled") {
.ltr button,
.rtl button,
.ltr input[type="button"],
.rtl input[type="button"] {
padding: 1px 4px;
}
.v-rl button,
.v-rl input[type="button"] {
padding: 4px 1px;
}
.ltr button,
.rtl button,
.ltr input[type="button"],
.rtl input[type="button"] {
padding: 1px 4px;
}
.v-rl button,
.v-rl input[type="button"] {
padding: 4px 1px;
}
</style>
<div class=ltr>
<button>one</button><br>

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

@ -2,27 +2,25 @@
<meta charset=utf-8>
<title>Test for logical properties of input type=color in the UA stylesheet</title>
<style>
:root { color-scheme: light }
.v-rl { writing-mode: vertical-rl; }
.ltr, .rtl, .v-rl { border: 1px solid blue; }
.a { -moz-appearance: none; }
.a { appearance: none; }
input[type=color] {
padding: 4px;
}
.ltr input[type="color"],
.rtl input[type="color"] {
width: 64px;
height: 23px;
padding: 1px 8px;
}
.v-rl input[type="color"] {
height: 64px;
width: 23px;
padding: 8px 1px;
}
@supports -moz-bool-pref("widget.non-native-theme.enabled") {
:is(.ltr, .rtl, .v-rl) input[type="color"] {
padding: 4px;
}
}
</style>
<div class=ltr>

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

@ -1080,12 +1080,6 @@ 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();
}