-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Text Extraction] Ignore transparent (or nearly-transparent) elements…
… when extracting text https://bugs.webkit.org/show_bug.cgi?id=270598 rdar://124102506 Reviewed by Megan Gardner and Abrar Rahman Protyasha. When extracting visible text, ignore subtrees where the renderer is transparent (or nearly transparent). To do this, we adjust `extractItemData` to return an enum (`SkipExtraction`) indicating whether we should skip text extraction for just the current node, or for the entire subtree; we then use this to skip subtrees where there is either no renderer (i.e. `display: none;`) or the opacity is near 0. * LayoutTests/fast/text-extraction/basic-text-extraction.html: * Source/WebCore/page/text-extraction/TextExtraction.cpp: (WebCore::TextExtraction::extractItemData): (WebCore::TextExtraction::extractRecursive): (WebCore::TextExtraction::extractRenderedText): Canonical link: https://commits.webkit.org/275769@main
- Loading branch information
Showing
2 changed files
with
33 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters