[LayoutNG] Implement up and down caret movements

This patch implements the last missing editing feature of
LayoutNG phase 1: up and down selection modifications, which
allow us to modify an existing selection using Shift+Up/Down.

This patch adds the NG implementation by:
- Replicating related logic from RootInlineBox to
  NGPhysicalLineBoxFragment
- Sharing common logic in Previous/NextLinePosition with NG,
  using AbstractLineBox to abstract the similarities between
  legacy and NG line boxes.

Bug: 877263
Change-Id: Ic97eaf6cdb02b7afb18603ab1b30000e5951d7c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1618643
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661603}
3 files changed