Long spins under rangeExpandedAroundPosition on Yahoo Mail
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Oct 2014 22:37:50 +0000 (22:37 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Oct 2014 22:37:50 +0000 (22:37 +0000)
commit7be7bc27cb4f165ba43d9240e685c4a5e79c9e1a
tree9e453b1e8c659da0ae8d73dd8115ac59507e3060
parentb05c9acb6ed9cf5456ae0097a5c5146c49a5f118
Long spins under rangeExpandedAroundPosition on Yahoo Mail
https://bugs.webkit.org/show_bug.cgi?id=138223
<rdar://problem/18819547>

Reviewed by Enrica Casucci.

* WebCore.exp.in:
Export some things.

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::rangeExpandedAroundPositionByCharacters):
Reimplement rangeExpandedAroundPosition to operate on characters instead of lines,
and to use Position. Moving VisiblePositions by line can be very expensive in some cases,
and for generating lookup/Data Detectors context, we don't care about that kind of precision.
This makes this function ~1000x faster when it hits on a row in the Yahoo Mail message list.

(WebKit::WebPage::performDictionaryLookupAtLocation):
(WebKit::scanForDataDetectedItems):
Adopt the new rangeExpandedAroundPositionByCharacters, expanding 250 characters
before and after, which roughly matches what we were usually getting going by line,
and is a reasonable amount of context for these operations.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175388 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm