Issue metadata
Sign in to add a comment
|
Inconsistent results between FrameSelection::ComputeVisibleSelectionInDOMTree and FrameSelection::ComputeVisibleSelectionInFlatTree |
||||||||||||||||||||||||
Issue descriptionThere are some scenarios where FrameSelection::ComputeVisibleSelectionInDOMTree() returns a non-null selection, but FrameSelection::ComputeVisibleSelectionInFlatTree() returns null selection. This is unexpected, and we should understand why.
,
Jun 1 2017
Culprit is:
PositionInFlatTree ToPositionInFlatTree(const Position& pos) {
...
if (pos.IsBeforeAnchor() || pos.IsAfterAnchor()) {
if (anchor->CanParticipateInFlatTree() &&
!FlatTreeTraversal::Parent(*anchor)) {
// For Before/AfterAnchor, if |anchor| doesn't have parent in the flat
// tree, there is no valid corresponding PositionInFlatTree.
// Since this function is a primitive function, we do not adjust |pos|
// to somewhere else in flat tree.
// Reached by unit test
// FrameSelectionTest.SelectInvalidPositionInFlatTreeDoesntCrash.
return PositionInFlatTree();
}
}
// TODO(yosin): Once we have a test case for SLOT or active insertion point,
// this function should handle it.
return PositionInFlatTree(anchor, pos.AnchorType());
}
,
Jun 5 2017
|
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by xiaoche...@chromium.org
, Jun 1 2017