Changeset 237485 in webkit
- Timestamp:
- Oct 26, 2018, 3:03:35 PM (8 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/ios/WKContentView.mm (modified) (1 diff)
-
UIProcess/ios/WKContentViewInteraction.h (modified) (1 diff)
-
UIProcess/ios/WKContentViewInteraction.mm (modified) (23 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r237483 r237485 1 2018-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 1 41 2018-10-26 Commit Queue <commit-queue@webkit.org> 2 42 -
trunk/Source/WebKit/UIProcess/ios/WKContentView.mm
r237331 r237485 360 360 361 361 [_textSelectionAssistant deactivateSelection]; 362 #if !PLATFORM(IOSMAC)363 [[_webSelectionAssistant selectionView] setHidden:YES];364 #endif365 362 } 366 363 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
r237331 r237485 189 189 190 190 RetainPtr<UIWKTextInteractionAssistant> _textSelectionAssistant; 191 RetainPtr<UIWKSelectionAssistant> _webSelectionAssistant;192 191 BOOL _suppressAssistantSelectionView; 193 192 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r237331 r237485 726 726 return; 727 727 728 _webSelectionAssistant = nil;729 728 _textSelectionAssistant = nil; 730 729 … … 1048 1047 1049 1048 [self _cancelInteraction]; 1050 [_webSelectionAssistant resignedFirstResponder];1051 1049 [_textSelectionAssistant deactivateSelection]; 1052 1050 … … 1299 1297 - (void)_scrollingNodeScrollingWillBegin 1300 1298 { 1301 [_webSelectionAssistant willStartScrollingOverflow];1302 1299 [_textSelectionAssistant willStartScrollingOverflow]; 1303 1300 } … … 1312 1309 } 1313 1310 [self _updateChangedSelection]; 1314 [_webSelectionAssistant didEndScrollingOverflow];1315 1311 [_textSelectionAssistant didEndScrollingOverflow]; 1316 1312 } … … 1424 1420 #endif 1425 1421 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)) 1427 1423 return NO; 1428 1424 … … 1440 1436 return YES; 1441 1437 1442 if (isSamePair(gestureRecognizer, otherGestureRecognizer, _highlightLongPressGestureRecognizer.get(), _webSelectionAssistant.get().selectionLongPressRecognizer))1443 return YES;1444 1438 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000 1445 1439 #if PLATFORM(IOSMAC) … … 1645 1639 for (WKTextSelectionRect *selectionRect in [_textSelectionAssistant valueForKeyPath:@"selectionView.selection.selectionRects"]) 1646 1640 [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]];1650 1641 } 1651 1642 … … 1985 1976 } 1986 1977 1987 if (_webSelectionAssistant && ![_webSelectionAssistant shouldHandleSingleTapAtPoint:gestureRecognizer.location]) {1988 [self _singleTapDidReset:gestureRecognizer];1989 return;1990 }1991 1992 1978 ASSERT(_potentialTapInProgress); 1993 1979 … … 2085 2071 - (void)_willStartScrollingOrZooming 2086 2072 { 2087 [_webSelectionAssistant willStartScrollingOrZoomingPage];2088 2073 [_textSelectionAssistant willStartScrollingOverflow]; 2089 2074 _page->setIsScrollingOrZooming(true); … … 2106 2091 { 2107 2092 if (!_needsDeferredEndScrollingSelectionUpdate) { 2108 [_webSelectionAssistant didEndScrollingOrZoomingPage];2109 2093 [_textSelectionAssistant didEndScrollingOverflow]; 2110 2094 } … … 2226 2210 if (auto textSelectionAssistant = view->_textSelectionAssistant) 2227 2211 [textSelectionAssistant lookup:selectionContext withRange:selectedRangeInContext fromRect:presentationRect]; 2228 else2229 [view->_webSelectionAssistant lookup:selectionContext withRange:selectedRangeInContext fromRect:presentationRect];2230 2212 }); 2231 2213 } … … 2244 2226 if (view->_textSelectionAssistant) 2245 2227 [view->_textSelectionAssistant showShareSheetFor:string fromRect:presentationRect]; 2246 else if (view->_webSelectionAssistant)2247 [view->_webSelectionAssistant showShareSheetFor:string fromRect:presentationRect];2248 2228 }); 2249 2229 } … … 2253 2233 if (_textSelectionAssistant) 2254 2234 [_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()];2257 2235 } 2258 2236 … … 2611 2589 if (_textSelectionAssistant) 2612 2590 [_textSelectionAssistant showDictionaryFor:text fromRect:presentationRect]; 2613 else2614 [_webSelectionAssistant showDictionaryFor:text fromRect:presentationRect];2615 2591 } 2616 2592 … … 2887 2863 return; 2888 2864 } 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))]; 2893 2866 } 2894 2867 … … 2899 2872 return; 2900 2873 } 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)]; 2905 2875 } 2906 2876 … … 3730 3700 } 3731 3701 3732 - (UIWebSelectionAssistant *)webSelectionAssistant3733 {3734 return _webSelectionAssistant.get();3735 }3736 3737 3702 - (id<UISelectionInteractionAssistant>)selectionInteractionAssistant 3738 3703 { 3739 if ([_webSelectionAssistant conformsToProtocol:@protocol(UISelectionInteractionAssistant)])3740 return (id<UISelectionInteractionAssistant>)_webSelectionAssistant.get();3741 3704 return nil; 3742 3705 } … … 4367 4330 [self reloadInputViews]; 4368 4331 [self _updateAccessory]; 4369 // The name is misleading, but this actually clears the selection views and removes any selection.4370 [_webSelectionAssistant resignedFirstResponder];4371 4332 4372 4333 #if PLATFORM(WATCHOS) … … 4727 4688 if (!_showingTextStyleOptions) 4728 4689 [_textSelectionAssistant selectionChanged]; 4729 } else if (!_page->editorState().isContentEditable) 4730 [_webSelectionAssistant selectionChanged]; 4690 } 4731 4691 4732 4692 _selectionNeedsUpdate = NO; 4733 4693 if (_shouldRestoreSelection) { 4734 [_webSelectionAssistant didEndScrollingOverflow];4735 4694 [_textSelectionAssistant didEndScrollingOverflow]; 4736 4695 _shouldRestoreSelection = NO; … … 4741 4700 if (!state.isMissingPostLayoutData && state.postLayoutData().isStableStateUpdate && _needsDeferredEndScrollingSelectionUpdate && _page->inStableState()) { 4742 4701 [[self selectionInteractionAssistant] showSelectionCommands]; 4743 [_webSelectionAssistant didEndScrollingOrZoomingPage];4744 #if !PLATFORM(IOSMAC)4745 [[_webSelectionAssistant selectionView] setHidden:NO];4746 #endif4747 4702 4748 4703 if (!self.suppressAssistantSelectionView) … … 4984 4939 if (_textSelectionAssistant) 4985 4940 [_textSelectionAssistant showShareSheetFor:userVisibleString(url) fromRect:boundingRect]; 4986 else if (_webSelectionAssistant)4987 [_webSelectionAssistant showShareSheetFor:userVisibleString(url) fromRect:boundingRect];4988 4941 } 4989 4942 … … 5423 5376 5424 5377 // FIXME: This SPI should be renamed in UIKit to reflect a more general purpose of revealing hidden interaction assistant controls. 5425 [_webSelectionAssistant didEndScrollingOverflow];5426 5378 [_textSelectionAssistant didEndScrollingOverflow]; 5427 5379 _shouldRestoreCalloutBarAfterDrop = NO; … … 5572 5524 if (!_shouldRestoreCalloutBarAfterDrop && _dragDropInteractionState.anyActiveDragSourceIs(DragSourceActionSelection)) { 5573 5525 // FIXME: This SPI should be renamed in UIKit to reflect a more general purpose of hiding interaction assistant controls. 5574 [_webSelectionAssistant willStartScrollingOverflow];5575 5526 [_textSelectionAssistant willStartScrollingOverflow]; 5576 5527 _shouldRestoreCalloutBarAfterDrop = YES;
Note:
See TracChangeset
for help on using the changeset viewer.