[webkit-changes] [WebKit/WebKit] b98c84: [UnifiedPDF] Context menu item "Previous Page" app...

Abrar Rahman Protyasha noreply at github.com
Mon May 6 12:45:37 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b98c84d7c4a00d2a516edec6ee696695724087f2
      https://github.com/WebKit/WebKit/commit/b98c84d7c4a00d2a516edec6ee696695724087f2
  Author: Abrar Rahman Protyasha <a_protyasha at apple.com>
  Date:   2024-05-06 (Mon, 06 May 2024)

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

  Log Message:
  -----------
  [UnifiedPDF] Context menu item "Previous Page" appears on the first page in Two Page view layouts
https://bugs.webkit.org/show_bug.cgi?id=273745
rdar://127442932

Reviewed by Simon Fraser.

This patch makes the logic to mark the "Previous/Next Page" context menu
items as active more versatile. It does so by:

1. Passing the page index where the context menu event was fired to
   navigationContextMenuItems, instead of trying to infer the view's page
   index through indexForCurrentPageInView.

2. Taking into account the fact that for 2up display modes, we want the
   first pair of pages to have an inactive "Previous Page" item.

3. Computing an effective last page index, below which the "Next Page"
   context menu item is active for all pages.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::createContextMenu const):
(WebKit::UnifiedPDFPlugin::navigationContextMenuItemsForPageAtIndex const):
(WebKit::UnifiedPDFPlugin::navigationContextMenuItems const): Deleted.

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