Title: [262443] branches/safari-610.1.15-branch/Source/WebKit
- Revision
- 262443
- Author
- alanc...@apple.com
- Date
- 2020-06-02 14:58:05 -0700 (Tue, 02 Jun 2020)
Log Message
Cherry-pick r262280. rdar://problem/63891526
Avoid unnecessary sync IPC messages when togging the callout bar for selections.
https://bugs.webkit.org/show_bug.cgi?id=212508
The loupe gesture only needs to be activated and evaluated if the tap is inside
an existing selectionView. We can do that test in the UIProcess without resorting to a sync IPC message.
Doing that evaluation locally will eliminate unnecessary hangs in the UIProcess.
Reviewed by Wenson Hsieh.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _pointIsInsideSelectionRect:outBoundingRect:]):
(-[WKContentView _shouldToggleSelectionCommandsAfterTapAt:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262280 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-610.1.15-branch/Source/WebKit/ChangeLog (262442 => 262443)
--- branches/safari-610.1.15-branch/Source/WebKit/ChangeLog 2020-06-02 21:58:03 UTC (rev 262442)
+++ branches/safari-610.1.15-branch/Source/WebKit/ChangeLog 2020-06-02 21:58:05 UTC (rev 262443)
@@ -1,5 +1,42 @@
2020-06-02 Alan Coon <alanc...@apple.com>
+ Cherry-pick r262280. rdar://problem/63891526
+
+ Avoid unnecessary sync IPC messages when togging the callout bar for selections.
+ https://bugs.webkit.org/show_bug.cgi?id=212508
+
+ The loupe gesture only needs to be activated and evaluated if the tap is inside
+ an existing selectionView. We can do that test in the UIProcess without resorting to a sync IPC message.
+ Doing that evaluation locally will eliminate unnecessary hangs in the UIProcess.
+
+ Reviewed by Wenson Hsieh.
+
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _pointIsInsideSelectionRect:outBoundingRect:]):
+ (-[WKContentView _shouldToggleSelectionCommandsAfterTapAt:]):
+ (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262280 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-05-28 Megan Gardner <megan_gard...@apple.com>
+
+ Avoid unnecessary sync IPC messages when togging the callout bar for selections.
+ https://bugs.webkit.org/show_bug.cgi?id=212508
+
+ The loupe gesture only needs to be activated and evaluated if the tap is inside
+ an existing selectionView. We can do that test in the UIProcess without resorting to a sync IPC message.
+ Doing that evaluation locally will eliminate unnecessary hangs in the UIProcess.
+
+ Reviewed by Wenson Hsieh.
+
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _pointIsInsideSelectionRect:outBoundingRect:]):
+ (-[WKContentView _shouldToggleSelectionCommandsAfterTapAt:]):
+ (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
+
+2020-06-02 Alan Coon <alanc...@apple.com>
+
Cherry-pick r262255. rdar://problem/63891604
Do not send a second sync request for positition information to the web process if we have not recieved information since the previous sync request.
Modified: branches/safari-610.1.15-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (262442 => 262443)
--- branches/safari-610.1.15-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2020-06-02 21:58:03 UTC (rev 262442)
+++ branches/safari-610.1.15-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2020-06-02 21:58:05 UTC (rev 262443)
@@ -2328,12 +2328,8 @@
return textSelectionRects;
}
-- (BOOL)_shouldToggleSelectionCommandsAfterTapAt:(CGPoint)point
+- (BOOL)_pointIsInsideSelectionRect:(CGPoint)point outBoundingRect:(WebCore::FloatRect *)outBoundingRect
{
- if (_lastSelectionDrawingInfo.selectionRects.isEmpty())
- return NO;
-
- WebCore::FloatRect selectionBoundingRect;
BOOL pointIsInSelectionRect = NO;
for (auto& rectInfo : _lastSelectionDrawingInfo.selectionRects) {
auto rect = rectInfo.rect();
@@ -2341,9 +2337,19 @@
continue;
pointIsInSelectionRect |= rect.contains(WebCore::roundedIntPoint(point));
- selectionBoundingRect.unite(rect);
+ if (outBoundingRect)
+ outBoundingRect->unite(rect);
}
+ return pointIsInSelectionRect;
+}
+- (BOOL)_shouldToggleSelectionCommandsAfterTapAt:(CGPoint)point
+{
+ if (_lastSelectionDrawingInfo.selectionRects.isEmpty())
+ return NO;
+
+ WebCore::FloatRect selectionBoundingRect;
+ BOOL pointIsInSelectionRect = [self _pointIsInsideSelectionRect:point outBoundingRect:&selectionBoundingRect];
WebCore::FloatRect unobscuredContentRect = self.unobscuredContentRect;
selectionBoundingRect.intersect(unobscuredContentRect);
@@ -2553,7 +2559,9 @@
return NO;
}
default:
- break;
+ if (!_page->editorState().selectionIsRange)
+ return NO;
+ return [self _pointIsInsideSelectionRect:point outBoundingRect:nil];
}
}
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes