Invalid caret at the end of line in overtype mode

When using overtype mode in content editable content we usually replace the
caret by a block cursor that covers the next character to be replaced.
However at the end of lines we should show the 'normal' blinking caret. In
those cases we were incorrectly adding a selection block till the end of the
container of the editable content.

That's because we were using a complicated (and wrong) way to detect the end
of lines based on modifying the internal selection used by the overtype
mode. We now use the proper tools to detect the end of line detection which
also supports bidi text.

BUG=385003

Review URL: https://codereview.chromium.org/437843002

git-svn-id: svn://svn.chromium.org/blink/trunk@180002 bbb929c8-8fbe-4397-9dbb-9b2b20218538