Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 836aff4c889665e9fdfc77e0c7aed2b348bf1184
      
https://github.com/WebKit/WebKit/commit/836aff4c889665e9fdfc77e0c7aed2b348bf1184
  Author: Wenson Hsieh <wenson_hs...@apple.com>
  Date:   2025-08-17 (Sun, 17 Aug 2025)

  Changed paths:
    A 
LayoutTests/fast/text-extraction/debug-text-extraction-interactions-expected.txt
    A 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/WebCore/page/text-extraction/TextExtractionTypes.h
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    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/_WKTextExtraction.swift
    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/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl
    M Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
    M Tools/TestRunnerShared/UIScriptContext/UIScriptControllerShared.cpp
    M Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.h
    M Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.mm

  Log Message:
  -----------
  [AutoFill Debugging] Part 5: Add basic support for performing interactions 
based on debug text output
https://bugs.webkit.org/show_bug.cgi?id=297506
rdar://158496489

Reviewed by Richard Robinson.

Add support for performing interactions based on the output of `-_debugText`. 
Clients may now create
a `_WKTextExtractionInteraction` object that describes a single interaction 
with the page (clicking,
selecting text, editing) and send it through `-[WKWebView 
performInteraction:completionHandler:]`.

See below for more details.

* 
LayoutTests/fast/text-extraction/debug-text-extraction-interactions-expected.txt:
 Added.
* LayoutTests/fast/text-extraction/debug-text-extraction-interactions.html: 
Added.

Add a layout test to exercise the new interaction actions.

* LayoutTests/resources/ui-helper.js:
(window.UIHelper.nodeIdentifierFromDebugText):

Add a new `UIHelper` method to extract a `nodeIdentifier` from raw debug text 
returned from
`UIHelper.requestDebugText`, of the form `uid=…`.

(window.UIHelper.async performTextExtractionInteraction):

Add a new `UIHelper` method to perform an interaction, taking an action name 
and an options
dictionary.

(window.UIHelper):
* Source/WebCore/page/text-extraction/TextExtraction.cpp:
(WebCore::TextExtraction::searchForText):
(WebCore::TextExtraction::dispatchSimulatedClick):
(WebCore::TextExtraction::selectOptionByValue):
(WebCore::TextExtraction::selectText):
(WebCore::TextExtraction::focusAndInsertText):
(WebCore::TextExtraction::handleInteraction):

Add support for each of the action types. Note that these are all currently 
synchronous, but may (in
the future) require asynchronous handling; we pass completion handlers through 
these helper methods
to help make that change easier in the near future.

* Source/WebCore/page/text-extraction/TextExtraction.h:
* Source/WebCore/page/text-extraction/TextExtractionTypes.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(toNodeIdentifier):
(-[WKWebView _performInteraction:completionHandler:]):
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKTextExtraction.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKTextExtraction.mm:
(-[_WKTextExtractionInteraction initWithAction:]):
(-[_WKTextExtractionInteraction nodeIdentifier]):
(-[_WKTextExtractionInteraction setNodeIdentifier:]):
(-[_WKTextExtractionInteraction text]):
(-[_WKTextExtractionInteraction setText:]):
(-[_WKTextExtractionInteraction setLocation:]):
* Source/WebKit/UIProcess/API/Cocoa/_WKTextExtraction.swift:
(WKTextExtractionSelectItem.supportsMultiple): Deleted.

Drive-by fix: remove `backingSupportsMultiple`. This is unnecessary, since this 
readonly getter is
not `is`-prefixed.

* 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):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:
* Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* Tools/TestRunnerShared/UIScriptContext/UIScriptController.h:
(WTR::UIScriptController::performTextExtractionInteraction):
* Tools/TestRunnerShared/UIScriptContext/UIScriptControllerShared.cpp:
(WTR::toTextExtractionInteractionOptions):
* Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.h:
* Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.mm:
(WTR::UIScriptControllerCocoa::performTextExtractionInteraction):

Canonical link: https://commits.webkit.org/298819@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

Reply via email to