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

Unified Diff: Source/core/css/SiblingTraversalStrategies.h

Issue 415823002: Drop slower Node::hasTagName(QualifiedName) overload (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase 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 | « no previous file | Source/core/dom/Element.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/SiblingTraversalStrategies.h
diff --git a/Source/core/css/SiblingTraversalStrategies.h b/Source/core/css/SiblingTraversalStrategies.h
index 58394911e797c095f8cffae2df6295f8e04a7404..7861b70541f1033237db4173fe5416f42f111104 100644
--- a/Source/core/css/SiblingTraversalStrategies.h
+++ b/Source/core/css/SiblingTraversalStrategies.h
@@ -168,7 +168,7 @@ inline bool ShadowDOMSiblingTraversalStrategy::isFirstOfType(Element& element, c
ASSERT(element == toElement(m_siblings[m_nth]));
for (int i = m_nth - 1; i >= 0; --i) {
- if (m_siblings[i]->hasTagName(type))
+ if (m_siblings[i]->isElementNode() && toElement(m_siblings[i])->hasTagName(type))
return false;
}
@@ -180,7 +180,7 @@ inline bool ShadowDOMSiblingTraversalStrategy::isLastOfType(Element& element, co
ASSERT(element == toElement(m_siblings[m_nth]));
for (size_t i = m_nth + 1; i < m_siblings.size(); ++i) {
- if (m_siblings[i]->hasTagName(type))
+ if (m_siblings[i]->isElementNode() && toElement(m_siblings[i])->hasTagName(type))
return false;
}
@@ -219,7 +219,7 @@ inline int ShadowDOMSiblingTraversalStrategy::countElementsOfTypeBefore(Element&
int count = 0;
for (int i = m_nth - 1; i >= 0; --i) {
- if (m_siblings[i]->hasTagName(type))
+ if (m_siblings[i]->isElementNode() && toElement(m_siblings[i])->hasTagName(type))
++count;
}
@@ -232,7 +232,7 @@ inline int ShadowDOMSiblingTraversalStrategy::countElementsOfTypeAfter(Element&
int count = 0;
for (size_t i = m_nth + 1; i < m_siblings.size(); ++i) {
- if (m_siblings[i]->hasTagName(type))
+ if (m_siblings[i]->isElementNode() && toElement(m_siblings[i])->hasTagName(type))
return ++count;
}
« no previous file with comments | « no previous file | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698