Bug 1272599 part.2 Rename KeyboardEvent.key values, "MozHomeScreen" and "MozCameraFocusAdjust" to "GoHome" and "CameraFocus" except on B2G r?smaug draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 20 May 2016 21:29:10 +0900
changeset 369271 ef31838bc981340abcceb4682e22209389129fbd
parent 369270 303a3767a31fddf454c0a463ba2a85a01d658044
child 521536 9d61479f93fd8e13ea93cc9e922a292798333252
push id18821
push usermasayuki@d-toybox.com
push dateSat, 21 May 2016 02:06:30 +0000
reviewerssmaug
bugs1272599
milestone49.0a1
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