Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 256ca142887492fec4008131e298b20ff29189de
      
https://github.com/WebKit/WebKit/commit/256ca142887492fec4008131e298b20ff29189de
  Author: Wenson Hsieh <[email protected]>
  Date:   2026-01-02 (Fri, 02 Jan 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    A 
LayoutTests/http/tests/text-extraction/debug-text-extraction-subframes-expected.txt
    A 
LayoutTests/http/tests/text-extraction/debug-text-extraction-subframes.html
    A LayoutTests/http/tests/text-extraction/resources/subframe1.html
    A LayoutTests/http/tests/text-extraction/resources/subframe2.html
    M LayoutTests/platform/ios/TestExpectations
    M LayoutTests/platform/mac-wk2/TestExpectations
    M Source/WebCore/page/text-extraction/TextExtraction.cpp
    M Source/WebCore/page/text-extraction/TextExtraction.h
    M Source/WebCore/page/text-extraction/TextExtractionTypes.h
    M Source/WebKit/Shared/TextExtractionToStringConversion.cpp
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/UIProcess/API/Cocoa/_WKTextExtraction.swift
    M Source/WebKit/UIProcess/API/Cocoa/_WKTextExtractionInternal.h
    M Source/WebKit/UIProcess/Cocoa/TextExtraction/WKTextExtractionUtilities.mm

  Log Message:
  -----------
  [AutoFill Debugging] Automatically extract items from same-origin subframes
https://bugs.webkit.org/show_bug.cgi?id=304789
rdar://167349874

Reviewed by Abrar Rahman Protyasha.

Work towards support for subframes in text extraction output by automatically 
recursing into only
same-origin subframes. See below for more details.

Test: http/tests/text-extraction/debug-text-extraction-subframes.html

* LayoutTests/TestExpectations:
* 
LayoutTests/http/tests/text-extraction/debug-text-extraction-subframes-expected.txt:
 Added.
* LayoutTests/http/tests/text-extraction/debug-text-extraction-subframes.html: 
Added.

Add a new layout test to verify that we recurse into nested same-origin 
subframes, but avoid
extracting items from nested cross-origin subframes.

* LayoutTests/http/tests/text-extraction/resources/subframe1.html: Added.
* LayoutTests/http/tests/text-extraction/resources/subframe2.html: Added.
* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/mac-wk2/TestExpectations:
* Source/WebCore/page/text-extraction/TextExtraction.cpp:
(WebCore::TextExtraction::extractItemData):
(WebCore::TextExtraction::areSameOrigin):
(WebCore::TextExtraction::extractRecursive):

When we hit a same-origin `iframe` element with a local content frame, use 
`extractItem` below to
recurse into the frame, and add all its child items as children of the `iframe` 
item.

(WebCore::TextExtraction::makeRootItem):
(WebCore::TextExtraction::extractItem):

Split this out into a separate method that takes a `LocalFrame` instead of 
`Page`.

* Source/WebCore/page/text-extraction/TextExtraction.h:
* Source/WebCore/page/text-extraction/TextExtractionTypes.h:

Add a new data type, `IFrameData`, that represents an extracted `iframe` 
element; we currently only
include the security origin as a string in the output, and also include a 
`FrameIdentifier` (which
we'll use in a subsequent patch).

* Source/WebKit/Shared/TextExtractionToStringConversion.cpp:
(WebKit::addPartsForItem):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/API/Cocoa/_WKTextExtraction.swift:
* Source/WebKit/UIProcess/API/Cocoa/_WKTextExtractionInternal.h:
* Source/WebKit/UIProcess/Cocoa/TextExtraction/WKTextExtractionUtilities.mm:
(WebKit::createItemWithChildren):

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



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

Reply via email to