Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6aadf8ea12703357e6be30ab8055507c19f21d82
      
https://github.com/WebKit/WebKit/commit/6aadf8ea12703357e6be30ab8055507c19f21d82
  Author: Wenson Hsieh <[email protected]>
  Date:   2025-11-01 (Sat, 01 Nov 2025)

  Changed paths:
    M LayoutTests/fast/text-extraction/debug-text-extraction-basic.html
    M LayoutTests/fast/text-extraction/debug-text-extraction-highlight-text.html
    M LayoutTests/fast/text-extraction/debug-text-extraction-interactions.html
    M 
LayoutTests/fast/text-extraction/debug-text-extraction-lightweight-expected.txt
    M LayoutTests/fast/text-extraction/debug-text-extraction-lightweight.html
    M Source/WebCore/page/text-extraction/TextExtraction.cpp
    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/_WKTextExtraction.h
    M Source/WebKit/UIProcess/API/Cocoa/_WKTextExtraction.mm
    M Source/WebKit/UIProcess/API/Cocoa/_WKTextExtractionInternal.h
    M 
Source/WebKit/UIProcess/Cocoa/TextExtraction/WKWebView+TextExtraction.swift
    M Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl
    M Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
    M Tools/TestRunnerShared/UIScriptContext/UIScriptControllerShared.cpp
    M Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.mm

  Log Message:
  -----------
  [AutoFill Debugging] Add more options to avoid extracting node identifiers, 
event listeners and DOM attributes
https://bugs.webkit.org/show_bug.cgi?id=301810
rdar://163864325

Reviewed by Abrar Rahman Protyasha.

Add support for three new properties, which can be used to shrink the size of 
debug text extraction
output by:

1. Not including node identifiers (`uid`) for interactive elements.
2. Not including event listener data (`events=[click,key]`).
3. Not including accessibility attributes (`aria-label=…`).

* LayoutTests/fast/text-extraction/debug-text-extraction-basic.html:
* LayoutTests/fast/text-extraction/debug-text-extraction-highlight-text.html:
* LayoutTests/fast/text-extraction/debug-text-extraction-interactions.html:
* 
LayoutTests/fast/text-extraction/debug-text-extraction-lightweight-expected.txt:

Adjust existing layout tests to include node identifiers if needed.

* LayoutTests/fast/text-extraction/debug-text-extraction-lightweight.html:

Adjust and rebaseline this layout test for lightweight text extraction, so that 
it excludes node
identifiers, event listeners and attributes.

* Source/WebCore/page/text-extraction/TextExtraction.cpp:
(WebCore::TextExtraction::extractRecursive):
(WebCore::TextExtraction::extractItem):
* Source/WebCore/page/text-extraction/TextExtractionTypes.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _requestTextExtractionInternal:completion:]):
* Source/WebKit/UIProcess/API/Cocoa/_WKTextExtraction.h:

Add plumbing for a couple new properties, `includeAccessibilityAttributes` and
`includeEventListeners`. Additionally, rename `canIncludeIdentifiers` to 
`includeNodeIdentifiers`
and move it from an internal property to the private header.

* Source/WebKit/UIProcess/API/Cocoa/_WKTextExtraction.mm:
(-[_WKTextExtractionConfiguration init]):
* Source/WebKit/UIProcess/API/Cocoa/_WKTextExtractionInternal.h:
* Source/WebKit/UIProcess/Cocoa/TextExtraction/WKWebView+TextExtraction.swift:
* Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* Tools/TestRunnerShared/UIScriptContext/UIScriptController.h:
* Tools/TestRunnerShared/UIScriptContext/UIScriptControllerShared.cpp:
(WTR::toTextExtractionTestOptions):
* Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.mm:
(WTR::createTextExtractionConfiguration):

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



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

Reply via email to