mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-18 14:56:07 +00:00
Bug 1121272 - Only traverse child elements when traversing the <select> tree r=mconley
This commit is contained in:
parent
2197b8f49e
commit
0fa824f57d
@ -88,11 +88,12 @@ this.SelectContentHelper.prototype = {
|
||||
|
||||
function buildOptionListForChildren(node) {
|
||||
let result = [];
|
||||
for (let child = node.firstChild; child; child = child.nextSibling) {
|
||||
if (child.tagName == 'OPTION' || child.tagName == 'OPTGROUP') {
|
||||
for (let child of node.children) {
|
||||
let tagName = child.tagName.toUpperCase();
|
||||
if (tagName == 'OPTION' || tagName == 'OPTGROUP') {
|
||||
let textContent =
|
||||
child.tagName == 'OPTGROUP' ? child.getAttribute("label")
|
||||
: child.textContent;
|
||||
tagName == 'OPTGROUP' ? child.getAttribute("label")
|
||||
: child.textContent;
|
||||
|
||||
if (textContent != null) {
|
||||
textContent = textContent.trim();
|
||||
@ -110,7 +111,7 @@ function buildOptionListForChildren(node) {
|
||||
// color does not override color: menutext in the parent.
|
||||
// backgroundColor: computedStyle.backgroundColor,
|
||||
// color: computedStyle.color,
|
||||
children: child.tagName == 'OPTGROUP' ? buildOptionListForChildren(child) : []
|
||||
children: tagName == 'OPTGROUP' ? buildOptionListForChildren(child) : []
|
||||
};
|
||||
result.push(info);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user