Bug 161394

Summary: AX: WKWebView for macOS does not allow configuration of tabsToLinks
Product: WebKit Reporter: Dan <dsaunders45459>
Component: AccessibilityAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, bburg, commit-queue, darin, dasau, mitz, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Mac   
OS: OS X 10.11   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Dan 2016-08-30 11:19:49 PDT
WebView allows setting [WebPreferences setTabsToLinks:] to allow the tab key to navigate between links in the web page. WKWebView does not expose this preference, which is an accessibility bug to us. To the end user interacting with the embedded browser, they are not aware they need to press options + tab to be able to access the link through keyboard. They expect the tab key which navigate between other cocoa controls in the window to navigate to the DOM elements that accept keyboard focus. Safari allows setTabsToLinks as a configurable setting, but the WKWebView control provided does not share this setting with Safari and no way to configure it through our code creating a WKWebView instance.
Comment 1 Radar WebKit Bug Importer 2016-08-30 11:20:25 PDT
<rdar://problem/28078982>
Comment 2 Dan Saunders 2016-08-30 18:40:12 PDT
Created attachment 287469 [details]
Patch
Comment 3 Anders Carlsson 2016-08-31 10:01:34 PDT
Comment on attachment 287469 [details]
Patch

We have to figure out whether this is something we want to expose on WKPreferences or not - it could either be a WKWebViewConfiguration property or a WKWebView property.
Comment 4 Dan Saunders 2016-09-06 11:21:41 PDT
I think this is more of a preference than a WKWebView property. The same property is available in WebPreferences for WebView control, so it makes sense to me to add in WKPreferences. Most of the properties on WKWebView change their state based on the web page contents loaded in the control, which is not the case with tabsToLinks. There is not a WKWebViewConfiguration equivalent of WebView to base the location on (some properties on WebPreferences for WebView have moved to WKWebViewConfiguration), but you also find this option as a preference in Safari. The user may want to configure it based on the WKWebView application.
Comment 5 Anders Carlsson 2016-09-06 11:40:37 PDT
(In reply to comment #4)
> I think this is more of a preference than a WKWebView property. The same
> property is available in WebPreferences for WebView control, so it makes
> sense to me to add in WKPreferences. Most of the properties on WKWebView
> change their state based on the web page contents loaded in the control,
> which is not the case with tabsToLinks. There is not a
> WKWebViewConfiguration equivalent of WebView to base the location on (some
> properties on WebPreferences for WebView have moved to
> WKWebViewConfiguration), but you also find this option as a preference in
> Safari. The user may want to configure it based on the WKWebView application.

After talking to some of my fellow colleagues, I tend to agree - WKPreferences is intended to be used for "things you might want to show in a preferences window", and "tabs to links" is one of the Safari preferences.

That said, I think we can come up with a better name than "tabsToLinks". It sounds like  it converts tabs into links.
Comment 6 Dan Saunders 2016-09-06 11:55:48 PDT
(In reply to comment #5)
> (In reply to comment #4)
> > I think this is more of a preference than a WKWebView property. The same
> > property is available in WebPreferences for WebView control, so it makes
> > sense to me to add in WKPreferences. Most of the properties on WKWebView
> > change their state based on the web page contents loaded in the control,
> > which is not the case with tabsToLinks. There is not a
> > WKWebViewConfiguration equivalent of WebView to base the location on (some
> > properties on WebPreferences for WebView have moved to
> > WKWebViewConfiguration), but you also find this option as a preference in
> > Safari. The user may want to configure it based on the WKWebView application.
> 
> After talking to some of my fellow colleagues, I tend to agree -
> WKPreferences is intended to be used for "things you might want to show in a
> preferences window", and "tabs to links" is one of the Safari preferences.
> 
> That said, I think we can come up with a better name than "tabsToLinks". It
> sounds like  it converts tabs into links.


I was keeping consistency with what is exposed in WebPreferences. Have there been other name changes between WebView and WKWebView for similar properties? I could call it tabNavigatesToLinks or linkTabStopEnabled
Comment 7 BJ Burg 2016-09-09 17:05:36 PDT
(In reply to comment #6)
> (In reply to comment #5)
> > (In reply to comment #4)
> > > I think this is more of a preference than a WKWebView property. The same
> > > property is available in WebPreferences for WebView control, so it makes
> > > sense to me to add in WKPreferences. Most of the properties on WKWebView
> > > change their state based on the web page contents loaded in the control,
> > > which is not the case with tabsToLinks. There is not a
> > > WKWebViewConfiguration equivalent of WebView to base the location on (some
> > > properties on WebPreferences for WebView have moved to
> > > WKWebViewConfiguration), but you also find this option as a preference in
> > > Safari. The user may want to configure it based on the WKWebView application.
> > 
> > After talking to some of my fellow colleagues, I tend to agree -
> > WKPreferences is intended to be used for "things you might want to show in a
> > preferences window", and "tabs to links" is one of the Safari preferences.
> > 
> > That said, I think we can come up with a better name than "tabsToLinks". It
> > sounds like  it converts tabs into links.
> 
> 
> I was keeping consistency with what is exposed in WebPreferences. Have there
> been other name changes between WebView and WKWebView for similar
> properties? I could call it tabNavigatesToLinks or linkTabStopEnabled

tabNavigatesToLinks sounds better to me.

Anders, is there anything else holding up review of this patch aside from the renaming?
Comment 8 BJ Burg 2016-09-09 17:05:58 PDT
Comment on attachment 287469 [details]
Patch

Please rename tabsToLinks to tabNavigatesToLinks.
Comment 9 Dan Saunders 2016-09-10 15:16:38 PDT
Created attachment 288503 [details]
Patch
Comment 10 Anders Carlsson 2016-09-12 11:47:55 PDT
Comment on attachment 288503 [details]
Patch

After discussing the name some more, we feel that "tabFocusesLinks" better explains what this preference does - navigates sounds like it will actually navigate to the webpage that the link points to. Everything else looks great though, so please rename the property and we'll get it landed.
Comment 11 Dan Saunders 2016-09-12 14:20:16 PDT
Created attachment 288610 [details]
Patch
Comment 12 WebKit Commit Bot 2016-09-12 14:44:36 PDT
Comment on attachment 288610 [details]
Patch

Clearing flags on attachment: 288610

Committed r205825: <http://trac.webkit.org/changeset/205825>
Comment 13 WebKit Commit Bot 2016-09-12 14:44:42 PDT
All reviewed patches have been landed.  Closing bug.