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

Unified Diff: Source/core/dom/shadow/ElementShadow.cpp

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/ElementShadow.cpp
diff --git a/Source/core/dom/shadow/ElementShadow.cpp b/Source/core/dom/shadow/ElementShadow.cpp
index 706ef9a24bbc86227e185df4115ddcbe0360dc85..8c94e9539fa9c81764773c4c25c6d58738b8eed4 100644
--- a/Source/core/dom/shadow/ElementShadow.cpp
+++ b/Source/core/dom/shadow/ElementShadow.cpp
@@ -88,7 +88,7 @@ void DistributionPool::distributeTo(InsertionPoint* insertionPoint, ElementShado
if (m_distributed[i])
continue;
- if (insertionPoint->hasTagName(HTMLNames::contentTag) && !toHTMLContentElement(insertionPoint)->canSelectNode(m_nodes, i))
+ if (isHTMLContentElement(*insertionPoint) && !toHTMLContentElement(insertionPoint)->canSelectNode(m_nodes, i))
continue;
Node* node = m_nodes[i];
@@ -302,7 +302,7 @@ void ElementShadow::distribute()
InsertionPoint* point = insertionPoints[i].get();
if (!point->isActive())
continue;
- if (point->hasTagName(HTMLNames::shadowTag)) {
+ if (isHTMLShadowElement(*point)) {
ASSERT(!shadowInsertionPoint);
shadowInsertionPoint = toHTMLShadowElement(point);
shadowInsertionPoints.append(shadowInsertionPoint);
@@ -358,9 +358,9 @@ void ElementShadow::collectSelectFeatureSetFrom(ShadowRoot& root)
for (Element* element = ElementTraversal::firstWithin(root); element; element = ElementTraversal::next(*element, &root)) {
if (ElementShadow* shadow = element->shadow())
m_selectFeatures.add(shadow->ensureSelectFeatureSet());
- if (!element->hasTagName(HTMLNames::contentTag))
+ if (!isHTMLContentElement(*element))
continue;
- const CSSSelectorList& list = toHTMLContentElement(element)->selectorList();
+ const CSSSelectorList& list = toHTMLContentElement(*element).selectorList();
for (const CSSSelector* selector = list.first(); selector; selector = CSSSelectorList::next(*selector)) {
for (const CSSSelector* component = selector; component; component = component->tagHistory())
m_selectFeatures.collectFeaturesFromSelector(*component);

Powered by Google App Engine
This is Rietveld 408576698