⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 238544 in webkit


Ignore:
Timestamp:
Nov 26, 2018, 7:32:06 PM (8 years ago)
Author:
Wenson Hsieh
Message:

[Cocoa] No way for clients to tell whether the content view is in the responder chain when the web view is
https://bugs.webkit.org/show_bug.cgi?id=169212
<rdar://problem/30899656>

Reviewed by Tim Horton.

Source/WebKit:

Add an SPI hook to allow internal WKWebView clients to determine whether the WKWebView's content view is the
first responder. Intended for use by clients, such as Mail, that embed native text input views and other views
that may become first responder within the view hierarchy of the WKWebView.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _contentViewIsFirstResponder]):

  • UIProcess/API/Cocoa/WKWebViewPrivate.h:

Tools:

Add an API test to exercise the behavior of -_contentViewIsFirstResponder when an embedded text input becomes
and resigns first responder.

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKitCocoa/WKWebViewFirstResponderTests.mm: Added.

(-[FirstResponderTestingView initWithFrame:]):
(-[FirstResponderTestingView inputField]):
(TestWebKitAPI::TEST):

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r238538 r238544  
     12018-11-26  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [Cocoa] No way for clients to tell whether the content view is in the responder chain when the web view is
     4        https://bugs.webkit.org/show_bug.cgi?id=169212
     5        <rdar://problem/30899656>
     6
     7        Reviewed by Tim Horton.
     8
     9        Add an SPI hook to allow internal WKWebView clients to determine whether the WKWebView's content view is the
     10        first responder. Intended for use by clients, such as Mail, that embed native text input views and other views
     11        that may become first responder within the view hierarchy of the WKWebView.
     12
     13        * UIProcess/API/Cocoa/WKWebView.mm:
     14        (-[WKWebView _contentViewIsFirstResponder]):
     15        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
     16
    1172018-11-26  Tim Horton  <timothy_horton@apple.com>
    218
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r238527 r238544  
    13191319
    13201320#if PLATFORM(IOS_FAMILY)
     1321
     1322- (BOOL)_contentViewIsFirstResponder
     1323{
     1324    return self._currentContentView.isFirstResponder;
     1325}
    13211326
    13221327- (_WKDragInteractionPolicy)_dragInteractionPolicy
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h

    r238527 r238544  
    474474- (UIView *)_fullScreenPlaceholderView WK_API_AVAILABLE(ios(12.0));
    475475
     476@property (nonatomic, readonly) BOOL _contentViewIsFirstResponder WK_API_AVAILABLE(ios(WK_IOS_TBA));
    476477#else
    477478- (void)_dismissContentRelativeChildWindows WK_API_AVAILABLE(macosx(10.13.4));
  • trunk/Tools/ChangeLog

    r238539 r238544  
     12018-11-26  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [Cocoa] No way for clients to tell whether the content view is in the responder chain when the web view is
     4        https://bugs.webkit.org/show_bug.cgi?id=169212
     5        <rdar://problem/30899656>
     6
     7        Reviewed by Tim Horton.
     8
     9        Add an API test to exercise the behavior of `-_contentViewIsFirstResponder` when an embedded text input becomes
     10        and resigns first responder.
     11
     12        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     13        * TestWebKitAPI/Tests/WebKitCocoa/WKWebViewFirstResponderTests.mm: Added.
     14        (-[FirstResponderTestingView initWithFrame:]):
     15        (-[FirstResponderTestingView inputField]):
     16        (TestWebKitAPI::TEST):
     17
    1182018-11-26  Fujii Hironori  <Hironori.Fujii@sony.com>
    219
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r238471 r238544  
    803803                ECA680CE1E68CC0900731D20 /* StringUtilities.mm in Sources */ = {isa = PBXBuildFile; fileRef = ECA680CD1E68CC0900731D20 /* StringUtilities.mm */; };
    804804                F407FE391F1D0DFC0017CF25 /* enormous.svg in Copy Resources */ = {isa = PBXBuildFile; fileRef = F407FE381F1D0DE60017CF25 /* enormous.svg */; };
     805                F4106C6921ACBF84004B89A1 /* WKWebViewFirstResponderTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4106C6821ACBF84004B89A1 /* WKWebViewFirstResponderTests.mm */; };
    805806                F415086D1DA040C50044BE9B /* play-audio-on-click.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F415086C1DA040C10044BE9B /* play-audio-on-click.html */; };
    806807                F418BE151F71B7DC001970E6 /* RoundedRectTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F418BE141F71B7DC001970E6 /* RoundedRectTests.cpp */; };
     
    20902091                F3FC3EE213678B7300126A65 /* libgtest.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libgtest.a; sourceTree = BUILT_PRODUCTS_DIR; };
    20912092                F407FE381F1D0DE60017CF25 /* enormous.svg */ = {isa = PBXFileReference; lastKnownFileType = text; path = enormous.svg; sourceTree = "<group>"; };
     2093                F4106C6821ACBF84004B89A1 /* WKWebViewFirstResponderTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = WKWebViewFirstResponderTests.mm; path = Tests/WebKitCocoa/WKWebViewFirstResponderTests.mm; sourceTree = "<group>"; };
    20922094                F415086C1DA040C10044BE9B /* play-audio-on-click.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "play-audio-on-click.html"; sourceTree = "<group>"; };
    20932095                F418BE141F71B7DC001970E6 /* RoundedRectTests.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RoundedRectTests.cpp; sourceTree = "<group>"; };
     
    22932295                                BCB9E7C711234E3A00A137E0 /* TestsController.h */,
    22942296                                7C83E0361D0A5F7000FEBCF3 /* Utilities.h */,
     2297                                F4106C6821ACBF84004B89A1 /* WKWebViewFirstResponderTests.mm */,
    22952298                                44A622C114A0E2B60048515B /* WTFStringUtilities.h */,
    22962299                        );
     
    42104213                                F4811E5921940BDE00A5E0FD /* WKWebViewEditActions.mm in Sources */,
    42114214                                0F3B94A71A77267400DE3272 /* WKWebViewEvaluateJavaScript.mm in Sources */,
     4215                                F4106C6921ACBF84004B89A1 /* WKWebViewFirstResponderTests.mm in Sources */,
    42124216                                D34E08761E4E42E1005FF14A /* WKWebViewGetContents.mm in Sources */,
    42134217                                F4FA91811E61849B007B8C1D /* WKWebViewMacEditingTests.mm in Sources */,
Note: See TracChangeset for help on using the changeset viewer.