Bug 189325 - [iOS] uiController.typeCharacterUsingHardwareKeyboard("`", ...) dispatches DOM key events for ~
Summary: [iOS] uiController.typeCharacterUsingHardwareKeyboard("`", ...) dispatches DO...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: iPhone / iPad iOS 11
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar
Depends on:
Blocks: 190571
  Show dependency treegraph
 
Reported: 2018-09-05 16:05 PDT by Daniel Bates
Modified: 2018-10-14 22:02 PDT (History)
6 users (show)

See Also:


Attachments
Test case (2.44 KB, text/html)
2018-09-05 16:05 PDT, Daniel Bates
no flags Details
Patch and layout test (4.96 KB, patch)
2018-09-07 15:47 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2018-09-05 16:05:07 PDT
Created attachment 348975 [details]
Test case

Today when writing a layout test for iOS I noticed that using uiController.typeCharacterUsingHardwareKeyboard("`", ...) to simulate typing the grave accent (`) causes DOM key events for tilda (~) to be emitted.

Steps to reproduce:

Run the attached test case, test.html, in iOS WebKitTestRunner.

Looking at the type and key properties in the fired key events I see:

type: keydown, key: ~
type: keypress, key: ~
type: keyup, key: ~

But I should see:

type: keydown, key: `
type: keypress, key: `
type: keyup, key: `
Comment 1 Wenson Hsieh 2018-09-05 16:54:39 PDT
Likely relevant: hidUsageCodeForCharacter (and nearby code) in HIDEventGenerator.mm.
Comment 2 Wenson Hsieh 2018-09-05 16:57:43 PDT
(In reply to Wenson Hsieh from comment #1)
> Likely relevant: hidUsageCodeForCharacter (and nearby code) in
> HIDEventGenerator.mm.

...and shouldWrapWithShiftKeyEventForCharacter, which wraps both '`' and '~' with shift key events :|
Comment 3 Daniel Bates 2018-09-07 15:47:08 PDT
Created attachment 349210 [details]
Patch and layout test
Comment 4 Daniel Bates 2018-09-07 16:09:20 PDT
Comment on attachment 349210 [details]
Patch and layout test

Clearing flags on attachment: 349210

Committed r235818: <https://trac.webkit.org/changeset/235818>
Comment 5 Daniel Bates 2018-09-07 16:09:22 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2018-09-07 16:10:33 PDT
<rdar://problem/44243118>