mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1103635 - Handle RTL when processing <select> elements for e10s r=mconley
This commit is contained in:
parent
4d77f86aab
commit
e2b02a1638
@ -88,8 +88,11 @@ this.SelectContentHelper.prototype = {
|
||||
|
||||
function buildOptionListForChildren(node) {
|
||||
let result = [];
|
||||
let win = node.ownerDocument.defaultView;
|
||||
|
||||
for (let child of node.children) {
|
||||
let tagName = child.tagName.toUpperCase();
|
||||
|
||||
if (tagName == 'OPTION' || tagName == 'OPTGROUP') {
|
||||
let textContent =
|
||||
tagName == 'OPTGROUP' ? child.getAttribute("label")
|
||||
@ -104,6 +107,9 @@ function buildOptionListForChildren(node) {
|
||||
let info = {
|
||||
tagName: child.tagName,
|
||||
textContent: textContent,
|
||||
// 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"),
|
||||
// XXX this uses a highlight color when this is the selected element.
|
||||
// We need to suppress such highlighting in the content process to get
|
||||
// the option's correct unhighlighted color here.
|
||||
|
@ -77,6 +77,7 @@ function populateChildren(element, options, selectedIndex, startIndex = 0, isGro
|
||||
for (let option of options) {
|
||||
let item = element.ownerDocument.createElement("menuitem");
|
||||
item.setAttribute("label", option.textContent);
|
||||
item.style.direction = option.textDirection;
|
||||
|
||||
element.appendChild(item);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user