Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 32f5d4077ba30bd70684e6cce7145417402cc4ce
      
https://github.com/WebKit/WebKit/commit/32f5d4077ba30bd70684e6cce7145417402cc4ce
  Author: Timothy Hatcher <[email protected]>
  Date:   2026-06-03 (Wed, 03 Jun 2026)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm

  Log Message:
  -----------
  [AutoFill Debugging] Add WKWebView method to apply debug text extraction 
filter rules to an arbitrary string.
https://webkit.org/b/316133
rdar://problem/178560869

Reviewed by Wenson Hsieh.

Add `_filterExtractedString:options:completionHandler:` on `WKWebView`, which 
applies text extraction
filters to an arbitrary string without requiring a debug text extraction. 
Filter rules are lazily
fetched and installed on first use, and a shared private helper avoids 
duplicating this rule-loading
logic with the existing extraction path.

Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm

* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _ensureTextExtractionFilterRulesWithCompletionHandler:]): Added.
(-[WKWebView _extractDebugTextWithConfiguration:completionHandler:]): Updated to
use `_ensureTextExtractionFilterRulesWithCompletionHandler:`.
(-[WKWebView _filterExtractedString:options:completionHandler:]): Added.
(-[WKWebView 
_filterExtractedStringWithoutUpdatingFilterRules:options:completionHandler:]): 
Added.
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm:
(TestWebKitAPI::(TextExtractionTests, FilterExtractedStringPassthrough)): Added.
(TestWebKitAPI::(TextExtractionTests, FilterExtractedStringRulesApplied)): 
Added.
(TestWebKitAPI::(TextExtractionTests, FilterExtractedStringRulesTruncates)): 
Added.
(TestWebKitAPI::(TextExtractionTests, FilterExtractedStringEmptyInput)): Added.

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



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

Reply via email to