Bug 1256313, clear active state on select button when releasing the mouse in e10s, r=mconley
authorNeil Deakin <neil@mozilla.com>
Mon, 25 Jul 2016 09:09:11 -0400
changeset 331616 9b361e455e6ab4c37c9368d5b9c914b22997efb7
parent 331615 81fa78eb62f6ff8eb0b392105e43b7122f04df90
child 331617 970ad562913ff0ac4a6027411f3ebf7ddd0b8427
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1256313
milestone50.0a1
Bug 1256313, clear active state on select button when releasing the mouse in e10s, r=mconley
toolkit/modules/SelectContentHelper.jsm
--- a/toolkit/modules/SelectContentHelper.jsm
+++ b/toolkit/modules/SelectContentHelper.jsm
@@ -12,16 +12,17 @@ Cu.import("resource://gre/modules/XPCOMU
 
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
                                   "resource://gre/modules/BrowserUtils.jsm");
 XPCOMUtils.defineLazyServiceGetter(this, "DOMUtils",
                                    "@mozilla.org/inspector/dom-utils;1", "inIDOMUtils");
 XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask",
                                   "resource://gre/modules/DeferredTask.jsm");
 
+const kStateActive = 0x00000001; // NS_EVENT_STATE_ACTIVE
 const kStateHover = 0x00000004; // NS_EVENT_STATE_HOVER
 
 // A process global state for whether or not content thinks
 // that a <select> dropdown is open or not. This is managed
 // entirely within this module, and is read-only accessible
 // via SelectContentHelper.open.
 var gOpen = false;
 
@@ -132,16 +133,19 @@ this.SelectContentHelper.prototype = {
           const MOUSE_EVENTS = ["mousedown", "mouseup", "click"];
           for (let eventName of MOUSE_EVENTS) {
             let mouseEvent = new win.MouseEvent(eventName, {
               view: win,
               bubbles: true,
               cancelable: true,
             });
             this.element.dispatchEvent(mouseEvent);
+            if (eventName == "mouseup") {
+              DOMUtils.removeContentState(this.element, kStateActive);
+            }
           }
         }
 
         this.uninit();
         break;
 
       case "Forms:MouseOver":
         DOMUtils.setContentState(this.element, kStateHover);