[LayoutNG] Mark previous line dirty when LayoutText was removed

This patch changes LayoutText to use |DirtyLinesFromChangedChild()|
when it is removed. This change makes LayoutText behavior the same
as LayoutInline in this regard.

Before the change, LayoutText marked only the line it belongs to.
When it is removed, however, it should mark the line its previous
sibling belongs to. E.g.,
  line 1<br>line 2
and removing "line 2" should invalidate the 1st line because its
break token needs to be updated. Another example:
  <span>foo part</span>OfLongWord
and removing "OfLongWord" may make "part" to fit to the previous
line.

There are tests that remove <span>s, but there were no tests that
remove text nodes unfortunately. Given it turned out that we have
separate code for each type on removal, this patch adds some
tests, but will add more in following patches.

Bug: 918812
Change-Id: I6ada5c9d9dbec51d03ed3f1fc9db8d70c031bdd8
Reviewed-on: https://chromium-review.googlesource.com/c/1405127
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622072}
3 files changed