[webkit-changes] [WebKit/WebKit] 3b5f85: [UnifiedPDF] Add ability to start focusing next/pr...
Sammy Gill
noreply at github.com
Thu Feb 8 19:10:46 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3b5f85622e9c64d8e6e1c748eeff3b9bdfafa82f
https://github.com/WebKit/WebKit/commit/3b5f85622e9c64d8e6e1c748eeff3b9bdfafa82f
Author: Sammy Gill <sammy.gill at apple.com>
Date: 2024-02-08 (Thu, 08 Feb 2024)
Changed paths:
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm
Log Message:
-----------
[UnifiedPDF] Add ability to start focusing next/previous text annotations.
https://bugs.webkit.org/show_bug.cgi?id=268349
rdar://problem/121890426
Reviewed by Simon Fraser.
When a text annotation is currently active, the user should be able
to focus the next/previous one using the appropriate keyboard shortcut.
Effectivley, what we will need to do is iterate over the annotations in
the appropriate direction until we find a text annotation that can be
interacted with (this could be the same annotation if there are no
others to be found).
We start by checking the current page the active annotation is on. If
there are any remaining annotations on the page, then we will iterate
over them to see if the next one is on the page. If we could not find an
appropriate text annotation on the page then we repeat the process by
going to the next page in the appropriate direction. This process is
repeated until we find an appropriate text annotation to return. There
should always be at least one text annotation to return: the original
one.
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::findFirstTextAnnotationStartingAtIndex):
(WebKit::UnifiedPDFPlugin::nextTextAnnotation const):
(WebKit::UnifiedPDFPlugin::focusNextAnnotation):
(WebKit::UnifiedPDFPlugin::focusPreviousAnnotation):
Canonical link: https://commits.webkit.org/274337@main
More information about the webkit-changes
mailing list