Title: [228845] trunk/Source/WebKit
Revision
228845
Author
jlew...@apple.com
Date
2018-02-20 15:02:01 -0800 (Tue, 20 Feb 2018)

Log Message

Unreviewed, rolling out r228829.

This caused a consistent failure in the API test
WebKit.InteractionDeadlockAfterCrash on iOS Simulator

Reverted changeset:

"Switch to UIWKTextInteractionAssistant for non-editable text"
https://bugs.webkit.org/show_bug.cgi?id=182834
https://trac.webkit.org/changeset/228829

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (228844 => 228845)


--- trunk/Source/WebKit/ChangeLog	2018-02-20 22:30:21 UTC (rev 228844)
+++ trunk/Source/WebKit/ChangeLog	2018-02-20 23:02:01 UTC (rev 228845)
@@ -1,3 +1,16 @@
+2018-02-20  Matt Lewis  <jlew...@apple.com>
+
+        Unreviewed, rolling out r228829.
+
+        This caused a consistent failure in the API test
+        WebKit.InteractionDeadlockAfterCrash on iOS Simulator
+
+        Reverted changeset:
+
+        "Switch to UIWKTextInteractionAssistant for non-editable text"
+        https://bugs.webkit.org/show_bug.cgi?id=182834
+        https://trac.webkit.org/changeset/228829
+
 2018-02-20  Megan Gardner  <megan_gard...@apple.com>
 
         Switch to UIWKTextInteractionAssistant for non-editable text

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (228844 => 228845)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2018-02-20 22:30:21 UTC (rev 228844)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2018-02-20 23:02:01 UTC (rev 228845)
@@ -1867,18 +1867,27 @@
 
 - (void)useSelectionAssistantWithGranularity:(WKSelectionGranularity)selectionGranularity
 {
-    if (_webSelectionAssistant)
-        _webSelectionAssistant = nil;
+    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 (!_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
@@ -4003,7 +4012,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 || _isChangingFocus || changingActivityState;
+        shouldShowKeyboard = userIsInteracting || _textSelectionAssistant || changingActivityState;
 #if ENABLE(DATA_INTERACTION)
         shouldShowKeyboard |= _dragDropInteractionState.isPerformingDrop();
 #endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to