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

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

Issue 471173003: Introduce HasHTMLTagName functor and use it with ElementTraversal (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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/html/HTMLTableElement.cpp » ('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 590b8eff543b5b1692d5a03681e742c48e930649..744acd84453149a7b0e92af5faf3ba6043d24f8c 100644
--- a/Source/core/html/HTMLElement.h
+++ b/Source/core/html/HTMLElement.h
@@ -149,6 +149,14 @@ inline bool Node::hasTagName(const HTMLQualifiedName& name) const
return isHTMLElement() && toHTMLElement(*this).hasTagName(name);
}
+class HasHTMLTagName {
adamk 2014/08/14 20:15:10 Please add a comment here explaining what this is
Inactive 2014/08/14 20:21:39 Done.
+public:
+ explicit HasHTMLTagName(const HTMLQualifiedName& tagName): m_tagName(tagName) { }
+ bool operator() (const HTMLElement& element) const { return element.hasTagName(m_tagName); }
+private:
+ const HTMLQualifiedName& m_tagName;
+};
+
// This requires isHTML*Element(const Element&) and isHTML*Element(const HTMLElement&).
// When the input element is an HTMLElement, we don't need to check the namespace URI, just the local name.
#define DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) \
« no previous file with comments | « no previous file | Source/core/html/HTMLTableElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698