Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9d44026b876f9914a02c641007b9ebbe75999ce6
https://github.com/WebKit/WebKit/commit/9d44026b876f9914a02c641007b9ebbe75999ce6
Author: Wenson Hsieh <[email protected]>
Date: 2026-08-18 (Tue, 18 Aug 2026)
Changed paths:
M Source/WebKit/Shared/TextExtractionToStringConversion.cpp
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm
Log Message:
-----------
[Text Extraction] Limit `replacementStrings` substitutions to word boundaries
(to reduce false positives when redacting PII)
https://bugs.webkit.org/show_bug.cgi?id=322061
rdar://185254024
Reviewed by Abrar Rahman Protyasha.
Adjust the string replacement heuristics for text extractions, such that it
only redacts text if it
spans word boundaries, in order to limit false positives (which may actually
cause us to indirectly
and unintentionally leak information, which the agent would not have otherwise
observed).
Test: TextExtractionTests.ReplacementStringsWordBoundaries
* Source/WebKit/Shared/TextExtractionToStringConversion.cpp:
(WebKit::isWordCharacter):
(WebKit::anchorsToWordBoundary):
(WebKit::matchIsWordBounded):
(WebKit::applyReplacements):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm:
(TestWebKitAPI::TEST(TextExtractionTests, ReplacementStringsWordBoundaries)):
Canonical link: https://commits.webkit.org/319423@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications