Bug 1394491 - Don't override menucaption background for content selects. r=mconley

So that they use the select background color by default. The code in
SelectParent expects this when figuring out whether to set background colors
too. This matches other browsers and MacOS, see:

  data:text/html,<select style="background: red"><optgroup label="foo"><option>Bar</option><option>Baz</option></optgroup></select>

Differential Revision: https://phabricator.services.mozilla.com/D95690
This commit is contained in:
Emilio Cobos Alvarez 2020-11-03 17:56:23 +00:00
Родитель 229fe39c18
Коммит 6e81f21951
2 изменённых файлов: 2 добавлений и 11 удалений

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

@ -70,7 +70,7 @@ const TRANSLUCENT_SELECT_APPLIES_ON_BASE_COLOR =
const DISABLED_OPTGROUP_AND_OPTIONS =
"<html><head>" +
"<body><select id='one'>" +
' <optgroup label=\'{"color": "rgb(0, 0, 0)", "backgroundColor": "buttonface"}\'>' +
' <optgroup label=\'{"color": "rgb(0, 0, 0)", "backgroundColor": "rgba(0, 0, 0, 0)"}\'>' +
' <option disabled="">{"color": "GrayText", "backgroundColor": "rgba(0, 0, 0, 0)"}</option>' +
' <option>{"color": "rgb(0, 0, 0)", "backgroundColor": "rgba(0, 0, 0, 0)"}</option>' +
' <option disabled="">{"color": "GrayText", "backgroundColor": "rgba(0, 0, 0, 0)"}</option>' +
@ -79,7 +79,7 @@ const DISABLED_OPTGROUP_AND_OPTIONS =
' <option>{"color": "rgb(0, 0, 0)", "backgroundColor": "rgba(0, 0, 0, 0)"}</option>' +
' <option>{"color": "rgb(0, 0, 0)", "backgroundColor": "rgba(0, 0, 0, 0)"}</option>' +
" </optgroup>" +
' <optgroup label=\'{"color": "GrayText", "backgroundColor": "buttonface"}\' disabled=\'\'>' +
' <optgroup label=\'{"color": "GrayText", "backgroundColor": "rgba(0, 0, 0, 0)"}\' disabled=\'\'>' +
' <option>{"color": "GrayText", "backgroundColor": "rgba(0, 0, 0, 0)"}</option>' +
' <option>{"color": "GrayText", "backgroundColor": "rgba(0, 0, 0, 0)"}</option>' +
' <option>{"color": "GrayText", "backgroundColor": "rgba(0, 0, 0, 0)"}</option>' +
@ -447,11 +447,6 @@ add_task(async function test_translucent_select_applies_on_base_color() {
});
add_task(async function test_disabled_optgroup_and_options() {
// The colors used by this test are platform-specific.
if (AppConstants.platform != "win") {
return;
}
await testSelectColors(DISABLED_OPTGROUP_AND_OPTIONS, 17, {
skipSelectColorTest: true,
});

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

@ -875,10 +875,6 @@ panel[touchmode] .PanelUI-subView #appMenu-zoom-controls > .subviewbutton-iconic
background-color: unset;
}
#ContentSelectDropdown > menupopup > menucaption {
background-color: buttonface;
}
#ContentSelectDropdown > menupopup > menucaption[disabled="true"] {
color: GrayText;
}