Bug 250817 nsWidgetStateManager assumes first element returned by getElementsByAttribute is its child

Toolkit version p=me+other, r=mconnor
This commit is contained in:
bugzilla%arlen.demon.co.uk 2004-08-26 22:30:36 +00:00
parent f55cf75a68
commit a58c184dbf
2 changed files with 17 additions and 4 deletions

View File

@ -260,7 +260,7 @@ nsWidgetStateManager.prototype =
var element = gCurrentWindow.document.getElementById(aElementID);
wsm.generic_Set(element, aDataObject);
if ("value" in aDataObject)
element.selectedItem = element.getElementsByAttribute("value", aDataObject.value)[0];
element.value = aDataObject.value;
if ("disabled" in aDataObject)
element.disabled = aDataObject.disabled;
},

View File

@ -20,8 +20,21 @@
</getter>
</property>
<property name="value" onset="this.setAttribute('value',val); return val;"
onget="return this.getAttribute('value');"/>
<property name="value" onget="return this.getAttribute('value');">
<setter>
<![CDATA[
this.setAttribute("value", val);
var children = this._getRadioChildren();
for (var i = 0; i < children.length; i++) {
if (children[i].value == val) {
this.selectedItem = children[i];
break;
}
}
return val;
]]>
</setter>
</property>
<property name="disabled">
<getter>
<![CDATA[
@ -89,7 +102,7 @@
alreadySelected = val.getAttribute("selected") == "true";
val.setAttribute("focused", focused);
val.setAttribute("selected", "true");
this.value = val.value;
this.setAttribute("value", val.value);
}
// uncheck all other group nodes