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

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

Issue 406843002: Optimize hasTagName when called on an HTMLElement / SVGElement (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/dom/Node.h ('k') | Source/core/editing/InsertListCommand.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 37e494051d361022d63dba296b1381434b8e0c91..de7765bd980a619acc0ede63fc77fbf7469afa7f 100644
--- a/Source/core/editing/ApplyStyleCommand.cpp
+++ b/Source/core/editing/ApplyStyleCommand.cpp
@@ -65,10 +65,10 @@ bool isLegacyAppleStyleSpan(const Node *node)
if (!node || !node->isHTMLElement())
return false;
- const HTMLElement* elem = toHTMLElement(node);
- if (!elem->hasLocalName(spanAttr) || elem->getAttribute(classAttr) != styleSpanClassString())
+ const HTMLElement& element = toHTMLElement(*node);
+ if (!isHTMLSpanElement(element) || element.getAttribute(classAttr) != styleSpanClassString())
return false;
- UseCounter::count(elem->document(), UseCounter::EditingAppleStyleSpanClass);
+ UseCounter::count(element.document(), UseCounter::EditingAppleStyleSpanClass);
return true;
}
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/editing/InsertListCommand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698