[editing] Avoid DCHECK failure with InsertOrderedList
In InsertListCommand::UnlistifyParagraph, if `list_element` has no <li>, then `list_child_node` will be a non-<li> child. In that case, `previous_list_child` and `next_list_child` may end up being the same `list_child_node` if it has multiple block children. This would make some DCHECKs fail. However, the behavior seems fine, so this patch changes the DCHECKs to ensure that `previous_list_child` and `next_list_child` are obtained from nodes different than the block where the caret is. Bug: 1138054 TEST=InsertListCommandTest.UnlistifyParagraphCrashOnNonLi Change-Id: I18631b1c90d59539433373a2139aab36115e59ec Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2497161 Commit-Queue: Oriol Brufau <obrufau@igalia.com> Reviewed-by:Yoshifumi Inoue <yosin@chromium.org> Cr-Commit-Position: refs/heads/master@{#821691}
Showing
Please register or sign in to comment