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

Unified Diff: Source/core/html/HTMLAnchorElement.h

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/VisitedLinkState.cpp ('k') | Source/core/page/DragController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLAnchorElement.h
diff --git a/Source/core/html/HTMLAnchorElement.h b/Source/core/html/HTMLAnchorElement.h
index 5cc83ca2b3e70d7471ed4a1d46390c4782c5533a..a63c563427e3cd942080d871b18207dce046a008 100644
--- a/Source/core/html/HTMLAnchorElement.h
+++ b/Source/core/html/HTMLAnchorElement.h
@@ -158,6 +158,22 @@ inline LinkHash HTMLAnchorElement::visitedLinkHash() const
bool isEnterKeyKeydownEvent(Event*);
bool isLinkClick(Event*);
+inline bool isHTMLAnchorElement(const Node* node)
+{
+ return node->hasTagName(HTMLNames::aTag);
+}
+
+inline bool isHTMLAnchorElement(const Element* element)
+{
+ return element->hasTagName(HTMLNames::aTag);
+}
+
+inline HTMLAnchorElement* toHTMLAnchorElement(Node* node)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLAnchorElement(node));
+ return static_cast<HTMLAnchorElement*>(node);
+}
+
} // namespace WebCore
#endif // HTMLAnchorElement_h
« no previous file with comments | « Source/core/dom/VisitedLinkState.cpp ('k') | Source/core/page/DragController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698