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

Unified Diff: Source/core/editing/ApplyStyleCommand.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/ApplyStyleCommand.h ('k') | Source/core/editing/CompositeEditCommand.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/ApplyStyleCommand.cpp
diff --git a/Source/core/editing/ApplyStyleCommand.cpp b/Source/core/editing/ApplyStyleCommand.cpp
index 00f9ab1e4f0374ddee3ead8552af4e3fb29483b0..847f85f3c853d8301ae8c9359d166750d1bf33e0 100644
--- a/Source/core/editing/ApplyStyleCommand.cpp
+++ b/Source/core/editing/ApplyStyleCommand.cpp
@@ -266,7 +266,7 @@ void ApplyStyleCommand::applyBlockStyle(EditingStyle *style)
if (styleChange.cssStyle().length() || m_removeOnly) {
RefPtrWillBeRawPtr<Node> block = enclosingBlock(paragraphStart.deepEquivalent().deprecatedNode());
if (!m_removeOnly) {
- RefPtrWillBeRawPtr<Node> newBlock = moveParagraphContentsToNewBlockIfNecessary(paragraphStart.deepEquivalent());
+ RefPtrWillBeRawPtr<Element> newBlock = moveParagraphContentsToNewBlockIfNecessary(paragraphStart.deepEquivalent());
if (newBlock)
block = newBlock;
}
@@ -424,7 +424,7 @@ void ApplyStyleCommand::applyRelativeFontStyleChange(EditingStyle* style)
removeNodePreservingChildren(unstyledSpans[i].get());
}
-static Node* dummySpanAncestorForNode(const Node* node)
+static ContainerNode* dummySpanAncestorForNode(const Node* node)
{
while (node && (!node->isElementNode() || !isStyleSpanOrSpanWithOnlyStyleAttribute(toElement(node))))
node = node->parentNode();
@@ -432,7 +432,7 @@ static Node* dummySpanAncestorForNode(const Node* node)
return node ? node->parentNode() : 0;
}
-void ApplyStyleCommand::cleanupUnstyledAppleStyleSpans(Node* dummySpanAncestor)
+void ApplyStyleCommand::cleanupUnstyledAppleStyleSpans(ContainerNode* dummySpanAncestor)
{
if (!dummySpanAncestor)
return;
@@ -546,8 +546,8 @@ static Node* highestEmbeddingAncestor(Node* startNode, Node* enclosingNode)
void ApplyStyleCommand::applyInlineStyle(EditingStyle* style)
{
- RefPtrWillBeRawPtr<Node> startDummySpanAncestor = nullptr;
- RefPtrWillBeRawPtr<Node> endDummySpanAncestor = nullptr;
+ RefPtrWillBeRawPtr<ContainerNode> startDummySpanAncestor = nullptr;
+ RefPtrWillBeRawPtr<ContainerNode> endDummySpanAncestor = nullptr;
// update document layout once before removing styles
// so that we avoid the expense of updating before each and every call
@@ -1528,7 +1528,7 @@ float ApplyStyleCommand::computedFontSize(Node* node)
return value->getFloatValue(CSSPrimitiveValue::CSS_PX);
}
-void ApplyStyleCommand::joinChildTextNodes(Node* node, const Position& start, const Position& end)
+void ApplyStyleCommand::joinChildTextNodes(ContainerNode* node, const Position& start, const Position& end)
{
if (!node)
return;
« no previous file with comments | « Source/core/editing/ApplyStyleCommand.h ('k') | Source/core/editing/CompositeEditCommand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698