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

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

Issue 17381010: Introduce toHTMLFormControlElement, and use it. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 6 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/html/HTMLFieldSetElement.cpp ('k') | Source/core/html/HTMLFormControlElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLFormControlElement.h
diff --git a/Source/core/html/HTMLFormControlElement.h b/Source/core/html/HTMLFormControlElement.h
index 27f8656b90e9bb5d445d37a02cb66344e402dba1..afdafdeb1f6d53062ab552dceb3f515488f203d0 100644
--- a/Source/core/html/HTMLFormControlElement.h
+++ b/Source/core/html/HTMLFormControlElement.h
@@ -171,6 +171,18 @@ private:
bool m_hasAutofocused : 1;
};
+inline HTMLFormControlElement* toHTMLFormControlElement(Node* node)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!node || (node->isElementNode() && toElement(node)->isFormControlElement()));
+ return static_cast<HTMLFormControlElement*>(node);
+}
+
+inline HTMLFormControlElement* toHTMLFormControlElement(FormAssociatedElement* control)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!control || control->isFormControlElement());
+ return static_cast<HTMLFormControlElement*>(control);
+}
+
} // namespace
#endif
« no previous file with comments | « Source/core/html/HTMLFieldSetElement.cpp ('k') | Source/core/html/HTMLFormControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698