HTML Editing: Insertion point jumps when using link detection
https://bugs.webkit.org/show_bug.cgi?id=82198

Source/WebCore:

Patch by Yi Shen <max.hong.shen@gmail.com> on 2013-04-29
Reviewed by Ryosuke Niwa.

Add links should be done only when typing a word separator (e.g. space or dot) which
breaks the text into two parts - the link and the rest of the text. Reflected in
code, we should only add link when the caret position is at the right end location of
TextChecking result. Otherwise, the text on the right of a word separator could be
highlighted as a link and the insertion point jumps unexpectedly.

Tests: update editing/inserting/typing-space-to-trigger-smart-link.html

* editing/Editor.cpp:
(WebCore::Editor::markAndReplaceFor):

LayoutTests:

Patch by Yi Shen <max.hong.shen@gmail.com> on 2013-04-29
Reviewed by Ryosuke Niwa.

Update typing-space-to-trigger-smart-link.html to verify link detection behavior
when typing a link before existing text.

* editing/inserting/typing-space-to-trigger-smart-link-expected.txt:
* editing/inserting/typing-space-to-trigger-smart-link.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149322 268f45cc-cd09-0410-ab3c-d52691b4dbfc