Bug 214272

Summary: [iOS] Sometimes unable to type Japanese on docs.google.com
Product: WebKit Reporter: Daniel Bates <dbates>
Component: WebKit Misc.Assignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: iPhone / iPad   
OS: iOS 13   
See Also: https://bugs.webkit.org/show_bug.cgi?id=199472
Attachments:
Description Flags
Patch none

Description Daniel Bates 2020-07-13 14:23:51 PDT
Steps to reproduce:

1. Open Safari, tap URL bar and ensure English keyboard is being used.
2. Visit <https://docs.google.com> and create a new document.
3. Tap on URL bar and switch to Kana or Romaji.
4. Press Escape key on keyboard (Command + . if the keyboard doesn't have it)
5. Start typing.

Then Latin characters will be inserted. But Japanese characters should have been.

Note that bug may not occur again when repeating these steps in the **same** Safari session.
Comment 1 Daniel Bates 2020-07-13 14:23:57 PDT
<rdar://problem/59449972>
Comment 2 Daniel Bates 2020-07-13 14:25:35 PDT
Cannot write a test due to bug #199472 and fixing that requires some work to do....
Comment 3 Daniel Bates 2020-07-13 14:27:11 PDT
Bug only happens, if it does, when key entry is via window/document event listeners. That is, there is no UCB on screen.
Comment 4 Daniel Bates 2020-07-13 15:15:15 PDT
Created attachment 404183 [details]
Patch
Comment 5 Darin Adler 2020-07-13 15:19:32 PDT
Comment on attachment 404183 [details]
Patch

No way to write a regression test?
Comment 6 Daniel Bates 2020-07-13 15:33:42 PDT
(In reply to Darin Adler from comment #5)
> Comment on attachment 404183 [details]
> Patch
> 
> No way to write a regression test?

Of course there is, but the last I tried to do so I hit bug #199472 and to fix that is quite a bit of work and risk.
Comment 7 Wenson Hsieh 2020-07-13 16:34:19 PDT
Comment on attachment 404183 [details]
Patch

I _could_ imagine writing an API test for this that directly invokes -handleKeyWebEvent:withCompletionHandler: inside _WKInputDelegate methods, and verifies that -handleKeyInputMethodCommandForCurrentEvent is consulted. It isn’t 100% ideal, but it is a way to exercise this change.
Comment 8 Daniel Bates 2020-07-14 10:51:31 PDT
Thanks for the review Wenson!
Comment 9 Daniel Bates 2020-07-14 10:56:01 PDT
Comment on attachment 404183 [details]
Patch

Clearing flags on attachment: 404183

Committed r264352: <https://trac.webkit.org/changeset/264352>
Comment 10 Daniel Bates 2020-07-14 10:56:03 PDT
All reviewed patches have been landed.  Closing bug.