Bug 304348
| Summary: | clean up WebFoundTextRangeController | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | ccarley2 |
| Component: | WebKit Misc. | Assignee: | Claudio Saavedra <csaavedra> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | dpino, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
ccarley2
Some of the code in WebFoundTextRangeController is difficult to read and could use some modernization
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/166726139>
ccarley2
Pull request: https://github.com/WebKit/WebKit/pull/55577
EWS
Committed 304713@main (8b622d23c65b): <https://commits.webkit.org/304713@main>
Reviewed commits have been landed. Closing PR #55577 and removing active labels.
Diego Pino
After this patch, 'GTK-Linux-64-bit-Release-Debian-Stable-Build' s is failing with the following error:
https://build.webkit.org/#/builders/46/builds/58814
```
In file included from DerivedSources/WebKit/unified-sources/UnifiedSource-54928a2b-30.cpp:8:
../../../Source/WebKit/WebProcess/WebPage/WebFoundTextRangeController.cpp: In member function ‘void WebKit::WebFoundTextRangeController::findTextRangesForStringMatches(const WTF::String&, WTF::OptionSet<WebKit::FindOptions>, uint32_t, WTF::CompletionHandler<void(WTF::HashMap<WTF::ObjectIdentifierGeneric<WebCore::FrameIdentifierType, WTF::ObjectIdentifierMainThreadAccessTraits<long unsigned int>, long unsigned int>, WTF::Vector<WebKit::WebFoundTextRange> >&&)>&&)’:
../../../Source/WebKit/WebProcess/WebPage/WebFoundTextRangeController.cpp:136:66: error: ‘zip’ is not a member of ‘std::views’
136 | for (const auto& [foundTextRange, simpleRange] : std::views::zip(webFoundTextRanges, validSimpleRanges)) {
| ^~~
ninja: build stopped: subcommand failed.
```
The issue is that this bot uses GCC12 which uses a libstdc++ version which doesn't implement `std::views:zip`. This is the only use of this function in the entire codebase. A potential fix could be to implement std::view:zip in StdLibExtras.h. Another possibility is to rewrite this code so it doesn't use `std::views::zip`.
Diego Pino
Re-opening for pull request https://github.com/WebKit/WebKit/pull/55840
Claudio Saavedra
Pull request: https://github.com/WebKit/WebKit/pull/56839
EWS
Committed 305851@main (bea9084bbebd): <https://commits.webkit.org/305851@main>
Reviewed commits have been landed. Closing PR #56839 and removing active labels.