From bacbce51475fd77fa19b79e7a0a76f7883c1ac18 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 cf39ad9b637..4cbde8eb612 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() {}