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

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

Issue 166573003: Port ParentNode API to ElementTraversal (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 | « Source/core/dom/ContainerNode.h ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ContainerNode.cpp
diff --git a/Source/core/dom/ContainerNode.cpp b/Source/core/dom/ContainerNode.cpp
index 4350dcea063e1d1e673f664675c290279a88525a..d63b98e908235bd54bd1ea1d68fd517d04e89bab 100644
--- a/Source/core/dom/ContainerNode.cpp
+++ b/Source/core/dom/ContainerNode.cpp
@@ -880,30 +880,6 @@ PassRefPtr<HTMLCollection> ContainerNode::children()
return ensureRareData().ensureNodeLists().addCache<HTMLCollection>(this, NodeChildren);
}
-Element* ContainerNode::firstElementChild() const
-{
- return ElementTraversal::firstWithin(*this);
-}
-
-Element* ContainerNode::lastElementChild() const
-{
- Node* n = lastChild();
- while (n && !n->isElementNode())
- n = n->previousSibling();
- return toElement(n);
-}
-
-unsigned ContainerNode::childElementCount() const
-{
- unsigned count = 0;
- Node* n = firstChild();
- while (n) {
- count += n->isElementNode();
- n = n->nextSibling();
- }
- return count;
-}
-
unsigned ContainerNode::childNodeCount() const
{
unsigned count = 0;
« no previous file with comments | « Source/core/dom/ContainerNode.h ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698