Index: Source/core/dom/TreeScope.cpp |
diff --git a/Source/core/dom/TreeScope.cpp b/Source/core/dom/TreeScope.cpp |
index 1564015de4f9670fb88d6fe69c8555e25b1c540e..9cd02cbcf3d4ec0c4b439280162f94870e3f7e10 100644 |
--- a/Source/core/dom/TreeScope.cpp |
+++ b/Source/core/dom/TreeScope.cpp |
@@ -302,8 +302,8 @@ Element* TreeScope::findAnchor(const String& name) |
if (Element* element = getElementById(name)) |
return element; |
for (Element* element = ElementTraversal::firstWithin(rootNode()); element; element = ElementTraversal::next(element)) { |
- if (element->hasTagName(aTag)) { |
- HTMLAnchorElement* anchor = static_cast<HTMLAnchorElement*>(element); |
+ if (isHTMLAnchorElement(element)) { |
+ HTMLAnchorElement* anchor = toHTMLAnchorElement(element); |
if (rootNode()->document()->inQuirksMode()) { |
// Quirks mode, case insensitive comparison of names. |
if (equalIgnoringCase(anchor->name(), name)) |