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

This is a workaround for

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

Bug: 845849
Change-Id: I7255d8224b8b6e29d479dd635e2c4ee99b366fc1
Reviewed-by: Yoshifumi Inoue <>
Commit-Queue: Xiaocheng Hu <>
Cr-Commit-Position: refs/heads/master@{#561775}
1 file changed