AX: WKWebView for macOS does not allow configuration of tabsToLinks
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Sep 2016 21:42:31 +0000 (21:42 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Sep 2016 21:42:31 +0000 (21:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=161394

Patch by DAN SAUNDERS <dasau@microsoft.com> on 2016-09-12
Reviewed by Anders Carlsson.

Source/WebKit2:

* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences encodeWithCoder:]):
(-[WKPreferences initWithCoder:]):
(-[WKPreferences tabFocusesLinks]):
(-[WKPreferences setTabFocusesLinks:]):

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/Coding.mm:
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205825 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.h
Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/Coding.mm

index 1153b20..d67edf2 100644 (file)
@@ -1,3 +1,17 @@
+2016-09-12  DAN SAUNDERS  <dasau@microsoft.com>
+
+        AX: WKWebView for macOS does not allow configuration of tabsToLinks
+        https://bugs.webkit.org/show_bug.cgi?id=161394
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/API/Cocoa/WKPreferences.h:
+        * UIProcess/API/Cocoa/WKPreferences.mm:
+        (-[WKPreferences encodeWithCoder:]):
+        (-[WKPreferences initWithCoder:]):
+        (-[WKPreferences tabFocusesLinks]):
+        (-[WKPreferences setTabFocusesLinks:]):
+
 2016-09-12  Saam Barati  <sbarati@apple.com>
 
         Add WebKit support for an option in Safari's debug menu similar to "Get Bytecode Profile" but for the Sampling Profiler's data
index 3b277f5..9faced8 100644 (file)
@@ -63,6 +63,13 @@ WK_CLASS_AVAILABLE(macosx(10.10), ios(8.0))
  @discussion The default value is NO.
  */
 @property (nonatomic) BOOL plugInsEnabled;
+
+/*!
+ @property tabFocusesLinks
+ @abstract If tabFocusesLinks is YES, the tab key will focus links and form controls.
+ The option key temporarily reverses this preference.
+ */
+@property (nonatomic) BOOL tabFocusesLinks WK_API_AVAILABLE(macosx(WK_MAC_TBA));
 #endif
 
 @end
index 6774cec..7807090 100644 (file)
@@ -66,6 +66,7 @@
 #if PLATFORM(MAC)
     [coder encodeBool:self.javaEnabled forKey:@"javaEnabled"];
     [coder encodeBool:self.plugInsEnabled forKey:@"plugInsEnabled"];
+    [coder encodeBool:self.tabFocusesLinks forKey:@"tabFocusesLinks"];
 #endif
 }
 
@@ -81,6 +82,7 @@
 #if PLATFORM(MAC)
     self.javaEnabled = [coder decodeBoolForKey:@"javaEnabled"];
     self.plugInsEnabled = [coder decodeBoolForKey:@"plugInsEnabled"];
+    self.tabFocusesLinks = [coder decodeBoolForKey:@"tabFocusesLinks"];
 #endif
 
     return self;
     _preferences->setPluginsEnabled(plugInsEnabled);
 }
 
+- (BOOL)tabFocusesLinks
+{
+    return _preferences->tabsToLinks();
+}
+
+- (void)setTabFocusesLinks:(BOOL)tabFocusesLinks
+{
+    _preferences->setTabsToLinks(tabFocusesLinks);
+}
+
 #endif
 
 #pragma mark WKObject protocol implementation
index 7e0f9c5..c7d60d1 100644 (file)
@@ -1,3 +1,13 @@
+2016-09-12  DAN SAUNDERS  <dasau@microsoft.com>
+
+        AX: WKWebView for macOS does not allow configuration of tabsToLinks
+        https://bugs.webkit.org/show_bug.cgi?id=161394
+
+        Reviewed by Anders Carlsson.
+
+        * TestWebKitAPI/Tests/WebKit2Cocoa/Coding.mm:
+        (TEST):
+
 2016-09-12  Alex Christensen  <achristensen@webkit.org>
 
         Remove trailing control characters and spaces before parsing a URL
index 828b1eb..194271a 100644 (file)
@@ -51,6 +51,7 @@ TEST(Coding, WKPreferences)
     [a setJavaScriptCanOpenWindowsAutomatically:NO];
     [a setJavaEnabled:YES];
     [a setPlugInsEnabled:YES];
+    [a setTabFocusesLinks:YES];
 #endif
 
     auto b = encodeAndDecode(a.get());
@@ -62,6 +63,7 @@ TEST(Coding, WKPreferences)
 #if PLATFORM(MAC)
     EXPECT_EQ([a javaEnabled], [b javaEnabled]);
     EXPECT_EQ([a plugInsEnabled], [b plugInsEnabled]);
+    EXPECT_EQ([a tabFocusesLinks], [b tabFocusesLinks]);
 #endif
 }