+2015-10-20 Joseph Pecoraro <pecoraro@apple.com>
+
+ ASSERT when right clicking on SVG Image generating Share menu - can break Web Inspector
+ https://bugs.webkit.org/show_bug.cgi?id=150374
+
+ Reviewed by Brian Burg.
+
+ When there is no absolute URL or downloadable media URL no system share
+ menu is created, but we were still appending the null context menu to
+ the list of context menu items.
+
+ * UIProcess/mac/WebContextMenuProxyMac.mm:
+ (WebKit::WebContextMenuProxyMac::shareMenuItem):
+ Bail early if the context menu is null.
+
+ (WebKit::WebContextMenuProxyMac::showContextMenu):
+ Only append the share context menu item if it is non-null.
+ This matches ContextMenuController.cpp in WebCore.
+
2015-10-20 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r191306.
image = adoptNS([[NSImage alloc] initWithData:[NSData dataWithBytes:(unsigned char*)hitTestData.imageSharedMemory->data() length:hitTestData.imageSize]]);
ContextMenuItem item = ContextMenuItem::shareMenuItem(absoluteLinkURL, downloadableMediaURL, image.get(), m_context.selectedText());
+ if (item.isNull())
+ return item;
NSMenuItem *nsItem = item.platformDescription();
}
#if ENABLE(SERVICE_CONTROLS)
- proposedAPIItems.append(WebContextMenuItem::create(shareMenuItem()));
+ ContextMenuItem shareItem = shareMenuItem();
+ if (!shareItem.isNull())
+ proposedAPIItems.append(WebContextMenuItem::create(shareItem));
#endif
}