Changeset 238498 in webkit


Ignore:
Timestamp:
Nov 26, 2018 9:42:12 AM (5 years ago)
Author:
dbates@webkit.org
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):

Location:
trunk/Source/WebKit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r238497 r238498  
     12018-11-26  Daniel Bates  <dabates@apple.com>
     2
     3        Wire up ChromeClient::takeFocus() on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=191763
     5        <rdar://problem/18584508>
     6
     7        Reviewed by Dan Bernstein.
     8
     9        Expose existing Mac SPI for use on iOS. This will allow Safari to be notified when
     10        the engine has cycled through all the tab focusable elements on the page.
     11
     12        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
     13        * UIProcess/Cocoa/UIDelegate.h:
     14        * UIProcess/Cocoa/UIDelegate.mm:
     15        (WebKit::UIDelegate::setDelegate):
     16
    1172018-11-26  Wenson Hsieh  <wenson_hsieh@apple.com>
    218
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h

    r236865 r238498  
    4848@protocol UIDropSession;
    4949#else
    50 typedef NS_ENUM(NSInteger, _WKFocusDirection) {
    51     _WKFocusDirectionBackward,
    52     _WKFocusDirectionForward,
    53 } WK_API_AVAILABLE(macosx(10.13.4));
    54 
    5550typedef NS_ENUM(NSInteger, _WKAutoplayEvent) {
    5651    _WKAutoplayEventDidPreventFromAutoplaying,
     
    7671} WK_API_AVAILABLE(macosx(10.13.4));
    7772#endif
     73
     74typedef NS_ENUM(NSInteger, _WKFocusDirection) {
     75    _WKFocusDirectionBackward,
     76    _WKFocusDirectionForward,
     77} WK_API_AVAILABLE(macosx(10.13.4), ios(WK_IOS_TBA));
    7878
    7979@protocol WKUIDelegatePrivate <WKUIDelegate>
     
    123123
    124124- (void)_webView:(WKWebView *)webView didChangeFontAttributes:(NSDictionary<NSString *, id> *)fontAttributes WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
     125
     126- (void)_webView:(WKWebView *)webView takeFocus:(_WKFocusDirection)direction WK_API_AVAILABLE(macosx(10.13.4), ios(WK_IOS_TBA));
    125127
    126128#if TARGET_OS_IPHONE
     
    174176- (void)_webViewDidScroll:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.13.4));
    175177- (void)_webViewRunModal:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.13.4));
    176 - (void)_webView:(WKWebView *)webView takeFocus:(_WKFocusDirection)direction WK_API_AVAILABLE(macosx(10.13.4));
    177178- (void)_webView:(WKWebView *)webView didNotHandleWheelEvent:(NSEvent *)event WK_API_AVAILABLE(macosx(10.13.4));
    178179- (void)_webView:(WKWebView *)webView handleAutoplayEvent:(_WKAutoplayEvent)event withFlags:(_WKAutoplayEventFlags)flags WK_API_AVAILABLE(macosx(10.13.4));
  • trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.h

    r237266 r238498  
    9696        void reachedApplicationCacheOriginQuota(WebPageProxy*, const WebCore::SecurityOrigin&, uint64_t currentQuota, uint64_t totalBytesNeeded, Function<void(unsigned long long)>&& completionHandler) final;
    9797        void didResignInputElementStrongPasswordAppearance(WebPageProxy&, API::Object*) final;
     98        void takeFocus(WebPageProxy*, WKFocusDirection) final;
    9899#if PLATFORM(MAC)
    99100        void showPage(WebPageProxy*) final;
    100         void takeFocus(WebPageProxy*, WKFocusDirection) final;
    101101        void focus(WebPageProxy*) final;
    102102        void unfocus(WebPageProxy*) final;
     
    164164        bool webViewRequestGeolocationPermissionForFrameDecisionHandler : 1;
    165165        bool webViewDidResignInputElementStrongPasswordAppearanceWithUserInfo : 1;
     166        bool webViewTakeFocus : 1;
    166167#if PLATFORM(MAC)
    167168        bool showWebView : 1;
     
    169170        bool unfocusWebView : 1;
    170171        bool webViewRunModal : 1;
    171         bool webViewTakeFocus : 1;
    172172        bool webViewDidScroll : 1;
    173173        bool webViewHeaderHeight : 1;
  • trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm

    r237988 r238498  
    108108    m_delegateMethods.webViewRequestGeolocationPermissionForFrameDecisionHandler = [delegate respondsToSelector:@selector(_webView:requestGeolocationPermissionForFrame:decisionHandler:)];
    109109    m_delegateMethods.webViewDidResignInputElementStrongPasswordAppearanceWithUserInfo = [delegate respondsToSelector:@selector(_webView:didResignInputElementStrongPasswordAppearanceWithUserInfo:)];
     110    m_delegateMethods.webViewTakeFocus = [delegate respondsToSelector:@selector(_webView:takeFocus:)];
    110111
    111112#if PLATFORM(MAC)
     
    113114    m_delegateMethods.focusWebView = [delegate respondsToSelector:@selector(_focusWebView:)];
    114115    m_delegateMethods.unfocusWebView = [delegate respondsToSelector:@selector(_unfocusWebView:)];
    115     m_delegateMethods.webViewTakeFocus = [delegate respondsToSelector:@selector(_webView:takeFocus:)];
    116116    m_delegateMethods.webViewRunModal = [delegate respondsToSelector:@selector(_webViewRunModal:)];
    117117    m_delegateMethods.webViewDidScroll = [delegate respondsToSelector:@selector(_webViewDidScroll:)];
     
    454454}
    455455
    456 #if PLATFORM(MAC)
    457456static inline _WKFocusDirection toWKFocusDirection(WKFocusDirection direction)
    458457{
     
    479478}
    480479
     480#if PLATFORM(MAC)
    481481bool UIDelegate::UIClient::canRunModal() const
    482482{
Note: See TracChangeset for help on using the changeset viewer.