WebContent crash in WebKit::WebPage::expandedRangeFromHandle
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Oct 2014 21:51:08 +0000 (21:51 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Oct 2014 21:51:08 +0000 (21:51 +0000)
commit0b9627b3c731ac0816e3066b3d9ca721ec359516
tree44e3fe2b48cd2d539ad1bd756f7f922a3525ae59
parenta6a0214aa7bbb1cb52d34057fdc0708da2318d58
WebContent crash in WebKit::WebPage::expandedRangeFromHandle
https://bugs.webkit.org/show_bug.cgi?id=138023

Reviewed by Enrica Casucci.

The crashes are caused by rangeForBlockAtPoint returning a null Range.
Exit early or continue if a range is null in various places.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::expandedRangeFromHandle): Continue looking for another point if the range returned by
rangeForBlockAtPoint is null.
(WebKit::WebPage::contractedRangeFromHandle): Ditto.
(WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): Removed the FIXME now that Enrica has
verified that this early exit added in r173788 is correct.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175143 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm