Bug 918225 - Right-click drop down options are offset r=mbrubeck,jimm
authorRodrigo Silveira <rsilveira@mozilla.com>
Tue, 22 Oct 2013 17:30:19 -0700
changeset 165582 13132285f1c93178515acdfbf134d69a2fa3bcb0
parent 165581 e0598dfe8de11270a3064d84febb6959d6b1a278
child 165583 f55d3aab80d430970d3062b75a169ffff8734798
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck, jimm
bugs918225
milestone27.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 918225 - Right-click drop down options are offset r=mbrubeck,jimm
browser/metro/base/content/helperui/MenuUI.js
browser/metro/theme/platform.css
widget/nsIWinMetroUtils.idl
widget/windows/winrt/nsWinMetroUtils.cpp
--- a/browser/metro/base/content/helperui/MenuUI.js
+++ b/browser/metro/base/content/helperui/MenuUI.js
@@ -373,23 +373,16 @@ MenuPopup.prototype = {
     }
 
     let width = this._popup.boxObject.width;
     let height = this._popup.boxObject.height;
     let halfWidth = width / 2;
     let screenWidth = ContentAreaObserver.width;
     let screenHeight = ContentAreaObserver.height;
 
-    // Add padding on the side of the menu per the user's hand preference
-    let leftHand =
-          Services.metro.handPreference == Ci.nsIWinMetroUtils.handPreferenceLeft;
-    if (aSource && aSource == Ci.nsIDOMMouseEvent.MOZ_SOURCE_TOUCH) {
-      this.commands.setAttribute("left-hand", leftHand);
-    }
-
     if (aPositionOptions.rightAligned)
       aX -= width;
 
     if (aPositionOptions.bottomAligned)
       aY -= height;
 
     if (aPositionOptions.centerHorizontally)
       aX -= halfWidth;
--- a/browser/metro/theme/platform.css
+++ b/browser/metro/theme/platform.css
@@ -202,21 +202,17 @@ menulist {
   color: black;
 }
 
 .menu-popup richlistitem:not([disabled]):active {
   background-color: black;
   color: white;
 }
 
-.menu-popup > richlistbox[left-hand="true"] > richlistitem {
-  padding-left: 50px;
-}
-
-.menu-popup > richlistbox[left-hand="false"] > richlistitem {
+.menu-popup > richlistbox > richlistitem {
   padding-right: 50px;
 }
 
 /* Additional styles applied to popups for form <select> elements. */
 
 #select-container {
   padding: 0;
   position: absolute;
--- a/widget/nsIWinMetroUtils.idl
+++ b/widget/nsIWinMetroUtils.idl
@@ -7,35 +7,26 @@
 
 /**
  * Integration with the "Metro"/"Modern" UI environment in Windows 8.
  *
  * Note: browser/metro/base/content/browser-scripts.js contains a stub
  * implementation of this interface for non-Windows systems, for testing and
  * development purposes only.
  */
-[scriptable, uuid(25524bde-8b30-4b49-8d67-7070c790aada)]
+[scriptable, uuid(496b4450-5757-40f7-aeb9-a958ae86dbd1)]
 interface nsIWinMetroUtils : nsISupports
 {
-  /* return constants for the handPreference property */
-  const long handPreferenceLeft = 0;
-  const long handPreferenceRight = 1;
-
   /**
    * Determine if the current browser is running in the metro immersive
    * environment.
    */
   readonly attribute boolean immersive;
 
   /**
-   * Determine if the user prefers left handed or right handed input.
-   */
-  readonly attribute long handPreference;
-
-  /**
    * Determine the activation URI
    */
   readonly attribute AString activationURI;
 
    /**
     * Show the settings flyout
     */
    void showSettingsFlyout();
--- a/widget/windows/winrt/nsWinMetroUtils.cpp
+++ b/widget/windows/winrt/nsWinMetroUtils.cpp
@@ -380,37 +380,16 @@ NS_IMETHODIMP
 nsWinMetroUtils::GetImmersive(bool *aImersive)
 {
   *aImersive =
     XRE_GetWindowsEnvironment() == WindowsEnvironmentType_Metro;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsWinMetroUtils::GetHandPreference(int32_t *aHandPreference)
-{
-  if (XRE_GetWindowsEnvironment() == WindowsEnvironmentType_Desktop) {
-    *aHandPreference = nsIWinMetroUtils::handPreferenceRight;
-    return NS_OK;
-  }
-
-  ComPtr<IUISettings> uiSettings;
-  AssertRetHRESULT(ActivateGenericInstance(RuntimeClass_Windows_UI_ViewManagement_UISettings, uiSettings), NS_ERROR_UNEXPECTED);
-
-  HandPreference value;
-  uiSettings->get_HandPreference(&value);
-  if (value == HandPreference::HandPreference_LeftHanded)
-    *aHandPreference = nsIWinMetroUtils::handPreferenceLeft;
-  else
-    *aHandPreference = nsIWinMetroUtils::handPreferenceRight;
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 nsWinMetroUtils::GetActivationURI(nsAString &aActivationURI)
 {
   if (!sFrameworkView) {
     NS_WARNING("GetActivationURI used before view is created!");
     return NS_OK;
   }
   sFrameworkView->GetActivationURI(aActivationURI);
   return NS_OK;