From b88f05e8930bb8039883399449e06382c9df421b Mon Sep 17 00:00:00 2001 From: Andreea Pavel Date: Fri, 5 Jan 2018 04:46:46 +0200 Subject: [PATCH] Backed out changeset 3a55b10a6974 (bug 106327) for build bustage on /builds/worker/workspace/build/src/layout/xul/nsMenuFrame.cpp r=backout a=backout on a CLOSED TREE --HG-- extra : amend_source : e09bf154093728898ad2c27dd185108f9ff3b009 --- layout/xul/nsMenuFrame.cpp | 8 +++---- .../mac/platformKeys.properties | 23 ++++++++----------- .../unix/platformKeys.properties | 23 ++++++++----------- .../win/platformKeys.properties | 23 ++++++++----------- .../en-US/chrome/global/keys.properties | 1 + toolkit/modules/ShortcutUtils.jsm | 6 ++--- 6 files changed, 33 insertions(+), 51 deletions(-) diff --git a/layout/xul/nsMenuFrame.cpp b/layout/xul/nsMenuFrame.cpp index 3d789850fd53..271185de0c2f 100644 --- a/layout/xul/nsMenuFrame.cpp +++ b/layout/xul/nsMenuFrame.cpp @@ -1105,11 +1105,9 @@ nsMenuFrame::BuildAcceleratorText(bool aNotify) mozilla::services::GetStringBundleService(); if (bundleService) { nsCOMPtr bundle; - rv = bundleService->CreateBundle( - (keyCode == "VK_RETURN" ? - "chrome://global-platform/locale/platformKeys.properties" - : "chrome://global/locale/keys.properties"), - getter_AddRefs(bundle)); + rv = bundleService->CreateBundle("chrome://global/locale/keys.properties", + getter_AddRefs(bundle)); + if (NS_SUCCEEDED(rv) && bundle) { nsAutoString keyName; rv = bundle->GetStringFromName(NS_ConvertUTF16toUTF8(keyCode).get(), diff --git a/toolkit/locales/en-US/chrome/global-platform/mac/platformKeys.properties b/toolkit/locales/en-US/chrome/global-platform/mac/platformKeys.properties index 725e97744126..39f3d62e8306 100644 --- a/toolkit/locales/en-US/chrome/global-platform/mac/platformKeys.properties +++ b/toolkit/locales/en-US/chrome/global-platform/mac/platformKeys.properties @@ -2,29 +2,24 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -# Platform: Mac -# This file defines the on-screen display names for the various modifier keys -# and the Return key (VK_RETURN). -# These are used in XP menus to show keyboard shortcuts. +#mac +#this file defines the on screen display names for the various modifier keys +#these are used in XP menus to show keyboard shortcuts -# The Shift key - open up arrow symbol (ctrl-e) +#the shift key - open up arrow symbol (ctrl-e) VK_SHIFT=\u21e7 -# The Command key - clover leaf symbol (ctrl-q) +#the command key - clover leaf symbol (ctrl-q) VK_META=\u2318 -# The Win key - never generated by native key event +#the win key - never generated by native key event VK_WIN=win -# The Option/Alt key - splitting tracks symbol (ctrl-g) +#the option/alt key - splitting tracks symbol (ctrl-g) VK_ALT=\u2325 -# The Control key - hat symbol (ctrl-f) +#the control key. hat symbol (ctrl-f) VK_CONTROL=\u2303 -# The Return key (on the main keyboard or numpad): -# "Enter" on Windows/Unix, "Return" on Mac -VK_RETURN=Return - -# The separator character used between modifiers (none on Mac OS) +#the separator character used between modifiers (none on Mac OS) MODIFIER_SEPARATOR= diff --git a/toolkit/locales/en-US/chrome/global-platform/unix/platformKeys.properties b/toolkit/locales/en-US/chrome/global-platform/unix/platformKeys.properties index 3a1394d87173..53321356e0b2 100644 --- a/toolkit/locales/en-US/chrome/global-platform/unix/platformKeys.properties +++ b/toolkit/locales/en-US/chrome/global-platform/unix/platformKeys.properties @@ -2,29 +2,24 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -# Platform: Unix -# This file defines the on-screen display names for the various modifier keys -# and the Enter key (VK_RETURN). -# These are used in XP menus to show keyboard shortcuts. +#default +#this file defines the on screen display names for the various modifier keys +#these are used in XP menus to show keyboard shortcuts -# The Shift key +#the shift key VK_SHIFT=Shift -# The Command key +#the command key VK_META=Meta -# The Win key (Super key and Hyper keys are mapped to DOM Win key) +#the win key (Super key and Hyper keys are mapped to DOM Win key) VK_WIN=Win -# The Alt key +#the alt key VK_ALT=Alt -# The Control key +#the control key VK_CONTROL=Ctrl -# The Enter key (on the main keyboard or numpad): -# "Enter" on Windows/Unix, "Return" on Mac -VK_RETURN=Enter - -# The separator character used between modifiers +#the separator character used between modifiers MODIFIER_SEPARATOR=+ diff --git a/toolkit/locales/en-US/chrome/global-platform/win/platformKeys.properties b/toolkit/locales/en-US/chrome/global-platform/win/platformKeys.properties index e05354c9ae07..307eeaf195ca 100644 --- a/toolkit/locales/en-US/chrome/global-platform/win/platformKeys.properties +++ b/toolkit/locales/en-US/chrome/global-platform/win/platformKeys.properties @@ -2,29 +2,24 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -# Platform: Windows -# This file defines the on-screen display names for the various modifier keys -# and the Enter key (VK_RETURN). -# These are used in XP menus to show keyboard shortcuts. +#default +#this file defines the on screen display names for the various modifier keys +#these are used in XP menus to show keyboard shortcuts -# The Shift key +#the shift key VK_SHIFT=Shift -# The Command key +#the command key VK_META=Meta -# The Win key +#the win key VK_WIN=Win -# The Alt key +#the alt key VK_ALT=Alt -# The Control key +#the control key VK_CONTROL=Ctrl -# The Enter key (on the main keyboard or numpad): -# "Enter" on Windows/Unix, "Return" on Mac -VK_RETURN=Enter - -# The separator character used between modifiers +#the separator character used between modifiers MODIFIER_SEPARATOR=+ diff --git a/toolkit/locales/en-US/chrome/global/keys.properties b/toolkit/locales/en-US/chrome/global/keys.properties index 03794367d5a4..1137bf7c6189 100644 --- a/toolkit/locales/en-US/chrome/global/keys.properties +++ b/toolkit/locales/en-US/chrome/global/keys.properties @@ -57,6 +57,7 @@ VK_PAGE_DOWN=Page Down # otherwise you should probably just translate the glyph regions # LOCALIZATION NOTE : BLOCK maybe GLYPHS +VK_RETURN=Return VK_TAB=Tab VK_BACK=Backspace VK_DELETE=Del diff --git a/toolkit/modules/ShortcutUtils.jsm b/toolkit/modules/ShortcutUtils.jsm index a5a8de0de787..0a6e495c31c7 100644 --- a/toolkit/modules/ShortcutUtils.jsm +++ b/toolkit/modules/ShortcutUtils.jsm @@ -88,11 +88,9 @@ var ShortcutUtils = { let key; let keyCode = aElemKey.getAttribute("keycode"); if (keyCode) { - keyCode = keyCode.toUpperCase(); try { - let bundle = keyCode == "VK_RETURN" ? PlatformKeys : Keys; - // Some keys might not exist in the locale file, which will throw. - key = bundle.GetStringFromName(keyCode); + // Some keys might not exist in the locale file, which will throw: + key = Keys.GetStringFromName(keyCode.toUpperCase()); } catch (ex) { Cu.reportError("Error finding " + keyCode + ": " + ex); key = keyCode.replace(/^VK_/, "");