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

Unified Diff: Source/core/dom/ClassNodeList.h

Issue 141683004: Use more const references in HTMLCollection / LiveNodeList (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Get rid of const_cast Created 6 years, 11 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/ChildNodeList.cpp ('k') | Source/core/dom/ClassNodeList.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ClassNodeList.h
diff --git a/Source/core/dom/ClassNodeList.h b/Source/core/dom/ClassNodeList.h
index a1dcbf4571846cbd4414f487557a0c0ab1e6c7e1..9c26b7f43af285abf73c4bbb04fb36647fef3c9b 100644
--- a/Source/core/dom/ClassNodeList.h
+++ b/Source/core/dom/ClassNodeList.h
@@ -49,28 +49,28 @@ public:
virtual ~ClassNodeList();
- bool nodeMatchesInlined(Element*) const;
+ bool nodeMatchesInlined(const Element&) const;
private:
ClassNodeList(PassRefPtr<Node> rootNode, const AtomicString& classNames);
- virtual bool nodeMatches(Element*) const OVERRIDE;
+ virtual bool nodeMatches(const Element&) const OVERRIDE;
SpaceSplitString m_classNames;
AtomicString m_originalClassNames;
};
-inline bool ClassNodeList::nodeMatchesInlined(Element* testNode) const
+inline bool ClassNodeList::nodeMatchesInlined(const Element& testNode) const
{
- if (!testNode->hasClass())
+ if (!testNode.hasClass())
return false;
if (!m_classNames.size())
return false;
// FIXME: DOM4 allows getElementsByClassName to return non StyledElement.
// https://bugs.webkit.org/show_bug.cgi?id=94718
- if (!testNode->isStyledElement())
+ if (!testNode.isStyledElement())
return false;
- return testNode->classNames().containsAll(m_classNames);
+ return testNode.classNames().containsAll(m_classNames);
}
} // namespace WebCore
« no previous file with comments | « Source/core/dom/ChildNodeList.cpp ('k') | Source/core/dom/ClassNodeList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698