Don't activate Selection Assistant unless it is actually needed.
authormegan_gardner@apple.com <megan_gardner@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Apr 2018 20:34:40 +0000 (20:34 +0000)
committermegan_gardner@apple.com <megan_gardner@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Apr 2018 20:34:40 +0000 (20:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=184944
<rdar://problem/39469671>

Reviewed by Tim Horton.

Source/WebKit:

Don't activate the selection unless we need to. Activating on init is overeager and allowing Javascript to
activate selections without user input.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView useSelectionAssistantWithGranularity:]):

LayoutTests:

Turning on previously flakey tests that are fixed with this change.

* platform/ios-wk2/TestExpectations:

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

LayoutTests/ChangeLog
LayoutTests/platform/ios-wk2/TestExpectations
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

index 2a7aac1..f39cd25 100644 (file)
@@ -1,3 +1,15 @@
+2018-04-25  Megan Gardner  <megan_gardner@apple.com>
+
+        Don't activate Selection Assistant unless it is actually needed.
+        https://bugs.webkit.org/show_bug.cgi?id=184944
+        <rdar://problem/39469671>
+
+        Reviewed by Tim Horton.
+        
+        Turning on previously flakey tests that are fixed with this change.
+
+        * platform/ios-wk2/TestExpectations:
+
 2018-04-25  Ross Kirsling  <ross.kirsling@sony.com>
 
         [WinCairo] Fix js/regexp-unicode.html crash.
index db637e6..2c46e42 100644 (file)
@@ -1349,21 +1349,4 @@ webkit.org/b/183860 [ Release ] http/wpt/service-workers/third-party-registratio
 
 webkit.org/b/184245 http/tests/workers/service/service-worker-cache-api.https.html [ Pass Failure ]
 
-#FIXME: <rdar://problem/39469671> Tests that fail when run after fast/events/ios/double-tap-zoom.html with UIWKTextInteractionAssistant turned on
-fast/flexbox/flexbox-fail-to-select-same-line.html [ ImageOnlyFailure Pass ]
-fast/html/marquee-child-wrap.html [ ImageOnlyFailure Pass ]
-fast/misc/subtree-layouts.html [ ImageOnlyFailure Pass ]
-fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout.html [ ImageOnlyFailure Pass ]
-fast/text/international/hebrew-selection.html [ ImageOnlyFailure Pass ]
-imported/blink/editing/selection/deleteFromDocument-crash.html [ ImageOnlyFailure Pass ]
-imported/blink/editing/style/justify-left-crash.html [ ImageOnlyFailure Pass ]
-imported/blink/fast/css/user-select-none.html [ ImageOnlyFailure Pass ]
-imported/blink/fast/text/international/repaint-glyph-bounds.html [ ImageOnlyFailure Pass ]
-imported/mozilla/svg/text/multiple-chunks-selection.svg [ ImageOnlyFailure Pass ]
-imported/mozilla/svg/text/selectSubString-2.svg [ ImageOnlyFailure Pass ]
-imported/mozilla/svg/text/selectSubString-3.svg [ ImageOnlyFailure Pass ]
-imported/mozilla/svg/text/selectSubString.svg [ ImageOnlyFailure Pass ]
-imported/mozilla/svg/text/textpath-selection.svg [ ImageOnlyFailure Pass ]
-svg/foreignObject/viewport-foreignobject-crash.html [ ImageOnlyFailure Pass ]
-
 webkit.org/b/184783 compositing/ios/overflow-scroll-touch-tiles.html [ Pass Failure ]
index 8df44d7..a249ee6 100644 (file)
@@ -1,3 +1,17 @@
+2018-04-25  Megan Gardner  <megan_gardner@apple.com>
+
+        Don't activate Selection Assistant unless it is actually needed.
+        https://bugs.webkit.org/show_bug.cgi?id=184944
+        <rdar://problem/39469671>
+
+        Reviewed by Tim Horton.
+        
+        Don't activate the selection unless we need to. Activating on init is overeager and allowing Javascript to 
+        activate selections without user input.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView useSelectionAssistantWithGranularity:]):
+
 2018-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Fix entitlements and sandbox configurations in WebKit after r230778
index 1b83610..7b95cec 100644 (file)
@@ -1932,9 +1932,6 @@ static void cancelPotentialTapIfNecessary(WKContentView* contentView)
         // Reset the gesture recognizers in case editibility has changed.
         [_textSelectionAssistant setGestureRecognizers];
     }
-
-    if (self.isFirstResponder && !self.suppressAssistantSelectionView)
-        [_textSelectionAssistant activateSelection];
 }
 
 - (void)clearSelection