Title: [274653] trunk/Source/WebKit
Revision
274653
Author
[email protected]
Date
2021-03-18 11:17:00 -0700 (Thu, 18 Mar 2021)

Log Message

[iOS] editing/selection/character-granularity-rect.html fails on certain internal configurations after r274610
https://bugs.webkit.org/show_bug.cgi?id=223447

Reviewed by Devin Rousso.

On versions of iOS where `ENABLE(IMAGE_EXTRACTION)` is defined but the system feature is disabled, this test
began failing after r274610. This is because the new image extraction deferral gesture now blocks text
interaction gestures, but the code to actually fail this deferring gesture (and thus, "lift" the deferring
gesture gate) is still behind the system flag. As a result, text interactions when the image extraction flag is
disabled will only begin after the touch ends.

This means that when selecting text via a long press, the text selection doesn't appear until lifting the touch
if image extraction is disabled. To fix this, we only enable this deferring gesture in the case where the system
feature is enabled.

* UIProcess/ios/GestureRecognizerConsistencyEnforcer.mm:
(WebKit::GestureRecognizerConsistencyEnforcer::timerFired):

Additionally tweak the `GestureRecognizerConsistencyEnforcer` to only forcibly reset lingering unlifted gesture
recognizers if they are enabled.

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

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (274652 => 274653)


--- trunk/Source/WebKit/ChangeLog	2021-03-18 18:14:48 UTC (rev 274652)
+++ trunk/Source/WebKit/ChangeLog	2021-03-18 18:17:00 UTC (rev 274653)
@@ -1,3 +1,29 @@
+2021-03-18  Wenson Hsieh  <[email protected]>
+
+        [iOS] editing/selection/character-granularity-rect.html fails on certain internal configurations after r274610
+        https://bugs.webkit.org/show_bug.cgi?id=223447
+
+        Reviewed by Devin Rousso.
+
+        On versions of iOS where `ENABLE(IMAGE_EXTRACTION)` is defined but the system feature is disabled, this test
+        began failing after r274610. This is because the new image extraction deferral gesture now blocks text
+        interaction gestures, but the code to actually fail this deferring gesture (and thus, "lift" the deferring
+        gesture gate) is still behind the system flag. As a result, text interactions when the image extraction flag is
+        disabled will only begin after the touch ends.
+
+        This means that when selecting text via a long press, the text selection doesn't appear until lifting the touch
+        if image extraction is disabled. To fix this, we only enable this deferring gesture in the case where the system
+        feature is enabled.
+
+        * UIProcess/ios/GestureRecognizerConsistencyEnforcer.mm:
+        (WebKit::GestureRecognizerConsistencyEnforcer::timerFired):
+
+        Additionally tweak the `GestureRecognizerConsistencyEnforcer` to only forcibly reset lingering unlifted gesture
+        recognizers if they are enabled.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView setUpInteraction]):
+
 2021-03-18  Antti Koivisto  <[email protected]>
 
         Don't delay conditional requests in resource load scheduler

Modified: trunk/Source/WebKit/UIProcess/ios/GestureRecognizerConsistencyEnforcer.mm (274652 => 274653)


--- trunk/Source/WebKit/UIProcess/ios/GestureRecognizerConsistencyEnforcer.mm	2021-03-18 18:14:48 UTC (rev 274652)
+++ trunk/Source/WebKit/UIProcess/ios/GestureRecognizerConsistencyEnforcer.mm	2021-03-18 18:17:00 UTC (rev 274653)
@@ -71,7 +71,7 @@
     auto strongView = m_view.get();
     auto possibleDeferringGestures = [NSMutableArray<WKDeferringGestureRecognizer *> array];
     for (WKDeferringGestureRecognizer *gesture in [strongView deferringGestures]) {
-        if (gesture.state == UIGestureRecognizerStatePossible)
+        if (gesture.state == UIGestureRecognizerStatePossible && gesture.enabled)
             [possibleDeferringGestures addObject:gesture];
     }
 

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (274652 => 274653)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2021-03-18 18:14:48 UTC (rev 274652)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2021-03-18 18:17:00 UTC (rev 274653)
@@ -795,6 +795,7 @@
     _imageExtractionDeferringGestureRecognizer = adoptNS([[WKDeferringGestureRecognizer alloc] initWithDeferringGestureDelegate:self]);
     [_imageExtractionDeferringGestureRecognizer setName:@"Deferrer for image extraction"];
     [_imageExtractionDeferringGestureRecognizer setImmediatelyFailsAfterTouchEnd:YES];
+    [_imageExtractionDeferringGestureRecognizer setEnabled:self._imageExtractionEnabled];
 #endif
 
     for (WKDeferringGestureRecognizer *gesture in self.deferringGestures) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to