Moving word boundaries backwards fails when there is a text node starting with an...
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Apr 2013 19:50:50 +0000 (19:50 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Apr 2013 19:50:50 +0000 (19:50 +0000)
commitd66db3e977893d92fed30ccb8e8fa06868d1ed31
treef192d3716e1235f517154e143f7fa98ccfa0c284
parentb60ee803507dc4cea9a641904a561e7aaa7cce3f
Moving word boundaries backwards fails when there is a text node starting with an apostrophe
https://bugs.webkit.org/show_bug.cgi?id=115070

Reviewed by Alexey Proskuryakov.

Source/WebCore:

The bug was caused by previousBoundary erroneously assuming that we don't need any more context if a word
boundary is found at the beginning of a string. For example, when "I'll" is split into two text nodes,
"I" and "'ll", there is a word boundary between "'" and "ll" in "'ll" so we need to examine the whole "I'll".

Fixed the bug by obtaining more context when the character starts exactly at offset 1 in a text node to
work around this bug. In the long term, we probably need to provide Foundation of the entire context since in
languages like Hebrew and some of European languages, there could be many accents and combining characters
between split into multiple text nodes as one variant is seen in the newly added test case.

Test: editing/selection/previous-word-boundary-across-text-nodes.html

* editing/VisibleUnits.cpp:
(WebCore::previousBoundary):

LayoutTests:

Added a test case for moving bacwkards with a word granurality across multiple text nodes.
Some test cases still fail since this patch only implements a work around.

* editing/selection/previous-word-boundary-across-text-nodes-expected.txt: Added.
* editing/selection/previous-word-boundary-across-text-nodes.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@149058 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/selection/previous-word-boundary-across-text-nodes-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/previous-word-boundary-across-text-nodes.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/VisibleUnits.cpp