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

Unified Diff: Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp

Issue 1294543005: Move execCommand related files in core/editing/ related files into core/editing/commands/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-17T17:57:33 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/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());

Powered by Google App Engine
This is Rietveld 408576698