Make FrameSelection::Contains return false for null VisibleSelection in DOM tree

This is a workaround for crbug.com/845849.

In some buggy cases, we get ComputeVisibleSelectionInFlatTree() returning
non-null, but ComputeVisibleSelectionInDOMTree() returning null. This
makes FrameSelection::Contains() return true erroneously.

As we don't have a fix to the inconsistency, this patch adds a
workaround that, we call ComputeVisibleSelectionInDOMTree() first to
set the cached VisibleSelections to null also for flat tree, so that
the following computation does not work on a non-null VS in flat tree
erroneously.

Bug: 845849
Change-Id: I7255d8224b8b6e29d479dd635e2c4ee99b366fc1
Reviewed-on: https://chromium-review.googlesource.com/1072924
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561775}
1 file changed