Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(923)

Unified Diff: Source/core/editing/InsertListCommand.cpp

Issue 1292303005: Make core/editing/ files to match Blink coding style (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-18T10:48:50 Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/editing/InsertListCommand.cpp
diff --git a/Source/core/editing/InsertListCommand.cpp b/Source/core/editing/InsertListCommand.cpp
index 9ad50f6c0fa3954af9f4c7b3d439715462dd97c6..794080e9e339d385f2a96628bbadb5f3e20248d2 100644
--- a/Source/core/editing/InsertListCommand.cpp
+++ b/Source/core/editing/InsertListCommand.cpp
@@ -218,11 +218,14 @@ bool InsertListCommand::doApplyForSingleParagraph(bool forceCreateList, const HT
listElement = fixOrphanedListChild(listChildNode);
listElement = mergeWithNeighboringLists(listElement);
}
- if (!listElement->hasTagName(listTag))
- // listChildNode will be removed from the list and a list of type m_type will be created.
+ if (!listElement->hasTagName(listTag)) {
+ // |listChildNode| will be removed from the list and a list of type
+ // |m_type| will be created.
switchListType = true;
+ }
- // If the list is of the desired type, and we are not removing the list, then exit early.
+ // If the list is of the desired type, and we are not removing the list,
+ // then exit early.
if (!switchListType && forceCreateList)
return true;
@@ -362,11 +365,11 @@ PassRefPtrWillBeRawPtr<HTMLElement> InsertListCommand::listifyParagraph(const Vi
HTMLElement* previousList = adjacentEnclosingList(start, start.previous(CannotCrossEditingBoundary), listTag);
HTMLElement* nextList = adjacentEnclosingList(start, end.next(CannotCrossEditingBoundary), listTag);
RefPtrWillBeRawPtr<HTMLElement> listElement = nullptr;
- if (previousList)
+ if (previousList) {
appendNode(listItemElement, previousList);
- else if (nextList)
+ } else if (nextList) {
insertNodeAt(listItemElement, positionBeforeNode(nextList));
- else {
+ } else {
// Create the list.
listElement = createHTMLElement(document(), listTag);
appendNode(listItemElement, listElement);
« no previous file with comments | « Source/core/editing/InsertLineBreakCommand.cpp ('k') | Source/core/editing/InsertParagraphSeparatorCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698