Convert MiniBrowser to use WKWebView API
Created attachment 226365 [details] Patch
I know there is some commented-out code in the patch.
Comment on attachment 226365 [details] Patch You still need to use the WK_API_ENABLED guards otherwise you'll break the 32-bit MiniBrowser build.
Created attachment 226537 [details] Patch
Comment on attachment 226537 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=226537&action=review > Tools/MiniBrowser/mac/WK2BrowserWindowController.m:-71 > - [_webView.browsingContextController removeObserver:self forKeyPath:@"title" context:keyValueObservingContext]; > - [_webView.browsingContextController removeObserver:self forKeyPath:@"activeURL" context:keyValueObservingContext]; You still need to remove these observers from the web view. > Tools/MiniBrowser/mac/WK2BrowserWindowController.m:-136 > - [_webView.browsingContextController reload]; Pretty sure we have SPI to call reload. > Tools/MiniBrowser/mac/WK2BrowserWindowController.m:179 > - return _webView && [_webView.browsingContextController canGoBack]; > + return _webView && [_webView canGoBack]; > > if (action == @selector(goForward:)) > - return _webView && [_webView.browsingContextController canGoForward]; > + return _webView && [_webView canGoForward]; No need to null check _webView here. > Tools/MiniBrowser/mac/WK2BrowserWindowController.m:202 > - (void)applicationTerminating > { > - // FIXME: Why are we bothering to close the page? This doesn't even prevent LEAK output. > - WKPageClose(_webView.pageRef); > } Just remove this. > Tools/MiniBrowser/mac/WK2BrowserWindowController.m:280 > + [alert beginSheetModalForWindow:self.window completionHandler:^void (NSModalResponse response) { No need for void here. > Tools/MiniBrowser/mac/WK2BrowserWindowController.m:296 > + [alert beginSheetModalForWindow:self.window completionHandler:^void (NSModalResponse response) { No need for void here. > Tools/MiniBrowser/mac/WK2BrowserWindowController.m:297 > + completionHandler(response == NSModalResponseStop); Is stop really the right response here? > Tools/MiniBrowser/mac/WK2BrowserWindowController.m:320 > + // FIXME: need to send OK/Cancel back. > + completionHandler([input stringValue]); Passing null implies cancel.
https://trac.webkit.org/r165749