[webkit-changes] [WebKit/WebKit] 8cf954: [UnifiedPDF] Snapshots don't get the correct scrol...
Sammy Gill
noreply at github.com
Wed May 1 20:41:01 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 8cf954d346bc1cc6b549e8a60cb95bda9c7d15f1
https://github.com/WebKit/WebKit/commit/8cf954d346bc1cc6b549e8a60cb95bda9c7d15f1
Author: Sammy Gill <sammy.gill at apple.com>
Date: 2024-05-01 (Wed, 01 May 2024)
Changed paths:
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm
Log Message:
-----------
[UnifiedPDF] Snapshots don't get the correct scroll offset
https://bugs.webkit.org/show_bug.cgi?id=273565
rdar://126945237
Reviewed by Simon Fraser and Abrar Rahman Protyasha.
In order to make the snapshots appear correct in the tab preview we
need to make a few related changes.
The first change we need to make is to take into consideration the page
scale. This is the main factor that is driving the incorrect scroll
offset in the snapshots. However, we must also recenter the document
by adding in the padding that is used to center it. Finally, we must
also make sure that we paint the grey background that is shown on the
page itself.
One other related change we need to make is to factor out the page scale
in the clip rect we pass to paintPDFContent. This is because we will
pass in the rect to pageCoverageForRect, which seems to expect that the
passed in rect is in document space, in order to determine which pages
need to get painted. With the page scale factored into the rect we
can get into a state where we scroll to a new page in the document but
not have that page appear in the snapshot.
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::paint):
Canonical link: https://commits.webkit.org/278244@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list