Bug 864891 - b2g/chrome/content/forms.js can dispatch a 'change' event on the wrong window in a single process build. r=fabrice
☠☠ backed out by 6cb5eeb57318 ☠ ☠
authorVivien Nicolas <21@vingtetun.org>
Fri, 26 Apr 2013 12:17:25 +0200
changeset 140990 8d69a81abff9f5d3eec4077251a2c9242c4c1e6f
parent 140989 17b205981e76e2c6993d42b343cbc4cc76ea6ff3
child 140991 556eb3bb629852bbb3834adce7fac927e9ca77eb
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice
bugs864891
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 864891 - b2g/chrome/content/forms.js can dispatch a 'change' event on the wrong window in a single process build. r=fabrice
b2g/chrome/content/forms.js
--- a/b2g/chrome/content/forms.js
+++ b/b2g/chrome/content/forms.js
@@ -346,17 +346,17 @@ let FormAssistant = {
       return;
     }
 
     let json = msg.json;
     switch (msg.name) {
       case "Forms:Input:Value": {
         target.value = json.value;
 
-        let event = content.document.createEvent('HTMLEvents');
+        let event = target.ownerDocument.createEvent('HTMLEvents');
         event.initEvent('input', true, false);
         target.dispatchEvent(event);
         break;
       }
 
       case "Forms:Select:Choice":
         let options = target.options;
         let valueChanged = false;
@@ -372,17 +372,17 @@ let FormAssistant = {
               options.item(i).selected = newValue;
               valueChanged = true;
             }
           }
         }
 
         // only fire onchange event if any selected option is changed
         if (valueChanged) {
-          let event = content.document.createEvent('HTMLEvents');
+          let event = target.ownerDocument.createEvent('HTMLEvents');
           event.initEvent('change', true, true);
           target.dispatchEvent(event);
         }
         break;
 
       case "Forms:Select:Blur": {
         this.setFocusedElement(null);
         break;