Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7e0e4d371e4f2dc823362d9abbd9d514564016f1
      
https://github.com/WebKit/WebKit/commit/7e0e4d371e4f2dc823362d9abbd9d514564016f1
  Author: Wenson Hsieh <[email protected]>
  Date:   2026-05-04 (Mon, 04 May 2026)

  Changed paths:
    M 
LayoutTests/fast/text-extraction/debug-text-extraction-markdown-expected.txt
    M LayoutTests/fast/text-extraction/debug-text-extraction-markdown.html
    M 
LayoutTests/fast/text-extraction/debug-text-extraction-shorten-urls-expected.txt
    M Source/WebCore/page/text-extraction/TextExtraction.cpp
    M Source/WebCore/page/text-extraction/TextExtractionTypes.h
    M Source/WebKit/Shared/TextExtractionToStringConversion.cpp
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in

  Log Message:
  -----------
  [AutoFill Debugging] Add an extra newline between large containers with 
visible borders or background colors when extracting markdown
https://bugs.webkit.org/show_bug.cgi?id=313978
rdar://175370880

Reviewed by Abrar Rahman Protyasha.

Add a heuristic to detect large (with an arbitrary threshold of at least 150 by 
90) block-level
containers with visible borders, backgrounds, or drop-shadows, and 
automatically insert extra
newlines before or after visible text in these containers.

* LayoutTests/fast/text-extraction/debug-text-extraction-markdown-expected.txt:
* LayoutTests/fast/text-extraction/debug-text-extraction-markdown.html:
* 
LayoutTests/fast/text-extraction/debug-text-extraction-shorten-urls-expected.txt:
* Source/WebCore/page/text-extraction/TextExtraction.cpp:
(WebCore::TextExtraction::TraversalContext::currentVisualBlockContainerNumber 
const):
(WebCore::TextExtraction::isVisuallyDistinctContainer):

Add the detection heuristic here.

(WebCore::TextExtraction::extractRecursive):
* Source/WebCore/page/text-extraction/TextExtractionTypes.h:
* Source/WebKit/Shared/TextExtractionToStringConversion.cpp:
(WebKit::TextExtractionAggregator::takeResults):

Add 2 newlines as a separator between text that spans across large visible 
container boundaries.

(WebKit::TextExtractionAggregator::addResult):
(WebKit::addPartsForItem):
(WebKit::addTextRepresentationRecursive):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

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



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

Reply via email to