Chromium Code Reviews| Index: Source/core/editing/DeleteSelectionCommand.cpp |
| diff --git a/Source/core/editing/DeleteSelectionCommand.cpp b/Source/core/editing/DeleteSelectionCommand.cpp |
| index ce27bb711cf0898ce1eb7760c9b3a2d8e635bdc6..0630c426309a9c1f03d1dc46cdcdcbf0c45e9e74 100644 |
| --- a/Source/core/editing/DeleteSelectionCommand.cpp |
| +++ b/Source/core/editing/DeleteSelectionCommand.cpp |
| @@ -639,6 +639,17 @@ void DeleteSelectionCommand::mergeParagraphs() |
| if (mergeDestination == endOfParagraphToMove) |
| return; |
| + // If the merge destination and source to be moved are both list items of different lists, merge them into single list. |
| + Node* listItemInFirstParagraph = enclosingNodeOfType(m_upstreamStart, &isListItem); |
|
yosin_UTC9
2013/12/12 04:20:45
nit: You don't need to have "&" for isListItem.
|
| + Node* listItemInSecondParagraph = enclosingNodeOfType(m_downstreamEnd, &isListItem); |
|
yosin_UTC9
2013/12/12 04:20:45
nit: You don't need to have "&" for isListItem.
|
| + if (listItemInFirstParagraph && listItemInSecondParagraph |
|
yosin_UTC9
2013/12/12 04:20:45
ni: Can we merge if-conditions of L645 and L647?
|
| + && listItemInFirstParagraph->parentElement() != listItemInSecondParagraph->parentElement()) { |
| + if (canMergeLists(listItemInFirstParagraph->parentElement(), listItemInSecondParagraph->parentElement())) { |
| + mergeIdenticalElements(listItemInFirstParagraph->parentElement(), listItemInSecondParagraph->parentElement()); |
| + return; |
| + } |
| + } |
| + |
| // The rule for merging into an empty block is: only do so if its farther to the right. |
| // FIXME: Consider RTL. |
| if (!m_startsAtEmptyLine && isStartOfParagraph(mergeDestination) && startOfParagraphToMove.absoluteCaretBounds().x() > mergeDestination.absoluteCaretBounds().x()) { |