[webkit-changes] [WebKit/WebKit] aee3f6: [UnifiedPDF] Switching from two page continuous to...

Sammy Gill noreply at github.com
Fri Sep 27 11:47:04 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: aee3f60e1e0a10a4caf0c7ce2a32e210b0422f5c
      https://github.com/WebKit/WebKit/commit/aee3f60e1e0a10a4caf0c7ce2a32e210b0422f5c
  Author: Sammy Gill <sammy.gill at apple.com>
  Date:   2024-09-27 (Fri, 27 Sep 2024)

  Changed paths:
    A LayoutTests/pdf/two-pages-continuous-to-discrete-expected.html
    A LayoutTests/pdf/two-pages-continuous-to-discrete.html
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDocumentLayout.mm

  Log Message:
  -----------
  [UnifiedPDF] Switching from two page continuous to discrete two up causes jump to last page of PDF.
https://bugs.webkit.org/show_bug.cgi?id=280383
rdar://136653611

Reviewed by Abrar Rahman Protyasha.

When switching the display mode the presentation control attempts to get the current point
of the page(s) in document space by converting the top left point of the plugin to
document coordinates. We then attempt to map that point to the corresponding page point
and index. However, during this mapping we fail to take into consideration the margins
imposed by the document so we end up computing a point and index of the last page. We
can fix this by simply inflating the bounds of each page by the document margins.

* LayoutTests/pdf/two-pages-continuous-to-discrete-expected.html: Added.
* LayoutTests/pdf/two-pages-continuous-to-discrete.html: Added.
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDocumentLayout.mm:
(WebKit::PDFDocumentLayout::pageIndexAndPagePointForDocumentYOffset const):

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