Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e2ce65d3cafe318d4d1f9e2b1c3d9dfd02326865
https://github.com/WebKit/WebKit/commit/e2ce65d3cafe318d4d1f9e2b1c3d9dfd02326865
Author: Wenson Hsieh <[email protected]>
Date: 2025-11-14 (Fri, 14 Nov 2025)
Changed paths:
M LayoutTests/fast/text-extraction/debug-text-extraction-basic.html
A
LayoutTests/fast/text-extraction/debug-text-extraction-form-controls-expected.txt
A LayoutTests/fast/text-extraction/debug-text-extraction-form-controls.html
M LayoutTests/fast/text-extraction/debug-text-extraction-highlight-text.html
M
LayoutTests/fast/text-extraction/debug-text-extraction-ignore-autofilled-fields.html
M LayoutTests/fast/text-extraction/debug-text-extraction-interactions.html
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/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] Replace `includeNodeIdentifiers` with an enum type
representing the kinds of nodes to identify
https://bugs.webkit.org/show_bug.cgi?id=302537
rdar://164726774
Reviewed by Aditya Keerthi and Abrar Rahman Protyasha.
Currently, `_WKTextExtractionConfiguration` has a single boolean flag that
clients can set, to
either include or exclude node identifiers `uid=…` in the output. Some clients
require more nuanced
identification heuristics, such as uniquely identifying only form controls and
other editable
elements.
To facilitate this, we replace `includeNodeIdentifier` with
`nodeIdentifierInclusion`, which
encompasses 3 possible policy enums; they're currently:
- `None`, meaning "don't collect any node identifiers"
- `EditableOnly`, meaning "only collect node identifiers for editable
elements and text fields"
- `Interactive`, which is the current default behavior that collects node
identifiers for anything
which the user might be able to interact with
Test: fast/text-extraction/debug-text-extraction-form-controls.html
* LayoutTests/fast/text-extraction/debug-text-extraction-basic.html:
*
LayoutTests/fast/text-extraction/debug-text-extraction-form-controls-expected.txt:
Added.
* LayoutTests/fast/text-extraction/debug-text-extraction-form-controls.html:
Copied from
LayoutTests/fast/text-extraction/debug-text-extraction-lightweight.html.
Add a new layout test that exercises `nodeIdentifierInclusion : "editableOnly"`.
* LayoutTests/fast/text-extraction/debug-text-extraction-highlight-text.html:
*
LayoutTests/fast/text-extraction/debug-text-extraction-ignore-autofilled-fields.html:
* LayoutTests/fast/text-extraction/debug-text-extraction-interactions.html:
* LayoutTests/fast/text-extraction/debug-text-extraction-lightweight.html:
Rebaseline existing tests to use the new property.
* Source/WebCore/page/text-extraction/TextExtraction.cpp:
(WebCore::TextExtraction::shouldIncludeNodeIdentifier):
(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:
* Source/WebKit/UIProcess/API/Cocoa/_WKTextExtraction.mm:
(-[_WKTextExtractionConfiguration _initForOnlyVisibleText:]):
(-[_WKTextExtractionConfiguration setNodeIdentifierInclusion:]):
(-[_WKTextExtractionConfiguration setIncludeNodeIdentifiers:]): Deleted.
* 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/303057@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications