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

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

Issue 307243004: Avoid calling slower Node::firstChild() / Node::lastChild() when possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 6 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/CompositeEditCommand.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/CompositeEditCommand.cpp
diff --git a/Source/core/editing/CompositeEditCommand.cpp b/Source/core/editing/CompositeEditCommand.cpp
index 69c7748e65f2f8ac8d192db9a258e9078de4fdb5..859a305be1e4b0f216c35fcd83480f5d9e787928 100644
--- a/Source/core/editing/CompositeEditCommand.cpp
+++ b/Source/core/editing/CompositeEditCommand.cpp
@@ -293,7 +293,7 @@ bool CompositeEditCommand::isRemovableBlock(const Node* node)
if (!isHTMLDivElement(*node))
return false;
- Node* parentNode = node->parentNode();
+ ContainerNode* parentNode = node->parentNode();
if (parentNode && parentNode->firstChild() != parentNode->lastChild())
return false;
@@ -885,7 +885,7 @@ void CompositeEditCommand::removePlaceholderAt(const Position& p)
deleteTextFromNode(toText(p.anchorNode()), p.offsetInContainerNode(), 1);
}
-PassRefPtrWillBeRawPtr<Node> CompositeEditCommand::insertNewDefaultParagraphElementAt(const Position& position)
+PassRefPtrWillBeRawPtr<Element> CompositeEditCommand::insertNewDefaultParagraphElementAt(const Position& position)
{
RefPtrWillBeRawPtr<Element> paragraphElement = createDefaultParagraphElement(document());
paragraphElement->appendChild(createBreakElement(document()));
@@ -895,7 +895,7 @@ PassRefPtrWillBeRawPtr<Node> CompositeEditCommand::insertNewDefaultParagraphElem
// If the paragraph is not entirely within it's own block, create one and move the paragraph into
// it, and return that block. Otherwise return 0.
-PassRefPtrWillBeRawPtr<Node> CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary(const Position& pos)
+PassRefPtrWillBeRawPtr<Element> CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary(const Position& pos)
{
if (pos.isNull())
return nullptr;
@@ -946,7 +946,7 @@ PassRefPtrWillBeRawPtr<Node> CompositeEditCommand::moveParagraphContentsToNewBlo
if (visibleParagraphEnd.isNull())
return nullptr;
- RefPtrWillBeRawPtr<Node> newBlock = insertNewDefaultParagraphElementAt(upstreamStart);
+ RefPtrWillBeRawPtr<Element> newBlock = insertNewDefaultParagraphElementAt(upstreamStart);
bool endWasBr = isHTMLBRElement(*visibleParagraphEnd.deepEquivalent().deprecatedNode());
« no previous file with comments | « Source/core/editing/CompositeEditCommand.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698