Changeset 252367 in webkit
- Timestamp:
- Nov 12, 2019 8:51:58 AM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r252366 r252367 1 2019-11-12 Megan Gardner <megan_gardner@apple.com> 2 3 Rename _textSelectionAssistant to _textInteractionAssistant to reflect the only class it can now represent 4 https://bugs.webkit.org/show_bug.cgi?id=204103 5 6 Reviewed by Wenson Hsieh. 7 8 No new tests - rename only. 9 10 Now that UIWKSelectionAssistant is no longer, the _textSelectionAssistant can only be a 11 UIWKTextInteractionAssistant. There is enough confusion around all the selection and 12 interaction assistants, renaming this should alleviate some of that confusion. 13 14 * UIProcess/ios/WKContentView.mm: 15 (-[WKContentView _didExitStableState]): 16 * UIProcess/ios/WKContentViewInteraction.h: 17 * UIProcess/ios/WKContentViewInteraction.mm: 18 (-[WKContentView cleanupInteraction]): 19 (-[WKContentView becomeFirstResponderForWebView]): 20 (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]): 21 (-[WKContentView _scrollingNodeScrollingWillBegin]): 22 (-[WKContentView _scrollingNodeScrollingDidEnd]): 23 (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]): 24 (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): 25 (-[WKContentView _uiTextSelectionRects]): 26 (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): 27 (-[WKContentView setUpTextSelectionAssistant]): 28 (-[WKContentView _willStartScrollingOrZooming]): 29 (-[WKContentView _didEndScrollingOrZooming]): 30 (-[WKContentView _lookupForWebView:]): 31 (-[WKContentView _shareForWebView:]): 32 (-[WKContentView _addShortcutForWebView:]): 33 (-[WKContentView _promptForReplaceForWebView:]): 34 (-[WKContentView _transliterateChineseForWebView:]): 35 (-[WKContentView tintColorDidChange]): 36 (-[WKContentView _didHideMenu:]): 37 (-[WKContentView selectForWebView:]): 38 (-[WKContentView selectAllForWebView:]): 39 (-[WKContentView _showTextStyleOptionsForWebView:]): 40 (-[WKContentView _showDictionary:]): 41 (-[WKContentView interactionAssistant]): 42 (-[WKContentView _showKeyboard]): 43 (-[WKContentView _hideKeyboard]): 44 (-[WKContentView _updateChangedSelection:]): 45 (-[WKContentView _startSuppressingSelectionAssistantForReason:]): 46 (-[WKContentView _stopSuppressingSelectionAssistantForReason:]): 47 (-[WKContentView _restoreCalloutBarIfNeeded]): 48 (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]): 49 1 50 2019-11-12 Carlos Alberto Lopez Perez <clopez@igalia.com> 2 51 -
trunk/Source/WebKit/UIProcess/ios/WKContentView.mm
r252175 r252367 365 365 return; 366 366 367 [_text SelectionAssistant deactivateSelection];367 [_textInteractionAssistant deactivateSelection]; 368 368 } 369 369 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
r251320 r252367 240 240 #endif 241 241 242 RetainPtr<UIWKTextInteractionAssistant> _text SelectionAssistant;242 RetainPtr<UIWKTextInteractionAssistant> _textInteractionAssistant; 243 243 OptionSet<WebKit::SuppressSelectionAssistantReason> _suppressSelectionAssistantReasons; 244 244 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r252309 r252367 869 869 return; 870 870 871 _text SelectionAssistant = nil;871 _textInteractionAssistant = nil; 872 872 873 873 [_actionSheetAssistant cleanupSheet]; … … 1292 1292 1293 1293 if ([self canShowNonEmptySelectionView]) 1294 [_text SelectionAssistant activateSelection];1294 [_textInteractionAssistant activateSelection]; 1295 1295 1296 1296 [self _scheduleResetInputViewDeferralAfterBecomingFirstResponder]; … … 1325 1325 1326 1326 [self _cancelInteraction]; 1327 [_text SelectionAssistant deactivateSelection];1327 [_textInteractionAssistant deactivateSelection]; 1328 1328 1329 1329 [self _resetInputViewDeferral]; … … 1797 1797 - (void)_scrollingNodeScrollingWillBegin 1798 1798 { 1799 [_text SelectionAssistant willStartScrollingOverflow];1799 [_textInteractionAssistant willStartScrollingOverflow]; 1800 1800 } 1801 1801 … … 1809 1809 } 1810 1810 [self _updateChangedSelection]; 1811 [_text SelectionAssistant didEndScrollingOverflow];1811 [_textInteractionAssistant didEndScrollingOverflow]; 1812 1812 } 1813 1813 … … 1949 1949 bool isForcePressGesture = NO; 1950 1950 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000 1951 isForcePressGesture = (preventingGestureRecognizer == _text SelectionAssistant.get().forcePressGesture);1951 isForcePressGesture = (preventingGestureRecognizer == _textInteractionAssistant.get().forcePressGesture); 1952 1952 #endif 1953 1953 #if PLATFORM(MACCATALYST) 1954 if ((preventingGestureRecognizer == _text SelectionAssistant.get().loupeGesture) && (preventedGestureRecognizer == _highlightLongPressGestureRecognizer || preventedGestureRecognizer == _longPressGestureRecognizer || preventedGestureRecognizer == _textSelectionAssistant.get().forcePressGesture))1954 if ((preventingGestureRecognizer == _textInteractionAssistant.get().loupeGesture) && (preventedGestureRecognizer == _highlightLongPressGestureRecognizer || preventedGestureRecognizer == _longPressGestureRecognizer || preventedGestureRecognizer == _textInteractionAssistant.get().forcePressGesture)) 1955 1955 return YES; 1956 1956 #endif 1957 1957 1958 if ((preventingGestureRecognizer == _text SelectionAssistant.get().loupeGesture || isForcePressGesture) && (preventedGestureRecognizer == _highlightLongPressGestureRecognizer || preventedGestureRecognizer == _longPressGestureRecognizer))1958 if ((preventingGestureRecognizer == _textInteractionAssistant.get().loupeGesture || isForcePressGesture) && (preventedGestureRecognizer == _highlightLongPressGestureRecognizer || preventedGestureRecognizer == _longPressGestureRecognizer)) 1959 1959 return NO; 1960 1960 … … 1979 1979 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000 1980 1980 #if PLATFORM(MACCATALYST) 1981 if (isSamePair(gestureRecognizer, otherGestureRecognizer, _text SelectionAssistant.get().loupeGesture, _textSelectionAssistant.get().forcePressGesture))1981 if (isSamePair(gestureRecognizer, otherGestureRecognizer, _textInteractionAssistant.get().loupeGesture, _textInteractionAssistant.get().forcePressGesture)) 1982 1982 return YES; 1983 1983 1984 if (isSamePair(gestureRecognizer, otherGestureRecognizer, _singleTapGestureRecognizer.get(), _text SelectionAssistant.get().loupeGesture))1984 if (isSamePair(gestureRecognizer, otherGestureRecognizer, _singleTapGestureRecognizer.get(), _textInteractionAssistant.get().loupeGesture)) 1985 1985 return YES; 1986 1986 … … 1988 1988 return YES; 1989 1989 #endif 1990 if (isSamePair(gestureRecognizer, otherGestureRecognizer, _highlightLongPressGestureRecognizer.get(), _text SelectionAssistant.get().forcePressGesture))1990 if (isSamePair(gestureRecognizer, otherGestureRecognizer, _highlightLongPressGestureRecognizer.get(), _textInteractionAssistant.get().forcePressGesture)) 1991 1991 return YES; 1992 1992 #endif 1993 if (isSamePair(gestureRecognizer, otherGestureRecognizer, _singleTapGestureRecognizer.get(), _text SelectionAssistant.get().singleTapGesture))1993 if (isSamePair(gestureRecognizer, otherGestureRecognizer, _singleTapGestureRecognizer.get(), _textInteractionAssistant.get().singleTapGesture)) 1994 1994 return YES; 1995 1995 … … 2186 2186 NSMutableArray *textSelectionRects = [NSMutableArray array]; 2187 2187 2188 if (_text SelectionAssistant) {2189 for (WKTextSelectionRect *selectionRect in [_text SelectionAssistant valueForKeyPath:@"selectionView.selection.selectionRects"])2188 if (_textInteractionAssistant) { 2189 for (WKTextSelectionRect *selectionRect in [_textInteractionAssistant valueForKeyPath:@"selectionView.selection.selectionRects"]) 2190 2190 [textSelectionRects addObject:[NSValue valueWithCGRect:selectionRect.webRect.rect]]; 2191 2191 } … … 2417 2417 return NO; 2418 2418 2419 switch ([_text SelectionAssistant loupeGesture].state) {2419 switch ([_textInteractionAssistant loupeGesture].state) { 2420 2420 case UIGestureRecognizerStateBegan: 2421 2421 case UIGestureRecognizerStateChanged: … … 2740 2740 - (void)setUpTextSelectionAssistant 2741 2741 { 2742 if (!_text SelectionAssistant)2743 _text SelectionAssistant = adoptNS([[UIWKTextInteractionAssistant alloc] initWithView:self]);2742 if (!_textInteractionAssistant) 2743 _textInteractionAssistant = adoptNS([[UIWKTextInteractionAssistant alloc] initWithView:self]); 2744 2744 else { 2745 2745 // Reset the gesture recognizers in case editability has changed. 2746 [_text SelectionAssistant setGestureRecognizers];2746 [_textInteractionAssistant setGestureRecognizers]; 2747 2747 } 2748 2748 } … … 2778 2778 - (void)_willStartScrollingOrZooming 2779 2779 { 2780 if ([_text SelectionAssistant respondsToSelector:@selector(willStartScrollingOrZooming)])2781 [_text SelectionAssistant willStartScrollingOrZooming];2780 if ([_textInteractionAssistant respondsToSelector:@selector(willStartScrollingOrZooming)]) 2781 [_textInteractionAssistant willStartScrollingOrZooming]; 2782 2782 else 2783 [_text SelectionAssistant willStartScrollingOverflow];2783 [_textInteractionAssistant willStartScrollingOverflow]; 2784 2784 _page->setIsScrollingOrZooming(true); 2785 2785 … … 2801 2801 { 2802 2802 if (!_needsDeferredEndScrollingSelectionUpdate) { 2803 if ([_text SelectionAssistant respondsToSelector:@selector(didEndScrollingOrZooming)])2804 [_text SelectionAssistant didEndScrollingOrZooming];2803 if ([_textInteractionAssistant respondsToSelector:@selector(didEndScrollingOrZooming)]) 2804 [_textInteractionAssistant didEndScrollingOrZooming]; 2805 2805 else 2806 [_text SelectionAssistant didEndScrollingOverflow];2806 [_textInteractionAssistant didEndScrollingOverflow]; 2807 2807 } 2808 2808 _page->setIsScrollingOrZooming(false); … … 2931 2931 NSRange selectedRangeInContext = NSMakeRange(textBefore.length(), selectedText.length()); 2932 2932 2933 if (auto textSelectionAssistant = view->_text SelectionAssistant)2933 if (auto textSelectionAssistant = view->_textInteractionAssistant) 2934 2934 [textSelectionAssistant lookup:selectionContext withRange:selectedRangeInContext fromRect:presentationRect]; 2935 2935 }); … … 2943 2943 return; 2944 2944 2945 if (!view->_text SelectionAssistant || !string || view->_page->editorState().isMissingPostLayoutData)2945 if (!view->_textInteractionAssistant || !string || view->_page->editorState().isMissingPostLayoutData) 2946 2946 return; 2947 2947 … … 2950 2950 return; 2951 2951 2952 [view->_text SelectionAssistant showShareSheetFor:string fromRect:selectionRects.first().rect()];2952 [view->_textInteractionAssistant showShareSheetFor:string fromRect:selectionRects.first().rect()]; 2953 2953 }); 2954 2954 } … … 2956 2956 - (void)_addShortcutForWebView:(id)sender 2957 2957 { 2958 if (_text SelectionAssistant)2959 [_text SelectionAssistant showTextServiceFor:[self selectedText] fromRect:_page->editorState().postLayoutData().selectionRects[0].rect()];2958 if (_textInteractionAssistant) 2959 [_textInteractionAssistant showTextServiceFor:[self selectedText] fromRect:_page->editorState().postLayoutData().selectionRects[0].rect()]; 2960 2960 } 2961 2961 … … 3003 3003 return; 3004 3004 3005 [_text SelectionAssistant scheduleReplacementsForText:wordAtSelection];3005 [_textInteractionAssistant scheduleReplacementsForText:wordAtSelection]; 3006 3006 } 3007 3007 3008 3008 - (void)_transliterateChineseForWebView:(id)sender 3009 3009 { 3010 [_text SelectionAssistant scheduleChineseTransliterationForText:_page->editorState().postLayoutData().wordAtSelection];3010 [_textInteractionAssistant scheduleChineseTransliterationForText:_page->editorState().postLayoutData().wordAtSelection]; 3011 3011 } 3012 3012 … … 3160 3160 BOOL shouldUpdateTextSelection = self.isFirstResponder && [self canShowNonEmptySelectionView]; 3161 3161 if (shouldUpdateTextSelection) 3162 [_text SelectionAssistant deactivateSelection];3162 [_textInteractionAssistant deactivateSelection]; 3163 3163 [self _updateInteractionTintColor]; 3164 3164 if (shouldUpdateTextSelection) 3165 [_text SelectionAssistant activateSelection];3165 [_textInteractionAssistant activateSelection]; 3166 3166 } 3167 3167 … … 3384 3384 { 3385 3385 _showingTextStyleOptions = NO; 3386 [_text SelectionAssistant hideTextStyleOptions];3386 [_textInteractionAssistant hideTextStyleOptions]; 3387 3387 } 3388 3388 … … 3419 3419 - (void)selectForWebView:(id)sender 3420 3420 { 3421 [_text SelectionAssistant selectWord];3421 [_textInteractionAssistant selectWord]; 3422 3422 // We cannot use selectWord command, because we want to be able to select the word even when it is the last in the paragraph. 3423 3423 _page->extendSelection(WebCore::WordGranularity); … … 3426 3426 - (void)selectAllForWebView:(id)sender 3427 3427 { 3428 [_text SelectionAssistant selectAll:sender];3428 [_textInteractionAssistant selectAll:sender]; 3429 3429 _page->selectAll(); 3430 3430 } … … 3473 3473 { 3474 3474 _showingTextStyleOptions = YES; 3475 [_text SelectionAssistant showTextStyleOptions];3475 [_textInteractionAssistant showTextStyleOptions]; 3476 3476 } 3477 3477 … … 3479 3479 { 3480 3480 CGRect presentationRect = _page->editorState().postLayoutData().selectionRects[0].rect(); 3481 if (_text SelectionAssistant)3482 [_text SelectionAssistant showDictionaryFor:text fromRect:presentationRect];3481 if (_textInteractionAssistant) 3482 [_textInteractionAssistant showDictionaryFor:text fromRect:presentationRect]; 3483 3483 } 3484 3484 … … 4819 4819 - (UITextInteractionAssistant *)interactionAssistant 4820 4820 { 4821 return _text SelectionAssistant.get();4821 return _textInteractionAssistant.get(); 4822 4822 } 4823 4823 … … 5352 5352 5353 5353 if (self.isFirstResponder && !_suppressSelectionAssistantReasons) 5354 [_text SelectionAssistant activateSelection];5354 [_textInteractionAssistant activateSelection]; 5355 5355 5356 5356 #if !PLATFORM(WATCHOS) … … 5364 5364 [self setUpTextSelectionAssistant]; 5365 5365 5366 [_text SelectionAssistant deactivateSelection];5366 [_textInteractionAssistant deactivateSelection]; 5367 5367 [_formAccessoryView hideAutoFillButton]; 5368 5368 … … 6234 6234 6235 6235 // FIXME: We need to figure out what to do if the selection is changed by Javascript. 6236 if (_text SelectionAssistant) {6236 if (_textInteractionAssistant) { 6237 6237 _markedText = (_page->editorState().hasComposition) ? _page->editorState().markedText : String(); 6238 [_text SelectionAssistant selectionChanged];6238 [_textInteractionAssistant selectionChanged]; 6239 6239 } 6240 6240 6241 6241 _selectionNeedsUpdate = NO; 6242 6242 if (_shouldRestoreSelection) { 6243 [_text SelectionAssistant didEndScrollingOverflow];6243 [_textInteractionAssistant didEndScrollingOverflow]; 6244 6244 _shouldRestoreSelection = NO; 6245 6245 } … … 6250 6250 6251 6251 if (!_suppressSelectionAssistantReasons) 6252 [_text SelectionAssistant activateSelection];6253 6254 [_text SelectionAssistant didEndScrollingOverflow];6252 [_textInteractionAssistant activateSelection]; 6253 6254 [_textInteractionAssistant didEndScrollingOverflow]; 6255 6255 6256 6256 _needsDeferredEndScrollingSelectionUpdate = NO; … … 6280 6280 6281 6281 if (!wasSuppressingSelectionAssistant) 6282 [_text SelectionAssistant deactivateSelection];6282 [_textInteractionAssistant deactivateSelection]; 6283 6283 } 6284 6284 … … 6289 6289 6290 6290 if (wasSuppressingSelectionAssistant && !_suppressSelectionAssistantReasons) 6291 [_text SelectionAssistant activateSelection];6291 [_textInteractionAssistant activateSelection]; 6292 6292 } 6293 6293 … … 7042 7042 7043 7043 // FIXME: This SPI should be renamed in UIKit to reflect a more general purpose of revealing hidden interaction assistant controls. 7044 [_text SelectionAssistant didEndScrollingOverflow];7044 [_textInteractionAssistant didEndScrollingOverflow]; 7045 7045 _shouldRestoreCalloutBarAfterDrop = NO; 7046 7046 } … … 7347 7347 if (!_shouldRestoreCalloutBarAfterDrop && _dragDropInteractionState.anyActiveDragSourceIs(WebCore::DragSourceActionSelection)) { 7348 7348 // FIXME: This SPI should be renamed in UIKit to reflect a more general purpose of hiding interaction assistant controls. 7349 [_text SelectionAssistant willStartScrollingOverflow];7349 [_textInteractionAssistant willStartScrollingOverflow]; 7350 7350 _shouldRestoreCalloutBarAfterDrop = YES; 7351 7351 }
Note: See TracChangeset
for help on using the changeset viewer.