Title: [261269] trunk/Source/WebKit
- Revision
- 261269
- Author
- [email protected]
- Date
- 2020-05-06 23:18:53 -0700 (Wed, 06 May 2020)
Log Message
Context Menus presented from the wrong location when presented from sub-frames
https://bugs.webkit.org/show_bug.cgi?id=211537
<rdar://problem/60390846>
Reviewed by Tim Horton.
The calculation for bounds for selection Information did not take frames into account,
so if a frame was used, the location would not be correct in the context of the whole
page, so the presentation location ended up being way off.
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel showDocumentPickerMenu]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::boundsPositionInformation):
(WebKit::selectionPositionInformation):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (261268 => 261269)
--- trunk/Source/WebKit/ChangeLog 2020-05-07 05:37:45 UTC (rev 261268)
+++ trunk/Source/WebKit/ChangeLog 2020-05-07 06:18:53 UTC (rev 261269)
@@ -1,3 +1,21 @@
+2020-05-06 Megan Gardner <[email protected]>
+
+ Context Menus presented from the wrong location when presented from sub-frames
+ https://bugs.webkit.org/show_bug.cgi?id=211537
+ <rdar://problem/60390846>
+
+ Reviewed by Tim Horton.
+
+ The calculation for bounds for selection Information did not take frames into account,
+ so if a frame was used, the location would not be correct in the context of the whole
+ page, so the presentation location ended up being way off.
+
+ * UIProcess/ios/forms/WKFileUploadPanel.mm:
+ (-[WKFileUploadPanel showDocumentPickerMenu]):
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::boundsPositionInformation):
+ (WebKit::selectionPositionInformation):
+
2020-05-06 Commit Queue <[email protected]>
Unreviewed, reverting r260689.
Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm (261268 => 261269)
--- trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm 2020-05-07 05:37:45 UTC (rev 261268)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm 2020-05-07 06:18:53 UTC (rev 261269)
@@ -512,7 +512,7 @@
BOOL shouldPresentDocumentMenuViewController = allowsImageMediaType || allowsVideoMediaType;
if (shouldPresentDocumentMenuViewController) {
[self ensureContextMenuInteraction];
- [_documentContextMenuInteraction _presentMenuAtLocation:CGPointMake(_interactionPoint.x, _interactionPoint.y)];
+ [_documentContextMenuInteraction _presentMenuAtLocation:_interactionPoint];
} else // Image and Video types are not accepted so bypass the menu and open the file picker directly.
#endif
[self showFilePickerMenu];
Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (261268 => 261269)
--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm 2020-05-07 05:37:45 UTC (rev 261268)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm 2020-05-07 06:18:53 UTC (rev 261269)
@@ -2693,7 +2693,7 @@
info.image = sharedBitmap;
}
-static void boundsPositionInformation(RenderElement& renderer, InteractionInformationAtPosition& info)
+static void boundsPositionInformation(RenderObject& renderer, InteractionInformationAtPosition& info)
{
if (renderer.isRenderImage())
info.bounds = downcast<RenderImage>(renderer).absoluteContentQuad().enclosingBoundingBox();
@@ -2761,7 +2761,7 @@
return;
RenderObject* renderer = hitNode->renderer();
- info.bounds = renderer->absoluteBoundingBoxRect(true);
+ boundsPositionInformation(*renderer, info);
if (is<Element>(*hitNode)) {
Element& element = downcast<Element>(*hitNode);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes