Bug 430745 - Select dropdown popups will anchor on a selected element for Mac r=jaws
authorbeachjar <beachjar@msu.edu>
Mon, 07 Nov 2016 16:19:19 -0500
changeset 368762 875479c06e72908802af7fcec654eceb3012d468
parent 368761 2824acfb199277acc6e130ab66a07801c8aa10ca
child 368763 a6a09538a5949f39bfc06b5929ed6348a93fbfbc
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs430745
milestone53.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 430745 - Select dropdown popups will anchor on a selected element for Mac r=jaws Select dropdown popups now anchor on the currently selected element in a <select> dropdown for Mac instead of above/below the <select> dropdown. MozReview-Commit-ID: JlgrZdArehq
toolkit/modules/SelectParentHelper.jsm
--- a/toolkit/modules/SelectParentHelper.jsm
+++ b/toolkit/modules/SelectParentHelper.jsm
@@ -3,16 +3,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = [
   "SelectParentHelper"
 ];
 
+const {utils: Cu} = Components;
+const {AppConstants} = Cu.import("resource://gre/modules/AppConstants.jsm");
+
 // Maximum number of rows to display in the select dropdown.
 const MAX_ROWS = 20;
 
 // Interval between autoscrolls
 const AUTOSCROLL_INTERVAL = 25;
 
 var currentBrowser = null;
 var currentMenulist = null;
@@ -58,17 +61,17 @@ this.SelectParentHelper = {
 
     menupopup.classList.toggle("isOpenedViaTouch", isOpenedViaTouch);
 
     let constraintRect = browser.getBoundingClientRect();
     constraintRect = new win.DOMRect(constraintRect.left + win.mozInnerScreenX,
                                      constraintRect.top + win.mozInnerScreenY,
                                      constraintRect.width, constraintRect.height);
     menupopup.setConstraintRect(constraintRect);
-    menupopup.openPopupAtScreenRect("after_start", rect.left, rect.top, rect.width, rect.height, false, false);
+    menupopup.openPopupAtScreenRect(AppConstants.platform == "macosx" ? "selection" : "after_start", rect.left, rect.top, rect.width, rect.height, false, false);
 
     // Set up for dragging
     menupopup.setCaptureAlways();
     this.draggedOverPopup = false;
     menupopup.addEventListener("mousemove", this);
   },
 
   hide: function(menulist, browser) {