Diff
Modified: trunk/Source/WebCore/ChangeLog (286811 => 286812)
--- trunk/Source/WebCore/ChangeLog 2021-12-09 23:20:39 UTC (rev 286811)
+++ trunk/Source/WebCore/ChangeLog 2021-12-09 23:25:50 UTC (rev 286812)
@@ -1,3 +1,18 @@
+2021-12-09 Megan Gardner <[email protected]>
+
+ Markup Pane not displaying.
+ https://bugs.webkit.org/show_bug.cgi?id=234089
+
+ Reviewed by Tim Horton.
+
+ Vend the image location so that the Markup Pane knows where to
+ present from.
+
+ * dom/mac/ImageControlsMac.cpp:
+ (WebCore::ImageControlsMac::handleEvent):
+ * page/ChromeClient.h:
+ (WebCore::ChromeClient::handleImageServiceClick):
+
2021-12-09 Tyler Wilcock <[email protected]>
AX: Improve ASSERT while processing tree appends in AXIsolatedTree::applyPendingChanges
Modified: trunk/Source/WebCore/dom/mac/ImageControlsMac.cpp (286811 => 286812)
--- trunk/Source/WebCore/dom/mac/ImageControlsMac.cpp 2021-12-09 23:20:39 UTC (rev 286811)
+++ trunk/Source/WebCore/dom/mac/ImageControlsMac.cpp 2021-12-09 23:25:50 UTC (rev 286812)
@@ -130,7 +130,7 @@
if (!imageElement)
return false;
if (auto* image = imageFromImageElementNode(*imageElement)) {
- page->chrome().client().handleImageServiceClick(roundedIntPoint(mouseEvent.absoluteLocation()), *image, imageElement->isContentEditable());
+ page->chrome().client().handleImageServiceClick(roundedIntPoint(mouseEvent.absoluteLocation()), *image, imageElement->isContentEditable(), imageElement->renderBox()->absoluteContentQuad().enclosingBoundingBox());
event.setDefaultHandled();
return true;
}
Modified: trunk/Source/WebCore/page/ChromeClient.h (286811 => 286812)
--- trunk/Source/WebCore/page/ChromeClient.h 2021-12-09 23:20:39 UTC (rev 286811)
+++ trunk/Source/WebCore/page/ChromeClient.h 2021-12-09 23:25:50 UTC (rev 286812)
@@ -532,7 +532,7 @@
#if ENABLE(SERVICE_CONTROLS)
virtual void handleSelectionServiceClick(FrameSelection&, const Vector<String>&, const IntPoint&) { }
virtual bool hasRelevantSelectionServices(bool /*isTextOnly*/) const { return false; }
- virtual void handleImageServiceClick(const IntPoint&, Image&, bool /*isEditable*/) { }
+ virtual void handleImageServiceClick(const IntPoint&, Image&, bool /*isEditable*/, const IntRect&) { }
#endif
virtual bool shouldDispatchFakeMouseMoveEvents() const { return true; }
Modified: trunk/Source/WebKit/ChangeLog (286811 => 286812)
--- trunk/Source/WebKit/ChangeLog 2021-12-09 23:20:39 UTC (rev 286811)
+++ trunk/Source/WebKit/ChangeLog 2021-12-09 23:25:50 UTC (rev 286812)
@@ -1,3 +1,36 @@
+2021-12-09 Megan Gardner <[email protected]>
+
+ Markup Pane not displaying.
+ https://bugs.webkit.org/show_bug.cgi?id=234089
+
+ Reviewed by Tim Horton.
+
+ An optional method on NSSharingServiceDelegate was not implemented, meaning
+ that the markup pane did not know where to present, and would assert and fail to
+ show up. Make sure this is implemented for the image controls menu and also
+ give it the correct location to present form.
+
+ * Shared/ContextMenuContextData.cpp:
+ (WebKit::ContextMenuContextData::ContextMenuContextData):
+ (WebKit::ContextMenuContextData::encode const):
+ (WebKit::ContextMenuContextData::decode):
+ * Shared/ContextMenuContextData.h:
+ (WebKit::ContextMenuContextData::controlledImageFrame const):
+ * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
+ (-[WKWebViewConfiguration init]):
+ * UIProcess/mac/WKSharingServicePickerDelegate.h:
+ * UIProcess/mac/WKSharingServicePickerDelegate.mm:
+ (-[WKSharingServicePickerDelegate setSourceFrame:]):
+ (-[WKSharingServicePickerDelegate sharingService:sourceFrameOnScreenForShareItem:]):
+ * UIProcess/mac/WebContextMenuProxyMac.mm:
+ (WebKit::WebContextMenuProxyMac::setupServicesMenu):
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::handleImageServiceClick):
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/mac/WebPageMac.mm:
+ (WebKit::WebPage::handleImageServiceClick):
+
2021-12-09 Tim Horton <[email protected]>
Momentum Generator: Scroll tail hiccup only when scrolling up on 60Hz displays
Modified: trunk/Source/WebKit/Shared/ContextMenuContextData.cpp (286811 => 286812)
--- trunk/Source/WebKit/Shared/ContextMenuContextData.cpp 2021-12-09 23:20:39 UTC (rev 286811)
+++ trunk/Source/WebKit/Shared/ContextMenuContextData.cpp 2021-12-09 23:25:50 UTC (rev 286812)
@@ -67,10 +67,11 @@
}
#if ENABLE(SERVICE_CONTROLS)
-ContextMenuContextData::ContextMenuContextData(const WebCore::IntPoint& menuLocation, WebCore::Image& image, bool isEditable)
+ContextMenuContextData::ContextMenuContextData(const WebCore::IntPoint& menuLocation, WebCore::Image& image, bool isEditable, const WebCore::IntRect& imageRect)
: m_type(Type::ServicesMenu)
, m_menuLocation(menuLocation)
, m_selectionIsEditable(isEditable)
+ , m_controlledImageBounds(imageRect)
{
setImage(&image);
}
@@ -102,6 +103,7 @@
encoder << m_controlledSelectionData;
encoder << m_selectedTelephoneNumbers;
encoder << m_selectionIsEditable;
+ encoder << m_controlledImageBounds;
#endif
}
@@ -136,6 +138,8 @@
return false;
if (!decoder.decode(result.m_selectionIsEditable))
return false;
+ if (!decoder.decode(result.m_controlledImageBounds))
+ return false;
#endif
return true;
Modified: trunk/Source/WebKit/Shared/ContextMenuContextData.h (286811 => 286812)
--- trunk/Source/WebKit/Shared/ContextMenuContextData.h 2021-12-09 23:20:39 UTC (rev 286811)
+++ trunk/Source/WebKit/Shared/ContextMenuContextData.h 2021-12-09 23:25:50 UTC (rev 286812)
@@ -64,7 +64,7 @@
{
}
- ContextMenuContextData(const WebCore::IntPoint& menuLocation, WebCore::Image&, bool isEditable);
+ ContextMenuContextData(const WebCore::IntPoint& menuLocation, WebCore::Image&, bool isEditable, const WebCore::IntRect& imageRect);
ShareableBitmap* controlledImage() const { return m_controlledImage.get(); }
const Vector<uint8_t>& controlledSelectionData() const { return m_controlledSelectionData; }
@@ -72,6 +72,7 @@
bool isServicesMenu() const { return m_type == ContextMenuContextData::Type::ServicesMenu; }
bool controlledDataIsEditable() const;
+ WebCore::IntRect controlledImageBounds() const { return m_controlledImageBounds; };
#endif
void encode(IPC::Encoder&) const;
@@ -93,6 +94,7 @@
Vector<uint8_t> m_controlledSelectionData;
Vector<String> m_selectedTelephoneNumbers;
bool m_selectionIsEditable;
+ WebCore::IntRect m_controlledImageBounds;
#endif
};
Modified: trunk/Source/WebKit/UIProcess/mac/WKSharingServicePickerDelegate.h (286811 => 286812)
--- trunk/Source/WebKit/UIProcess/mac/WKSharingServicePickerDelegate.h 2021-12-09 23:20:39 UTC (rev 286811)
+++ trunk/Source/WebKit/UIProcess/mac/WKSharingServicePickerDelegate.h 2021-12-09 23:25:50 UTC (rev 286812)
@@ -38,6 +38,7 @@
RetainPtr<NSSharingServicePicker> _picker;
BOOL _filterEditingServices;
BOOL _handleEditingReplacement;
+ NSRect _sourceFrame;
}
+ (WKSharingServicePickerDelegate *)sharedSharingServicePickerDelegate;
@@ -46,6 +47,8 @@
- (void)setPicker:(NSSharingServicePicker *)picker;
- (void)setFiltersEditingServices:(BOOL)filtersEditingServices;
- (void)setHandlesEditingReplacement:(BOOL)handlesEditingReplacement;
+- (void)setSourceFrame:(NSRect)sourceFrame;
+
@end
#endif // ENABLE(SERVICE_CONTROLS)
Modified: trunk/Source/WebKit/UIProcess/mac/WKSharingServicePickerDelegate.mm (286811 => 286812)
--- trunk/Source/WebKit/UIProcess/mac/WKSharingServicePickerDelegate.mm 2021-12-09 23:20:39 UTC (rev 286811)
+++ trunk/Source/WebKit/UIProcess/mac/WKSharingServicePickerDelegate.mm 2021-12-09 23:25:50 UTC (rev 286812)
@@ -70,6 +70,11 @@
_handleEditingReplacement = handlesEditingReplacement;
}
+- (void)setSourceFrame:(NSRect)sourceFrame
+{
+ _sourceFrame = sourceFrame;
+}
+
- (NSArray *)sharingServicePicker:(NSSharingServicePicker *)sharingServicePicker sharingServicesForItems:(NSArray *)items mask:(NSSharingServiceMask)mask proposedSharingServices:(NSArray *)proposedServices
{
if (!_filterEditingServices)
@@ -90,6 +95,11 @@
return self;
}
+- (NSRect)sharingService:(NSSharingService *)sharingService sourceFrameOnScreenForShareItem:(id <NSPasteboardWriting>)item
+{
+ return _sourceFrame;
+}
+
- (void)sharingService:(NSSharingService *)sharingService willShareItems:(NSArray *)items
{
_menuProxy->clearServicesMenu();
Modified: trunk/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm (286811 => 286812)
--- trunk/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm 2021-12-09 23:20:39 UTC (rev 286811)
+++ trunk/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm 2021-12-09 23:25:50 UTC (rev 286812)
@@ -238,6 +238,11 @@
[[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate] setPicker:picker.get()];
[[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate] setFiltersEditingServices:!includeEditorServices];
[[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate] setHandlesEditingReplacement:includeEditorServices];
+
+ NSRect imageRect = m_context.controlledImageBounds();
+ imageRect = [m_webView convertRect:imageRect toView:nil];
+ imageRect = [[m_webView window] convertRectToScreen:imageRect];
+ [[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate] setSourceFrame:imageRect];
m_menu = adoptNS([[picker menu] copy]);
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp (286811 => 286812)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp 2021-12-09 23:20:39 UTC (rev 286811)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp 2021-12-09 23:25:50 UTC (rev 286812)
@@ -1347,9 +1347,9 @@
return (isTextOnly && WebProcess::singleton().hasSelectionServices()) || WebProcess::singleton().hasRichContentServices();
}
-void WebChromeClient::handleImageServiceClick(const IntPoint& point, Image& image, bool isEditable)
+void WebChromeClient::handleImageServiceClick(const IntPoint& point, Image& image, bool isEditable, const IntRect& imageRect)
{
- m_page.handleImageServiceClick(point, image, isEditable);
+ m_page.handleImageServiceClick(point, image, isEditable, imageRect);
}
#endif
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h (286811 => 286812)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h 2021-12-09 23:20:39 UTC (rev 286811)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h 2021-12-09 23:25:50 UTC (rev 286812)
@@ -381,7 +381,7 @@
#if ENABLE(SERVICE_CONTROLS)
void handleSelectionServiceClick(WebCore::FrameSelection&, const Vector<String>& telephoneNumbers, const WebCore::IntPoint&) final;
bool hasRelevantSelectionServices(bool isTextOnly) const final;
- void handleImageServiceClick(const WebCore::IntPoint&, WebCore::Image&, bool isEditable) final;
+ void handleImageServiceClick(const WebCore::IntPoint&, WebCore::Image&, bool isEditable, const WebCore::IntRect&) final;
#endif
bool shouldDispatchFakeMouseMoveEvents() const final;
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (286811 => 286812)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2021-12-09 23:20:39 UTC (rev 286811)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2021-12-09 23:25:50 UTC (rev 286812)
@@ -1203,7 +1203,7 @@
#if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
void handleTelephoneNumberClick(const String& number, const WebCore::IntPoint&);
void handleSelectionServiceClick(WebCore::FrameSelection&, const Vector<String>& telephoneNumbers, const WebCore::IntPoint&);
- void handleImageServiceClick(const WebCore::IntPoint&, WebCore::Image&, bool isEditable);
+ void handleImageServiceClick(const WebCore::IntPoint&, WebCore::Image&, bool isEditable, const WebCore::IntRect&);
#endif
void didChangeScrollOffsetForFrame(WebCore::Frame*);
Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm (286811 => 286812)
--- trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm 2021-12-09 23:20:39 UTC (rev 286811)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm 2021-12-09 23:25:50 UTC (rev 286812)
@@ -828,9 +828,9 @@
send(Messages::WebPageProxy::ShowContextMenu(ContextMenuContextData(point, selectionDataVector, phoneNumbers, selection.selection().isContentEditable()), UserData()));
}
-void WebPage::handleImageServiceClick(const IntPoint& point, Image& image, bool isEditable)
+void WebPage::handleImageServiceClick(const IntPoint& point, Image& image, bool isEditable, const IntRect& imageRect)
{
- send(Messages::WebPageProxy::ShowContextMenu(ContextMenuContextData(point, image, isEditable), UserData()));
+ send(Messages::WebPageProxy::ShowContextMenu(ContextMenuContextData(point, image, isEditable, imageRect), UserData()));
}
#endif