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 435602 d67c6dcba478633c56f807da668483c42bf8ca25
parent 435601 11d72a9e3365c9b32e79d8a251c4fc571e29850c
child 435603 6fde51a1e17fefca53ad10ff5e3c4037d1524cf4
push id35078
push usermbrubeck@mozilla.com
push dateTue, 08 Nov 2016 22:02:54 +0000
reviewersjaws
bugs430745
milestone52.0a1
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;
 
 var currentBrowser = null;
 var currentMenulist = null;
 var currentZoom = 1;
 var closedWithEnter = false;
 
@@ -52,17 +55,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);
   },
 
   hide: function(menulist, browser) {
     if (currentBrowser == browser) {
       menulist.menupopup.hidePopup();
     }
   },