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

Unified Diff: Source/core/html/HTMLMetaElement-in.cpp

Issue 476273004: Use Traversal<>::firstAncestor() API more in the code base (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | « Source/core/html/HTMLLegendElement.cpp ('k') | Source/core/html/HTMLTextFormControlElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMetaElement-in.cpp
diff --git a/Source/core/html/HTMLMetaElement-in.cpp b/Source/core/html/HTMLMetaElement-in.cpp
index 1a88b7135160c7fc9cc090ff8c8e2ea51851759f..c9c8509afbfd485d7f8ca9e33648f3740535c6ce 100644
--- a/Source/core/html/HTMLMetaElement-in.cpp
+++ b/Source/core/html/HTMLMetaElement-in.cpp
@@ -25,8 +25,10 @@
#include "core/HTMLNames.h"
#include "core/dom/Document.h"
+#include "core/dom/ElementTraversal.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
+#include "core/html/HTMLHeadElement.h"
#include "core/inspector/ConsoleMessage.h"
#include "core/loader/FrameLoaderClient.h"
#include "platform/RuntimeEnabledFeatures.h"
@@ -448,11 +450,7 @@ static bool inDocumentHead(HTMLMetaElement* element)
if (!element->inDocument())
return false;
- for (Element* current = element; current; current = current->parentElement()) {
- if (isHTMLHeadElement(*current))
- return true;
- }
- return false;
+ return Traversal<HTMLHeadElement>::firstAncestor(*element);
}
void HTMLMetaElement::process()
« no previous file with comments | « Source/core/html/HTMLLegendElement.cpp ('k') | Source/core/html/HTMLTextFormControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698