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

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

Issue 18888002: Introduce isHTMLAnchorElement and toHTMLAnchorElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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/dom/Document.cpp ('k') | Source/core/dom/VisitedLinkState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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))
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/VisitedLinkState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698