$debug("Defining HTMLSelectElement");
/*
* HTMLSelectElement - DOM Level 2
*/
var HTMLSelectElement = function(ownerDocument) {
this.HTMLTypeValueInputs = HTMLTypeValueInputs;
this.HTMLTypeValueInputs(ownerDocument);
this._oldIndex = -1;
};
HTMLSelectElement.prototype = new HTMLTypeValueInputs;
__extend__(HTMLSelectElement.prototype, inputElements_dataProperties);
__extend__(HTMLButtonElement.prototype, inputElements_size);
__extend__(HTMLSelectElement.prototype, inputElements_onchange);
__extend__(HTMLSelectElement.prototype, inputElements_focusEvents);
__extend__(HTMLSelectElement.prototype, {
setAttributeNS : function(namespaceURI, qualifiedName, value) {
if (namespaceURI) {
throw new Error("unexpected namespaceURI");
}
this.setAttribute(qualifiedName, value);
},
getAttributeNS : function(namespaceURI, qualifiedName) {
if (namespaceURI) {
throw new Error("unexpected namespaceURI");
}
return this.getAttribute(qualifiedName);
},
setAttribute: function(name, value){
if (name === "type") {
throw new Error("cannot set readonly attribute: "+name);
} else if (name === "multiple") {
HTMLInputCommon.prototype.
setAttribute.call(this, "type", value ? "select-multiple" : "select-one");
HTMLInputCommon.prototype.setAttribute.call(this, "multiple", !!value);
} else if (name === "value") {
var options = this.options,
i, index;
for (i=0; i