Index: Source/core/dom/Document.cpp |
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
index 8668dd20dee17af73c1de393abae62a90f05e65d..daab4c30c1f126968f794b2d53384363bccc905c 100644 |
--- a/Source/core/dom/Document.cpp |
+++ b/Source/core/dom/Document.cpp |
@@ -601,6 +601,16 @@ void Document::dispose() |
} |
#endif |
+unsigned Document::nodeCount() const |
+{ |
+ unsigned count = 0; |
+ for (Node& node : NodeTraversal::inclusiveDescendantsOf(*this)) { |
+ ASSERT_UNUSED(node, &node); |
+ count++; |
+ } |
+ return count; |
+} |
+ |
SelectorQueryCache& Document::selectorQueryCache() |
{ |
if (!m_selectorQueryCache) |