Masayuki Nakano cc43626912 Bug 1810902 - Make HTMLEditUtils::GetRangeSelectingAllContentInAllListItems return correct range r=m_kato
`AutoDeleteRangesHandler::Run` shrink the range not to delete list item if
the list is not empty.  However, due to the bug of
`HTMLEditUtils::GetRangeSelectingAllContentInAllListItems`, it may get empty
range (in the testcase, first the only `<li>` element is the list has empty
text node as first child, and the range is collapsed into it).  Therefore,
`AutoDeleteRangesHandler::Run` gives up to delete the list items, but does not
update the `Selection`.  Therefore, from the caller point of view, `Selection`
is unexpectedly not collapsed even after deleting `Selection`.

Therefore, this patch also makes `AutoDeleteRangeHandler::Run` collapse
`Selection` if it gives up to delete something.

Differential Revision: https://phabricator.services.mozilla.com/D169044
2023-02-15 23:00:12 +00:00
..