Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bd875a909950772189f7265bcb1e909bf3c3d29c
      
https://github.com/WebKit/WebKit/commit/bd875a909950772189f7265bcb1e909bf3c3d29c
  Author: Wenson Hsieh <[email protected]>
  Date:   2026-08-05 (Wed, 05 Aug 2026)

  Changed paths:
    M Source/WebCore/page/text-extraction/TextExtraction.cpp
    M Source/WebCore/page/text-extraction/TextExtraction.h
    M Source/WebKit/UIProcess/API/Cocoa/WKWebView+TextExtraction.mm
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h
    M Source/WebKit/UIProcess/API/Cocoa/_WKTextExtraction.h
    M Source/WebKit/UIProcess/API/Cocoa/_WKTextExtraction.mm
    M Source/WebKit/UIProcess/WebFrameProxy.cpp
    M Source/WebKit/UIProcess/WebFrameProxy.h
    M Source/WebKit/WebProcess/WebPage/WebFrame.cpp
    M Source/WebKit/WebProcess/WebPage/WebFrame.h
    M Source/WebKit/WebProcess/WebPage/WebFrame.messages.in
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm

  Log Message:
  -----------
  [Text Extraction] Add a way to map node identifier strings to `WKFrameInfo`
https://bugs.webkit.org/show_bug.cgi?id=321096
rdar://184135720

Reviewed by Richard Robinson.

Add a way for text extractions to grab a `WKFrameInfo`, corresponding to a node 
`uid` string. If the
`uid` corresponds to an `iframe`, this finds the frame info corresponding to 
the content frame of
the `iframe` element; otherwise, it falls back to returning the content frame 
containing the given
target node.

This allows agents to (for instance) evaluate script in the context of the 
content frame underneath
an `iframe`, without requiring the agent to first extract content within the 
target subframe.

Test: TextExtractionTests.RequestFrameInfoForNodeIdentifier

* Source/WebCore/page/text-extraction/TextExtraction.cpp:
(WebCore::TextExtraction::contentFrameIdentifierForNode):
* Source/WebCore/page/text-extraction/TextExtraction.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebView+TextExtraction.mm:
(-[WKWebView _requestFrameInfoForNodeIdentifier:completionHandler:]):
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKTextExtraction.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKTextExtraction.mm:
(-[_WKTextExtractionResult 
requestFrameInfoForNodeIdentifier:completionHandler:]):
* Source/WebKit/UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::requestContentFrameIdentifierForNode):
* Source/WebKit/UIProcess/WebFrameProxy.h:
* Source/WebKit/WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::requestContentFrameIdentifierForNode):
* Source/WebKit/WebProcess/WebPage/WebFrame.h:
* Source/WebKit/WebProcess/WebPage/WebFrame.messages.in:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm:
(-[_WKTextExtractionResult frameInfoForNodeIdentifier:]):
(TestWebKitAPI::(TextExtractionTests, RequestFrameInfoForNodeIdentifier)):

Add an API test to exercise this new method.

Canonical link: https://commits.webkit.org/318652@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to