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

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

Issue 171773008: Rename childNodeCount() / childNode() methods for clarity (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Further renaming for consistency Created 6 years, 10 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/ContainerNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ContainerNode.h
diff --git a/Source/core/dom/ContainerNode.h b/Source/core/dom/ContainerNode.h
index 62a3e3230b2b586de5a51f6d301914886bcef541..67b4c472a61ab46e0ba5174a3a9de3769e4bc8a4 100644
--- a/Source/core/dom/ContainerNode.h
+++ b/Source/core/dom/ContainerNode.h
@@ -82,7 +82,7 @@ public:
Node* firstChild() const { return m_firstChild; }
Node* lastChild() const { return m_lastChild; }
- bool hasChildNodes() const { return m_firstChild; }
+ bool hasChildren() const { return m_firstChild; }
bool hasOneChild() const { return m_firstChild && !m_firstChild->nextSibling(); }
bool hasOneTextChild() const { return hasOneChild() && m_firstChild->isTextNode(); }
@@ -90,8 +90,8 @@ public:
PassRefPtr<HTMLCollection> children();
- unsigned childNodeCount() const;
- Node* childNode(unsigned index) const;
+ unsigned countChildren() const;
+ Node* traverseToChildAt(unsigned index) const;
PassRefPtr<Element> querySelector(const AtomicString& selectors, ExceptionState&);
PassRefPtr<NodeList> querySelectorAll(const AtomicString& selectors, ExceptionState&);
@@ -215,18 +215,18 @@ inline void ContainerNode::detachChildren(const AttachContext& context)
child->detach(childrenContext);
}
-inline unsigned Node::childNodeCount() const
+inline unsigned Node::countChildren() const
{
if (!isContainerNode())
return 0;
- return toContainerNode(this)->childNodeCount();
+ return toContainerNode(this)->countChildren();
}
-inline Node* Node::childNode(unsigned index) const
+inline Node* Node::traverseToChildAt(unsigned index) const
{
if (!isContainerNode())
return 0;
- return toContainerNode(this)->childNode(index);
+ return toContainerNode(this)->traverseToChildAt(index);
}
inline Node* Node::firstChild() const
« no previous file with comments | « no previous file | Source/core/dom/ContainerNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698