Bug 188251

Summary: [iOS] Keyboard becomes unresponsive after pressing delete while pressing down on a character key with accents
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: WebKit2Assignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, commit-queue, megan_gardner, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Wenson Hsieh 2018-08-01 22:18:13 PDT
<rdar://problem/37842108>
Comment 1 Wenson Hsieh 2018-08-01 22:20:05 PDT
This following code:

- (void)handleKeyWebEvent:(::WebEvent *)theEvent withCompletionHandler:(void (^)(::WebEvent *theEvent, BOOL wasHandled))completionHandler
{
    _keyWebEventHandler = [completionHandler copy];
    _page->handleKeyboardEvent(NativeWebKeyboardEvent(theEvent));
}

- (void)_didHandleKeyEvent:(::WebEvent *)event eventWasHandled:(BOOL)eventWasHandled
{
    if (_keyWebEventHandler) {
        _keyWebEventHandler(event, eventWasHandled);
        [_keyWebEventHandler release];
        _keyWebEventHandler = nil;
        return;
    }

…

}

...is not robust in the case where the key event completion handler calls back into -handleKeyWebEvent:withCompletionHandler:, since we'll just end up stomping over the newly stored completion block in the next line.
Comment 2 Wenson Hsieh 2018-08-01 23:32:16 PDT
Created attachment 346360 [details]
Patch
Comment 3 Wenson Hsieh 2018-08-02 08:02:07 PDT
Created attachment 346380 [details]
Patch
Comment 4 Wenson Hsieh 2018-08-02 11:05:33 PDT
Comment on attachment 346380 [details]
Patch

Thanks for the review!
Comment 5 WebKit Commit Bot 2018-08-02 11:32:29 PDT
Comment on attachment 346380 [details]
Patch

Clearing flags on attachment: 346380

Committed r234504: <https://trac.webkit.org/changeset/234504>
Comment 6 WebKit Commit Bot 2018-08-02 11:32:31 PDT
All reviewed patches have been landed.  Closing bug.