[UnifiedPDF] Adjust automatically resize logic.#26142
Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom Mar 19, 2024
Merged
[UnifiedPDF] Adjust automatically resize logic.#26142webkit-commit-queue merged 1 commit intoWebKit:mainfrom
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
Conversation
Collaborator
|
EWS run on current version of this PR (hash 339ad03) Details
|
smfr
approved these changes
Mar 19, 2024
aprotyas
approved these changes
Mar 19, 2024
https://bugs.webkit.org/show_bug.cgi?id=271264 rdar://123417338 Reviewed by Simon Fraser and Abrar Rahman Protyasha. This patch aims to make the "Automatically Resize," context menu item logic a little more intuitive. The way that this setting works now with this patch is as follows: 1. Defaults to off - PDFDocumentLayout has m_autoSizeState initialized to ShouldUpdateAutoSizeScale::Yes, but the plugin will set it to No after the first layout. This is so that the document gets fitted according to our existing logic on initial load. Any sort of window resizing at this point will not resize the document. 2. Turning it on rescales the PDF to the window width - This is done by adjusting the logic that we have when we handle the associated context menu event. Instead of setting the plugin's scale factor to its initial scale that was computed on load, we will set it to 1.0. 3. Any type of zooming turns it off - This is already handled already in UnifiedPDFPlugin::setPageScaleFactor. This includes HUD, pinch, and keyboard zooming. 4. The setting can also be toggleable - Expanded the associated context menu action handling to include this. When the setting is toggled off the scales will remain the same even during window resizing. Toggling it back on will reset the plugin's scale factor and adjust the document fitting scale so that the document once again fits the available width. * Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm: (WebKit::UnifiedPDFPlugin::updateLayout): (WebKit::UnifiedPDFPlugin::performContextMenuAction): Canonical link: https://commits.webkit.org/276371@main
339ad03 to
088d359
Compare
Collaborator
|
Committed 276371@main (088d359): https://commits.webkit.org/276371@main Reviewed commits have been landed. Closing PR #26142 and removing active labels. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🧪 mac-AS-debug-wk2
088d359
339ad03
🧪 wpe-wk2🧪 api-mac🧪 ios-wk2-wpt🛠 tv-sim🛠 watch