[webkit-reviews] review canceled: [Bug 235830] Add SPI to retrieve the rect of a found text range : [Attachment 450264] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 28 12:09:58 PST 2022

Darin Adler <darin at apple.com> has canceled Aditya Keerthi
<akeerthi at apple.com>'s request for review:
Bug 235830: Add SPI to retrieve the rect of a found text range

Attachment 450264: Patch


--- Comment #4 from Darin Adler <darin at apple.com> ---
Comment on attachment 450264
  --> https://bugs.webkit.org/attachment.cgi?id=450264

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

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:10145
> +    WKFoundTextRange *foundTextRange = (WKFoundTextRange *)range;

Local variable doesn’t add much value and involves repeating WKFoundTextRange
twice, which we could mitigate with auto. Also, could use dynamic_objc_cast or
checked_objc_cast if you like; they are for this.

> Source/WebKit/WebProcess/WebPage/WebFoundTextRangeController.cpp:184
> +    auto rect =

local variable doesn’t help here

We may not need the WebCore prefix on the call unionRect because of
argument-dependent lookup, since the type is in the WebCore namespace.

> Tools/TestWebKitAPI/Tests/WebKitCocoa/FindInPage.mm:410
> +    auto searchOptions = adoptNS([[TestTextSearchOptions alloc] init]);

Would just name this local "options".

> Tools/TestWebKitAPI/Tests/WebKitCocoa/FindInPage.mm:411
> +    [webView performTextSearchWithQueryString:query
usingOptions:(_UITextSearchOptions *)searchOptions.get()

Why is a typecast to _UITextSearchOptions needed here? That does not seem

> Tools/TestWebKitAPI/Tests/WebKitCocoa/FindInPage.mm:500
> +    RetainPtr<NSArray<UITextRange *>> ranges =
adoptNS(getTextRangesForQueryString(webView.get(), @"Sapien"));

I suggest auto here.

More information about the webkit-reviews mailing list