Title: [238498] trunk/Source/WebKit
Revision
238498
Author
[email protected]
Date
2018-11-26 09:42:12 -0800 (Mon, 26 Nov 2018)

Log Message

Wire up ChromeClient::takeFocus() on iOS
https://bugs.webkit.org/show_bug.cgi?id=191763
<rdar://problem/18584508>

Reviewed by Dan Bernstein.

Expose existing Mac SPI for use on iOS. This will allow Safari to be notified when
the engine has cycled through all the tab focusable elements on the page.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (238497 => 238498)


--- trunk/Source/WebKit/ChangeLog	2018-11-26 17:11:48 UTC (rev 238497)
+++ trunk/Source/WebKit/ChangeLog	2018-11-26 17:42:12 UTC (rev 238498)
@@ -1,3 +1,19 @@
+2018-11-26  Daniel Bates  <[email protected]>
+
+        Wire up ChromeClient::takeFocus() on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=191763
+        <rdar://problem/18584508>
+
+        Reviewed by Dan Bernstein.
+
+        Expose existing Mac SPI for use on iOS. This will allow Safari to be notified when
+        the engine has cycled through all the tab focusable elements on the page.
+
+        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
+        * UIProcess/Cocoa/UIDelegate.h:
+        * UIProcess/Cocoa/UIDelegate.mm:
+        (WebKit::UIDelegate::setDelegate):
+
 2018-11-26  Wenson Hsieh  <[email protected]>
 
         Unreviewed, fix the internal 32-bit macOS 10.13 build after r238471

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h (238497 => 238498)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h	2018-11-26 17:11:48 UTC (rev 238497)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h	2018-11-26 17:42:12 UTC (rev 238498)
@@ -47,11 +47,6 @@
 @protocol UIDragSession;
 @protocol UIDropSession;
 #else
-typedef NS_ENUM(NSInteger, _WKFocusDirection) {
-    _WKFocusDirectionBackward,
-    _WKFocusDirectionForward,
-} WK_API_AVAILABLE(macosx(10.13.4));
-
 typedef NS_ENUM(NSInteger, _WKAutoplayEvent) {
     _WKAutoplayEventDidPreventFromAutoplaying,
     _WKAutoplayEventDidPlayMediaPreventedFromAutoplaying,
@@ -76,6 +71,11 @@
 } WK_API_AVAILABLE(macosx(10.13.4));
 #endif
 
+typedef NS_ENUM(NSInteger, _WKFocusDirection) {
+    _WKFocusDirectionBackward,
+    _WKFocusDirectionForward,
+} WK_API_AVAILABLE(macosx(10.13.4), ios(WK_IOS_TBA));
+
 @protocol WKUIDelegatePrivate <WKUIDelegate>
 
 struct UIEdgeInsets;
@@ -123,6 +123,8 @@
 
 - (void)_webView:(WKWebView *)webView didChangeFontAttributes:(NSDictionary<NSString *, id> *)fontAttributes WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
 
+- (void)_webView:(WKWebView *)webView takeFocus:(_WKFocusDirection)direction WK_API_AVAILABLE(macosx(10.13.4), ios(WK_IOS_TBA));
+
 #if TARGET_OS_IPHONE
 - (BOOL)_webView:(WKWebView *)webView shouldIncludeAppLinkActionsForElement:(_WKActivatedElementInfo *)element WK_API_AVAILABLE(ios(9.0));
 - (NSArray *)_webView:(WKWebView *)webView actionsForElement:(_WKActivatedElementInfo *)element defaultActions:(NSArray<_WKElementAction *> *)defaultActions;
@@ -173,7 +175,6 @@
 - (void)_unfocusWebView:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.13.4));
 - (void)_webViewDidScroll:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.13.4));
 - (void)_webViewRunModal:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.13.4));
-- (void)_webView:(WKWebView *)webView takeFocus:(_WKFocusDirection)direction WK_API_AVAILABLE(macosx(10.13.4));
 - (void)_webView:(WKWebView *)webView didNotHandleWheelEvent:(NSEvent *)event WK_API_AVAILABLE(macosx(10.13.4));
 - (void)_webView:(WKWebView *)webView handleAutoplayEvent:(_WKAutoplayEvent)event withFlags:(_WKAutoplayEventFlags)flags WK_API_AVAILABLE(macosx(10.13.4));
 - (void)_webView:(WKWebView *)webView didClickAutoFillButtonWithUserInfo:(id <NSSecureCoding>)userInfo WK_API_AVAILABLE(macosx(10.13.4));

