Bug 1272578 part.2 Rename key name VolumeUp to AudioVolumeUp except on B2G r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Sat, 21 May 2016 00:55:48 +0900
changeset 339782 8e106633b86e4371fbc675429651fc00e2088f7a
parent 339781 d0604395964c8aa9886755d53128bcfe5f3b2af8
child 339783 cfaea09ca3411e330e0617019d6998a2197d242c
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1272578
milestone49.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 1272578 part.2 Rename key name VolumeUp to AudioVolumeUp except on B2G r=smaug VolumeUp was renamed to AudioVolumeUp in the latest draft and Chromium uses the new name. Therefore, we need to update this but Gaia uses the old name. So, we shouldn't rename on B2G until Gaia is fixed. Note that this patch changes tests but they are not used by B2G. Therefore, just replacing with new name is enough. Only forms.js is necessary #ifdef because the main purpose of forms.js is for B2G's IME framework. However, it's available on the other platforms if chrome needs to use it. MozReview-Commit-ID: KzLVL5Y2dIN
devtools/client/responsivedesign/responsivedesign.jsm
dom/base/test/chrome/window_nsITextInputProcessor.xul
dom/events/KeyNameList.h
dom/inputmethod/forms.js
testing/marionette/event.js
testing/mochitest/tests/SimpleTest/EventUtils.js
widget/NativeKeyToDOMKeyName.h
widget/WidgetEventImpl.cpp
--- a/devtools/client/responsivedesign/responsivedesign.jsm
+++ b/devtools/client/responsivedesign/responsivedesign.jsm
@@ -597,20 +597,20 @@ ResponsiveUI.prototype = {
     let volumeButtons = this.chromeDoc.createElement("vbox");
     volumeButtons.className = "devtools-responsiveui-volume-buttons";
     volumeButtons.setAttribute("top", 0);
     volumeButtons.setAttribute("left", 0);
 
     let volumeUp = this.chromeDoc.createElement("button");
     volumeUp.className = "devtools-responsiveui-volume-up-button";
     volumeUp.addEventListener("mousedown", () => {
-      SystemAppProxy.dispatchKeyboardEvent("keydown", {key: "VolumeUp"});
+      SystemAppProxy.dispatchKeyboardEvent("keydown", {key: "AudioVolumeUp"});
     });
     volumeUp.addEventListener("mouseup", () => {
-      SystemAppProxy.dispatchKeyboardEvent("keyup", {key: "VolumeUp"});
+      SystemAppProxy.dispatchKeyboardEvent("keyup", {key: "AudioVolumeUp"});
     });
 
     let volumeDown = this.chromeDoc.createElement("button");
     volumeDown.className = "devtools-responsiveui-volume-down-button";
     volumeDown.addEventListener("mousedown", () => {
       SystemAppProxy.dispatchKeyboardEvent("keydown", {key: "AudioVolumeDown"});
     });
     volumeDown.addEventListener("mouseup", () => {
--- a/dom/base/test/chrome/window_nsITextInputProcessor.xul
+++ b/dom/base/test/chrome/window_nsITextInputProcessor.xul
@@ -2767,17 +2767,17 @@ function runKeyTests()
     { key: "F21",                       keyCode: KeyboardEvent.DOM_VK_F21 },
     { key: "F22",                       keyCode: KeyboardEvent.DOM_VK_F22 },
     { key: "F23",                       keyCode: KeyboardEvent.DOM_VK_F23 },
     { key: "F24",                       keyCode: KeyboardEvent.DOM_VK_F24 },
     { key: "NumLock",                   keyCode: KeyboardEvent.DOM_VK_NUM_LOCK,           isModifier: true, isLockableModifier: true },
     { key: "ScrollLock",                keyCode: KeyboardEvent.DOM_VK_SCROLL_LOCK,        isModifier: true, isLockableModifier: true },
     { key: "VolumeMute",                keyCode: KeyboardEvent.DOM_VK_VOLUME_MUTE },
     { key: "AudioVolumeDown",           keyCode: KeyboardEvent.DOM_VK_VOLUME_DOWN },
-    { key: "VolumeUp",                  keyCode: KeyboardEvent.DOM_VK_VOLUME_UP },
+    { key: "AudioVolumeUp",             keyCode: KeyboardEvent.DOM_VK_VOLUME_UP },
     { key: "Meta",                      keyCode: KeyboardEvent.DOM_VK_META,               isModifier: true },
     { key: "AltGraph",                  keyCode: KeyboardEvent.DOM_VK_ALTGR,              isModifier: true },
     { key: "Attn",                      keyCode: KeyboardEvent.DOM_VK_ATTN },
     { key: "CrSel",                     keyCode: KeyboardEvent.DOM_VK_CRSEL },
     { key: "ExSel",                     keyCode: KeyboardEvent.DOM_VK_EXSEL },
     { key: "EraseEof",                  keyCode: KeyboardEvent.DOM_VK_EREOF },
     { key: "Play",                      keyCode: KeyboardEvent.DOM_VK_PLAY },
     { key: "ZoomToggle",                keyCode: KeyboardEvent.DOM_VK_ZOOM },
--- a/dom/events/KeyNameList.h
+++ b/dom/events/KeyNameList.h
@@ -245,21 +245,22 @@ DEFINE_KEYNAME_WITH_SAME_NAME(AudioBassB
 DEFINE_KEYNAME_WITH_SAME_NAME(AudioBassBoostUp)
 DEFINE_KEYNAME_WITH_SAME_NAME(AudioFaderFront)
 DEFINE_KEYNAME_WITH_SAME_NAME(AudioFaderRear)
 DEFINE_KEYNAME_WITH_SAME_NAME(AudioSurroundModeNext)
 DEFINE_KEYNAME_WITH_SAME_NAME(AudioTrebleDown)
 DEFINE_KEYNAME_WITH_SAME_NAME(AudioTrebleUp)
 #ifndef MOZ_B2G
 DEFINE_KEYNAME_WITH_SAME_NAME(AudioVolumeDown)
+DEFINE_KEYNAME_WITH_SAME_NAME(AudioVolumeUp)
 #else
 // Temporarily, remaining for B2G
 DEFINE_KEYNAME_WITH_SAME_NAME(VolumeDown)
+DEFINE_KEYNAME_WITH_SAME_NAME(VolumeUp)
 #endif
-DEFINE_KEYNAME_WITH_SAME_NAME(VolumeUp)
 DEFINE_KEYNAME_WITH_SAME_NAME(VolumeMute)
 DEFINE_KEYNAME_WITH_SAME_NAME(MicrophoneToggle)
 DEFINE_KEYNAME_WITH_SAME_NAME(MicrophoneVolumeDown)
 DEFINE_KEYNAME_WITH_SAME_NAME(MicrophoneVolumeUp)
 DEFINE_KEYNAME_WITH_SAME_NAME(MicrophoneVolumeMute)
 
 /******************************************************************************
  * Speech Keys
--- a/dom/inputmethod/forms.js
+++ b/dom/inputmethod/forms.js
@@ -202,22 +202,24 @@ function guessKeyNameFromKeyCode(Keyboar
       return "NumLock";
     case KeyboardEvent.DOM_VK_SCROLL_LOCK:
       return "ScrollLock";
     case KeyboardEvent.DOM_VK_VOLUME_MUTE:
       return "VolumeMute";
 #ifndef MOZ_B2G
     case KeyboardEvent.DOM_VK_VOLUME_DOWN:
       return "AudioVolumeDown";
+    case KeyboardEvent.DOM_VK_VOLUME_UP:
+      return "AudioVolumeUp";
 #else
     case KeyboardEvent.DOM_VK_VOLUME_DOWN:
       return "VolumeDown";
-#endif
     case KeyboardEvent.DOM_VK_VOLUME_UP:
       return "VolumeUp";
+#endif
     case KeyboardEvent.DOM_VK_META:
       return "Meta";
     case KeyboardEvent.DOM_VK_ALTGR:
       return "AltGraph";
     case KeyboardEvent.DOM_VK_ATTN:
       return "Attn";
     case KeyboardEvent.DOM_VK_CRSEL:
       return "CrSel";
--- a/testing/marionette/event.js
+++ b/testing/marionette/event.js
@@ -831,17 +831,17 @@ function guessKeyNameFromKeyCode_(aKeyCo
       return "NumLock";
     case KeyboardEvent.DOM_VK_SCROLL_LOCK:
       return "ScrollLock";
     case KeyboardEvent.DOM_VK_VOLUME_MUTE:
       return "VolumeMute";
     case KeyboardEvent.DOM_VK_VOLUME_DOWN:
       return "AudioVolumeDown";
     case KeyboardEvent.DOM_VK_VOLUME_UP:
-      return "VolumeUp";
+      return "AudioVolumeUp";
     case KeyboardEvent.DOM_VK_META:
       return "Meta";
     case KeyboardEvent.DOM_VK_ALTGR:
       return "AltGraph";
     case KeyboardEvent.DOM_VK_ATTN:
       return "Attn";
     case KeyboardEvent.DOM_VK_CRSEL:
       return "CrSel";
--- a/testing/mochitest/tests/SimpleTest/EventUtils.js
+++ b/testing/mochitest/tests/SimpleTest/EventUtils.js
@@ -1239,17 +1239,17 @@ function _guessKeyNameFromKeyCode(aKeyCo
       return "NumLock";
     case KeyboardEvent.DOM_VK_SCROLL_LOCK:
       return "ScrollLock";
     case KeyboardEvent.DOM_VK_VOLUME_MUTE:
       return "VolumeMute";
     case KeyboardEvent.DOM_VK_VOLUME_DOWN:
       return "AudioVolumeDown";
     case KeyboardEvent.DOM_VK_VOLUME_UP:
-      return "VolumeUp";
+      return "AudioVolumeUp";
     case KeyboardEvent.DOM_VK_META:
       return "Meta";
     case KeyboardEvent.DOM_VK_ALTGR:
       return "AltGraph";
     case KeyboardEvent.DOM_VK_ATTN:
       return "Attn";
     case KeyboardEvent.DOM_VK_CRSEL:
       return "CrSel";
--- a/widget/NativeKeyToDOMKeyName.h
+++ b/widget/NativeKeyToDOMKeyName.h
@@ -1012,23 +1012,24 @@ KEY_MAP_QT      (AudioBassBoostUp, Qt::K
 KEY_MAP_WIN               (AudioVolumeDown, VK_VOLUME_DOWN)
 KEY_MAP_WIN_CMD           (AudioVolumeDown, APPCOMMAND_VOLUME_DOWN)
 KEY_MAP_COCOA             (AudioVolumeDown, kVK_VolumeDown)
 KEY_MAP_GTK               (AudioVolumeDown, GDK_AudioLowerVolume)
 KEY_MAP_QT                (AudioVolumeDown, Qt::Key_VolumeDown)
 KEY_MAP_ANDROID_EXCEPT_B2G(AudioVolumeDown, AKEYCODE_VOLUME_DOWN)
 KEY_MAP_B2G               (VolumeDown,      AKEYCODE_VOLUME_DOWN)
 
-// VolumeUp (should be renamed to AudioVolumeUp)
-KEY_MAP_WIN     (VolumeUp, VK_VOLUME_UP)
-KEY_MAP_WIN_CMD (VolumeUp, APPCOMMAND_VOLUME_UP)
-KEY_MAP_COCOA   (VolumeUp, kVK_VolumeUp)
-KEY_MAP_GTK     (VolumeUp, GDK_AudioRaiseVolume)
-KEY_MAP_QT      (VolumeUp, Qt::Key_VolumeUp)
-KEY_MAP_ANDROID (VolumeUp, AKEYCODE_VOLUME_UP)
+// AudioVolumeUp
+KEY_MAP_WIN               (AudioVolumeUp, VK_VOLUME_UP)
+KEY_MAP_WIN_CMD           (AudioVolumeUp, APPCOMMAND_VOLUME_UP)
+KEY_MAP_COCOA             (AudioVolumeUp, kVK_VolumeUp)
+KEY_MAP_GTK               (AudioVolumeUp, GDK_AudioRaiseVolume)
+KEY_MAP_QT                (AudioVolumeUp, Qt::Key_VolumeUp)
+KEY_MAP_ANDROID_EXCEPT_B2G(AudioVolumeUp, AKEYCODE_VOLUME_UP)
+KEY_MAP_B2G               (VolumeUp,      AKEYCODE_VOLUME_UP)
 
 // VolumeMute (should be renamed to AudioVolumeMute)
 KEY_MAP_WIN     (VolumeMute, VK_VOLUME_MUTE)
 KEY_MAP_WIN_CMD (VolumeMute, APPCOMMAND_VOLUME_MUTE)
 KEY_MAP_COCOA   (VolumeMute, kVK_Mute)
 KEY_MAP_GTK     (VolumeMute, GDK_AudioMute)
 KEY_MAP_QT      (VolumeMute, Qt::Key_VolumeMute)
 KEY_MAP_ANDROID (VolumeMute, AKEYCODE_VOLUME_MUTE)
--- a/widget/WidgetEventImpl.cpp
+++ b/widget/WidgetEventImpl.cpp
@@ -898,22 +898,24 @@ WidgetKeyboardEvent::ComputeKeyCodeFromK
       return nsIDOMKeyEvent::DOM_VK_NUM_LOCK;
     case KEY_NAME_INDEX_ScrollLock:
       return nsIDOMKeyEvent::DOM_VK_SCROLL_LOCK;
     case KEY_NAME_INDEX_VolumeMute:
       return nsIDOMKeyEvent::DOM_VK_VOLUME_MUTE;
 #ifndef MOZ_B2G
     case KEY_NAME_INDEX_AudioVolumeDown:
       return nsIDOMKeyEvent::DOM_VK_VOLUME_DOWN;
+    case KEY_NAME_INDEX_AudioVolumeUp:
+      return nsIDOMKeyEvent::DOM_VK_VOLUME_UP;
 #else // #ifndef MOZ_B2G
     case KEY_NAME_INDEX_VolumeDown:
       return nsIDOMKeyEvent::DOM_VK_VOLUME_DOWN;
-#endif // #ifndef MOZ_B2G #else
     case KEY_NAME_INDEX_VolumeUp:
       return nsIDOMKeyEvent::DOM_VK_VOLUME_UP;
+#endif // #ifndef MOZ_B2G #else
     case KEY_NAME_INDEX_Meta:
       return nsIDOMKeyEvent::DOM_VK_META;
     case KEY_NAME_INDEX_AltGraph:
       return nsIDOMKeyEvent::DOM_VK_ALTGR;
     case KEY_NAME_INDEX_Attn:
       return nsIDOMKeyEvent::DOM_VK_ATTN;
     case KEY_NAME_INDEX_CrSel:
       return nsIDOMKeyEvent::DOM_VK_CRSEL;