Bug 937377 - [e10s] Selecting an item in a <select> should trigger onChange (r=felipe)
authorBill McCloskey <wmccloskey@mozilla.com>
Tue, 10 Dec 2013 13:46:21 -0800
changeset 159802 0af44c4131fb538d6bea82f40c193e668956e673
parent 159801 f9149f2fc278284e1d6279bf379f26a6ba6bde58
child 159803 70e76314c8a7ee99ee8666c3a5aacb662ee4fe49
push idunknown
push userunknown
push dateunknown
reviewersfelipe
bugs937377
milestone29.0a1
Bug 937377 - [e10s] Selecting an item in a <select> should trigger onChange (r=felipe)
toolkit/modules/SelectContentHelper.jsm
--- a/toolkit/modules/SelectContentHelper.jsm
+++ b/toolkit/modules/SelectContentHelper.jsm
@@ -69,17 +69,23 @@ this.SelectContentHelper.prototype = {
 
   _buildOptionList: function() {
     return buildOptionListForChildren(this.element);
   },
 
   receiveMessage: function(message) {
     switch (message.name) {
       case "Forms:SelectDropDownItem":
-        this.element.selectedIndex = message.data.value;
+        if (this.element.selectedIndex != message.data.value) {
+          this.element.selectedIndex = message.data.value;
+
+          let event = this.element.ownerDocument.createEvent("Events");
+          event.initEvent("change", true, true);
+          this.element.dispatchEvent(event);
+        }
 
         //intentional fall-through
       case "Forms:DismissedDropDown":
         this.uninit();
         break;
     }
   },