mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 05:48:26 +00:00

`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