When WKWebView control exists in a window with other controls that accept keyboard focus on macOS, there is no way to tab out of the WKWebView and access the other controls with keyboard. The keyView loop contains a cycle inside the WKWebView regardless of the page being loaded. This could block using WKWebView in accessible applications, without voiceover there is no way to exit the control using keyboard. WebView control does not have this issue.
<rdar://problem/28100085>
UIDelegate::UIClient::takeFocus needs to be implemented to get this behavior
Created attachment 359141 [details] Patch
Comment on attachment 359141 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=359141&action=review > Tools/TestWebKitAPI/Tests/WebKitCocoa/CommandBackForward.mm:86 > + window = [[OffscreenWindow alloc] initWithSize:CGSizeMake(100, 100)]; adopt? > Tools/TestWebKitAPI/Tests/WebKitCocoa/TabOutOfWebView.mm:61 > + RetainPtr<TestWKWebView> webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 100, 100, 100) configuration:[[WKWebViewConfiguration alloc] init] addToWindow:NO]); Let's -autorelease the configuration, or put it in a RetainPtr and use adoptNS.
(In reply to Wenson Hsieh from comment #4) > Comment on attachment 359141 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=359141&action=review > > > Tools/TestWebKitAPI/Tests/WebKitCocoa/CommandBackForward.mm:86 > > + window = [[OffscreenWindow alloc] initWithSize:CGSizeMake(100, 100)]; > > adopt? > > > Tools/TestWebKitAPI/Tests/WebKitCocoa/TabOutOfWebView.mm:61 > > + RetainPtr<TestWKWebView> webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 100, 100, 100) configuration:[[WKWebViewConfiguration alloc] init] addToWindow:NO]); > > Let's -autorelease the configuration, or put it in a RetainPtr and use > adoptNS. LOL I've been ARCing too much. Thank you for your eyes.
Created attachment 359181 [details] Patch
Created attachment 359193 [details] Patch
Comment on attachment 359193 [details] Patch Clearing flags on attachment: 359193 Committed r240010: <https://trac.webkit.org/changeset/240010>
All reviewed patches have been landed. Closing bug.