Bug 1790780 - The options of a select do not honor text-transform. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D173607
This commit is contained in:
Lata 2023-03-27 21:46:02 +00:00
parent dbae17218c
commit 10c75a682c
4 changed files with 45 additions and 0 deletions

View File

@ -14,5 +14,8 @@ skip-if = os == "linux" # Bug 1329991 - test fails intermittently on Linux build
[browser_selectpopup_dir.js]
[browser_selectpopup_large.js]
[browser_selectpopup_searchfocus.js]
[browser_selectpopup_text_transform.js]
[browser_selectpopup_user_input.js]
[browser_selectpopup_width.js]

View File

@ -0,0 +1,40 @@
const PAGE = `
<!doctype html>
<select style="text-transform: uppercase">
<option>abc</option>
<option>defg</option>
</select>
`;
add_task(async function() {
await SpecialPowers.pushPrefEnv({
set: [["dom.forms.select.customstyling", true]],
});
const url = "data:text/html," + encodeURI(PAGE);
await BrowserTestUtils.withNewTab(
{
gBrowser,
url,
},
async function(browser) {
let popup = await openSelectPopup("click");
let menuitems = popup.querySelectorAll("menuitem");
is(menuitems[0].textContent, "abc", "Option text should be lowercase");
is(menuitems[1].textContent, "defg", "Option text should be lowercase");
let optionStyle = getComputedStyle(menuitems[0]);
is(
optionStyle.textTransform,
"uppercase",
"Option text should be transformed to uppercase"
);
optionStyle = getComputedStyle(menuitems[1]);
is(
optionStyle.textTransform,
"uppercase",
"Option text should be transformed to uppercase"
);
}
);
});

View File

@ -22,6 +22,7 @@ const SUPPORTED_OPTION_OPTGROUP_PROPERTIES = [
"color",
"background-color",
"text-shadow",
"text-transform",
"font-family",
"font-weight",
"font-size",

View File

@ -42,6 +42,7 @@ const SUPPORTED_OPTION_OPTGROUP_PROPERTIES = [
"color",
"background-color",
"text-shadow",
"text-transform",
"font-family",
"font-weight",
"font-size",