mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 14:25:52 +00:00
Bug 1168691 - Preserve the text direction for the select element itself r=mconley
This commit is contained in:
parent
ea1fb17fdc
commit
d9c58c62bb
@ -315,6 +315,7 @@
|
||||
}
|
||||
|
||||
let menulist = document.getElementById(this.getAttribute("selectmenulist"));
|
||||
menulist.menupopup.style.direction = data.direction;
|
||||
this._selectParentHelper.populate(menulist, data.options, data.selectedIndex, this._fullZoom);
|
||||
this._selectParentHelper.open(this, menulist, data.rect);
|
||||
break;
|
||||
|
@ -46,7 +46,8 @@ this.SelectContentHelper.prototype = {
|
||||
this.global.sendAsyncMessage("Forms:ShowDropDown", {
|
||||
rect: rect,
|
||||
options: this._buildOptionList(),
|
||||
selectedIndex: this.element.selectedIndex
|
||||
selectedIndex: this.element.selectedIndex,
|
||||
direction: getComputedDirection(this.element)
|
||||
});
|
||||
},
|
||||
|
||||
@ -87,9 +88,12 @@ this.SelectContentHelper.prototype = {
|
||||
|
||||
}
|
||||
|
||||
function getComputedDirection(element) {
|
||||
return element.ownerDocument.defaultView.getComputedStyle(element).getPropertyValue("direction");
|
||||
}
|
||||
|
||||
function buildOptionListForChildren(node) {
|
||||
let result = [];
|
||||
let win = node.ownerDocument.defaultView;
|
||||
|
||||
for (let child of node.children) {
|
||||
let tagName = child.tagName.toUpperCase();
|
||||
@ -111,7 +115,7 @@ function buildOptionListForChildren(node) {
|
||||
disabled: child.disabled,
|
||||
// We need to do this for every option element as each one can have
|
||||
// an individual style set for direction
|
||||
textDirection: win.getComputedStyle(child).getPropertyValue("direction"),
|
||||
textDirection: getComputedDirection(child),
|
||||
tooltip: child.title,
|
||||
// XXX this uses a highlight color when this is the selected element.
|
||||
// We need to suppress such highlighting in the content process to get
|
||||
|
Loading…
Reference in New Issue
Block a user