[webkit-changes] [WebKit/WebKit] 12f1eb: [UnifiedPDF] Zooming via HUD buttons, keyboard, an...
Tim Horton
noreply at github.com
Mon Jan 22 21:02:06 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 12f1eb0ad174c46f8acd8586704f9934f17612cb
https://github.com/WebKit/WebKit/commit/12f1eb0ad174c46f8acd8586704f9934f17612cb
Author: Tim Horton <thorton at apple.com>
Date: 2024-01-22 (Mon, 22 Jan 2024)
Changed paths:
M Source/WebCore/platform/LocalizedStrings.cpp
M Source/WebCore/platform/LocalizedStrings.h
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm
M Source/WebKit/WebProcess/Plugins/PluginView.cpp
M Source/WebKit/WebProcess/Plugins/PluginView.h
M Tools/MiniBrowser/mac/WK2BrowserWindowController.m
Log Message:
-----------
[UnifiedPDF] Zooming via HUD buttons, keyboard, and context menu
https://bugs.webkit.org/show_bug.cgi?id=267899
rdar://119632377
Reviewed by Simon Fraser.
* Source/WebCore/platform/LocalizedStrings.cpp:
(WebCore::contextMenuItemPDFTwoPagesContinuous):
(WebCore::contextMenuItemPDFAutoSize):
* Source/WebCore/platform/LocalizedStrings.h:
Expose zoomIn, zoomOut, and actualSize strings.
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::contextMenuItemTagFromDisplayMode const):
(WebKit::UnifiedPDFPlugin::displayModeFromContextMenuItemTag const):
Move these in from the header.
(WebKit::UnifiedPDFPlugin::createContextMenu const):
(WebKit::UnifiedPDFPlugin::performContextMenuAction):
Add context menu items for the three new actions.
(WebKit::UnifiedPDFPlugin::zoomIn):
(WebKit::UnifiedPDFPlugin::zoomOut):
Implement these via setPageScaleFactor(). These back the HUD actions.
(WebKit::UnifiedPDFPlugin::pageScaleFactor const): Deleted.
Don't implement this getter in terms of PluginView's cached plugin scale;
just use ours! This way we don't get out of sync when we call
setPageScaleFactor internally.
* Source/WebKit/WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::setPageScaleFactor):
(WebKit::PluginView::pageScaleFactor const):
* Source/WebKit/WebProcess/Plugins/PluginView.h:
Stop storing the plugin scale in PluginView, since it's duplicative of state
in each of the children. Just defer to them.
* Tools/MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController resetZoom:]):
Reset page scale in addition to page zoom in MiniBrowser, to match Safari's behavior.
Canonical link: https://commits.webkit.org/273342@main
More information about the webkit-changes
mailing list