Bug 226704 - [Cocoa] Find-in-page should match text inside image overlays
Summary: [Cocoa] Find-in-page should match text inside image overlays
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-06-06 18:20 PDT by Wenson Hsieh
Modified: 2021-06-07 06:46 PDT (History)
8 users (show)

See Also:


Attachments
Patch (12.27 KB, patch)
2021-06-06 20:58 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2021-06-06 18:20:48 PDT
.
Comment 1 Wenson Hsieh 2021-06-06 20:58:08 PDT
Created attachment 430709 [details]
Patch
Comment 2 Tim Horton 2021-06-07 00:15:32 PDT
Comment on attachment 430709 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=430709&action=review

> Source/WebKit/WebProcess/WebPage/FindController.cpp:379
> +        textIndicatorOptions.add({ TextIndicatorOption::PaintAllContent, TextIndicatorOption::PaintBackgrounds });

I wonder (separately) if we can infer some of these options in TI and remove some complexity from the clients. Like, give it more reasonable/intelligent defaults and delete some of the TextIndicatorOption values. Would need a careful pass over all the clients, though.
Comment 3 Wenson Hsieh 2021-06-07 06:37:22 PDT
Comment on attachment 430709 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=430709&action=review

Thanks for the review!

>> Source/WebKit/WebProcess/WebPage/FindController.cpp:379
>> +        textIndicatorOptions.add({ TextIndicatorOption::PaintAllContent, TextIndicatorOption::PaintBackgrounds });
> 
> I wonder (separately) if we can infer some of these options in TI and remove some complexity from the clients. Like, give it more reasonable/intelligent defaults and delete some of the TextIndicatorOption values. Would need a careful pass over all the clients, though.

That’s a good point. I think in the case of look up and find in image overlays, this would help to alleviate some duplicate code, but (as you mentioned) it would require some careful vetting to make this change for all textindicators.

A halfway point might be something like a helper function in TextIndicator that adjusts a given set of TI options, given a range.
Comment 4 EWS 2021-06-07 06:45:54 PDT
Committed r278560 (238558@main): <https://commits.webkit.org/238558@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 430709 [details].
Comment 5 Radar WebKit Bug Importer 2021-06-07 06:46:15 PDT
<rdar://problem/78945509>