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

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

Issue 27142002: Use DEFINE_NODE_TYPE_CASTS instead of using manual toHTMLFooElement() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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/HTMLDivElement.h ('k') | Source/core/html/HTMLFieldSetElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLElement.h
diff --git a/Source/core/html/HTMLElement.h b/Source/core/html/HTMLElement.h
index 9c56c7815f4640294663e60b19a2d6dbd76561ec..e58a25efc436ccc9a8fc7a16bda9fcf0e1e22b3c 100644
--- a/Source/core/html/HTMLElement.h
+++ b/Source/core/html/HTMLElement.h
@@ -136,20 +136,7 @@ private:
bool supportsSpatialNavigationFocus() const;
};
-inline HTMLElement* toHTMLElement(Node* node)
-{
- ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isHTMLElement());
- return static_cast<HTMLElement*>(node);
-}
-
-inline const HTMLElement* toHTMLElement(const Node* node)
-{
- ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isHTMLElement());
- return static_cast<const HTMLElement*>(node);
-}
-
-// This will catch anyone doing an unnecessary cast.
-void toHTMLElement(const HTMLElement*);
+DEFINE_NODE_TYPE_CASTS(HTMLElement, isHTMLElement());
inline HTMLElement::HTMLElement(const QualifiedName& tagName, Document& document, ConstructionType type = CreateHTMLElement)
: Element(tagName, &document, type)
« no previous file with comments | « Source/core/html/HTMLDivElement.h ('k') | Source/core/html/HTMLFieldSetElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698