Chromium Code Reviews| Index: Source/core/dom/Document.cpp |
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
| index 5a09d1d367578cc53657d00fa5ce5ccae1876ee8..95ef105d03f0abee4f5e40a9ca25d688bf376885 100644 |
| --- a/Source/core/dom/Document.cpp |
| +++ b/Source/core/dom/Document.cpp |
| @@ -2390,10 +2390,11 @@ PassRefPtrWillBeRawPtr<DocumentParser> Document::implicitOpen() |
| HTMLElement* Document::body() const |
| { |
| - if (!documentElement()) |
| + Element* documentElement = this->documentElement(); |
|
tkent
2014/12/15 01:09:29
Is this related to the topic of this CL?
|
| + if (!documentElement || !documentElement->hasTagName(htmlTag)) |
| return 0; |
| - for (HTMLElement* child = Traversal<HTMLElement>::firstChild(*documentElement()); child; child = Traversal<HTMLElement>::nextSibling(*child)) { |
| + for (HTMLElement* child = Traversal<HTMLElement>::firstChild(*documentElement); child; child = Traversal<HTMLElement>::nextSibling(*child)) { |
| if (isHTMLFrameSetElement(*child) || isHTMLBodyElement(*child)) |
| return child; |
| } |