Modified: trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.h (238497 => 238498)


--- trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.h	2018-11-26 17:11:48 UTC (rev 238497)
+++ trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.h	2018-11-26 17:42:12 UTC (rev 238498)
@@ -95,9 +95,9 @@
         void exceededDatabaseQuota(WebPageProxy*, WebFrameProxy*, API::SecurityOrigin*, const WTF::String& databaseName, const WTF::String& displayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentUsage, unsigned long long expectedUsage, Function<void(unsigned long long)>&& completionHandler) final;
         void reachedApplicationCacheOriginQuota(WebPageProxy*, const WebCore::SecurityOrigin&, uint64_t currentQuota, uint64_t totalBytesNeeded, Function<void(unsigned long long)>&& completionHandler) final;
         void didResignInputElementStrongPasswordAppearance(WebPageProxy&, API::Object*) final;
+        void takeFocus(WebPageProxy*, WKFocusDirection) final;
 #if PLATFORM(MAC)
         void showPage(WebPageProxy*) final;
-        void takeFocus(WebPageProxy*, WKFocusDirection) final;
         void focus(WebPageProxy*) final;
         void unfocus(WebPageProxy*) final;
         bool canRunModal() const final;
@@ -163,12 +163,12 @@
         bool webViewRunBeforeUnloadConfirmPanelWithMessageInitiatedByFrameCompletionHandler : 1;
         bool webViewRequestGeolocationPermissionForFrameDecisionHandler : 1;
         bool webViewDidResignInputElementStrongPasswordAppearanceWithUserInfo : 1;
+        bool webViewTakeFocus : 1;
 #if PLATFORM(MAC)
         bool showWebView : 1;
         bool focusWebView : 1;
         bool unfocusWebView : 1;
         bool webViewRunModal : 1;
-        bool webViewTakeFocus : 1;
         bool webViewDidScroll : 1;
         bool webViewHeaderHeight : 1;
         bool webViewFooterHeight : 1;

Modified: trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm (238497 => 238498)


--- trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm	2018-11-26 17:11:48 UTC (rev 238497)
+++ trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm	2018-11-26 17:42:12 UTC (rev 238498)
@@ -107,12 +107,12 @@
     m_delegateMethods.webViewRunBeforeUnloadConfirmPanelWithMessageInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(_webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler:)];
     m_delegateMethods.webViewRequestGeolocationPermissionForFrameDecisionHandler = [delegate respondsToSelector:@selector(_webView:requestGeolocationPermissionForFrame:decisionHandler:)];
     m_delegateMethods.webViewDidResignInputElementStrongPasswordAppearanceWithUserInfo = [delegate respondsToSelector:@selector(_webView:didResignInputElementStrongPasswordAppearanceWithUserInfo:)];
+    m_delegateMethods.webViewTakeFocus = [delegate respondsToSelector:@selector(_webView:takeFocus:)];
 
 #if PLATFORM(MAC)
     m_delegateMethods.showWebView = [delegate respondsToSelector:@selector(_showWebView:)];
     m_delegateMethods.focusWebView = [delegate respondsToSelector:@selector(_focusWebView:)];
     m_delegateMethods.unfocusWebView = [delegate respondsToSelector:@selector(_unfocusWebView:)];
-    m_delegateMethods.webViewTakeFocus = [delegate respondsToSelector:@selector(_webView:takeFocus:)];
     m_delegateMethods.webViewRunModal = [delegate respondsToSelector:@selector(_webViewRunModal:)];
     m_delegateMethods.webViewDidScroll = [delegate respondsToSelector:@selector(_webViewDidScroll:)];
     m_delegateMethods.webViewGetToolbarsAreVisibleWithCompletionHandler = [delegate respondsToSelector:@selector(_webView:getToolbarsAreVisibleWithCompletionHandler:)];
@@ -453,7 +453,6 @@
     }).get()];
 }
 
-#if PLATFORM(MAC)
 static inline _WKFocusDirection toWKFocusDirection(WKFocusDirection direction)
 {
     switch (direction) {
@@ -478,6 +477,7 @@
     [(id <WKUIDelegatePrivate>)delegate _webView:m_uiDelegate.m_webView takeFocus:toWKFocusDirection(direction)];
 }
 
+#if PLATFORM(MAC)
 bool UIDelegate::UIClient::canRunModal() const
 {
     return m_uiDelegate.m_delegateMethods.webViewRunModal;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to