[webkit-changes] [WebKit/WebKit] 91624f: REGRESSION(288932 at main): [Unified PDF] Anchor link...

Abrar Rahman Protyasha noreply at github.com
Tue Feb 11 10:32:41 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 91624f355e6b624501619ab40d4ce5973d2aa32b
      https://github.com/WebKit/WebKit/commit/91624f355e6b624501619ab40d4ce5973d2aa32b
  Author: Abrar Rahman Protyasha <a_protyasha at apple.com>
  Date:   2025-02-11 (Tue, 11 Feb 2025)

  Changed paths:
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/UnifiedPDFTests.mm

  Log Message:
  -----------
  REGRESSION(288932 at main): [Unified PDF] Anchor links not working within document
https://bugs.webkit.org/show_bug.cgi?id=287443
rdar://143387526

Reviewed by Aditya Keerthi and Wenson Hsieh.

After 288392 at main, the scrollable area for the plugin expectedly cannot
be scrolled, i.e. has (0, 0) minimum and maximum positions. Instead,
when the plugin is inflated to fit the size of the PDF content, we
should just drive all our scrolling needs through the main frame. This
patch addresses the bug in the title by:

1. Only accounting for the `ScrolledContents` coordinate space when
   the plugin is _not_ sized the fit the PDF contents.
2. Driving scroll through the main frame rather than through the
   scrollable area representing the plugin when it is sized to fit the
   PDF contents.

API test: UnifiedPDF.RespectsPageFragment

This API test does not perform anchor link following, but revealing a
page fragment goes through the same codepath, and is sufficient to
exercise the bug.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
(WebKit::UnifiedPDFPlugin::convertDown const):
(WebKit::UnifiedPDFPlugin::convertUp const):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::revealPage):
(WebKit::UnifiedPDFPlugin::scrollToPointInContentsSpace):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/UnifiedPDFTests.mm:
(TestWebKitAPI::UNIFIED_PDF_TEST):

Canonical link: https://commits.webkit.org/290220@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