Title: [228829] trunk/Source/WebKit
Revision
228829
Author
[email protected]
Date
2018-02-20 12:12:09 -0800 (Tue, 20 Feb 2018)

Log Message

Switch to UIWKTextInteractionAssistant for non-editable text
https://bugs.webkit.org/show_bug.cgi?id=182834
        
Reviewed by Wenson Hsieh and Tim Horton.
        
Switching to only using the UIWKTextInteractionAssistant. Only character granularity is now supported. 
Also keep the from regressing gating the keyboard bring up on user interaction. The presents of a  
textInteractionAssistant can no longer be used as proxy for the presence of the keyboard.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView useSelectionAssistantWithGranularity:]):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (228828 => 228829)


--- trunk/Source/WebKit/ChangeLog	2018-02-20 19:27:26 UTC (rev 228828)
+++ trunk/Source/WebKit/ChangeLog	2018-02-20 20:12:09 UTC (rev 228829)
@@ -1,3 +1,18 @@
+2018-02-20  Megan Gardner  <[email protected]>
+
+        Switch to UIWKTextInteractionAssistant for non-editable text
+        https://bugs.webkit.org/show_bug.cgi?id=182834
+        
+        Reviewed by Wenson Hsieh and Tim Horton.
+        
+        Switching to only using the UIWKTextInteractionAssistant. Only character granularity is now supported. 
+        Also keep the from regressing gating the keyboard bring up on user interaction. The presents of a  
+        textInteractionAssistant can no longer be used as proxy for the presence of the keyboard.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView useSelectionAssistantWithGranularity:]):
+        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
+
 2018-02-20  John Wilander  <[email protected]>
 
         Make WebResourceLoadStatisticsStore::processStatisticsAndDataRecords() call WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed() in a proper callback

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (228828 => 228829)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2018-02-20 19:27:26 UTC (rev 228828)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2018-02-20 20:12:09 UTC (rev 228829)
@@ -1867,27 +1867,18 @@
 
 - (void)useSelectionAssistantWithGranularity:(WKSelectionGranularity)selectionGranularity
 {
-    if (selectionGranularity == WKSelectionGranularityDynamic) {
-        if (_textSelectionAssistant) {
-            [_textSelectionAssistant deactivateSelection];
-            _textSelectionAssistant = nil;
-        }
-        if (!_webSelectionAssistant)
-            _webSelectionAssistant = adoptNS([[UIWKSelectionAssistant alloc] initWithView:self]);
-    } else if (selectionGranularity == WKSelectionGranularityCharacter) {
-        if (_webSelectionAssistant)
-            _webSelectionAssistant = nil;
+    if (_webSelectionAssistant)
+        _webSelectionAssistant = nil;
 
-        if (!_textSelectionAssistant)
-            _textSelectionAssistant = adoptNS([[UIWKTextInteractionAssistant alloc] initWithView:self]);
-        else {
-            // Reset the gesture recognizers in case editibility has changed.
-            [_textSelectionAssistant setGestureRecognizers];
-        }
+    if (!_textSelectionAssistant)
+        _textSelectionAssistant = adoptNS([[UIWKTextInteractionAssistant alloc] initWithView:self]);
+    else {
+        // Reset the gesture recognizers in case editibility has changed.
+        [_textSelectionAssistant setGestureRecognizers];
+    }
 
-        if (self.isFirstResponder && !self.suppressAssistantSelectionView)
-            [_textSelectionAssistant activateSelection];
-    }
+    if (self.isFirstResponder && !self.suppressAssistantSelectionView)
+        [_textSelectionAssistant activateSelection];
 }
 
 - (void)clearSelection
@@ -4012,7 +4003,7 @@
         shouldShowKeyboard = [inputDelegate _webView:_webView focusShouldStartInputSession:focusedElementInfo.get()];
     else {
         // The default behavior is to allow node assistance if the user is interacting or the keyboard is already active.
-        shouldShowKeyboard = userIsInteracting || _textSelectionAssistant || changingActivityState;
+        shouldShowKeyboard = userIsInteracting || _isChangingFocus || changingActivityState;
 #if ENABLE(DATA_INTERACTION)
         shouldShowKeyboard |= _dragDropInteractionState.isPerformingDrop();
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to