зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
d6f7757ddb
Коммит
0b7cfe2afa
|
@ -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();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче