Summary: | Add history delegate to WKWebView | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Anders Carlsson <andersca> | ||||
Component: | New Bugs | Assignee: | Anders Carlsson <andersca> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | commit-queue | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Anders Carlsson
2014-02-17 13:20:45 PST
Created attachment 224416 [details]
Patch
Attachment 224416 [details] did not pass style-queue:
ERROR: Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h:46: Missing spaces around = [whitespace/operators] [4]
Total errors found: 1 in 10 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 224416 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=224416&action=review r=me but there is a critical typo > Source/WebKit2/UIProcess/API/Cocoa/WKHistoryDelegatePrivate.h:40 > +- (void)webView:(WKWebView *)webView didNavigateWithNavigationData:(WKNavigationData *)navigationData; > +- (void)webView:(WKWebView *)webView didPerformClientRedirectFromURL:(NSURL *)sourceURL toURL:(NSURL *)destinationURL; > +- (void)webView:(WKWebView *)webView didPerformServerRedirectFromURL:(NSURL *)sourceURL toURL:(NSURL *)destinationURL; > +- (void)webView:(WKWebView *)webView didUpdateHistoryTitle:(NSString *)title forURL:(NSURL *)URL; Let’s prefix all methods in private delegates with _. > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:465 > +- (id<WKHistoryDelegatePrivate>)_historyDelegate Missing space after id > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:470 > +- (void)_setHistoryDelegate:(id<WKHistoryDelegatePrivate>)historyDelegate Ditto > Source/WebKit2/UIProcess/Cocoa/NavigationState.mm:174 > + [historyDelegate webView:m_webView didPerformClientRedirectFromURL:wrapper(*API::URL::create(sourceURL)) toURL:wrapper(*API::URL::create(destinationURL))]; Let’s avoid wrappers here and use +[NSURL _web_URLWithWTFString:]. > Source/WebKit2/UIProcess/Cocoa/NavigationState.mm:186 > + [historyDelegate webView:m_webView didPerformClientRedirectFromURL:wrapper(*API::URL::create(sourceURL)) toURL:wrapper(*API::URL::create(destinationURL))]; Typo: s/Client/Server/! Let’s avoid wrappers here and use +[NSURL _web_URLWithWTFString:]. > Source/WebKit2/UIProcess/Cocoa/NavigationState.mm:198 > + [historyDelegate.get() webView:m_webView didUpdateHistoryTitle:wrapper(*API::String::create(title)) forURL:wrapper(*API::URL::create(url))]; Let’s avoid wrappers here and use the ability of WTF::String to turn into an NSString (and _web_URLWithWTFString:). Committed r164258: <http://trac.webkit.org/changeset/164258> |