Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 36615bee766c36705ff40a0ee99145973d03e0ed
      
https://github.com/WebKit/WebKit/commit/36615bee766c36705ff40a0ee99145973d03e0ed
  Author: Wenson Hsieh <wenson_hs...@apple.com>
  Date:   2025-08-24 (Sun, 24 Aug 2025)

  Changed paths:
    M LayoutTests/fast/text-extraction/debug-text-extraction-basic-expected.txt
    M LayoutTests/resources/ui-helper.js
    M Source/WebCore/page/text-extraction/TextExtraction.cpp
    M Source/WebKit/UIProcess/API/Cocoa/_WKTextExtraction.swift

  Log Message:
  -----------
  [AutoFill Debugging] Streamline debug text output (prune redundant items and 
coalesce adjacent text runs)
https://bugs.webkit.org/show_bug.cgi?id=297830
rdar://159027795

Reviewed by Richard Robinson and Timothy Hatcher.

Further streamlime the output of 
`-_debugTextWithConfiguration:completionHandler:`:

-   Limit `rect` output to only leaf nodes in the item tree.

-   Allow adjacent text nodes to be coalesced, as long as they both only 
represent text nodes (as
    opposed to links, or other elements with relevant DOM attributes).

-   Drop the `container=` and `type=` prefixes in the output text (these are 
self-explanatory based
    on their respective values anyways).

-   For items with only a single text node as the child, append the single text 
node to the end of
    its parent in the debug text output, rather than leaving the text on a 
separate line.

-   Trim trailing or leading newlines in text content, adjusting selection 
ranges to match.

-   Prune any `containerType` items that lack any accessibility attributes, and 
that also don't
    contain any visible text (or only contain other `containerType`s that are 
pruned). Buttons are
    the only exception to this.

* LayoutTests/fast/text-extraction/debug-text-extraction-basic-expected.txt:

Rebaseline an existing test.

* Source/WebCore/page/text-extraction/TextExtraction.cpp:
(WebCore::TextExtraction::extractRecursive):
(WebCore::TextExtraction::pruneWhitespaceRecursive):
(WebCore::TextExtraction::pruneEmptyContainersRecursive):
(WebCore::TextExtraction::extractItem):
(WebCore::TextExtraction::pruneRedundantItemsRecursive): Deleted.
* Source/WebKit/UIProcess/API/Cocoa/_WKTextExtraction.swift:
(WKTextExtractionItem.textRepresentationRecursive(_:)):
(WKTextExtractionItem.textRepresentationParts):
(WKTextExtractionContainerItem.textRepresentationParts):
(WKTextExtractionContentEditableItem.textRepresentationParts):
(WKTextExtractionTextFormControlItem.textRepresentationParts):
(WKTextExtractionLinkItem.textRepresentationParts):
(WKTextExtractionTextItem.textRepresentationParts):
(WKTextExtractionScrollableItem.textRepresentationParts):
(WKTextExtractionSelectItem.textRepresentationParts):
(WKTextExtractionImageItem.textRepresentationParts):
(WKTextExtractionPopupMenu.textRepresentation):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to