Relax text validation in FrameSelection::selectWordAroundPosition

This CL fixes text select failure in the cases that |startOfWord|
 returns VisiblePosition before space like " bar".
In that case, selectWordAroundPosition failed.

This CL covers the case to check text contains characters rather than
 separators.

The root cause is that though |previousBoundary| in |startOfWord| finds
correct position of " |bar", |mostBackWordPosition| of canonicalization
 moves to "| bar". We can fix it changing function signature from
 VisiblePosition to Position. However it changes editing code widely.
I think that is a kind of refactoring, but that is massive change. I will
 do it after branch-cut.

BUG=658765
TEST=webkit_unit_test --gtest_filter=FrameSelectionTest.SelectWordAroundPosition2, by hand with https://jsfiddle.net/fpt03tv5/1/

Review-Url: https://codereview.chromium.org/2723913002
Cr-Commit-Position: refs/heads/master@{#453860}
2 files changed