Skip to content

Conversation

@aslushnikov
Copy link
Contributor

@aslushnikov aslushnikov commented Jul 2, 2020

Review URL: aslushnikov/WebKit@42f86e9

Currently, if web page has an open context menu, then it won't close.
This prevents browser from quitting.

In stock safari, this behavior can also be observed in a way that
context menu will stay opened even if related page got closed.

While investigating this behavior on Mac, a crucial observation was
that [NSMenu popUpContextMenu] is spawning a nested event loop,
keeping reference to WebContextMenuProxyMac instance, which in turn
keeps references on associated NSView with WKWebView.

To exit the loop, we need to explicitly cancel context menu. For this,
this patch adds a method hide on WebContextMenuProxy that uses
port-specific code to cancel context menu.

Windows part of this patch is somewhat speculative: I didn't check
it, but given the same symptomps, I applied the same solution.

Fixes #2700

@aslushnikov aslushnikov force-pushed the fix-context-menus-on-webkit branch from cdeb53d to fb66948 Compare July 2, 2020 01:11
@aslushnikov aslushnikov merged commit 14162f8 into microsoft:master Jul 2, 2020
@aslushnikov aslushnikov deleted the fix-context-menus-on-webkit branch July 2, 2020 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] browser.close does not resolve after right-click on Webkit headful

2 participants