Index: Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp |
diff --git a/Source/core/editing/InsertParagraphSeparatorCommand.cpp b/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp |
similarity index 96% |
rename from Source/core/editing/InsertParagraphSeparatorCommand.cpp |
rename to Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp |
index 5e0bbe51f45dc4c8f68df03f372323cf2c2c1492..b7bea17ad2787a29fb8ac8bd0fc487186e68177f 100644 |
--- a/Source/core/editing/InsertParagraphSeparatorCommand.cpp |
+++ b/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp |
@@ -24,7 +24,7 @@ |
*/ |
#include "config.h" |
-#include "core/editing/InsertParagraphSeparatorCommand.h" |
+#include "core/editing/commands/InsertParagraphSeparatorCommand.h" |
#include "core/HTMLNames.h" |
#include "core/dom/Document.h" |
@@ -32,8 +32,8 @@ |
#include "core/dom/Text.h" |
#include "core/editing/EditingStyle.h" |
#include "core/editing/EditingUtilities.h" |
-#include "core/editing/InsertLineBreakCommand.h" |
#include "core/editing/VisibleUnits.h" |
+#include "core/editing/commands/InsertLineBreakCommand.h" |
#include "core/html/HTMLBRElement.h" |
#include "core/html/HTMLElement.h" |
#include "core/html/HTMLQuoteElement.h" |
@@ -91,11 +91,11 @@ 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) |
@@ -115,11 +115,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 +394,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()); |