[webkit-changes] [WebKit/WebKit] 099c34: [UnifiedPDF] Selections are broken in rotated pages

Abrar Rahman Protyasha noreply at github.com
Mon Feb 26 16:27:36 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 099c347a91fc9f6cc329b487dde7d154968dd188
      https://github.com/WebKit/WebKit/commit/099c347a91fc9f6cc329b487dde7d154968dd188
  Author: Abrar Rahman Protyasha <a_protyasha at apple.com>
  Date:   2024-02-26 (Mon, 26 Feb 2024)

  Changed paths:
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDocumentLayout.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDocumentLayout.mm
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm

  Log Message:
  -----------
  [UnifiedPDF] Selections are broken in rotated pages
https://bugs.webkit.org/show_bug.cgi?id=270073
rdar://123621642

Reviewed by Simon Fraser.

The `-[PDFPage drawWithBox:toContext:]` method accounts for page
rotation, and we took this behavior to assume that the PDFSelection
drawing API would behave similarly. Unfortunately, this is wrong, and
said method expects callers to apply the transform corresponding to
the appropriate boundary box type.

This patch amends this situation by manually applying the transform in
question to the context's CTM while we have a selection painted into
that context.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDocumentLayout.h:

Expose `toPageTransform` and `geometryForPage` publicly.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDocumentLayout.mm:
(WebKit::PDFDocumentLayout::geometryForPage const):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::paintPDFContent):

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