Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 1113729a76ef64168a293440405f039a6b5977bf
https://github.com/WebKit/WebKit/commit/1113729a76ef64168a293440405f039a6b5977bf
Author: Abrar Rahman Protyasha <[email protected]>
Date: 2024-11-21 (Thu, 21 Nov 2024)
Changed paths:
M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
M Tools/TestWebKitAPI/SourcesCocoa.txt
M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
A Tools/TestWebKitAPI/Tests/WebKitCocoa/MouseSupportUIDelegate.h
A Tools/TestWebKitAPI/Tests/WebKitCocoa/MouseSupportUIDelegate.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/UnifiedPDFTests.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtension.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/iOSMouseSupport.mm
Log Message:
-----------
[UnifiedPDF] [iPadOS] Web process crash under WebKit::populateCaretContext()
when trackpad hover over PDF document
https://bugs.webkit.org/show_bug.cgi?id=283477
rdar://140191140
Reviewed by Tim Horton, Wenson Hsieh, and Richard Robinson.
Currently, whenever the trackpad hovers over a PDF document, the web
process crashes trying to retrieve position information because of an
unchecked std::optional<Cursor> access. The RenderEmbeddedObject
corresponding to the PDF plugin thinks the plugin should handle cursor
updates, hence returning a null cursor value to populateCaretContext().
This patch avoids this very frequent crasher by ensuring that we check
the optional cursor value in the interaction information argument is
non-empty before reasoning about it. We may revisit this codepath when
we implement cursor update support for Unified PDF on iOS, but at least
this patch avoids the crash.
API test: UnifiedPDF.MouseDidMoveOverPDF
We introduce test coverage by exercising a mouse move over a PDF
document, which would cause the WP to crash without the proposed
changes.
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::populateCaretContext):
* Tools/TestWebKitAPI/SourcesCocoa.txt:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/MouseSupportUIDelegate.h: Added.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/MouseSupportUIDelegate.mm: Added.
(-[MouseSupportUIDelegate
_webView:mouseDidMoveOverElement:withFlags:userInfo:]):
(-[MouseSupportUIDelegate setMouseDidMoveOverElementHandler:]):
Separate MouseSupportUIDelegate into its own header, which makes this
sharable across multiple test suites.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm:
Unified sources build fix.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/UnifiedPDFTests.mm:
(TestWebKitAPI::UNIFIED_PDF_TEST):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtension.mm:
Unified sources build fix.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/iOSMouseSupport.mm:
(-[MouseSupportUIDelegate
_webView:mouseDidMoveOverElement:withFlags:userInfo:]): Deleted.
(-[MouseSupportUIDelegate setMouseDidMoveOverElementHandler:]): Deleted.
Canonical link: https://commits.webkit.org/286927@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes