DescriptionFix for an issue while breaking out of an empty list item in case of nested lists
In case of nested lists, if we break out of the inner list in such a way that
it is split into two inner lists, then break out of the first inner list
(which lands us in outer list) and then try to break out of the outer list,
it fails. Currently, in such scenario we cannot break out of the outer list.
This is caused by appendedSublist() called from enclosingEmptyListItem().
In appendedSublist() we check if the next sibling of the list item(of outer list)
from which we are trying to break out is a list(second inner list), in this case
we will not consider this list item as an empty one. Thus, we cannot break out.
Extending the check in appendedSublist() so as to additionally check if the
list which is the next sibling of list item from which we are trying to break out
is not a descendant of the outer list(to which list item belongs), fixes the issue.
i.e. Change the following check in appendedSubList()
if (isListElement(n))
return toHTMLElement(n);
to
if (isListElement(n) && !n->isDescendantOf(enclosingList(listItem)))
return toHTMLElement(n);
But further analysis seemed to show that the check
if (embeddedSublist(listChildNode) || appendedSublist(listChildNode))
return 0;
which we do in enclosingEmptyListItem() is not needed. Because in the cases
where the list item from which we are trying to break out has an embeddedSublist
or appendedSublist we would still want to break out of the list. Getting rid of
this check and hence these functions(which are not used anywhere else),
fixes the issue.
BUG=328037
TEST=LayoutTests/editing/inserting/break-out-of-nested-lists.html
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=164049
Patch Set 1 #Patch Set 2 : Resubmitting as base file was missing #
Messages
Total messages: 6 (0 generated)
|