Remove some last vestiges of assisted node terminology in WebKit
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2019 19:10:04 +0000 (19:10 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2019 19:10:04 +0000 (19:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193572

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
(-[WKContentView _showKeyboard]):
(-[WKContentView _hideKeyboard]):

Add a FIXME about invoking `-reloadInputViews` on watchOS when the focused element is blurred.

(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _elementDidBlur]):
(-[WKContentView updateCurrentFocusedElementInformation:]):
(-[WKContentView _startAssistingKeyboard]): Deleted.
(-[WKContentView _stopAssistingKeyboard]): Deleted.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getFocusedElementInformation):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240159 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/_WKFocusedElementInfo.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

index 42a0383..692389c 100644 (file)
@@ -1,3 +1,27 @@
+2019-01-18  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Remove some last vestiges of assisted node terminology in WebKit
+        https://bugs.webkit.org/show_bug.cgi?id=193572
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView gestureRecognizerShouldBegin:]):
+        (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
+        (-[WKContentView _showKeyboard]):
+        (-[WKContentView _hideKeyboard]):
+
+        Add a FIXME about invoking `-reloadInputViews` on watchOS when the focused element is blurred.
+
+        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
+        (-[WKContentView _elementDidBlur]):
+        (-[WKContentView updateCurrentFocusedElementInformation:]):
+        (-[WKContentView _startAssistingKeyboard]): Deleted.
+        (-[WKContentView _stopAssistingKeyboard]): Deleted.
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::getFocusedElementInformation):
+
 2019-01-18  Youenn Fablet  <youenn@apple.com>
 
         Add a new SPI to request for cache storage quota increase
index b19a3e0..b43fcaa 100644 (file)
@@ -58,9 +58,9 @@ typedef NS_ENUM(NSInteger, WKInputType) {
 };
 
 /**
- * The _WKFocusedElementInfo provides basic information about an element
- * that has been focused (either programmatically or through user interaction)
- * but has not yet been assisted.
+ * The _WKFocusedElementInfo provides basic information about an element that
+ * has been focused (either programmatically or through user interaction) but
+ * is not causing any input UI (e.g. keyboard, date picker, etc.) to be shown.
  */
 @protocol _WKFocusedElementInfo <NSObject>
 
index 3e5292a..e86b629 100644 (file)
@@ -1736,7 +1736,7 @@ static inline bool isSamePair(UIGestureRecognizer *a, UIGestureRecognizer *b, UI
 
         if (hasFocusedElement(_focusedElementInformation)) {
             // Request information about the position with sync message.
-            // If the assisted node is the same, prevent the gesture.
+            // If the focused element is the same, prevent the gesture.
             if (![self ensurePositionInformationIsUpToDate:WebKit::InteractionInformationRequest(WebCore::roundedIntPoint(point))])
                 return NO;
             if (_positionInformation.nodeAtPositionIsFocusedElement)
@@ -1746,7 +1746,7 @@ static inline bool isSamePair(UIGestureRecognizer *a, UIGestureRecognizer *b, UI
 
     if (gestureRecognizer == _highlightLongPressGestureRecognizer) {
         if (hasFocusedElement(_focusedElementInformation)) {
-            // This is a different node than the assisted one.
+            // This is a different element than the focused one.
             // Prevent the gesture if there is no node.
             // Allow the gesture if it is a node that wants highlight or if there is an action for it.
             if (!_positionInformation.isElement)
@@ -1885,7 +1885,7 @@ static inline bool isSamePair(UIGestureRecognizer *a, UIGestureRecognizer *b, UI
         return NO;
 #endif
 
-    // If we're currently editing an assisted node, only allow the selection to move within that assisted node.
+    // If we're currently focusing an editable element, only allow the selection to move within that focused element.
     if (self.isFocusingElement)
         return _positionInformation.nodeAtPositionIsFocusedElement;
     
@@ -4318,10 +4318,7 @@ static NSString *contentTypeFromFieldName(WebCore::AutofillFieldName fieldName)
     [[self textInputTraits] takeTraitsFrom:traits];
 }
 
-// FIXME: I want to change the name of these functions, but I'm leaving it for now
-// to make it easier to look up the corresponding functions in UIKit.
-
-- (void)_startAssistingKeyboard
+- (void)_showKeyboard
 {
     [self setUpTextSelectionAssistant];
     
@@ -4333,12 +4330,17 @@ static NSString *contentTypeFromFieldName(WebCore::AutofillFieldName fieldName)
 #endif
 }
 
-- (void)_stopAssistingKeyboard
+- (void)_hideKeyboard
 {
     self.inputDelegate = nil;
     [self setUpTextSelectionAssistant];
     
     [_textSelectionAssistant deactivateSelection];
+    [_formAccessoryView hideAutoFillButton];
+
+    // FIXME: Does it make sense to call -reloadInputViews on watchOS?
+    [self reloadInputViews];
+    [self _updateAccessory];
 }
 
 - (const WebKit::FocusedElementInformation&)focusedElementInformation
@@ -4565,7 +4567,7 @@ static const double minimumFocusedElementAreaForSuppressingSelectionAssistant =
 #endif
         break;
     default:
-        [self _startAssistingKeyboard];
+        [self _showKeyboard];
         break;
     }
     
@@ -4615,10 +4617,7 @@ static const double minimumFocusedElementAreaForSuppressingSelectionAssistant =
     _inputPeripheral = nil;
     _focusRequiresStrongPasswordAssistance = NO;
 
-    [self _stopAssistingKeyboard];
-    [_formAccessoryView hideAutoFillButton];
-    [self reloadInputViews];
-    [self _updateAccessory];
+    [self _hideKeyboard];
 
 #if PLATFORM(WATCHOS)
     [self dismissAllInputViewControllers:YES];
@@ -4671,7 +4670,7 @@ static const double minimumFocusedElementAreaForSuppressingSelectionAssistant =
     auto identifierBeforeUpdate = _focusedElementInformation.focusedElementIdentifier;
     _page->requestFocusedElementInformation([callback = WTFMove(callback), identifierBeforeUpdate, weakSelf] (auto& info, auto error) {
         if (!weakSelf || error != WebKit::CallbackBase::Error::None || info.focusedElementIdentifier != identifierBeforeUpdate) {
-            // If the assisted node may have changed in the meantime, don't overwrite assisted node information.
+            // If the focused element may have changed in the meantime, don't overwrite focused element information.
             callback(false);
             return;
         }
index 9b09a0a..f391b56 100644 (file)
@@ -2528,10 +2528,10 @@ void WebPage::getFocusedElementInformation(FocusedElementInformation& informatio
     } else if (m_focusedElement->hasEditableStyle()) {
         information.elementType = InputType::ContentEditable;
         if (is<HTMLElement>(*m_focusedElement)) {
-            auto& assistedElement = downcast<HTMLElement>(*m_focusedElement);
-            information.isAutocorrect = assistedElement.shouldAutocorrect();
-            information.autocapitalizeType = assistedElement.autocapitalizeType();
-            information.inputMode = assistedElement.canonicalInputMode();
+            auto& focusedElement = downcast<HTMLElement>(*m_focusedElement);
+            information.isAutocorrect = focusedElement.shouldAutocorrect();
+            information.autocapitalizeType = focusedElement.autocapitalizeType();
+            information.inputMode = focusedElement.canonicalInputMode();
         } else {
             information.isAutocorrect = true;
             information.autocapitalizeType = AutocapitalizeTypeDefault;