...
rdar://89437334
Created attachment 453698 [details] Patch
Created attachment 453699 [details] Patch
Comment on attachment 453699 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=453699&action=review > Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:787 > + if ([_customContentView conformsToProtocol:@protocol(_UITextSearching)]) > + [_findInteraction setSearchableObject:(id<_UITextSearching>)_customContentView.get()]; > + else > + [_findInteraction setSearchableObject:_contentView.get()]; Nit - perhaps you could factor this out into a helper function, and use it both here and in `-_setFindInteractionEnabled:` below. > Source/WebKit/UIProcess/ios/WKPDFView.mm:101 > + auto pos = adoptNS([[WKPDFFoundTextPosition alloc] init]); Nit - we usually don't abbreviate local variable names. Maybe rename to `position`?
Created attachment 454986 [details] Patch for landing
(In reply to Wenson Hsieh from comment #4) > Comment on attachment 453699 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=453699&action=review Thanks for the review! > > Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:787 > > + if ([_customContentView conformsToProtocol:@protocol(_UITextSearching)]) > > + [_findInteraction setSearchableObject:(id<_UITextSearching>)_customContentView.get()]; > > + else > > + [_findInteraction setSearchableObject:_contentView.get()]; > > Nit - perhaps you could factor this out into a helper function, and use it > both here and in `-_setFindInteractionEnabled:` below. Done. > > Source/WebKit/UIProcess/ios/WKPDFView.mm:101 > > + auto pos = adoptNS([[WKPDFFoundTextPosition alloc] init]); > > Nit - we usually don't abbreviate local variable names. Maybe rename to > `position`? Done.
Committed r291445 (248568@main): <https://commits.webkit.org/248568@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 454986 [details].
Comment on attachment 454986 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=454986&action=review > Source/WebKit/UIProcess/ios/WKPDFView.mm:718 > + NSInteger offset = from.index - to.index; > + > + if (offset < 0) > + return NSOrderedAscending; > + > + if (offset > 0) > + return NSOrderedDescending; > + > + return NSOrderedSame; Probably not a real risk here, but typically doing subtraction to determine ordering can introduce overflow, so itβs better not to use that pattern.
Reopening to attach new patch.
Created attachment 455273 [details] Address post-landing feedback
Committed r291591 (248685@main): <https://commits.webkit.org/248685@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 455273 [details].