DescriptioncanMergeLists() should make sure that the list items do not belong to the same list
This issue is reproduced only when list is the only visible element
present. In this case, visible positions after & before the list's
parent node would be NULL and hence are treated as equal. Because of
this, isVisiblyAdjacent() and therefore canMergeLists() would return
true. This results in invoking mergeIdenticalElements where things go
wrong as we try to delete the second list and add its content to first
list, while we actually have only one list and should be merging the
list items of the same list.
In canMergeLists(), calling
isVisiblyAdjacent(positionInParentAfterNode(*firstList), positionInParentBeforeNode(*secondList)
makes sense only if firstList & secondList are different lists. Hence,
before invoking isVisiblyAdjacent() we need to check if the lists are
identical in which case return false from canMergeLists().
BUG=362463
TEST=LayoutTests/editing/deleting/merge-list-items-in-same-list.html
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=172941
Patch Set 1 #
Total comments: 4
Patch Set 2 : Review comments incorporated #
Messages
Total messages: 9 (0 generated)
|