Title: [249933] trunk/Source
Revision
249933
Author
[email protected]
Date
2019-09-16 17:37:57 -0700 (Mon, 16 Sep 2019)

Log Message

REGRESSION: iPad: Safari becomes unresponsive after context menu on 1-800-MY-APPLE phone number, tapping 'Add to Contacts'
https://bugs.webkit.org/show_bug.cgi?id=201816
<rdar://55105827>

Reviewed by Darin Adler.

Source/WebCore/PAL:

Expose kDataDetectorsSourceRectKey (and sort things while there).

* pal/spi/ios/DataDetectorsUISPI.h:

Source/WebKit:

When generating the DataDetectorsContext for a position, we should
also provide the source rectangle for the link in root view coordinates.
This allows DataDetectors to show any modal dialogs in the right
position.

* UIProcess/ios/WKContentViewInteraction.mm: Use either the bounds of the positionInformation
or the text bounding rectangle.
(-[WKContentView dataDetectionContextForPositionInformation:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/PAL/ChangeLog (249932 => 249933)


--- trunk/Source/WebCore/PAL/ChangeLog	2019-09-17 00:13:16 UTC (rev 249932)
+++ trunk/Source/WebCore/PAL/ChangeLog	2019-09-17 00:37:57 UTC (rev 249933)
@@ -1,3 +1,15 @@
+2019-09-16  Dean Jackson  <[email protected]>
+
+        REGRESSION: iPad: Safari becomes unresponsive after context menu on 1-800-MY-APPLE phone number, tapping 'Add to Contacts'
+        https://bugs.webkit.org/show_bug.cgi?id=201816
+        <rdar://55105827>
+
+        Reviewed by Darin Adler.
+
+        Expose kDataDetectorsSourceRectKey (and sort things while there).
+
+        * pal/spi/ios/DataDetectorsUISPI.h:
+
 2019-09-13  Youenn Fablet  <[email protected]>
 
         Use WebProcess processIdentifier to identify Service Worker connections

Modified: trunk/Source/WebCore/PAL/pal/spi/ios/DataDetectorsUISPI.h (249932 => 249933)


--- trunk/Source/WebCore/PAL/pal/spi/ios/DataDetectorsUISPI.h	2019-09-17 00:13:16 UTC (rev 249932)
+++ trunk/Source/WebCore/PAL/pal/spi/ios/DataDetectorsUISPI.h	2019-09-17 00:37:57 UTC (rev 249933)
@@ -87,7 +87,8 @@
 #endif
 SOFT_LINK_CLASS(DataDetectorsUI, DDDetectionController)
 SOFT_LINK_CONSTANT(DataDetectorsUI, kDataDetectorsLeadingText, const NSString *)
+SOFT_LINK_CONSTANT(DataDetectorsUI, kDataDetectorsReferenceDateKey, const NSString *)
+SOFT_LINK_CONSTANT(DataDetectorsUI, kDataDetectorsSourceRectKey, const NSString *)
 SOFT_LINK_CONSTANT(DataDetectorsUI, kDataDetectorsTrailingText, const NSString *)
-SOFT_LINK_CONSTANT(DataDetectorsUI, kDataDetectorsReferenceDateKey, const NSString *)
 
 #endif

Modified: trunk/Source/WebKit/ChangeLog (249932 => 249933)


--- trunk/Source/WebKit/ChangeLog	2019-09-17 00:13:16 UTC (rev 249932)
+++ trunk/Source/WebKit/ChangeLog	2019-09-17 00:37:57 UTC (rev 249933)
@@ -1,3 +1,20 @@
+2019-09-16  Dean Jackson  <[email protected]>
+
+        REGRESSION: iPad: Safari becomes unresponsive after context menu on 1-800-MY-APPLE phone number, tapping 'Add to Contacts'
+        https://bugs.webkit.org/show_bug.cgi?id=201816
+        <rdar://55105827>
+
+        Reviewed by Darin Adler.
+
+        When generating the DataDetectorsContext for a position, we should
+        also provide the source rectangle for the link in root view coordinates.
+        This allows DataDetectors to show any modal dialogs in the right
+        position.
+
+        * UIProcess/ios/WKContentViewInteraction.mm: Use either the bounds of the positionInformation
+        or the text bounding rectangle.
+        (-[WKContentView dataDetectionContextForPositionInformation:]):
+
 2019-09-16  Chris Dumez  <[email protected]>
 
         NetworkProcessConnection does not need HashMaps of sessionIDs for Service Workers and IDB

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (249932 => 249933)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-09-17 00:13:16 UTC (rev 249932)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-09-17 00:37:57 UTC (rev 249933)
@@ -6424,6 +6424,15 @@
         context.get()[getkDataDetectorsLeadingText()] = positionInformation.textBefore;
     if (!positionInformation.textAfter.isEmpty())
         context.get()[getkDataDetectorsTrailingText()] = positionInformation.textAfter;
+
+    CGRect sourceRect;
+    if (positionInformation.isLink)
+        sourceRect = positionInformation.linkIndicator.textBoundingRectInRootViewCoordinates;
+    else
+        sourceRect = positionInformation.bounds;
+
+    CGRect frameInContainerViewCoordinates = [self convertRect:sourceRect toView:self.containerViewForTargetedPreviews];
+    context.get()[getkDataDetectorsSourceRectKey()] = [NSValue valueWithCGRect:frameInContainerViewCoordinates];
 #endif
     
     return context.autorelease();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to