Bug 1272599 part.2 Rename KeyboardEvent.key values, "MozHomeScreen" and "MozCameraFocusAdjust" to "GoHome" and "CameraFocus" except on B2G r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 20 May 2016 21:29:10 +0900
changeset 337772 7562ee87e961d3166ca77392e9b81eb4865c8f3e
parent 337771 d50ff85ea0db606858fd860077a0b89d8a26e23e
child 337773 011e172a9ddffa9419b3282309ee170355c4f09a
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1272599
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 1272599 part.2 Rename KeyboardEvent.key values, "MozHomeScreen" and "MozCameraFocusAdjust" to "GoHome" and "CameraFocus" except on B2G r=smaug KEYCODE_HOME was temporarily named as "MozHomeScreen" and KEYCODE_FOCUS was temprarily named as "MozCameraFocusAdjust" since they were not defined by the spec. However, in the latest spec, they are defined as "GoHome" and "CameraFocus". So, it is the time to rename them. However, these temporary key names are still used by Gaia. Until it's fixed, we should keep using the temporary names only on B2G. MozReview-Commit-ID: 9ILtZdf6EUQ
dom/events/KeyNameList.h
widget/NativeKeyToDOMKeyName.h
--- a/dom/events/KeyNameList.h
+++ b/dom/events/KeyNameList.h
@@ -24,20 +24,23 @@
  * Special Key Values
  *****************************************************************************/
 DEFINE_KEYNAME_WITH_SAME_NAME(Unidentified)
 
 /******************************************************************************
  * Our Internal Key Values (must have "Moz" prefix)
  *****************************************************************************/
 DEFINE_KEYNAME_INTERNAL(PrintableKey, "MozPrintableKey")
+DEFINE_KEYNAME_INTERNAL(SoftLeft, "MozSoftLeft")
+DEFINE_KEYNAME_INTERNAL(SoftRight, "MozSoftRight")
+
+#ifdef MOZ_B2G
 DEFINE_KEYNAME_INTERNAL(HomeScreen, "MozHomeScreen")
 DEFINE_KEYNAME_INTERNAL(CameraFocusAdjust, "MozCameraFocusAdjust")
-DEFINE_KEYNAME_INTERNAL(SoftLeft, "MozSoftLeft")
-DEFINE_KEYNAME_INTERNAL(SoftRight, "MozSoftRight")
+#endif // #ifdef MOZ_B2G
 
 /******************************************************************************
  * Modifier Keys
  *****************************************************************************/
 DEFINE_KEYNAME_WITH_SAME_NAME(Alt)
 DEFINE_KEYNAME_WITH_SAME_NAME(AltGraph)
 DEFINE_KEYNAME_WITH_SAME_NAME(CapsLock)
 DEFINE_KEYNAME_WITH_SAME_NAME(Control)
--- a/widget/NativeKeyToDOMKeyName.h
+++ b/widget/NativeKeyToDOMKeyName.h
@@ -1227,22 +1227,24 @@ KEY_MAP_QT      (BrowserStop, Qt::Key_St
  ******************************************************************************/
 // Call
 KEY_MAP_ANDROID (Call, AKEYCODE_CALL)
 
 // Camera
 KEY_MAP_QT      (Camera, Qt::Key_Camera)
 KEY_MAP_ANDROID (Camera, AKEYCODE_CAMERA)
 
-// CameraFocusAdjust (should be renamed to CameraFocus)
-KEY_MAP_QT      (CameraFocusAdjust, Qt::Key_CameraFocus)
-KEY_MAP_ANDROID (CameraFocusAdjust, AKEYCODE_FOCUS)
+// CameraFocus
+KEY_MAP_QT                (CameraFocus,       Qt::Key_CameraFocus)
+KEY_MAP_ANDROID_EXCEPT_B2G(CameraFocus,       AKEYCODE_FOCUS)
+KEY_MAP_B2G               (CameraFocusAdjust, AKEYCODE_FOCUS)
 
-// HomeScreen (should be renamed to GoHome)
-KEY_MAP_ANDROID (HomeScreen, AKEYCODE_HOME)
+// GoHome
+KEY_MAP_ANDROID_EXCEPT_B2G(GoHome,     AKEYCODE_HOME)
+KEY_MAP_B2G               (HomeScreen, AKEYCODE_HOME)
 
 /******************************************************************************
  * TV Keys
  ******************************************************************************/
 // TV
 KEY_MAP_ANDROID (TV, AKEYCODE_TV)
 
 // TVInput