[webkit-changes] [WebKit/WebKit] 3cecef: [UnifiedPDF] Form annotations get stuck permanentl...
Abrar Rahman Protyasha
noreply at github.com
Thu May 30 12:19:23 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3cecef4425a0713947e7774132427d2d9bb7193d
https://github.com/WebKit/WebKit/commit/3cecef4425a0713947e7774132427d2d9bb7193d
Author: Abrar Rahman Protyasha <a_protyasha at apple.com>
Date: 2024-05-30 (Thu, 30 May 2024)
Changed paths:
M Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h
M Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm
M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginAnnotation.mm
M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm
Log Message:
-----------
[UnifiedPDF] Form annotations get stuck permanently on the document when navigating while an annotation is focused
https://bugs.webkit.org/show_bug.cgi?id=274867
rdar://128912717
Reviewed by Simon Fraser.
When an annotation is focused and we navigate away, nothing ensures that
the active annotation is cleaned up appropriately and the queued async
task to call Node::remove() on the annotation element gets dropped.
This means that on a reload, the Node corresponding to the previous
active annotation is still hanging around, and now with no way to
actually detach it.
This patch fixes said issue by ensuring we do eager cleanup for any
active annotation when the PDF plugin is torn down.Note that we now
provide additional context to setActiveAnnotation() because when the
navigation has started, and the plugin is being torn down,
PDFPluginBase::isFullFramePlugin() returns false, expectedly so. We do
not want to consult this during cleanup.
* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:
(-[WKPDFLayerControllerDelegate pdfLayerController:didChangeActiveAnnotation:]):
(WebKit::PDFPlugin::setActiveAnnotation):
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
(WebKit::PDFPluginAnnotation::handleEvent):
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::teardown):
(WebKit::UnifiedPDFPlugin::handleMouseEvent):
(WebKit::UnifiedPDFPlugin::focusNextAnnotation):
(WebKit::UnifiedPDFPlugin::focusPreviousAnnotation):
(WebKit::UnifiedPDFPlugin::setActiveAnnotation):
Canonical link: https://commits.webkit.org/279537@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