Index: Source/core/dom/Range.cpp |
diff --git a/Source/core/dom/Range.cpp b/Source/core/dom/Range.cpp |
index 9c9ac3466ca2d477fbb7498f479c7d8c5a8071f1..458e7924d7a51f5e07133c5435916d894e547802 100644 |
--- a/Source/core/dom/Range.cpp |
+++ b/Source/core/dom/Range.cpp |
@@ -657,9 +657,10 @@ static inline unsigned lengthOfContentsInNode(Node* node) |
case Node::ELEMENT_NODE: |
case Node::ATTRIBUTE_NODE: |
case Node::DOCUMENT_NODE: |
- case Node::DOCUMENT_TYPE_NODE: |
case Node::DOCUMENT_FRAGMENT_NODE: |
- return node->childNodeCount(); |
+ return toContainerNode(node)->childNodeCount(); |
+ case Node::DOCUMENT_TYPE_NODE: |
+ return 0; |
} |
ASSERT_NOT_REACHED(); |
return 0; |