Bug 168183 - [Cocoa] Some -respondsToSelector: checks are unnecessary
Summary: [Cocoa] Some -respondsToSelector: checks are unnecessary
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: mitz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-12 00:08 PST by mitz
Modified: 2017-02-12 14:03 PST (History)
4 users (show)

See Also:


Attachments
For EWS (32.97 KB, patch)
2017-02-12 00:08 PST, mitz
no flags Details | Formatted Diff | Diff
For EWS (33.19 KB, patch)
2017-02-12 09:01 PST, mitz
no flags Details | Formatted Diff | Diff
For EWS (41.51 KB, text/plain)
2017-02-12 09:36 PST, mitz
no flags Details
For EWS (41.51 KB, patch)
2017-02-12 09:37 PST, mitz
no flags Details | Formatted Diff | Diff
For EWS (59.37 KB, patch)
2017-02-12 10:36 PST, mitz
no flags Details | Formatted Diff | Diff
Remove unnecessary checking (67.36 KB, patch)
2017-02-12 12:06 PST, mitz
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>.