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

Unified Diff: Source/core/editing/InsertParagraphSeparatorCommand.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
« no previous file with comments | « Source/core/editing/InsertListCommand.cpp ('k') | Source/core/editing/InsertTextCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/InsertParagraphSeparatorCommand.cpp
diff --git a/Source/core/editing/InsertParagraphSeparatorCommand.cpp b/Source/core/editing/InsertParagraphSeparatorCommand.cpp
index 5e0bbe51f45dc4c8f68df03f372323cf2c2c1492..9ef837814fd0d2562aa34a0bf486bf7517c3b4a7 100644
--- a/Source/core/editing/InsertParagraphSeparatorCommand.cpp
+++ b/Source/core/editing/InsertParagraphSeparatorCommand.cpp
@@ -91,12 +91,13 @@ void InsertParagraphSeparatorCommand::applyStyleAfterInsertion(Element* original
{
// Not only do we break out of header tags, but we also do not preserve the typing style,
// in order to match other browsers.
- if (originalEnclosingBlock->hasTagName(h1Tag) ||
- originalEnclosingBlock->hasTagName(h2Tag) ||
- originalEnclosingBlock->hasTagName(h3Tag) ||
- originalEnclosingBlock->hasTagName(h4Tag) ||
- originalEnclosingBlock->hasTagName(h5Tag))
+ if (originalEnclosingBlock->hasTagName(h1Tag)
+ || originalEnclosingBlock->hasTagName(h2Tag)
+ || originalEnclosingBlock->hasTagName(h3Tag)
+ || originalEnclosingBlock->hasTagName(h4Tag)
+ || originalEnclosingBlock->hasTagName(h5Tag)) {
return;
+ }
if (!m_style)
return;
@@ -115,11 +116,11 @@ bool InsertParagraphSeparatorCommand::shouldUseDefaultParagraphElement(Element*
if (!isEndOfBlock(endingSelection().visibleStart()))
return false;
- return enclosingBlock->hasTagName(h1Tag) ||
- enclosingBlock->hasTagName(h2Tag) ||
- enclosingBlock->hasTagName(h3Tag) ||
- enclosingBlock->hasTagName(h4Tag) ||
- enclosingBlock->hasTagName(h5Tag);
+ return enclosingBlock->hasTagName(h1Tag)
+ || enclosingBlock->hasTagName(h2Tag)
+ || enclosingBlock->hasTagName(h3Tag)
+ || enclosingBlock->hasTagName(h4Tag)
+ || enclosingBlock->hasTagName(h5Tag);
}
void InsertParagraphSeparatorCommand::getAncestorsInsideBlock(const Node* insertionNode, Element* outerBlock, WillBeHeapVector<RefPtrWillBeMember<Element>>& ancestors)
@@ -394,9 +395,9 @@ void InsertParagraphSeparatorCommand::doApply()
// Move the start node and the siblings of the start node.
if (VisiblePosition(insertionPosition).deepEquivalent() != VisiblePosition(positionBeforeNode(blockToInsert.get())).deepEquivalent()) {
Node* n;
- if (insertionPosition.computeContainerNode() == startBlock)
+ if (insertionPosition.computeContainerNode() == startBlock) {
n = insertionPosition.computeNodeAfterPosition();
- else {
+ } else {
Node* splitTo = insertionPosition.computeContainerNode();
if (splitTo->isTextNode() && insertionPosition.offsetInContainerNode() >= caretMaxOffset(splitTo))
splitTo = NodeTraversal::next(*splitTo, startBlock.get());
« no previous file with comments | « Source/core/editing/InsertListCommand.cpp ('k') | Source/core/editing/InsertTextCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698