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

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

Issue 405973004: Optimize / clean up hasTagName() call sites (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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/ReplaceSelectionCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/MarkupAccumulator.cpp
diff --git a/Source/core/editing/MarkupAccumulator.cpp b/Source/core/editing/MarkupAccumulator.cpp
index 69b8673e7f2ab85335a56e88e9e1f906f9c55a74..ee12e50793c8ae2eeafab5f96e49e20ab5904795 100644
--- a/Source/core/editing/MarkupAccumulator.cpp
+++ b/Source/core/editing/MarkupAccumulator.cpp
@@ -125,9 +125,9 @@ String MarkupAccumulator::serializeNodes(Node& targetNode, EChildrenOnly childre
void MarkupAccumulator::serializeNodesWithNamespaces(Node& targetNode, EChildrenOnly childrenOnly, const Namespaces* namespaces, Vector<QualifiedName>* tagNamesToSkip)
{
- if (tagNamesToSkip) {
+ if (tagNamesToSkip && targetNode.isElementNode()) {
for (size_t i = 0; i < tagNamesToSkip->size(); ++i) {
- if (targetNode.hasTagName(tagNamesToSkip->at(i)))
+ if (toElement(targetNode).hasTagName(tagNamesToSkip->at(i)))
return;
}
}
« no previous file with comments | « Source/core/editing/InsertListCommand.cpp ('k') | Source/core/editing/ReplaceSelectionCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698