<rdar://problem/37842108>
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.
Created attachment 346360 [details] Patch
Created attachment 346380 [details] Patch
Comment on attachment 346380 [details] Patch Thanks for the review!
Comment on attachment 346380 [details] Patch Clearing flags on attachment: 346380 Committed r234504: <https://trac.webkit.org/changeset/234504>
All reviewed patches have been landed. Closing bug.