Changeset 249051 in webkit


Ignore:
Timestamp:
Aug 23, 2019 10:15:42 AM (5 years ago)
Author:
russell_e@apple.com
Message:

Unreviewed, rolling out r249031.

Causes multiple test failures on iOS simulator

Reverted changeset:

"[iOS] Should show input view when became first responder if
keyboard was showing when the view was resigned"
https://bugs.webkit.org/show_bug.cgi?id=200902
https://trac.webkit.org/changeset/249031

Location:
trunk
Files:
7 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r249042 r249051  
     12019-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
    1142019-08-23  Megan Gardner  <megan_gardner@apple.com>
    215
  • trunk/LayoutTests/resources/ui-helper.js

    r249031 r249051  
    507507    }
    508508
    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                     else
    520                         uiController.didShowKeyboardCallback = () => uiController.uiScriptComplete();
    521                 })()`, resolve);
    522         });
    523     }
    524 
    525509    static getUICaretRect()
    526510    {
     
    806790
    807791        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));
    816792    }
    817793
  • trunk/Source/WebKit/ChangeLog

    r249036 r249051  
     12019-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
    1142019-08-22  Andy Estes  <aestes@apple.com>
    215
  • trunk/Source/WebKit/UIProcess/PageClient.h

    r249031 r249051  
    389389    virtual void updateInputContextAfterBlurringAndRefocusingElement() = 0;
    390390    virtual void elementDidBlur() = 0;
    391     virtual void focusedElementDidChangeInputMode(WebCore::InputMode, OptionSet<WebCore::ActivityState::Flag>) = 0;
     391    virtual void focusedElementDidChangeInputMode(WebCore::InputMode) = 0;
    392392    virtual void didReceiveEditorStateUpdateAfterFocus() = 0;
    393393    virtual bool isFocusingElement() = 0;
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r249031 r249051  
    19461946    void elementDidBlur();
    19471947    void updateInputContextAfterBlurringAndRefocusingElement();
    1948     void focusedElementDidChangeInputMode(WebCore::InputMode, OptionSet<WebCore::ActivityState::Flag>);
     1948    void focusedElementDidChangeInputMode(WebCore::InputMode);
    19491949    void didReleaseAllTouchPoints();
    19501950    void didReceiveEditorStateUpdateAfterFocus();
  • trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in

    r249031 r249051  
    410410    ElementDidBlur()
    411411    UpdateInputContextAfterBlurringAndRefocusingElement()
    412     FocusedElementDidChangeInputMode(enum:uint8_t WebCore::InputMode mode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges)
     412    FocusedElementDidChangeInputMode(enum:uint8_t WebCore::InputMode mode)
    413413    ScrollingNodeScrollWillStartScroll()
    414414    ScrollingNodeScrollDidEndScroll()
  • trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h

    r249031 r249051  
    152152    void updateInputContextAfterBlurringAndRefocusingElement() final;
    153153    void elementDidBlur() override;
    154     void focusedElementDidChangeInputMode(WebCore::InputMode, OptionSet<WebCore::ActivityState::Flag>) override;
     154    void focusedElementDidChangeInputMode(WebCore::InputMode) override;
    155155    void didReceiveEditorStateUpdateAfterFocus() override;
    156156    bool isFocusingElement() override;
  • trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm

    r249031 r249051  
    574574}
    575575
    576 void PageClientImpl::focusedElementDidChangeInputMode(WebCore::InputMode mode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges)
    577 {
    578     [m_contentView _didUpdateInputMode:mode activityStateChanges:activityStateChanges];
     576void PageClientImpl::focusedElementDidChangeInputMode(WebCore::InputMode mode)
     577{
     578    [m_contentView _didUpdateInputMode:mode];
    579579}
    580580
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h

    r249031 r249051  
    338338
    339339    BOOL _keyboardDidRequestDismissal;
    340     BOOL _wasResignedWhileShowingInputView;
    341     BOOL _shouldShowAutomaticKeyboardUIWhenInputModeNone;
    342340
    343341#if USE(UIKIT_KEYBOARD_ADDITIONS)
     
    465463- (void)_elementDidBlur;
    466464- (void)_hideContextMenuHintContainer;
    467 - (void)_didUpdateInputMode:(WebCore::InputMode)mode activityStateChanges:(OptionSet<WebCore::ActivityState::Flag>)activityStateChanges;
     465- (void)_didUpdateInputMode:(WebCore::InputMode)mode;
    468466- (void)_didReceiveEditorStateUpdateAfterFocus;
    469467- (void)_hardwareKeyboardAvailabilityChanged;
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r249031 r249051  
    944944    [self _resetInputViewDeferral];
    945945    _focusedElementInformation = { };
    946     _wasResignedWhileShowingInputView = NO;
    947946   
    948947    [_keyboardScrollingAnimator invalidate];
     
    12631262    SetForScope<BOOL> resigningFirstResponderScope { _resigningFirstResponder, YES };
    12641263
    1265     BOOL wasKeyboardOnScreen = UIPeripheralHost.activeInstance.isOnScreen;
    1266     [self endEditingAndUpdateFocusAppearanceWithReason:EndEditingReasonResigningFirstResponder]; // May dismiss the keyboard.
     1264    [self endEditingAndUpdateFocusAppearanceWithReason:EndEditingReasonResigningFirstResponder];
    12671265
    12681266    // If the user explicitly dismissed the keyboard then we will lose first responder
     
    12761274
    12771275    if (superDidResign) {
    1278         _wasResignedWhileShowingInputView = wasKeyboardOnScreen;
    12791276        [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
    12801277        _page->activityStateDidChange(WebCore::ActivityState::IsFocused);
     
    17081705    // We currently refrain from doing so because that would prevent UIKit from showing
    17091706    // 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())
    17111708        return NO;
    17121709
     
    39793976    _seenHardwareKeyDownInNonEditableElement = NO;
    39803977#endif
    3981     _wasResignedWhileShowingInputView = NO;
    39823978    [self _elementDidBlur];
    39833979    [self _cancelLongPressGestureRecognizer];
     
    52775273}
    52785274
    5279 - (BOOL)isFirstResponderOrBecomingFirstResponder
    5280 {
    5281     return self.isFirstResponder || _becomingFirstResponder;
    5282 }
    5283 
    5284 - (BOOL)shouldShowInputViewOnPageActivation:(const OptionSet<WebCore::ActivityState::Flag> &)activityStateChanges
    5285 {
    5286     return [self isFirstResponderOrBecomingFirstResponder] && activityStateChanges.contains(WebCore::ActivityState::IsFocused) && _wasResignedWhileShowingInputView;
    5287 }
    5288 
    52895275- (void)_elementDidFocus:(const WebKit::FocusedElementInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode activityStateChanges:(OptionSet<WebCore::ActivityState::Flag>)activityStateChanges userObject:(NSObject <NSSecureCoding> *)userObject
    52905276{
     
    53105296    if ([inputDelegate respondsToSelector:@selector(_webView:decidePolicyForFocusedElement:)])
    53115297        startInputSessionPolicy = [inputDelegate _webView:_webView decidePolicyForFocusedElement:focusedElementInfo.get()];
    5312 
    5313     SetForScope<BOOL> shouldShowAutomaticKeyboardUIWhenInputModeNoneScope { _shouldShowAutomaticKeyboardUIWhenInputModeNone, startInputSessionPolicy == _WKFocusStartsInputSessionPolicyAuto && [self shouldShowInputViewOnPageActivation:activityStateChanges] };
    53145298
    53155299    BOOL shouldShowInputView = [&] {
     
    53215305                return YES;
    53225306
    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)
    53255312                    return YES;
    53265313
     
    55365523}
    55375524
    5538 - (void)_didUpdateInputMode:(WebCore::InputMode)mode activityStateChanges:(OptionSet<WebCore::ActivityState::Flag>)activityStateChanges
    5539 {
    5540     if (!self.inputDelegate || !hasFocusedElement(_focusedElementInformation))
     5525- (void)_didUpdateInputMode:(WebCore::InputMode)mode
     5526{
     5527    if (!self.inputDelegate || _focusedElementInformation.elementType == WebKit::InputType::None)
    55415528        return;
    55425529
    55435530#if !PLATFORM(WATCHOS)
    5544     SetForScope<BOOL> shouldShowAutomaticKeyboardUIWhenInputModeNoneScope { _shouldShowAutomaticKeyboardUIWhenInputModeNone, [self shouldShowInputViewOnPageActivation:activityStateChanges] };
    55455531    _focusedElementInformation.inputMode = mode;
    55465532    [self reloadInputViews];
  • trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm

    r249031 r249051  
    933933}
    934934
    935 void WebPageProxy::focusedElementDidChangeInputMode(WebCore::InputMode mode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges)
     935void WebPageProxy::focusedElementDidChangeInputMode(WebCore::InputMode mode)
    936936{
    937937#if ENABLE(TOUCH_EVENTS)
     
    942942#endif
    943943
    944     pageClient().focusedElementDidChangeInputMode(mode, activityStateChanges);
     944    pageClient().focusedElementDidChangeInputMode(mode);
    945945}
    946946
     
    950950        return;
    951951
    952     pageClient().focusedElementDidChangeInputMode(*m_pendingInputModeChange, { });
     952    pageClient().focusedElementDidChangeInputMode(*m_pendingInputModeChange);
    953953    m_pendingInputModeChange = WTF::nullopt;
    954954}
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r249031 r249051  
    55365536        return;
    55375537
    5538     send(Messages::WebPageProxy::FocusedElementDidChangeInputMode(mode, m_lastActivityStateChanges));
     5538    send(Messages::WebPageProxy::FocusedElementDidChangeInputMode(mode));
    55395539#else
    55405540    UNUSED_PARAM(mode);
Note: See TracChangeset for help on using the changeset viewer.