Bug 620527 - Prepopulated form data is not selected in Fennec on EVO 4g [r=mfinkle]
authorVivien Nicolas <21@vingtetun.org>
Wed, 22 Dec 2010 18:51:53 +0100
changeset 67155 e505487cc15e9fbb1daf3ca47c5a3bacf7de03e1
parent 67154 60257da121d99f3a3e703aa8e31cd597fd80ce56
child 67156 4ae2982737aacc9921116a6ba7b16bdccee5263e
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs620527
Bug 620527 - Prepopulated form data is not selected in Fennec on EVO 4g [r=mfinkle]
mobile/chrome/content/forms.js
--- a/mobile/chrome/content/forms.js
+++ b/mobile/chrome/content/forms.js
@@ -704,18 +704,25 @@ SelectWrapper.prototype = {
     return aChild instanceof HTMLOptionElement;
   },
 
   isGroup: function(aChild) {
     return aChild instanceof HTMLOptGroupElement;
   },
 
   select: function(aIndex, aSelected, aClearAll) {
-    let selectElement = this._control.QueryInterface(Ci.nsISelectElement);
-    selectElement.setOptionsSelectedByIndex(aIndex, aIndex, aSelected, aClearAll, false, true);
+    let options = this._control.options;
+    options[aIndex].selected = aSelected;
+
+    if (aClearAll) {
+      for (let i = 0; i < options.length; i++) {
+        if (i != aIndex)
+          options.item(i).selected = false;
+      }
+    }
   },
 
   fireOnChange: function() {
     let control = this._control;
     let evt = this._control.ownerDocument.createEvent("Events");
     evt.initEvent("change", true, true, this._control.ownerDocument.defaultView, 0,
                   false, false,
                   false, false, null);