From aa050b233624834d565a9f86db7ae6618bbd0e38 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Tue, 3 Mar 2015 11:09:01 +0000 Subject: [PATCH] Bug 1134280 - Get rid of Tag() - patch 5 - nsGenericHTMLElement::IsHTMLElement, r=smaug --- dom/html/nsGenericHTMLElement.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dom/html/nsGenericHTMLElement.h b/dom/html/nsGenericHTMLElement.h index cf39ad9b6372..4cbde8eb612a 100644 --- a/dom/html/nsGenericHTMLElement.h +++ b/dom/html/nsGenericHTMLElement.h @@ -291,6 +291,25 @@ public: return rcFrame.height; } + // These methods are already implemented in nsIContent but we want something + // faster for HTMLElements ignoring the namespace checking. + // This is safe because we already know that we are in the HTML namespace. + inline bool IsHTMLElement() const + { + return true; + } + + inline bool IsHTMLElement(nsIAtom* aTag) const + { + return mNodeInfo->Equals(aTag); + } + + template + inline bool IsAnyOfHTMLElements(First aFirst, Args... aArgs) const + { + return IsNodeInternal(aFirst, aArgs...); + } + protected: virtual ~nsGenericHTMLElement() {}