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

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

Issue 18970003: Introduce isHTMLOptGroupElement and toHTMLOptGroupElement (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/css/resolver/StyleResolver.cpp ('k') | Source/core/html/HTMLOptionElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLOptGroupElement.h
diff --git a/Source/core/html/HTMLOptGroupElement.h b/Source/core/html/HTMLOptGroupElement.h
index e3360f90410d2831df5b281025795942a38c394b..ccf6758b2c666d812a65a39f78c14eb9764a6aa8 100644
--- a/Source/core/html/HTMLOptGroupElement.h
+++ b/Source/core/html/HTMLOptGroupElement.h
@@ -63,6 +63,22 @@ private:
RefPtr<RenderStyle> m_style;
};
+inline bool isHTMLOptGroupElement(const Node* node)
+{
+ return node->hasTagName(HTMLNames::optgroupTag);
+}
+
+inline bool isHTMLOptGroupElement(const Element* element)
+{
+ return element->hasTagName(HTMLNames::optgroupTag);
+}
+
+inline HTMLOptGroupElement* toHTMLOptGroupElement(Node* node)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLOptGroupElement(node));
+ return static_cast<HTMLOptGroupElement*>(node);
+}
+
} //namespace
#endif
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | Source/core/html/HTMLOptionElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698