+2014-08-08 Timothy Horton <timothy_horton@apple.com>
+
+ Clients that request the selection services menu after WebKit2 will get one with different metrics than otherwise
+ https://bugs.webkit.org/show_bug.cgi?id=135765
+ <rdar://problem/17962180>
+
+ Reviewed by Brady Eidson.
+
+ * UIProcess/mac/WebContextMenuProxyMac.mm:
+ (WebKit::WebContextMenuProxyMac::setupServicesMenu):
+ The menu is cached between clients, but we make adjustments to it.
+ We should copy it before adjusting.
+
2014-08-08 Timothy Horton <timothy_horton@apple.com>
Services overlay dropdown is often in the wrong place with zoomed pages or horizontal scrolling
void WebContextMenuProxyMac::setupServicesMenu(const ContextMenuContextData& context)
{
- RetainPtr<NSSharingServicePicker> picker;
bool includeEditorServices = context.controlledDataIsEditable();
bool hasControlledImage = !context.controlledImageHandle().isNull();
NSArray *items = nil;
return;
}
- picker = adoptNS([[NSSharingServicePicker alloc] initWithItems:items]);
+ RetainPtr<NSSharingServicePicker> picker = adoptNS([[NSSharingServicePicker alloc] initWithItems:items]);
[picker setStyle:hasControlledImage ? NSSharingServicePickerStyleRollover : NSSharingServicePickerStyleTextSelection];
[picker setDelegate:[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate]];
[[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate] setPicker:picker.get()];
[[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate] setIncludeEditorServices:includeEditorServices];
- m_servicesMenu = [picker menu];
+ m_servicesMenu = adoptNS([[picker menu] copy]);
if (!hasControlledImage)
[m_servicesMenu setShowsStateColumn:YES];