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

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

Issue 23956013: Add toHTMLHeadElement(), and use it. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months 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
« no previous file with comments | « no previous file | Source/core/html/HTMLHeadElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 318ced439f0281f06f6538befdd02dd98b357892..c5187398aa2600e8ddce84b3bcb441ef47c7ab85 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -2296,10 +2296,10 @@ HTMLHeadElement* Document::head()
if (!de)
return 0;
- for (Node* e = de->firstChild(); e; e = e->nextSibling())
- if (e->hasTagName(headTag))
- return static_cast<HTMLHeadElement*>(e);
-
+ for (Node* node = de->firstChild(); node; node = node->nextSibling()) {
+ if (node->hasTagName(headTag))
+ return toHTMLHeadElement(node);
+ }
return 0;
}
« no previous file with comments | « no previous file | Source/core/html/HTMLHeadElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698