[webkit-changes] [WebKit/WebKit] 6e0308: [UnifiedPDF] Annotations are not repainted in subf...
Sammy Gill
noreply at github.com
Sat Oct 19 00:50:50 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6e0308aeeedbca1c9fd5a47e216e5372bc0d6392
https://github.com/WebKit/WebKit/commit/6e0308aeeedbca1c9fd5a47e216e5372bc0d6392
Author: Sammy Gill <sammy.gill at apple.com>
Date: 2024-10-19 (Sat, 19 Oct 2024)
Changed paths:
A LayoutTests/pdf/annotations/text-annotation-filled.pdf
A LayoutTests/pdf/annotations/text-annotation.pdf
A LayoutTests/pdf/pdf-in-iframe-with-text-annotation-expected.html
A LayoutTests/pdf/pdf-in-iframe-with-text-annotation.html
M Source/WebCore/plugins/PluginViewBase.h
M Source/WebCore/testing/Internals.cpp
M Source/WebCore/testing/Internals.h
M Source/WebCore/testing/Internals.idl
M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.h
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.mm
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDiscretePresentationController.mm
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFScrollingPresentationController.mm
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm
M Source/WebKit/WebProcess/Plugins/PluginView.cpp
M Source/WebKit/WebProcess/Plugins/PluginView.h
Log Message:
-----------
[UnifiedPDF] Annotations are not repainted in subframe PDFs when zoomed in on the main frame.
https://bugs.webkit.org/show_bug.cgi?id=281782
rdar://137999791
Reviewed by Abrar Rahman Protyasha.
If you have a PDF that is contained within a subframe and zoom in on the main frame, then
we may fail to repaint the annotation. This is due to a bug in our partial repaint code
since we can recover from this state when we repaint all tiles with a subsequent zoom.
It turns out this is because the PDFAsyncRenderer was using the passed-in pageScaleFactor
from the plugin to compute the "to tile transform," that would be used to compute the
clip rect. The page scale factor for the plugin does not change since it is in an iframe,
but the tile sizes and tiling scale factor do change. This causes us to compute an
incorrect clip rect and repaint an incorrect portion of the tile. The fix is to just
use the tilingScaleFactor and stop using the pageScaleFactor from the plugin since that
is incorrect to use.
I also added some new functionality to modify the value of text annotations in testing
code using a page and annotation index. This is much better than using the clunky
pdfAnnotationRectsForTesting API that just returns a list of FloatRects for the
annotations.
* LayoutTests/pdf/annotations/text-annotation-filled.pdf: Added.
* LayoutTests/pdf/annotations/text-annotation.pdf: Added.
* LayoutTests/pdf/pdf-in-iframe-with-text-annotation-expected.html: Added.
* LayoutTests/pdf/pdf-in-iframe-with-text-annotation.html: Added.
* Source/WebCore/plugins/PluginViewBase.h:
(WebCore::PluginViewBase::setPDFTextAnnotationValueForTesting):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::setPDFTextAnnotationValueForTesting):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h:
(WebKit::PDFPluginBase::setTextAnnotationValueForTesting):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.mm:
(WebKit::AsyncPDFRenderer::pdfContentChangedInRect):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDiscretePresentationController.mm:
(WebKit::PDFDiscretePresentationController::setNeedsRepaintInDocumentRect):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFScrollingPresentationController.mm:
(WebKit::PDFScrollingPresentationController::setNeedsRepaintInDocumentRect):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::setTextAnnotationValueForTesting):
* Source/WebKit/WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::setPDFTextAnnotationValueForTesting):
* Source/WebKit/WebProcess/Plugins/PluginView.h:
Canonical link: https://commits.webkit.org/285463@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