RESOLVED FIXED 137358
[iOS] Teach WKPDFView to navigate to pageNumber links
https://bugs.webkit.org/show_bug.cgi?id=137358
Summary [iOS] Teach WKPDFView to navigate to pageNumber links
Andy Estes
Reported 2014-10-02 13:43:33 PDT
[iOS] Teach WKPDFView to navigate to pageNumber links
Attachments
Patch (18.42 KB, patch)
2014-10-02 14:18 PDT, Andy Estes
thorton: review+
Andy Estes
Comment 1 2014-10-02 14:05:14 PDT
Andy Estes
Comment 2 2014-10-02 14:18:15 PDT
WebKit Commit Bot
Comment 3 2014-10-02 14:20:20 PDT
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.
Tim Horton
Comment 4 2014-10-02 14:27:27 PDT
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.
Andy Estes
Comment 5 2014-10-02 14:30:16 PDT
(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?
Andy Estes
Comment 6 2014-10-02 14:39:16 PDT
Oh never mind, WTFString has a bunch of number conversion functions.
Andy Estes
Comment 7 2014-10-02 14:51:21 PDT
Darin Adler
Comment 8 2014-10-02 16:05:53 PDT
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.
Note You need to log in before you can comment on or make changes to this bug.