WebKit Bugzilla
Attachment 369528 Details for
Bug 197753
: [iOS] Numpad comma key has incorrect keyIdentifier property
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
To land
bug-197753-20190509155902.patch (text/plain), 12.82 KB, created by
Daniel Bates
on 2019-05-09 15:59:03 PDT
(
hide
)
Description:
To land
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2019-05-09 15:59:03 PDT
Size:
12.82 KB
patch
obsolete
>Subversion Revision: 245158 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 7de812b3f6ffd199b8c6045d2e875d7df71bedd8..ea70ef1824adc8e537ff1970ac422c12c768bfb7 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2019-05-09 Daniel Bates <dabates@apple.com> >+ >+ [iOS] Numpad comma key has incorrect keyIdentifier property >+ https://bugs.webkit.org/show_bug.cgi?id=197753 >+ <rdar://problem/50636274> >+ >+ Reviewed by Brent Fulgham. >+ >+ Map the Numpad Comma HID usage code to its Window virtual key code, VK_SEPARATOR, >+ so that can compute the keyIdentifier property for the Numpad Comma key. Also >+ consider this key as a keypad key just like we do on Mac. There is no discernable >+ difference for doing so on iOS because the non-keypad code path computes the same result >+ due to GraphicsServices having fixed up the input string for the Numpad Comma to be >+ ",", which is want. >+ >+ * platform/ios/KeyEventIOS.mm: >+ (WebCore::windowsKeyCodeForKeyCode): Map kHIDUsage_KeypadComma to VK_SEPARATOR. >+ * platform/ios/PlatformEventFactoryIOS.mm: >+ (WebCore::codeForKeyEvent): Add a comment to explain that this key is only on >+ JIS keyboards. >+ (WebCore::isKeypadEvent): Return true for the Numpad Comma key. >+ > 2019-05-09 Zalan Bujtas <zalan@apple.com> > > Do not mix inline and block level boxes. >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index 3d9f18293e8209803a6d9751df4eaefd93130efa..61521bb1a4180df5b7d3ae2a652e3e64fc059ed8 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -1,3 +1,15 @@ >+2019-05-09 Daniel Bates <dabates@apple.com> >+ >+ [iOS] Numpad comma key has incorrect keyIdentifier property >+ https://bugs.webkit.org/show_bug.cgi?id=197753 >+ <rdar://problem/50636274> >+ >+ Reviewed by Brent Fulgham. >+ >+ Expose enumerator for Numpad Comma. >+ >+ * pal/spi/cocoa/IOKitSPI.h: >+ > 2019-05-08 Alex Christensen <achristensen@webkit.org> > > Add SPI to set HSTS storage directory >diff --git a/Source/WebCore/PAL/pal/spi/cocoa/IOKitSPI.h b/Source/WebCore/PAL/pal/spi/cocoa/IOKitSPI.h >index 429951803627dc456ffe627a57403c9c1e032933..8b8d1fade4e051bf0761e1efd8947e39b0f225bd 100644 >--- a/Source/WebCore/PAL/pal/spi/cocoa/IOKitSPI.h >+++ b/Source/WebCore/PAL/pal/spi/cocoa/IOKitSPI.h >@@ -197,6 +197,7 @@ enum { > kHIDUsage_KeyboardF13 = 0x68, > kHIDUsage_KeyboardF24 = 0x73, > kHIDUsage_KeyboardMenu = 0x76, >+ kHIDUsage_KeypadComma = 0x85, > kHIDUsage_KeyboardLeftControl = 0xE0, > kHIDUsage_KeyboardLeftShift = 0xE1, > kHIDUsage_KeyboardLeftAlt = 0xE2, >diff --git a/Source/WebCore/platform/ios/KeyEventIOS.mm b/Source/WebCore/platform/ios/KeyEventIOS.mm >index 7ccc967ae778510e93346580634e923b02a8404c..e58037323df2aea43ec5c52cb85863435d096679 100644 >--- a/Source/WebCore/platform/ios/KeyEventIOS.mm >+++ b/Source/WebCore/platform/ios/KeyEventIOS.mm >@@ -172,8 +172,10 @@ int windowsKeyCodeForKeyCode(uint16_t keyCode) > /* 0x80 */ VK_VOLUME_UP, // Volume Up > /* 0x81 */ VK_VOLUME_DOWN, // Volume Down > }; >- // Check if key is a modifier. >+ // Check if key is a modifier or the keypad comma (on JIS keyboard). > switch (keyCode) { >+ case kHIDUsage_KeypadComma: >+ return VK_SEPARATOR; > case kHIDUsage_KeyboardLeftControl: > return VK_LCONTROL; > case kHIDUsage_KeyboardLeftShift: >diff --git a/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm b/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm >index a171b9db1fd4f503454d46b4e87fc1f2fb046029..63221d4552f1f614c9f85601748ada3682d5c931 100644 >--- a/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm >+++ b/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm >@@ -322,7 +322,7 @@ String codeForKeyEvent(WebEvent *event) > // NumpadBackspace. > // NumpadClear. > // NumpadClearEntry. >- case VK_SEPARATOR: return "NumpadComma"_s; >+ case VK_SEPARATOR: return "NumpadComma"_s; // On JIS keyboard > case VK_DECIMAL: return "NumpadDecimal"_s; > case VK_DIVIDE: return "NumpadDivide"_s; > // NumpadEnter. >@@ -427,8 +427,6 @@ static bool isKeypadEvent(WebEvent* event) > if (event.type != WebEventKeyDown && event.type != WebEventKeyUp) > return false; > >- // With the exception of keypad comma, the following corresponds to the criterion for UIKeyModifierNumericPad. >- // FIXME: Recognize keypad comma. > switch (event.keyCode) { > case VK_CLEAR: // Num Pad Clear > case VK_OEM_PLUS: // Num Pad = >@@ -438,6 +436,7 @@ static bool isKeypadEvent(WebEvent* event) > case VK_ADD: > case VK_RETURN: // Num Pad Enter > case VK_DECIMAL: // Num Pad . >+ case VK_SEPARATOR: // Num Pad , (on JIS keyboard) > case VK_NUMPAD0: > case VK_NUMPAD1: > case VK_NUMPAD2: >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 0e842f1b6fce5a6c7e9e9b00aba4cc6e633cf22c..94cccbf13971012647912226bde230ceccfbe39d 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,16 @@ >+2019-05-09 Daniel Bates <dabates@apple.com> >+ >+ [iOS] Numpad comma key has incorrect keyIdentifier property >+ https://bugs.webkit.org/show_bug.cgi?id=197753 >+ <rdar://problem/50636274> >+ >+ Reviewed by Brent Fulgham. >+ >+ Recognize "numpadComma" and return the appropriate HID usage code. >+ >+ * WebKitTestRunner/ios/HIDEventGenerator.mm: >+ (hidUsageCodeForCharacter): >+ > 2019-05-09 Eric Carlson <eric.carlson@apple.com> > > Refine AudioSession route sharing policy >diff --git a/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm b/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm >index 57756267e495936359e912ffc0202bbf34c98eaf..89991c2a63b8583baea5cc7bfba95099837b7b08 100644 >--- a/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm >+++ b/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm >@@ -973,6 +973,8 @@ static inline uint32_t hidUsageCodeForCharacter(NSString *key) > return kHIDUsage_KeyboardLeftAlt; > if ([key isEqualToString:@"rightAlt"]) > return kHIDUsage_KeyboardRightAlt; >+ if ([key isEqualToString:@"numpadComma"]) >+ return kHIDUsage_KeypadComma; > > return 0; > } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 93408f4d0cb0610b51b85a90157321222681ebab..2fad6d8d57fed049acb514a0a82b51b71627de70 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2019-05-09 Daniel Bates <dabates@apple.com> >+ >+ [iOS] Numpad comma key has incorrect keyIdentifier property >+ https://bugs.webkit.org/show_bug.cgi?id=197753 >+ <rdar://problem/50636274> >+ >+ Reviewed by Brent Fulgham. >+ >+ Update test results. >+ >+ * fast/events/ios/keydown-keyup-special-keys-in-non-editable-element-expected.txt: >+ * fast/events/ios/keydown-keyup-special-keys-in-non-editable-element.html: >+ > 2019-05-08 Zalan Bujtas <zalan@apple.com> > > Do not mix inline and block level boxes. >diff --git a/LayoutTests/fast/events/ios/keydown-keyup-special-keys-in-non-editable-element-expected.txt b/LayoutTests/fast/events/ios/keydown-keyup-special-keys-in-non-editable-element-expected.txt >index 84fc32e69fa53338826700857a9cd58371fed905..400e289e54102def17ea2fdc3cb2825e1919e507 100644 >--- a/LayoutTests/fast/events/ios/keydown-keyup-special-keys-in-non-editable-element-expected.txt >+++ b/LayoutTests/fast/events/ios/keydown-keyup-special-keys-in-non-editable-element-expected.txt >@@ -1,4 +1,4 @@ >-This tests that DOM keydown and keyup events are dispatched to a non-editable <body> on iOS when pressing special keys on a hardware keyboard. To run this test manually, verify that two messages are emitted when you press the following keys: Tab, â, â, â, â, Delete, End, Enter, Escape, Home, left Alt, left â Command, left Ctrl, left â§ Shift, Page Down, Page Up, Return, right Alt, right â Command, right Ctrl, right â§ Shift, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16. >+This tests that DOM keydown and keyup events are dispatched to a non-editable <body> on iOS when pressing special keys on a hardware keyboard. To run this test manually, verify that two messages are emitted when you press the following keys: Tab, â, â, â, â, Delete, End, Enter, Escape, Home, left Alt, left â Command, left Ctrl, left â§ Shift, Page Down, Page Up, Return, right Alt, right â Command, right Ctrl, right â§ Shift, Numpad ,, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16. > > type: keydown, key: Tab, code: Tab, keyIdentifier: U+0009, keyCode: 9, charCode: 0, keyCode: 9, which: 9 > type: keyup, key: Dead, code: Tab, keyIdentifier: Unidentified, keyCode: 9, charCode: 0, keyCode: 9, which: 9 >@@ -44,6 +44,8 @@ type: keydown, key: Control, code: ControlRight, keyIdentifier: Control, keyCode > type: keyup, key: Control, code: ControlRight, keyIdentifier: Control, keyCode: 17, charCode: 0, keyCode: 17, which: 17 > type: keydown, key: Shift, code: ShiftRight, keyIdentifier: Shift, keyCode: 16, charCode: 0, keyCode: 16, which: 16 > type: keyup, key: Shift, code: ShiftRight, keyIdentifier: Shift, keyCode: 16, charCode: 0, keyCode: 16, which: 16 >+type: keydown, key: ,, code: NumpadComma, keyIdentifier: U+002C, keyCode: 108, charCode: 0, keyCode: 108, which: 108 >+type: keyup, key: ,, code: NumpadComma, keyIdentifier: U+002C, keyCode: 108, charCode: 0, keyCode: 108, which: 108 > type: keydown, key: , code: F1, keyIdentifier: U+0010, keyCode: 112, charCode: 0, keyCode: 112, which: 112 > type: keyup, key: Dead, code: F1, keyIdentifier: Unidentified, keyCode: 112, charCode: 0, keyCode: 112, which: 112 > type: keydown, key: , code: F2, keyIdentifier: U+0010, keyCode: 113, charCode: 0, keyCode: 113, which: 113 >diff --git a/LayoutTests/fast/events/ios/keydown-keyup-special-keys-in-non-editable-element.html b/LayoutTests/fast/events/ios/keydown-keyup-special-keys-in-non-editable-element.html >index a824482a91bfd3191cf5072b25e796ffb93b3c7a..2f5332a0db8eb1a531a01d14f1f40e04ea01853c 100644 >--- a/LayoutTests/fast/events/ios/keydown-keyup-special-keys-in-non-editable-element.html >+++ b/LayoutTests/fast/events/ios/keydown-keyup-special-keys-in-non-editable-element.html >@@ -12,7 +12,7 @@ if (window.testRunner) { > </script> > </head> > <body onkeydown="handleKeyDown(event)" onkeyup="handleKeyUp(event)"> >-<p>This tests that DOM keydown and keyup events are dispatched to a non-editable <body> on iOS when pressing special keys on a hardware keyboard. To run this test manually, verify that two messages are emitted when you press the following keys: <kbd>Tab</kbd>, <kbd>â</kbd>, <kbd>â</kbd>, <kbd>â</kbd>, <kbd>â</kbd>, <kbd>Delete</kbd>, <kbd>End</kbd>, <kbd>Enter</kbd>, <kbd>Escape</kbd>, <kbd>Home</kbd><!-- FIXME: Add <kbd>Insert</kbd> once <rdar://problem/47128940> is fixed. -->, left <kbd>Alt</kbd>, left <kbd>â Command</kbd>, left <kbd>Ctrl</kbd>, left <kbd>â§ Shift</kbd>, <kbd>Page Down</kbd>, <kbd>Page Up</kbd>, <kbd>Return</kbd>, right <kbd>Alt</kbd>, right <kbd>â Command</kbd>, right <kbd>Ctrl</kbd>, right <kbd>â§ Shift</kbd>, <kbd>F1</kbd>, <kbd>F2</kbd>, <kbd>F3</kbd>, <kbd>F4</kbd>, <kbd>F5</kbd>, <kbd>F6</kbd>, <kbd>F7</kbd>, <kbd>F8</kbd>, <kbd>F9</kbd>, <kbd>F10</kbd>, <kbd>F11</kbd>, <kbd>F12</kbd>, <kbd>F13</kbd>, <kbd>F14</kbd>, <kbd>F15</kbd>, <kbd>F16</kbd><!-- FIXME: Add <kbd>F17</kbd>, <kbd>F18</kbd>, <kbd>F19</kbd>, <kbd>F20</kbd>, <kbd>F21</kbd>, <kbd>F22</kbd>, <kbd>F23</kbd>, <kbd>F24</kbd> once <rdar://problem/47128940> is fixed.-->. >+<p>This tests that DOM keydown and keyup events are dispatched to a non-editable <body> on iOS when pressing special keys on a hardware keyboard. To run this test manually, verify that two messages are emitted when you press the following keys: <kbd>Tab</kbd>, <kbd>â</kbd>, <kbd>â</kbd>, <kbd>â</kbd>, <kbd>â</kbd>, <kbd>Delete</kbd>, <kbd>End</kbd>, <kbd>Enter</kbd>, <kbd>Escape</kbd>, <kbd>Home</kbd><!-- FIXME: Add <kbd>Insert</kbd> once <rdar://problem/47128940> is fixed. -->, left <kbd>Alt</kbd>, left <kbd>â Command</kbd>, left <kbd>Ctrl</kbd>, left <kbd>â§ Shift</kbd>, <kbd>Page Down</kbd>, <kbd>Page Up</kbd>, <kbd>Return</kbd>, right <kbd>Alt</kbd>, right <kbd>â Command</kbd>, right <kbd>Ctrl</kbd>, right <kbd>â§ Shift</kbd>, <kbd>Numpad ,</kbd>, </kbd><kbd>F1</kbd>, <kbd>F2</kbd>, <kbd>F3</kbd>, <kbd>F4</kbd>, <kbd>F5</kbd>, <kbd>F6</kbd>, <kbd>F7</kbd>, <kbd>F8</kbd>, <kbd>F9</kbd>, <kbd>F10</kbd>, <kbd>F11</kbd>, <kbd>F12</kbd>, <kbd>F13</kbd>, <kbd>F14</kbd>, <kbd>F15</kbd>, <kbd>F16</kbd><!-- FIXME: Add <kbd>F17</kbd>, <kbd>F18</kbd>, <kbd>F19</kbd>, <kbd>F20</kbd>, <kbd>F21</kbd>, <kbd>F22</kbd>, <kbd>F23</kbd>, <kbd>F24</kbd> once <rdar://problem/47128940> is fixed.-->. > </p> > <pre id="console"></pre> > <script> >@@ -39,6 +39,7 @@ var remainingKeysToPress = [ > "rightCommand", > "rightControl", > "rightShift", >+ "numpadComma", > ]; > > // FIXME: Check function keys up to F24 once <rdar://problem/47128940> is fixed.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197753
:
369521
| 369528