[LayoutNG] Fork UpdateVisualRect loop for when selected

As Finch indicated pre-paint is slower in NG, this patch
splits the loop to compute VisualRect for fragments for when
there's a selection for the LayoutObject and for when not.

By splitting the loop, not only reducing the work within the
loop, we could try to apply simplication of VisualRect for
inline fragments as legacy does.

For the branch when there is a selection, yoichio@ will look
into it after the end of January.

Bug: 636993
Change-Id: Ia06ad95e0cd7e0e9f2d663d26ee2fc7702c05908
Reviewed-on: https://chromium-review.googlesource.com/c/1405948
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622078}
1 file changed