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

Unified Diff: Source/build/scripts/templates/ElementTypeHelpers.h.tmpl

Issue 192293002: Use new is*Element() helper functions in DOM code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | « no previous file | Source/core/dom/ContainerNode.cpp » ('j') | Source/core/dom/ContainerNode.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/build/scripts/templates/ElementTypeHelpers.h.tmpl
diff --git a/Source/build/scripts/templates/ElementTypeHelpers.h.tmpl b/Source/build/scripts/templates/ElementTypeHelpers.h.tmpl
index f4c6b20cf3ec1d23c360cb4e3d8f95bb4f927e2f..fb22148f6110b9ad6bbc13b252e4cfcfa7af9766 100644
--- a/Source/build/scripts/templates/ElementTypeHelpers.h.tmpl
+++ b/Source/build/scripts/templates/ElementTypeHelpers.h.tmpl
@@ -27,6 +27,7 @@ inline bool is{{tag.interface}}(const Element& element) {
return element.hasTagName({{namespace}}Names::{{tag|symbol}}Tag);
}
inline bool is{{tag.interface}}(const Element* element) { return element && is{{tag.interface}}(*element); }
+template<typename T> inline bool is{{tag.interface}}(const RefPtr<T>& node) { return is{{tag.interface}}(node.get()); }
adamk 2014/03/10 18:23:24 This seems possibly-dangerous, as passing a PassRe
Inactive 2014/03/10 18:28:29 You are right, I believe we had the exact same dis
inline bool is{{tag.interface}}(const Node& node) { return node.isElementNode() ? is{{tag.interface}}(toElement(node)) : false; }
inline bool is{{tag.interface}}(const Node* node) { return node && node->isElementNode() ? is{{tag.interface}}(*toElement(node)) : false; }
template <> inline bool isElementOfType<const {{tag.interface}}>(const Element& element) { return is{{tag.interface}}(element); }
« no previous file with comments | « no previous file | Source/core/dom/ContainerNode.cpp » ('j') | Source/core/dom/ContainerNode.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698