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() |