Bug 1300319 part.1 NativeKey::IsControlChar() should return true when the char is 0x7F (control character, DELETE) r=m_kato a=ritu
authorMasayuki Nakano <masayuki@d-toybox.com>
Mon, 05 Sep 2016 12:51:49 +0900
changeset 350109 a1b9426c54bc082cc6db8ccf6dfdb734430a27d6
parent 350108 245983b752c0db9d954a8ebd928d15a0bff3ae1b
child 350110 dd718143b7e29c316306185ba3cb6f342fb79a85
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersm_kato, ritu
bugs1300319
milestone50.0a2
Bug 1300319 part.1 NativeKey::IsControlChar() should return true when the char is 0x7F (control character, DELETE) r=m_kato a=ritu Ctrl+Backspace causes WM_CHAR for control character DELETE. However, NativeKey::IsControlChar() doesn't treat it as a control character. Therefore, NativeKey treats Backspace key as a printable character. MozReview-Commit-ID: 29V45CNp8kW
widget/windows/KeyboardLayout.cpp
--- a/widget/windows/KeyboardLayout.cpp
+++ b/widget/windows/KeyboardLayout.cpp
@@ -1037,17 +1037,18 @@ NativeKey::InitWithAppCommand()
       GetScanCodeWithExtendedFlag());
 }
 
 // static
 bool
 NativeKey::IsControlChar(char16_t aChar)
 {
   static const char16_t U_SPACE = 0x20;
-  return aChar < U_SPACE;
+  static const char16_t U_DELETE = 0x7F;
+  return aChar < U_SPACE || aChar == U_DELETE;
 }
 
 bool
 NativeKey::IsFollowedByDeadCharMessage() const
 {
   MSG nextMsg;
   if (mFakeCharMsgs) {
     nextMsg = mFakeCharMsgs->ElementAt(0).GetCharMsg(mMsg.hwnd);