Changeset 238635 in webkit
- Timestamp:
- Nov 28, 2018 1:55:13 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r238633 r238635 1 2018-11-28 Daniel Bates <dabates@apple.com> 2 3 [iOS] Page not defocused when Find-in-page becomes first responder 4 https://bugs.webkit.org/show_bug.cgi?id=192084 5 <rdar://problem/46146777> 6 7 Reviewed by Tim Horton. 8 9 When -becomeFirstResponder and -resignFirstResponder is called the page should become focused 10 and defocused, respectively. WebKit adjusts it behavior depending on whether it knows it has 11 focus. This includes decisions about whether to allow an element to be focused. We need to 12 ensure that WebKit knows whether the web view is focused for it to make good decisions. 13 14 * UIProcess/ios/PageClientImplIOS.mm: 15 (WebKit::PageClientImpl::isViewFocused): Check if the content view is the first responder and 16 hence is accepting keyboard input. Note that picture-in-picture views do not accept keyboard 17 input. 18 * UIProcess/ios/WKContentViewInteraction.mm: 19 (-[WKContentView becomeFirstResponderForWebView]): Update activity state when the view 20 becomes focused. 21 (-[WKContentView resignFirstResponderForWebView]): Update activity state when the view 22 becomes defocused. 23 1 24 2018-11-28 Alex Christensen <achristensen@webkit.org> 2 25 -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
r238468 r238635 167 167 bool PageClientImpl::isViewFocused() 168 168 { 169 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=133098 170 return isViewWindowActive() || [m_webView _isRetainingActiveFocusedState]; 169 if (isViewInWindow() && ![m_webView _isBackground]) 170 return [m_webView _contentViewIsFirstResponder]; 171 return [m_webView _isRetainingActiveFocusedState]; 171 172 } 172 173 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r238526 r238635 1035 1035 } 1036 1036 1037 if (didBecomeFirstResponder) 1038 _page->activityStateDidChange(WebCore::ActivityState::IsFocused); 1039 1037 1040 if (didBecomeFirstResponder && [self canShowNonEmptySelectionView]) 1038 1041 [_textSelectionAssistant activateSelection]; … … 1064 1067 1065 1068 bool superDidResign = [super resignFirstResponder]; 1069 1070 if (superDidResign) 1071 _page->activityStateDidChange(WebCore::ActivityState::IsFocused); 1066 1072 1067 1073 _resigningFirstResponder = NO; -
trunk/Tools/ChangeLog
r238634 r238635 1 2018-11-28 Daniel Bates <dabates@apple.com> 2 3 [iOS] Page not defocused when Find-in-page becomes first responder 4 https://bugs.webkit.org/show_bug.cgi?id=192084 5 <rdar://problem/46146777> 6 7 Reviewed by Tim Horton. 8 9 Add tests for both Mac and iOS to ensure that when finding a string on the page 10 that we do not start an input session if a match is found in an <input> and the 11 WKWebView is not the first responder. 12 13 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 14 * TestWebKitAPI/Tests/WebKitCocoa/WKWebViewFindString.mm: Added. 15 (-[WKWebViewFindStringInputDelegate _webView:didStartInputSession:]): 16 (-[WKWebViewFindStringFindDelegate findString]): 17 (-[WKWebViewFindStringFindDelegate _webView:didCountMatches:forString:]): 18 (-[WKWebViewFindStringFindDelegate _webView:didFindMatches:forString:withMatchIndex:]): 19 (-[WKWebViewFindStringFindDelegate _webView:didFailToFindString:]): 20 (returnNo): 21 (returnYes): 22 (viewIsFirstResponder): 23 (TestWebKitAPI::TEST): 24 * WebKitTestRunner/ios/PlatformWebViewIOS.mm: 25 (WTR::PlatformWebView::PlatformWebView): Make the view the first responder before the 26 window key. This matches the ordering used in PlatformWebView::focus(). No behavior change. 27 1 28 2018-11-28 Aakash Jain <aakash_jain@apple.com> 2 29 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r238544 r238635 780 780 CE3524F91B1441C40028A7C5 /* TextFieldDidBeginAndEndEditing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE3524F11B142B8D0028A7C5 /* TextFieldDidBeginAndEndEditing.cpp */; }; 781 781 CE3524FA1B1443890028A7C5 /* input-focus-blur.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CE3524F51B142BBB0028A7C5 /* input-focus-blur.html */; }; 782 CE449E1121AE0F7200E7ADA1 /* WKWebViewFindString.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE449E1021AE0F7200E7ADA1 /* WKWebViewFindString.mm */; }; 782 783 CE4D5DE71F6743BA0072CFC6 /* StringWithDirection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE4D5DE51F6743BA0072CFC6 /* StringWithDirection.cpp */; }; 783 784 CE6E81A020A6935F00E2C80F /* SetTimeoutFunction.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE6E819F20A6935F00E2C80F /* SetTimeoutFunction.mm */; }; … … 2054 2055 CE3524F21B142B8D0028A7C5 /* TextFieldDidBeginAndEndEditing_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextFieldDidBeginAndEndEditing_Bundle.cpp; sourceTree = "<group>"; }; 2055 2056 CE3524F51B142BBB0028A7C5 /* input-focus-blur.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "input-focus-blur.html"; sourceTree = "<group>"; }; 2057 CE449E1021AE0F7200E7ADA1 /* WKWebViewFindString.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewFindString.mm; sourceTree = "<group>"; }; 2056 2058 CE4D5DE51F6743BA0072CFC6 /* StringWithDirection.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = StringWithDirection.cpp; sourceTree = "<group>"; }; 2057 2059 CE50D8C81C8665CE0072EA5A /* OptionSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionSet.cpp; sourceTree = "<group>"; }; … … 2545 2547 F4811E5821940B4400A5E0FD /* WKWebViewEditActions.mm */, 2546 2548 0F3B94A51A77266C00DE3272 /* WKWebViewEvaluateJavaScript.mm */, 2549 CE449E1021AE0F7200E7ADA1 /* WKWebViewFindString.mm */, 2547 2550 D3BE5E341E4CE85E00FD563A /* WKWebViewGetContents.mm */, 2548 2551 37A9DBE7213B4C9300D261A2 /* WKWebViewServerTrustKVC.mm */, … … 4213 4216 F4811E5921940BDE00A5E0FD /* WKWebViewEditActions.mm in Sources */, 4214 4217 0F3B94A71A77267400DE3272 /* WKWebViewEvaluateJavaScript.mm in Sources */, 4218 CE449E1121AE0F7200E7ADA1 /* WKWebViewFindString.mm in Sources */, 4215 4219 F4106C6921ACBF84004B89A1 /* WKWebViewFirstResponderTests.mm in Sources */, 4216 4220 D34E08761E4E42E1005FF14A /* WKWebViewGetContents.mm in Sources */, -
trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm
r238134 r238635 182 182 183 183 [m_window.rootViewController.view addSubview:m_view]; 184 [m_view becomeFirstResponder]; 184 185 [m_window makeKeyAndVisible]; 185 [m_view becomeFirstResponder];186 186 } 187 187
Note: See TracChangeset
for help on using the changeset viewer.