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

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

Issue 18259016: Introduce isHTMLLabelElement and toHTMLLabelElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Took tkent's comment into consideration 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/TreeScope.cpp ('k') | Source/core/html/LabelsNodeList.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLLabelElement.h
diff --git a/Source/core/html/HTMLLabelElement.h b/Source/core/html/HTMLLabelElement.h
index 4e239ed2f9c2d9ab47fa4af4ae055be262ce690e..4c11115218a98206c8ba0f6308560295af9854ad 100644
--- a/Source/core/html/HTMLLabelElement.h
+++ b/Source/core/html/HTMLLabelElement.h
@@ -55,6 +55,22 @@ private:
virtual void focus(bool restorePreviousSelection, FocusDirection) OVERRIDE;
};
+inline bool isHTMLLabelElement(const Node* node)
+{
+ return node->hasTagName(HTMLNames::labelTag);
+}
+
+inline bool isHTMLLabelElement(const Element* element)
+{
+ return element->hasTagName(HTMLNames::labelTag);
+}
+
+inline HTMLLabelElement* toHTMLLabelElement(Node* node)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLLabelElement(node));
+ return static_cast<HTMLLabelElement*>(node);
+}
+
} //namespace
#endif
« no previous file with comments | « Source/core/dom/TreeScope.cpp ('k') | Source/core/html/LabelsNodeList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698