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

Changeset 237485 in webkit


Ignore:
Timestamp:
Oct 26, 2018, 3:03:35 PM (8 years ago)
Author:
Megan Gardner
Message:

Remove Unused WebSelectionAssistant
​https://bugs.webkit.org/show_bug.cgi?id=190939

Reviewed by Tim Horton.

We made webSelectionAssistant alwasys nil last year when we moved to using
the textSelectionAssistant for all text selection on the web. This patch merely
goes through and cleans out all the references to this object that is always nil.
No functionality should change.

  • UIProcess/ios/WKContentView.mm:

(-[WKContentView _didExitStableState]):

  • UIProcess/ios/WKContentViewInteraction.h:
  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView cleanupInteraction]):
(-[WKContentView resignFirstResponderForWebView]):
(-[WKContentView _scrollingNodeScrollingWillBegin]):
(-[WKContentView _scrollingNodeScrollingDidEnd]):
(-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView _uiTextSelectionRects]):
(-[WKContentView _singleTapCommited:]):
(-[WKContentView _willStartScrollingOrZooming]):
(-[WKContentView _didEndScrollingOrZooming]):
(-[WKContentView _lookupForWebView:]):
(-[WKContentView _shareForWebView:]):
(-[WKContentView _addShortcutForWebView:]):
(-[WKContentView _showDictionary:]):
(selectionChangedWithGesture):
(selectionChangedWithTouch):
(-[WKContentView selectionInteractionAssistant]):
(-[WKContentView _stopAssistingNode]):
(-[WKContentView _updateChangedSelection:]):
(-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
(-[WKContentView _restoreCalloutBarIfNeeded]):
(-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
(-[WKContentView webSelectionAssistant]): Deleted.

Location:
trunk/Source/WebKit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r237483 r237485  
     12018-10-26  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Remove Unused WebSelectionAssistant
     4        https://bugs.webkit.org/show_bug.cgi?id=190939
     5
     6        Reviewed by Tim Horton.
     7
     8        We made webSelectionAssistant alwasys nil last year when we moved to using
     9        the textSelectionAssistant for all text selection on the web. This patch merely
     10        goes through and cleans out all the references to this object that is always nil.
     11        No functionality should change.
     12
     13        * UIProcess/ios/WKContentView.mm:
     14        (-[WKContentView _didExitStableState]):
     15        * UIProcess/ios/WKContentViewInteraction.h:
     16        * UIProcess/ios/WKContentViewInteraction.mm:
     17        (-[WKContentView cleanupInteraction]):
     18        (-[WKContentView resignFirstResponderForWebView]):
     19        (-[WKContentView _scrollingNodeScrollingWillBegin]):
     20        (-[WKContentView _scrollingNodeScrollingDidEnd]):
     21        (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
     22        (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
     23        (-[WKContentView _uiTextSelectionRects]):
     24        (-[WKContentView _singleTapCommited:]):
     25        (-[WKContentView _willStartScrollingOrZooming]):
     26        (-[WKContentView _didEndScrollingOrZooming]):
     27        (-[WKContentView _lookupForWebView:]):
     28        (-[WKContentView _shareForWebView:]):
     29        (-[WKContentView _addShortcutForWebView:]):
     30        (-[WKContentView _showDictionary:]):
     31        (selectionChangedWithGesture):
     32        (selectionChangedWithTouch):
     33        (-[WKContentView selectionInteractionAssistant]):
     34        (-[WKContentView _stopAssistingNode]):
     35        (-[WKContentView _updateChangedSelection:]):
     36        (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
     37        (-[WKContentView _restoreCalloutBarIfNeeded]):
     38        (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
     39        (-[WKContentView webSelectionAssistant]): Deleted.
     40
    1412018-10-26  Commit Queue  <commit-queue@webkit.org>
    242
  • trunk/Source/WebKit/UIProcess/ios/WKContentView.mm

    r237331 r237485  
    360360
    361361    [_textSelectionAssistant deactivateSelection];
    362 #if !PLATFORM(IOSMAC)
    363     [[_webSelectionAssistant selectionView] setHidden:YES];
    364 #endif
    365362}
    366363
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h

    r237331 r237485  
    189189
    190190    RetainPtr<UIWKTextInteractionAssistant> _textSelectionAssistant;
    191     RetainPtr<UIWKSelectionAssistant> _webSelectionAssistant;
    192191    BOOL _suppressAssistantSelectionView;
    193192
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r237331 r237485  
    726726        return;
    727727
    728     _webSelectionAssistant = nil;
    729728    _textSelectionAssistant = nil;
    730729   
    … …  
    10481047
    10491048    [self _cancelInteraction];
    1050     [_webSelectionAssistant resignedFirstResponder];
    10511049    [_textSelectionAssistant deactivateSelection];
    10521050   
    … …  
    12991297- (void)_scrollingNodeScrollingWillBegin
    13001298{
    1301     [_webSelectionAssistant willStartScrollingOverflow];
    13021299    [_textSelectionAssistant willStartScrollingOverflow];   
    13031300}
    … …  
    13121309    }
    13131310    [self _updateChangedSelection];
    1314     [_webSelectionAssistant didEndScrollingOverflow];
    13151311    [_textSelectionAssistant didEndScrollingOverflow];
    13161312}
    … …  
    14241420#endif
    14251421   
    1426     if ((preventingGestureRecognizer == _textSelectionAssistant.get().loupeGesture || isForcePressGesture || [_webSelectionAssistant isSelectionGestureRecognizer:preventingGestureRecognizer]) && (preventedGestureRecognizer == _highlightLongPressGestureRecognizer || preventedGestureRecognizer == _longPressGestureRecognizer))
     1422    if ((preventingGestureRecognizer == _textSelectionAssistant.get().loupeGesture || isForcePressGesture) && (preventedGestureRecognizer == _highlightLongPressGestureRecognizer || preventedGestureRecognizer == _longPressGestureRecognizer))
    14271423        return NO;
    14281424
    … …  
    14401436        return YES;
    14411437
    1442     if (isSamePair(gestureRecognizer, otherGestureRecognizer, _highlightLongPressGestureRecognizer.get(), _webSelectionAssistant.get().selectionLongPressRecognizer))
    1443         return YES;
    14441438#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000
    14451439#if PLATFORM(IOSMAC)
    … …  
    16451639        for (WKTextSelectionRect *selectionRect in [_textSelectionAssistant valueForKeyPath:@"selectionView.selection.selectionRects"])
    16461640            [textSelectionRects addObject:[NSValue valueWithCGRect:selectionRect.webRect.rect]];
    1647     } else if (_webSelectionAssistant) {
    1648         for (WebSelectionRect *selectionRect in [_webSelectionAssistant valueForKeyPath:@"selectionView.selectionRects"])
    1649             [textSelectionRects addObject:[NSValue valueWithCGRect:selectionRect.rect]];
    16501641    }
    16511642
    … …  
    19851976    }
    19861977
    1987     if (_webSelectionAssistant && ![_webSelectionAssistant shouldHandleSingleTapAtPoint:gestureRecognizer.location]) {
    1988         [self _singleTapDidReset:gestureRecognizer];
    1989         return;
    1990     }
    1991 
    19921978    ASSERT(_potentialTapInProgress);
    19931979
    … …  
    20852071- (void)_willStartScrollingOrZooming
    20862072{
    2087     [_webSelectionAssistant willStartScrollingOrZoomingPage];
    20882073    [_textSelectionAssistant willStartScrollingOverflow];
    20892074    _page->setIsScrollingOrZooming(true);
    … …  
    21062091{
    21072092    if (!_needsDeferredEndScrollingSelectionUpdate) {
    2108         [_webSelectionAssistant didEndScrollingOrZoomingPage];
    21092093        [_textSelectionAssistant didEndScrollingOverflow];
    21102094    }
    … …  
    22262210        if (auto textSelectionAssistant = view->_textSelectionAssistant)
    22272211            [textSelectionAssistant lookup:selectionContext withRange:selectedRangeInContext fromRect:presentationRect];
    2228         else
    2229             [view->_webSelectionAssistant lookup:selectionContext withRange:selectedRangeInContext fromRect:presentationRect];
    22302212    });
    22312213}
    … …  
    22442226        if (view->_textSelectionAssistant)
    22452227            [view->_textSelectionAssistant showShareSheetFor:string fromRect:presentationRect];
    2246         else if (view->_webSelectionAssistant)
    2247             [view->_webSelectionAssistant showShareSheetFor:string fromRect:presentationRect];
    22482228    });
    22492229}
    … …  
    22532233    if (_textSelectionAssistant)
    22542234        [_textSelectionAssistant showTextServiceFor:[self selectedText] fromRect:_page->editorState().postLayoutData().selectionRects[0].rect()];
    2255     else if (_webSelectionAssistant)
    2256         [_webSelectionAssistant showTextServiceFor:[self selectedText] fromRect:_page->editorState().postLayoutData().selectionRects[0].rect()];
    22572235}
    22582236
    … …  
    26112589    if (_textSelectionAssistant)
    26122590        [_textSelectionAssistant showDictionaryFor:text fromRect:presentationRect];
    2613     else
    2614         [_webSelectionAssistant showDictionaryFor:text fromRect:presentationRect];
    26152591}
    26162592
    … …  
    28872863        return;
    28882864    }
    2889     if ([view webSelectionAssistant])
    2890         [(UIWKSelectionAssistant *)[view webSelectionAssistant] selectionChangedWithGestureAt:(CGPoint)point withGesture:toUIWKGestureType((GestureType)gestureType) withState:toUIGestureRecognizerState(static_cast<GestureRecognizerState>(gestureState)) withFlags:(toUIWKSelectionFlags((SelectionFlags)flags))];
    2891     else
    2892         [(UIWKTextInteractionAssistant *)[view interactionAssistant] selectionChangedWithGestureAt:(CGPoint)point withGesture:toUIWKGestureType((GestureType)gestureType) withState:toUIGestureRecognizerState(static_cast<GestureRecognizerState>(gestureState)) withFlags:(toUIWKSelectionFlags((SelectionFlags)flags))];
     2865    [(UIWKTextInteractionAssistant *)[view interactionAssistant] selectionChangedWithGestureAt:(CGPoint)point withGesture:toUIWKGestureType((GestureType)gestureType) withState:toUIGestureRecognizerState(static_cast<GestureRecognizerState>(gestureState)) withFlags:(toUIWKSelectionFlags((SelectionFlags)flags))];
    28932866}
    28942867
    … …  
    28992872        return;
    29002873    }
    2901     if ([view webSelectionAssistant])
    2902         [(UIWKSelectionAssistant *)[view webSelectionAssistant] selectionChangedWithTouchAt:(CGPoint)point withSelectionTouch:toUIWKSelectionTouch((SelectionTouch)touch) withFlags:static_cast<UIWKSelectionFlags>(flags)];
    2903     else
    2904         [(UIWKTextInteractionAssistant *)[view interactionAssistant] selectionChangedWithTouchAt:(CGPoint)point withSelectionTouch:toUIWKSelectionTouch((SelectionTouch)touch) withFlags:static_cast<UIWKSelectionFlags>(flags)];
     2874    [(UIWKTextInteractionAssistant *)[view interactionAssistant] selectionChangedWithTouchAt:(CGPoint)point withSelectionTouch:toUIWKSelectionTouch((SelectionTouch)touch) withFlags:static_cast<UIWKSelectionFlags>(flags)];
    29052875}
    29062876
    … …  
    37303700}
    37313701
    3732 - (UIWebSelectionAssistant *)webSelectionAssistant
    3733 {
    3734     return _webSelectionAssistant.get();
    3735 }
    3736 
    37373702- (id<UISelectionInteractionAssistant>)selectionInteractionAssistant
    37383703{
    3739     if ([_webSelectionAssistant conformsToProtocol:@protocol(UISelectionInteractionAssistant)])
    3740         return (id<UISelectionInteractionAssistant>)_webSelectionAssistant.get();
    37413704    return nil;
    37423705}
    … …  
    43674330    [self reloadInputViews];
    43684331    [self _updateAccessory];
    4369     // The name is misleading, but this actually clears the selection views and removes any selection.
    4370     [_webSelectionAssistant resignedFirstResponder];
    43714332
    43724333#if PLATFORM(WATCHOS)
    … …  
    47274688            if (!_showingTextStyleOptions)
    47284689                [_textSelectionAssistant selectionChanged];
    4729         } else if (!_page->editorState().isContentEditable)
    4730             [_webSelectionAssistant selectionChanged];
     4690        }
    47314691
    47324692        _selectionNeedsUpdate = NO;
    47334693        if (_shouldRestoreSelection) {
    4734             [_webSelectionAssistant didEndScrollingOverflow];
    47354694            [_textSelectionAssistant didEndScrollingOverflow];
    47364695            _shouldRestoreSelection = NO;
    … …  
    47414700    if (!state.isMissingPostLayoutData && state.postLayoutData().isStableStateUpdate && _needsDeferredEndScrollingSelectionUpdate && _page->inStableState()) {
    47424701        [[self selectionInteractionAssistant] showSelectionCommands];
    4743         [_webSelectionAssistant didEndScrollingOrZoomingPage];
    4744 #if !PLATFORM(IOSMAC)
    4745         [[_webSelectionAssistant selectionView] setHidden:NO];
    4746 #endif
    47474702
    47484703        if (!self.suppressAssistantSelectionView)
    … …  
    49844939    if (_textSelectionAssistant)
    49854940        [_textSelectionAssistant showShareSheetFor:userVisibleString(url) fromRect:boundingRect];
    4986     else if (_webSelectionAssistant)
    4987         [_webSelectionAssistant showShareSheetFor:userVisibleString(url) fromRect:boundingRect];
    49884941}
    49894942
    … …  
    54235376
    54245377    // FIXME: This SPI should be renamed in UIKit to reflect a more general purpose of revealing hidden interaction assistant controls.
    5425     [_webSelectionAssistant didEndScrollingOverflow];
    54265378    [_textSelectionAssistant didEndScrollingOverflow];
    54275379    _shouldRestoreCalloutBarAfterDrop = NO;
    … …  
    55725524    if (!_shouldRestoreCalloutBarAfterDrop && _dragDropInteractionState.anyActiveDragSourceIs(DragSourceActionSelection)) {
    55735525        // FIXME: This SPI should be renamed in UIKit to reflect a more general purpose of hiding interaction assistant controls.
    5574         [_webSelectionAssistant willStartScrollingOverflow];
    55755526        [_textSelectionAssistant willStartScrollingOverflow];
    55765527        _shouldRestoreCalloutBarAfterDrop = YES;
Note: See TracChangeset for help on using the changeset viewer.