UI process sometimes crashes under -[WKContentView _lookupForWebView:]
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 4 Feb 2018 03:35:18 +0000 (03:35 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 4 Feb 2018 03:35:18 +0000 (03:35 +0000)
commit6909278fa48f1f1194d5c7a62d5e3837e2e693a0
tree76db5bc460e18ea5d208b183e3e0ee9364c23081
parent6687648fe4c2c32db38a5d96fdd1991a019742a5
UI process sometimes crashes under -[WKContentView _lookupForWebView:]
https://bugs.webkit.org/show_bug.cgi?id=182460
<rdar://problem/33260602>

Reviewed by Wenson Hsieh.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _lookupForWebView:]):
If you have a range selection, but no rects for the selection, retrieving
the 0th element of selectionRects will crash the UI process. To fix, in
this case, use the rect for the starting caret instead.

It doesn't seem like the presentationRect is actually currently used for
the Lookup service, so the only impact is that we shouldn't crash anymore.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm