Changeset 249051 in webkit
- Timestamp:
- Aug 23, 2019 10:15:42 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 7 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r249042 r249051 1 2019-08-23 Russell Epstein <repstein@apple.com> 2 3 Unreviewed, rolling out r249031. 4 5 Causes multiple test failures on iOS simulator 6 7 Reverted changeset: 8 9 "[iOS] Should show input view when became first responder if 10 keyboard was showing when the view was resigned" 11 https://bugs.webkit.org/show_bug.cgi?id=200902 12 https://trac.webkit.org/changeset/249031 13 1 14 2019-08-23 Megan Gardner <megan_gardner@apple.com> 2 15 -
trunk/LayoutTests/resources/ui-helper.js
r249031 r249051 507 507 } 508 508 509 static waitForKeyboardToShow()510 {511 if (!this.isWebKit2() || !this.isIOSFamily())512 return Promise.resolve();513 514 return new Promise(resolve => {515 testRunner.runUIScript(`516 (function() {517 if (uiController.isShowingKeyboard)518 uiController.uiScriptComplete();519 else520 uiController.didShowKeyboardCallback = () => uiController.uiScriptComplete();521 })()`, resolve);522 });523 }524 525 509 static getUICaretRect() 526 510 { … … 806 790 807 791 return new Promise(resolve => testRunner.runUIScript(`uiController.resignFirstResponder()`, resolve)); 808 }809 810 static becomeFirstResponder()811 {812 if (!this.isWebKit2())813 return Promise.resolve();814 815 return new Promise(resolve => testRunner.runUIScript(`uiController.becomeFirstResponder()`, resolve));816 792 } 817 793 -
trunk/Source/WebKit/ChangeLog
r249036 r249051 1 2019-08-23 Russell Epstein <repstein@apple.com> 2 3 Unreviewed, rolling out r249031. 4 5 Causes multiple test failures on iOS simulator 6 7 Reverted changeset: 8 9 "[iOS] Should show input view when became first responder if 10 keyboard was showing when the view was resigned" 11 https://bugs.webkit.org/show_bug.cgi?id=200902 12 https://trac.webkit.org/changeset/249031 13 1 14 2019-08-22 Andy Estes <aestes@apple.com> 2 15 -
trunk/Source/WebKit/UIProcess/PageClient.h
r249031 r249051 389 389 virtual void updateInputContextAfterBlurringAndRefocusingElement() = 0; 390 390 virtual void elementDidBlur() = 0; 391 virtual void focusedElementDidChangeInputMode(WebCore::InputMode , OptionSet<WebCore::ActivityState::Flag>) = 0;391 virtual void focusedElementDidChangeInputMode(WebCore::InputMode) = 0; 392 392 virtual void didReceiveEditorStateUpdateAfterFocus() = 0; 393 393 virtual bool isFocusingElement() = 0; -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r249031 r249051 1946 1946 void elementDidBlur(); 1947 1947 void updateInputContextAfterBlurringAndRefocusingElement(); 1948 void focusedElementDidChangeInputMode(WebCore::InputMode , OptionSet<WebCore::ActivityState::Flag>);1948 void focusedElementDidChangeInputMode(WebCore::InputMode); 1949 1949 void didReleaseAllTouchPoints(); 1950 1950 void didReceiveEditorStateUpdateAfterFocus(); -
trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in
r249031 r249051 410 410 ElementDidBlur() 411 411 UpdateInputContextAfterBlurringAndRefocusingElement() 412 FocusedElementDidChangeInputMode(enum:uint8_t WebCore::InputMode mode , OptionSet<WebCore::ActivityState::Flag> activityStateChanges)412 FocusedElementDidChangeInputMode(enum:uint8_t WebCore::InputMode mode) 413 413 ScrollingNodeScrollWillStartScroll() 414 414 ScrollingNodeScrollDidEndScroll() -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h
r249031 r249051 152 152 void updateInputContextAfterBlurringAndRefocusingElement() final; 153 153 void elementDidBlur() override; 154 void focusedElementDidChangeInputMode(WebCore::InputMode , OptionSet<WebCore::ActivityState::Flag>) override;154 void focusedElementDidChangeInputMode(WebCore::InputMode) override; 155 155 void didReceiveEditorStateUpdateAfterFocus() override; 156 156 bool isFocusingElement() override; -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
r249031 r249051 574 574 } 575 575 576 void PageClientImpl::focusedElementDidChangeInputMode(WebCore::InputMode mode , OptionSet<WebCore::ActivityState::Flag> activityStateChanges)577 { 578 [m_contentView _didUpdateInputMode:mode activityStateChanges:activityStateChanges];576 void PageClientImpl::focusedElementDidChangeInputMode(WebCore::InputMode mode) 577 { 578 [m_contentView _didUpdateInputMode:mode]; 579 579 } 580 580 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
r249031 r249051 338 338 339 339 BOOL _keyboardDidRequestDismissal; 340 BOOL _wasResignedWhileShowingInputView;341 BOOL _shouldShowAutomaticKeyboardUIWhenInputModeNone;342 340 343 341 #if USE(UIKIT_KEYBOARD_ADDITIONS) … … 465 463 - (void)_elementDidBlur; 466 464 - (void)_hideContextMenuHintContainer; 467 - (void)_didUpdateInputMode:(WebCore::InputMode)mode activityStateChanges:(OptionSet<WebCore::ActivityState::Flag>)activityStateChanges;465 - (void)_didUpdateInputMode:(WebCore::InputMode)mode; 468 466 - (void)_didReceiveEditorStateUpdateAfterFocus; 469 467 - (void)_hardwareKeyboardAvailabilityChanged; -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r249031 r249051 944 944 [self _resetInputViewDeferral]; 945 945 _focusedElementInformation = { }; 946 _wasResignedWhileShowingInputView = NO;947 946 948 947 [_keyboardScrollingAnimator invalidate]; … … 1263 1262 SetForScope<BOOL> resigningFirstResponderScope { _resigningFirstResponder, YES }; 1264 1263 1265 BOOL wasKeyboardOnScreen = UIPeripheralHost.activeInstance.isOnScreen; 1266 [self endEditingAndUpdateFocusAppearanceWithReason:EndEditingReasonResigningFirstResponder]; // May dismiss the keyboard. 1264 [self endEditingAndUpdateFocusAppearanceWithReason:EndEditingReasonResigningFirstResponder]; 1267 1265 1268 1266 // If the user explicitly dismissed the keyboard then we will lose first responder … … 1276 1274 1277 1275 if (superDidResign) { 1278 _wasResignedWhileShowingInputView = wasKeyboardOnScreen;1279 1276 [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture]; 1280 1277 _page->activityStateDidChange(WebCore::ActivityState::IsFocused); … … 1708 1705 // We currently refrain from doing so because that would prevent UIKit from showing 1709 1706 // the language picker when pressing the globe key to change the input language. 1710 if (_focusedElementInformation.inputMode == WebCore::InputMode::None && !GSEventIsHardwareKeyboardAttached() && !_shouldShowAutomaticKeyboardUIWhenInputModeNone)1707 if (_focusedElementInformation.inputMode == WebCore::InputMode::None && !GSEventIsHardwareKeyboardAttached()) 1711 1708 return NO; 1712 1709 … … 3979 3976 _seenHardwareKeyDownInNonEditableElement = NO; 3980 3977 #endif 3981 _wasResignedWhileShowingInputView = NO;3982 3978 [self _elementDidBlur]; 3983 3979 [self _cancelLongPressGestureRecognizer]; … … 5277 5273 } 5278 5274 5279 - (BOOL)isFirstResponderOrBecomingFirstResponder5280 {5281 return self.isFirstResponder || _becomingFirstResponder;5282 }5283 5284 - (BOOL)shouldShowInputViewOnPageActivation:(const OptionSet<WebCore::ActivityState::Flag> &)activityStateChanges5285 {5286 return [self isFirstResponderOrBecomingFirstResponder] && activityStateChanges.contains(WebCore::ActivityState::IsFocused) && _wasResignedWhileShowingInputView;5287 }5288 5289 5275 - (void)_elementDidFocus:(const WebKit::FocusedElementInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode activityStateChanges:(OptionSet<WebCore::ActivityState::Flag>)activityStateChanges userObject:(NSObject <NSSecureCoding> *)userObject 5290 5276 { … … 5310 5296 if ([inputDelegate respondsToSelector:@selector(_webView:decidePolicyForFocusedElement:)]) 5311 5297 startInputSessionPolicy = [inputDelegate _webView:_webView decidePolicyForFocusedElement:focusedElementInfo.get()]; 5312 5313 SetForScope<BOOL> shouldShowAutomaticKeyboardUIWhenInputModeNoneScope { _shouldShowAutomaticKeyboardUIWhenInputModeNone, startInputSessionPolicy == _WKFocusStartsInputSessionPolicyAuto && [self shouldShowInputViewOnPageActivation:activityStateChanges] };5314 5298 5315 5299 BOOL shouldShowInputView = [&] { … … 5321 5305 return YES; 5322 5306 5323 if ([self isFirstResponderOrBecomingFirstResponder]) { 5324 if (_shouldShowAutomaticKeyboardUIWhenInputModeNone) 5307 if (self.isFirstResponder || _becomingFirstResponder) { 5308 // When the software keyboard is being used to enter an url, only the focus activity state is changing. 5309 // In this case, auto focus on the page being navigated to should be disabled, unless a hardware 5310 // keyboard is attached. 5311 if (activityStateChanges && activityStateChanges != WebCore::ActivityState::IsFocused) 5325 5312 return YES; 5326 5313 … … 5536 5523 } 5537 5524 5538 - (void)_didUpdateInputMode:(WebCore::InputMode)mode activityStateChanges:(OptionSet<WebCore::ActivityState::Flag>)activityStateChanges5539 { 5540 if (!self.inputDelegate || !hasFocusedElement(_focusedElementInformation))5525 - (void)_didUpdateInputMode:(WebCore::InputMode)mode 5526 { 5527 if (!self.inputDelegate || _focusedElementInformation.elementType == WebKit::InputType::None) 5541 5528 return; 5542 5529 5543 5530 #if !PLATFORM(WATCHOS) 5544 SetForScope<BOOL> shouldShowAutomaticKeyboardUIWhenInputModeNoneScope { _shouldShowAutomaticKeyboardUIWhenInputModeNone, [self shouldShowInputViewOnPageActivation:activityStateChanges] };5545 5531 _focusedElementInformation.inputMode = mode; 5546 5532 [self reloadInputViews]; -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r249031 r249051 933 933 } 934 934 935 void WebPageProxy::focusedElementDidChangeInputMode(WebCore::InputMode mode , OptionSet<WebCore::ActivityState::Flag> activityStateChanges)935 void WebPageProxy::focusedElementDidChangeInputMode(WebCore::InputMode mode) 936 936 { 937 937 #if ENABLE(TOUCH_EVENTS) … … 942 942 #endif 943 943 944 pageClient().focusedElementDidChangeInputMode(mode , activityStateChanges);944 pageClient().focusedElementDidChangeInputMode(mode); 945 945 } 946 946 … … 950 950 return; 951 951 952 pageClient().focusedElementDidChangeInputMode(*m_pendingInputModeChange , { });952 pageClient().focusedElementDidChangeInputMode(*m_pendingInputModeChange); 953 953 m_pendingInputModeChange = WTF::nullopt; 954 954 } -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r249031 r249051 5536 5536 return; 5537 5537 5538 send(Messages::WebPageProxy::FocusedElementDidChangeInputMode(mode , m_lastActivityStateChanges));5538 send(Messages::WebPageProxy::FocusedElementDidChangeInputMode(mode)); 5539 5539 #else 5540 5540 UNUSED_PARAM(mode);
Note: See TracChangeset
for help on using the changeset viewer.