REGRESSION (r171376): Sometimes we detect less than the whole phone number
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Jul 2014 00:24:09 +0000 (00:24 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Jul 2014 00:24:09 +0000 (00:24 +0000)
commitee1d1c3c62d0f18509551642b6bdc94bf28bc845
tree4930a00d68e1b9a2dbde27bba6cccf51a0ad9f80
parentb15705826a4d72f84a23aaee5e23fddf83c23b45
REGRESSION (r171376): Sometimes we detect less than the whole phone number
https://bugs.webkit.org/show_bug.cgi?id=135220
<rdar://problem/17783423>

Reviewed by Brady Eidson.

* editing/Editor.cpp:
(WebCore::Editor::scanSelectionForTelephoneNumbers):
Use the visible selection's start and end instead of base and extent, because they'll
always be in the right order in the case of a directional selection (base can be *after* extent
if you select from right to left). This fixes the code that expands the selection.

Pass the *entire* expanded selection to DataDetectors, instead of using TextIterator.
This way, we will find each number only once, and will never get part of a phone number once
and then the whole phone number later.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@171499 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/editing/Editor.cpp