Bug 190402

Summary: [iOS] Cleanup -[WAKView _selfHandleEvent:] and -[WAKWindow sendEventSynchronously:]
Product: WebKit Reporter: Daniel Bates <dbates>
Component: WebCore Misc.Assignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, andersca, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: All   
OS: iOS 12   
Bug Depends on:    
Bug Blocks: 190571    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Daniel Bates
Reported 2018-10-09 09:56:16 PDT
Cleanup code style in -[WAKView _selfHandleEvent:] and -[WAKWindow sendEventSynchronously:] and remove default case statements with body ASSERT_NOT_REACHED() so as make a missing enumerator a compile-time error instead of a runtime error.
Attachments
Patch (5.04 KB, patch)
2018-10-09 09:59 PDT, Daniel Bates
no flags
Patch (5.17 KB, patch)
2018-10-09 10:07 PDT, Daniel Bates
no flags
Patch (5.11 KB, patch)
2018-10-09 10:13 PDT, Daniel Bates
no flags
Patch (5.11 KB, patch)
2018-10-09 10:46 PDT, Daniel Bates
no flags
Daniel Bates
Comment 1 2018-10-09 09:59:11 PDT
Daniel Bates
Comment 2 2018-10-09 10:07:18 PDT
Created attachment 351885 [details] Patch More clean up of -[WAKView _selfHandleEvent:]. Inline a local variable into the swithc condition, change break statements to return statements and remove the return statement at the end of the function as the compiler is capable of verifing that the switch block handles all enumerators.
Daniel Bates
Comment 3 2018-10-09 10:13:26 PDT
Created attachment 351886 [details] Patch Tighten up -[WAKView _selfHandleEvent:] some more by removing unncessary braces.
Anders Carlsson
Comment 4 2018-10-09 10:14:15 PDT
Comment on attachment 351886 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=351886&action=review > Source/WebCore/platform/ios/wak/WAKView.mm:132 > - (BOOL)_selfHandleEvent:(WebEvent *)event > { Does _selfHandleEvent ever return NO? I'm guessing there are WAKView subclasses that can return NO.
Daniel Bates
Comment 5 2018-10-09 10:46:06 PDT
Daniel Bates
Comment 6 2018-10-09 14:22:36 PDT
(In reply to Anders Carlsson from comment #4) > Comment on attachment 351886 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=351886&action=review > > > Source/WebCore/platform/ios/wak/WAKView.mm:132 > > - (BOOL)_selfHandleEvent:(WebEvent *)event > > { > > Does _selfHandleEvent ever return NO? I'm guessing there are WAKView > subclasses that can return NO. Your intuition is correct. -[WAKScrollView _selfHandleEvent] can return NO: <https://trac.webkit.org/browser/trunk/Source/WebCore/platform/ios/wak/WAKScrollView.mm?rev=236938#L88>.
Daniel Bates
Comment 7 2018-10-10 20:08:39 PDT
Comment on attachment 351894 [details] Patch Clearing flags on attachment: 351894 Committed r237027: <https://trac.webkit.org/changeset/237027>
Daniel Bates
Comment 8 2018-10-10 20:08:41 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 9 2018-10-10 20:09:28 PDT
Note You need to log in before you can comment on or make changes to this bug.