Summary: | Trying to lookup when WebView is in a popover causes process to hang. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Megan Gardner <megan_gardner> | ||||||
Component: | New Bugs | Assignee: | Megan Gardner <megan_gardner> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | hi, thorton, webkit-bug-importer, wenson_hsieh | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Megan Gardner
2020-07-24 17:50:53 PDT
Created attachment 405210 [details]
Patch
Comment on attachment 405210 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=405210&action=review > Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm:355 > + if (!(((webView.get().window._childWindowOrderingPriority == NSWindowChildOrderingPriorityPopover) || [NSUserDefaults.standardUserDefaults boolForKey:@"LULookupDisabled"]) && items[i].action() == ContextMenuItemTagLookUpInDictionary)) Can we move the `((webView.get().window._childWindowOrderingPriority == NSWindowChildOrderingPriorityPopover) || [NSUserDefaults.standardUserDefaults boolForKey:@"LULookupDisabled"])` to a variable outside this loop so that it doesn't have to be recalculated in each iteration? ``` bool isPopover = m_webView->get().window._childWindowOrderingPriority == NSWindowChildOrderingPriorityPopover; bool isLookupDisabled = [NSUserDefaults.standardUserDefaults boolForKey:@"LULookupDisabled"]; for (auto& item : items) { if (item.action() != ContextMenuItemTagLookUpInDictionary || (!isLookupDisabled && !isPopover)) filteredItems.uncheckedAppend(item); } ``` Comment on attachment 405210 [details]
Patch
It looks like you’ll need to add NSWindowChildOrderingPriorityPopover to NSWindowSPI.h as well.
Created attachment 405276 [details]
Patch
Comment on attachment 405276 [details]
Patch
r=me
Committed r264928: <https://trac.webkit.org/changeset/264928> All reviewed patches have been landed. Closing bug and clearing flags on attachment 405276 [details]. |