зеркало из https://github.com/mozilla/gecko-dev.git
Fixed not checking for child nodes in menulist constructor, b=103310, r=brade, sr=sfraser
This commit is contained in:
Родитель
153d61338a
Коммит
60867fd4da
|
@ -47,20 +47,22 @@
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
this.setAttribute('sizetopopup', 'true');
|
this.setAttribute('sizetopopup', 'true');
|
||||||
|
|
||||||
// if there was a previously selected item, be sure to set our internal
|
if (this.childNodes.length) {
|
||||||
// selection memory to that item so we can un-set it properly later on
|
// if there was a previously selected item, be sure to set our internal
|
||||||
var arr = this.firstChild.getElementsByAttribute('selected', 'true');
|
// selection memory to that item so we can un-set it properly later on
|
||||||
if (arr.length)
|
var arr = this.firstChild.getElementsByAttribute('selected', 'true');
|
||||||
this.selectedInternal = arr[0];
|
|
||||||
|
|
||||||
if (!this.label && this.childNodes.length) {
|
|
||||||
if (!arr.length && this.value)
|
|
||||||
arr = this.firstChild.getElementsByAttribute('value', this.value);
|
|
||||||
|
|
||||||
if (arr.length)
|
if (arr.length)
|
||||||
this.selectedItem = arr[0];
|
this.selectedInternal = arr[0];
|
||||||
else
|
|
||||||
this.selectedIndex = 0;
|
if (!this.label && this.childNodes.length) {
|
||||||
|
if (!arr.length && this.value)
|
||||||
|
arr = this.firstChild.getElementsByAttribute('value', this.value);
|
||||||
|
|
||||||
|
if (arr.length)
|
||||||
|
this.selectedItem = arr[0];
|
||||||
|
else
|
||||||
|
this.selectedIndex = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]]>
|
]]>
|
||||||
</body>
|
</body>
|
||||||
|
@ -186,7 +188,6 @@
|
||||||
// to automatically select the inputField.value in the list
|
// to automatically select the inputField.value in the list
|
||||||
if (!this.getAttribute("autoSelectMenuitem"))
|
if (!this.getAttribute("autoSelectMenuitem"))
|
||||||
this.setAttribute("autoSelectMenuitem", "true");
|
this.setAttribute("autoSelectMenuitem", "true");
|
||||||
|
|
||||||
]]></constructor>
|
]]></constructor>
|
||||||
|
|
||||||
<method name="_selectInputFieldValueInList">
|
<method name="_selectInputFieldValueInList">
|
||||||
|
|
Загрузка…
Ссылка в новой задаче