Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Unified Diff: Source/core/dom/Document.cpp

Issue 795173003: Stricter parsing for rows/cols attribute on textarea (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add some subtests I forgot... Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}
« no previous file with comments | « LayoutTests/fast/dom/HTMLTextAreaElement/script-tests/rows-attribute.js ('k') | Source/core/html/HTMLTextAreaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698