commit 1a0acdc99667ef32a8d466a7a3dd72dd15540c8f
parent 79faa1417a713f6b7179841da0208306319229c0
Author: Emilio Cobos Álvarez <emilio@crisal.io>
Date: Tue, 16 Dec 2025 19:42:15 +0000
Bug 2004762 - Don't use UA style for transparent custom-styled select background. r=mconley
Nowadays we don't override the system background and just paint on top,
via a linear-gradient. So given we also have code to detect dark
backgrounds and so on, I think this would be fine.
Differential Revision: https://phabricator.services.mozilla.com/D276233
Diffstat:
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/browser/base/content/test/forms/browser_selectpopup_colors.js b/browser/base/content/test/forms/browser_selectpopup_colors.js
@@ -32,7 +32,7 @@ const gSelects = {
" #one { background-color: transparent; }" +
"</style>" +
"<body><select id='one'>" +
- ' <option value="One">{"unstyled": "true"}</option>' +
+ ' <option value="One">{"color": "-moz-ComboboxText", "backgroundColor": "rgba(0, 0, 0, 0)"}</option>' +
' <option value="Two" selected="true">{"end": "true"}</option>' +
"</select></body></html>",
@@ -500,7 +500,6 @@ add_task(async function test_colors_applied_to_popup() {
// This test checks when a <select> element has a transparent background applied to itself.
add_task(async function test_transparent_applied_to_popup() {
let options = {
- unstyled: true,
skipSelectColorTest: true,
};
await testSelectColors("TRANSPARENT_SELECT", 2, options);
diff --git a/toolkit/actors/SelectParent.sys.mjs b/toolkit/actors/SelectParent.sys.mjs
@@ -117,10 +117,6 @@ export var SelectParentHelper = {
selectStyle = uaStyle;
}
- if (selectStyle["background-color"] == "rgba(0, 0, 0, 0)") {
- selectStyle["background-color"] = uaStyle["background-color"];
- }
-
if (selectStyle.color == selectStyle["background-color"]) {
selectStyle.color = uaStyle.color;
}