Bug 168183

Summary: [Cocoa] Some -respondsToSelector: checks are unnecessary
Product: WebKit Reporter: mitz
Component: New BugsAssignee: mitz
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, commit-queue, sam, thorton
Priority: P2    
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
For EWS
none
For EWS
none
For EWS
none
For EWS
none
For EWS
none
Remove unnecessary checking thorton: review+

Description mitz 2017-02-12 00:08:04 PST
If a method or property is declared in a class interface or class extension, there’s no need to check.
Comment 1 mitz 2017-02-12 00:08:52 PST
Created attachment 301293 [details]
For EWS
Comment 2 WebKit Commit Bot 2017-02-12 00:11:36 PST
Attachment 301293 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4166:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4166:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4167:  Wrong number of spaces before statement. (expected: 24)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4167:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4172:  Wrong number of spaces before statement. (expected: 24)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4167:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4167:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4172:  Wrong number of spaces before statement. (expected: 24)  [whitespace/indent] [4]
ERROR: Source/WebKit2/Platform/spi/ios/UIKitSPI.h:311:  Should have space between @property and attributes.  [whitespace/property] [4]
ERROR: Source/WebKit2/Platform/spi/ios/UIKitSPI.h:311:  Missing space after ,  [whitespace/comma] [3]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:489:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:489:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:490:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:490:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:495:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:497:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:490:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:490:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:495:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:497:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
Total errors found: 20 in 15 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 mitz 2017-02-12 09:01:38 PST
Created attachment 301305 [details]
For EWS
Comment 4 WebKit Commit Bot 2017-02-12 09:02:52 PST
Attachment 301305 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4166:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4166:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4167:  Wrong number of spaces before statement. (expected: 24)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4167:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4172:  Wrong number of spaces before statement. (expected: 24)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4167:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4167:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4172:  Wrong number of spaces before statement. (expected: 24)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:489:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:489:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:490:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:490:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:495:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:497:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:490:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:490:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:495:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:497:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
Total errors found: 18 in 15 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 mitz 2017-02-12 09:36:06 PST
Created attachment 301306 [details]
For EWS
Comment 6 mitz 2017-02-12 09:37:20 PST
Created attachment 301307 [details]
For EWS
Comment 7 WebKit Commit Bot 2017-02-12 09:40:22 PST
Attachment 301307 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4166:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4166:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4167:  Wrong number of spaces before statement. (expected: 24)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4167:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4172:  Wrong number of spaces before statement. (expected: 24)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4167:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4167:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4172:  Wrong number of spaces before statement. (expected: 24)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:489:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:489:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:490:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:490:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:495:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:497:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:490:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:490:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:495:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:497:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit/mac/WebView/WebImmediateActionController.mm:441:  The parameter name "]" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 19 in 20 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 mitz 2017-02-12 10:36:05 PST
Created attachment 301310 [details]
For EWS
Comment 9 mitz 2017-02-12 10:36:41 PST
One of the checks was masking a change to NEFilterSource SPI!
Comment 10 WebKit Commit Bot 2017-02-12 10:38:16 PST
Attachment 301310 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4166:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4166:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4167:  Wrong number of spaces before statement. (expected: 24)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4167:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4172:  Wrong number of spaces before statement. (expected: 24)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4167:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4167:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4172:  Wrong number of spaces before statement. (expected: 24)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:489:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:489:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:490:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:490:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:495:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:497:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:490:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:490:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:495:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:497:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit/mac/WebView/WebImmediateActionController.mm:441:  The parameter name "]" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 19 in 32 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 11 mitz 2017-02-12 12:06:07 PST
Created attachment 301313 [details]
Remove unnecessary checking
Comment 12 WebKit Commit Bot 2017-02-12 12:08:03 PST
Attachment 301313 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4166:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4166:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4167:  Wrong number of spaces before statement. (expected: 24)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4167:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4172:  Wrong number of spaces before statement. (expected: 24)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4167:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4167:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4172:  Wrong number of spaces before statement. (expected: 24)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:489:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:489:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:490:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:490:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:495:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:497:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:490:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:490:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:495:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:497:  Wrong number of spaces before statement. (expected: 16)  [whitespace/indent] [4]
ERROR: Source/WebKit/mac/WebView/WebImmediateActionController.mm:441:  The parameter name "]" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 19 in 35 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 13 Tim Horton 2017-02-12 13:05:22 PST
Comment on attachment 301313 [details]
Remove unnecessary checking

Woo!
Comment 14 mitz 2017-02-12 14:03:13 PST
Committed <https://trac.webkit.org/r212211>.