Changeset 228829 in webkit


Ignore:
Timestamp:
Feb 20, 2018 12:12:09 PM (6 years ago)
Author:
Megan Gardner
Message:

Switch to UIWKTextInteractionAssistant for non-editable text
https://bugs.webkit.org/show_bug.cgi?id=182834

Reviewed by Wenson Hsieh and Tim Horton.

Switching to only using the UIWKTextInteractionAssistant. Only character granularity is now supported.
Also keep the from regressing gating the keyboard bring up on user interaction. The presents of a
textInteractionAssistant can no longer be used as proxy for the presence of the keyboard.

  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView useSelectionAssistantWithGranularity:]):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r228828 r228829  
     12018-02-20  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Switch to UIWKTextInteractionAssistant for non-editable text
     4        https://bugs.webkit.org/show_bug.cgi?id=182834
     5       
     6        Reviewed by Wenson Hsieh and Tim Horton.
     7       
     8        Switching to only using the UIWKTextInteractionAssistant. Only character granularity is now supported.
     9        Also keep the from regressing gating the keyboard bring up on user interaction. The presents of a 
     10        textInteractionAssistant can no longer be used as proxy for the presence of the keyboard.
     11
     12        * UIProcess/ios/WKContentViewInteraction.mm:
     13        (-[WKContentView useSelectionAssistantWithGranularity:]):
     14        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
     15
    1162018-02-20  John Wilander  <wilander@apple.com>
    217
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r228605 r228829  
    18681868- (void)useSelectionAssistantWithGranularity:(WKSelectionGranularity)selectionGranularity
    18691869{
    1870     if (selectionGranularity == WKSelectionGranularityDynamic) {
    1871         if (_textSelectionAssistant) {
    1872             [_textSelectionAssistant deactivateSelection];
    1873             _textSelectionAssistant = nil;
    1874         }
    1875         if (!_webSelectionAssistant)
    1876             _webSelectionAssistant = adoptNS([[UIWKSelectionAssistant alloc] initWithView:self]);
    1877     } else if (selectionGranularity == WKSelectionGranularityCharacter) {
    1878         if (_webSelectionAssistant)
    1879             _webSelectionAssistant = nil;
    1880 
    1881         if (!_textSelectionAssistant)
    1882             _textSelectionAssistant = adoptNS([[UIWKTextInteractionAssistant alloc] initWithView:self]);
    1883         else {
    1884             // Reset the gesture recognizers in case editibility has changed.
    1885             [_textSelectionAssistant setGestureRecognizers];
    1886         }
    1887 
    1888         if (self.isFirstResponder && !self.suppressAssistantSelectionView)
    1889             [_textSelectionAssistant activateSelection];
    1890     }
     1870    if (_webSelectionAssistant)
     1871        _webSelectionAssistant = nil;
     1872
     1873    if (!_textSelectionAssistant)
     1874        _textSelectionAssistant = adoptNS([[UIWKTextInteractionAssistant alloc] initWithView:self]);
     1875    else {
     1876        // Reset the gesture recognizers in case editibility has changed.
     1877        [_textSelectionAssistant setGestureRecognizers];
     1878    }
     1879
     1880    if (self.isFirstResponder && !self.suppressAssistantSelectionView)
     1881        [_textSelectionAssistant activateSelection];
    18911882}
    18921883
     
    40134004    else {
    40144005        // The default behavior is to allow node assistance if the user is interacting or the keyboard is already active.
    4015         shouldShowKeyboard = userIsInteracting || _textSelectionAssistant || changingActivityState;
     4006        shouldShowKeyboard = userIsInteracting || _isChangingFocus || changingActivityState;
    40164007#if ENABLE(DATA_INTERACTION)
    40174008        shouldShowKeyboard |= _dragDropInteractionState.isPerformingDrop();
Note: See TracChangeset for help on using the changeset viewer.