[LayoutNG] Fix LocalVisualRect to include LocalSelectionRect

From the discussion with wangxianzhu@, NG differs from legacy
in that LocalVisualRect does not include LocalSelectionRect,
and it is causing additional computation in PaintInvalidator.

This wasn't the intention, and the fix in PaintInvalidator
lead to additional work in pre-paint phase. This patch fixes
LocalVisualRect to include LocalSelectionRect when it is
selected.

LayoutObject::IsSelected turned out to be slow for this
purpose. Its improvement is in a separate CL:1460576.

Also this change figured out that LocalSelectionRect is in
different coordinate than legacy. Filed issue 930034 for it
to work on later as there might be impacts to other code.

Bug: 636993, 930034
Change-Id: If02d17dbc88e3d7195050d87b8a3b425f4158375
Reviewed-on: https://chromium-review.googlesource.com/c/1457812
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630233}
2 files changed