Title: [240159] trunk/Source/WebKit
Revision
240159
Author
wenson_hs...@apple.com
Date
2019-01-18 11:10:04 -0800 (Fri, 18 Jan 2019)

Log Message

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):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (240158 => 240159)


--- trunk/Source/WebKit/ChangeLog	2019-01-18 18:44:54 UTC (rev 240158)
+++ trunk/Source/WebKit/ChangeLog	2019-01-18 19:10:04 UTC (rev 240159)
@@ -1,3 +1,27 @@
+2019-01-18  Wenson Hsieh  <wenson_hs...@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  <you...@apple.com>
 
         Add a new SPI to request for cache storage quota increase

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKFocusedElementInfo.h (240158 => 240159)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKFocusedElementInfo.h	2019-01-18 18:44:54 UTC (rev 240158)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKFocusedElementInfo.h	2019-01-18 19:10:04 UTC (rev 240159)
@@ -58,9 +58,9 @@
 };
 
 /**
- * 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>
 

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (240158 => 240159)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-01-18 18:44:54 UTC (rev 240158)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-01-18 19:10:04 UTC (rev 240159)
@@ -1736,7 +1736,7 @@
 
         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 @@
 
     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 @@
         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 @@
     [[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 @@
 #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 @@
 #endif
         break;
     default:
-        [self _startAssistingKeyboard];
+        [self _showKeyboard];
         break;
     }
     
@@ -4615,10 +4617,7 @@
     _inputPeripheral = nil;
     _focusRequiresStrongPasswordAssistance = NO;
 
-    [self _stopAssistingKeyboard];
-    [_formAccessoryView hideAutoFillButton];
-    [self reloadInputViews];
-    [self _updateAccessory];
+    [self _hideKeyboard];
 
 #if PLATFORM(WATCHOS)
     [self dismissAllInputViewControllers:YES];
@@ -4671,7 +4670,7 @@
     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;
         }

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (240158 => 240159)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-01-18 18:44:54 UTC (rev 240158)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-01-18 19:10:04 UTC (rev 240159)
@@ -2528,10 +2528,10 @@
     } 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;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to