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

Unified Diff: Source/core/dom/shadow/ShadowRootRareData.h

Issue 192293002: Use new is*Element() helper functions in DOM code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add is*Element(PassRefPtr) helper Created 6 years, 9 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
Index: Source/core/dom/shadow/ShadowRootRareData.h
diff --git a/Source/core/dom/shadow/ShadowRootRareData.h b/Source/core/dom/shadow/ShadowRootRareData.h
index 4ec22d5a34195dfbd8f6a45c34a4c9d51cecd944..051579a00b2a69b19aac026eec3738d3f6f7db3a 100644
--- a/Source/core/dom/shadow/ShadowRootRareData.h
+++ b/Source/core/dom/shadow/ShadowRootRareData.h
@@ -106,9 +106,10 @@ private:
inline void ShadowRootRareData::didAddInsertionPoint(InsertionPoint* point)
{
- if (point->hasTagName(HTMLNames::shadowTag))
+ ASSERT(point);
+ if (isHTMLShadowElement(*point))
++m_descendantShadowElementCount;
- else if (point->hasTagName(HTMLNames::contentTag))
+ else if (isHTMLContentElement(*point))
++m_descendantContentElementCount;
else
ASSERT_NOT_REACHED();
@@ -116,9 +117,10 @@ inline void ShadowRootRareData::didAddInsertionPoint(InsertionPoint* point)
inline void ShadowRootRareData::didRemoveInsertionPoint(InsertionPoint* point)
{
- if (point->hasTagName(HTMLNames::shadowTag))
+ ASSERT(point);
+ if (isHTMLShadowElement(*point))
--m_descendantShadowElementCount;
- else if (point->hasTagName(HTMLNames::contentTag))
+ else if (isHTMLContentElement(*point))
--m_descendantContentElementCount;
else
ASSERT_NOT_REACHED();

Powered by Google App Engine
This is Rietveld 408576698