[webkit-changes] [WebKit/WebKit] 3babd3: PDF context menu should be shown asynchronously
Abrar Rahman Protyasha
noreply at github.com
Thu Feb 8 15:38:39 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3babd344c6c08255c3ce2db7459b57d99209ae43
https://github.com/WebKit/WebKit/commit/3babd344c6c08255c3ce2db7459b57d99209ae43
Author: Abrar Rahman Protyasha <a_protyasha at apple.com>
Date: 2024-02-08 (Thu, 08 Feb 2024)
Changed paths:
M Source/WebKit/UIProcess/WebPageProxy.messages.in
M Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm
Log Message:
-----------
PDF context menu should be shown asynchronously
https://bugs.webkit.org/show_bug.cgi?id=268973
rdar://122525514
Reviewed by Simon Fraser.
WebPageProxy::ShowPDFContextMenu is a sync IPC call that blocks the WP.
Among other things, this manifests itself in repaint requests queued
right before the IPC call to be fulfilled only _after_ a context menu
action has been taken.
There is no reason for this synchronicity, so this patch async-ifies
WebPageProxy::ShowPDFContextMenu, which we call with sendWithAsyncReply
to learn about the context menu item selected by the user.
We also make some drive-by fixes such as avoiding blindly casting
integral values from the UIP into ContextMenuItemTag and moving some
function definitions around so we can annotate function groups with
`#pragma mark`.
* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::handleContextMenuEvent):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::handleMouseEvent):
(WebKit::UnifiedPDFPlugin::handleMouseEnterEvent):
(WebKit::UnifiedPDFPlugin::handleMouseLeaveEvent):
(WebKit::UnifiedPDFPlugin::handleContextMenuEvent):
(WebKit::UnifiedPDFPlugin::contextMenuItemTagFromDisplayMode const):
(WebKit::UnifiedPDFPlugin::displayModeFromContextMenuItemTag const):
(WebKit::UnifiedPDFPlugin::performContextMenuAction):
Canonical link: https://commits.webkit.org/274320@main
More information about the webkit-changes
mailing list