Index: Source/core/xml/parser/XMLDocumentParser.cpp |
diff --git a/Source/core/xml/parser/XMLDocumentParser.cpp b/Source/core/xml/parser/XMLDocumentParser.cpp |
index 8ed8307aa3f33f9ab87f3c1c04a7d3fc444866af..7f0e69fd65e9e60ac1595b5732ab4bbccc4ff458 100644 |
--- a/Source/core/xml/parser/XMLDocumentParser.cpp |
+++ b/Source/core/xml/parser/XMLDocumentParser.cpp |
@@ -801,10 +801,10 @@ XMLDocumentParser::XMLDocumentParser(DocumentFragment* fragment, Element* parent |
while (parentElement) { |
elemStack.append(parentElement); |
- ContainerNode* n = parentElement->parentNode(); |
- if (!n || !n->isElementNode()) |
+ Element* grandParentElement = parentElement->parentElement(); |
+ if (!grandParentElement) |
break; |
- parentElement = toElement(n); |
+ parentElement = grandParentElement; |
} |
if (elemStack.isEmpty()) |