зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1791219 - Fix direction of <select>. r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D157576
This commit is contained in:
Родитель
5e854cdaff
Коммит
8855a8d3ac
|
@ -13,4 +13,5 @@ skip-if =
|
||||||
skip-if = os == "linux" # Bug 1329991 - test fails intermittently on Linux builds
|
skip-if = os == "linux" # Bug 1329991 - test fails intermittently on Linux builds
|
||||||
[browser_selectpopup_searchfocus.js]
|
[browser_selectpopup_searchfocus.js]
|
||||||
[browser_selectpopup_width.js]
|
[browser_selectpopup_width.js]
|
||||||
|
[browser_selectpopup_dir.js]
|
||||||
[browser_selectpopup_user_input.js]
|
[browser_selectpopup_user_input.js]
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
const PAGE = `
|
||||||
|
<!doctype html>
|
||||||
|
<select style="direction: rtl">
|
||||||
|
<option>ABC</option>
|
||||||
|
<option>DEFG</option>
|
||||||
|
</select>
|
||||||
|
`;
|
||||||
|
|
||||||
|
add_task(async function() {
|
||||||
|
const url = "data:text/html," + encodeURI(PAGE);
|
||||||
|
await BrowserTestUtils.withNewTab(
|
||||||
|
{
|
||||||
|
gBrowser,
|
||||||
|
url,
|
||||||
|
},
|
||||||
|
async function(browser) {
|
||||||
|
let popupShownPromise = BrowserTestUtils.waitForSelectPopupShown(window);
|
||||||
|
await BrowserTestUtils.synthesizeMouseAtCenter("select", {}, browser);
|
||||||
|
let popup = await popupShownPromise;
|
||||||
|
is(popup.style.direction, "rtl", "Should be the right dir");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
|
@ -113,6 +113,7 @@ var SelectParentHelper = {
|
||||||
|
|
||||||
menupopup.setAttribute("style", "");
|
menupopup.setAttribute("style", "");
|
||||||
menupopup.style.colorScheme = isDarkBackground ? "dark" : "light";
|
menupopup.style.colorScheme = isDarkBackground ? "dark" : "light";
|
||||||
|
menupopup.style.direction = selectStyle.direction;
|
||||||
|
|
||||||
stylesheet = doc.createElementNS("http://www.w3.org/1999/xhtml", "style");
|
stylesheet = doc.createElementNS("http://www.w3.org/1999/xhtml", "style");
|
||||||
stylesheet.setAttribute("id", "ContentSelectDropdownStylesheet");
|
stylesheet.setAttribute("id", "ContentSelectDropdownStylesheet");
|
||||||
|
@ -781,7 +782,6 @@ class SelectParent extends JSWindowActorParent {
|
||||||
let menulist = this._menulist || this._createMenulist();
|
let menulist = this._menulist || this._createMenulist();
|
||||||
|
|
||||||
let data = message.data;
|
let data = message.data;
|
||||||
menulist.menupopup.style.direction = data.style.direction;
|
|
||||||
|
|
||||||
SelectParentHelper.populate(
|
SelectParentHelper.populate(
|
||||||
menulist,
|
menulist,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче