Index: third_party/WebKit/Source/core/dom/Document.cpp |
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp |
index b8a19d24048bd6bdadfc6b73542aa5f2eb4224dd..5f88cb36eba5435516419c216218a0ff9a4d0160 100644 |
--- a/third_party/WebKit/Source/core/dom/Document.cpp |
+++ b/third_party/WebKit/Source/core/dom/Document.cpp |
@@ -2499,7 +2499,7 @@ PassRefPtrWillBeRawPtr<DocumentParser> Document::implicitOpen(ParserSynchronizat |
HTMLElement* Document::body() const |
{ |
- if (!documentElement()) |
+ if (!documentElement() || !isHTMLHtmlElement(documentElement())) |
return 0; |
for (HTMLElement* child = Traversal<HTMLElement>::firstChild(*documentElement()); child; child = Traversal<HTMLElement>::nextSibling(*child)) { |