Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 8217dfbe7292cd1f230266716fe34decbdbfd0ab https://github.com/WebKit/WebKit/commit/8217dfbe7292cd1f230266716fe34decbdbfd0ab Author: Wenson Hsieh <wenson_hs...@apple.com> Date: 2025-08-19 (Tue, 19 Aug 2025)
Changed paths: M LayoutTests/fast/text-extraction/debug-text-extraction-interactions-expected.txt M LayoutTests/fast/text-extraction/debug-text-extraction-interactions.html M LayoutTests/resources/ui-helper.js M Source/WebCore/page/text-extraction/TextExtraction.cpp M Source/WebCore/page/text-extraction/TextExtraction.h M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h M Source/WebKit/UIProcess/API/Cocoa/_WKTextExtraction.h M Source/WebKit/UIProcess/API/Cocoa/_WKTextExtraction.mm M Source/WebKit/UIProcess/API/Cocoa/_WKTextExtractionInternal.h M Source/WebKit/UIProcess/WebPageProxy.cpp M Source/WebKit/UIProcess/WebPageProxy.h M Source/WebKit/WebProcess/WebPage/WebPage.cpp M Source/WebKit/WebProcess/WebPage/WebPage.h M Source/WebKit/WebProcess/WebPage/WebPage.messages.in M Tools/TestWebKitAPI/Tests/WebKitCocoa/TextExtractionTests.mm M Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.mm Log Message: ----------- [Autofill Debugging] Part 8: Surface debug descriptions back to the client when performing interactions https://bugs.webkit.org/show_bug.cgi?id=297607 rdar://158700025 Reviewed by Abrar Rahman Protyasha and Timothy Hatcher. Plumb a string description back to the client, in `-_performInteraction:completionHandler:`'s callback, in the form of a new object (`_WKTextExtractionInteractionResult`) that represents the result of performing a single `_WKTextExtractionInteraction`. For now, this only contains an `NSError` with a debug description, but in the future, we'll expand it to contain more information (including additional context even in the case where the interaction succeeds, as well as element selectors and other metadata). * LayoutTests/fast/text-extraction/debug-text-extraction-interactions-expected.txt: * LayoutTests/fast/text-extraction/debug-text-extraction-interactions.html: Rebaseline an existing test to check the resulting error message. * LayoutTests/resources/ui-helper.js: (window.UIHelper.async performTextExtractionInteraction): Make this `UIHelper` method return the reason for failure (or empty string, of the interaction was successful). (window.UIHelper): * Source/WebCore/page/text-extraction/TextExtraction.cpp: (WebCore::TextExtraction::invalidNodeIdentifierDescription): (WebCore::TextExtraction::searchTextNotFoundDescription): (WebCore::TextExtraction::dispatchSimulatedClick): (WebCore::TextExtraction::selectText): (WebCore::TextExtraction::simulateKeyPress): (WebCore::TextExtraction::focusAndInsertText): (WebCore::TextExtraction::handleInteraction): Populate error messages in various codepaths when handling interactions. * Source/WebCore/page/text-extraction/TextExtraction.h: * Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _performInteraction:completionHandler:]): Plumb a new `String` representing a succint debug description of the interaction result, alongside the `bool` indicating success. * Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h: * Source/WebKit/UIProcess/API/Cocoa/_WKTextExtraction.h: * Source/WebKit/UIProcess/API/Cocoa/_WKTextExtraction.mm: (-[_WKTextExtractionInteractionResult initWithErrorDescription:]): (-[_WKTextExtractionInteractionResult error]): * Source/WebKit/UIProcess/API/Cocoa/_WKTextExtractionInternal.h: * Source/WebKit/UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleTextExtractionInteraction): * Source/WebKit/UIProcess/WebPageProxy.h: * Source/WebKit/WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::handleTextExtractionInteraction): This should never be hit in the case where there's no running web proccess, so we can instead just `ASSERT_NOT_REACHED()` here. * Source/WebKit/WebProcess/WebPage/WebPage.h: * Source/WebKit/WebProcess/WebPage/WebPage.messages.in: * Tools/TestWebKitAPI/Tests/WebKitCocoa/TextExtractionTests.mm: (TestWebKitAPI::TEST(TextExtractionTests, SelectPopupMenu)): * Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.mm: (WTR::UIScriptControllerCocoa::performTextExtractionInteraction): Canonical link: https://commits.webkit.org/298936@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes