Summary: | [iOS] Teach WKPDFView to navigate to pageNumber links | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Andy Estes <aestes> | ||||
Component: | New Bugs | Assignee: | Andy Estes <aestes> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | commit-queue | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Andy Estes
2014-10-02 13:43:33 PDT
Created attachment 239137 [details]
Patch
Attachment 239137 [details] did not pass style-queue:
ERROR: Source/WebKit2/UIProcess/ios/WKPDFView.mm:356: The parameter name "url" adds no information, so it should be removed. [readability/parameter_name] [5]
Total errors found: 1 in 9 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 239137 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=239137&action=review > Source/WebKit2/UIProcess/ios/WKPDFView.mm:359 > + urlString = String::format("#page%lu", pageNumber); I'm not sure String::format is the best way to do this. I realize that this isn't performance critical code, but still probably not a great example to set. (In reply to comment #4) > (From update of attachment 239137 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=239137&action=review > > > Source/WebKit2/UIProcess/ios/WKPDFView.mm:359 > > + urlString = String::format("#page%lu", pageNumber); > > I'm not sure String::format is the best way to do this. I realize that this isn't performance critical code, but still probably not a great example to set. What's the alternative? append '0' + pageNumber as a character literal? Oh never mind, WTFString has a bunch of number conversion functions. Committed r174232: <http://trac.webkit.org/changeset/174232> Comment on attachment 239137 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=239137&action=review >>> Source/WebKit2/UIProcess/ios/WKPDFView.mm:359 >>> + urlString = String::format("#page%lu", pageNumber); >> >> I'm not sure String::format is the best way to do this. I realize that this isn't performance critical code, but still probably not a great example to set. > > What's the alternative? append '0' + pageNumber as a character literal? One alternative is to use StringBuilder and appendNumber. I don’t think it’s higher performance than String::format, but it does avoid the assumption that NSUInteger is always unsigned long, which this code makes by using %lu for it. |