diff --git a/content/base/public/nsINodeInfo.h b/content/base/public/nsINodeInfo.h index 205fe5c1185..2520899cbfc 100644 --- a/content/base/public/nsINodeInfo.h +++ b/content/base/public/nsINodeInfo.h @@ -72,8 +72,8 @@ class nsIPrincipal; // IID for the nsINodeInfo interface #define NS_INODEINFO_IID \ -{ 0xdfb15226, 0x79ad, 0x4c7c, \ - { 0x9d, 0x73, 0x3d, 0xbc, 0x13, 0x17, 0x02, 0x74 } } +{ 0xc5188ea1, 0x0a9c, 0x43e6, \ + { 0x95, 0x90, 0xcc, 0x43, 0x6b, 0xe9, 0xcf, 0xa0 } } class nsINodeInfo : public nsISupports { @@ -254,13 +254,30 @@ public: return mInner.mNamespaceID == aNamespaceID; } - virtual PRBool Equals(const nsAString& aName) const = 0; - virtual PRBool Equals(const nsAString& aName, - const nsAString& aPrefix) const = 0; - virtual PRBool Equals(const nsAString& aName, - PRInt32 aNamespaceID) const = 0; - virtual PRBool Equals(const nsAString& aName, const nsAString& aPrefix, - PRInt32 aNamespaceID) const = 0; + PRBool Equals(const nsAString& aName) const + { + return mInner.mName->Equals(aName); + } + + PRBool Equals(const nsAString& aName, const nsAString& aPrefix) const + { + return mInner.mName->Equals(aName) && + (mInner.mPrefix ? mInner.mPrefix->Equals(aPrefix) : aPrefix.IsEmpty()); + } + + PRBool Equals(const nsAString& aName, PRInt32 aNamespaceID) const + { + return mInner.mNamespaceID == aNamespaceID && + mInner.mName->Equals(aName); + } + + PRBool Equals(const nsAString& aName, const nsAString& aPrefix, + PRInt32 aNamespaceID) const + { + return mInner.mName->Equals(aName) && mInner.mNamespaceID == aNamespaceID && + (mInner.mPrefix ? mInner.mPrefix->Equals(aPrefix) : aPrefix.IsEmpty()); + } + virtual PRBool NamespaceEquals(const nsAString& aNamespaceURI) const = 0; PRBool QualifiedNameEquals(nsIAtom* aNameAtom) const diff --git a/content/base/src/nsNodeInfo.cpp b/content/base/src/nsNodeInfo.cpp index 1bee1a78c21..91136332290 100644 --- a/content/base/src/nsNodeInfo.cpp +++ b/content/base/src/nsNodeInfo.cpp @@ -208,49 +208,6 @@ nsNodeInfo::GetNamespaceURI(nsAString& aNameSpaceURI) const } -PRBool -nsNodeInfo::Equals(const nsAString& aName) const -{ - return mInner.mName->Equals(aName); -} - - -PRBool -nsNodeInfo::Equals(const nsAString& aName, const nsAString& aPrefix) const -{ - if (!mInner.mName->Equals(aName)) { - return PR_FALSE; - } - - if (!mInner.mPrefix) { - return aPrefix.IsEmpty(); - } - - return mInner.mPrefix->Equals(aPrefix); -} - - -PRBool -nsNodeInfo::Equals(const nsAString& aName, PRInt32 aNamespaceID) const -{ - return mInner.mNamespaceID == aNamespaceID && - mInner.mName->Equals(aName); -} - - -PRBool -nsNodeInfo::Equals(const nsAString& aName, const nsAString& aPrefix, - PRInt32 aNamespaceID) const -{ - if (!mInner.mNamespaceID == aNamespaceID || - !mInner.mName->Equals(aName)) - return PR_FALSE; - - return mInner.mPrefix ? mInner.mPrefix->Equals(aPrefix) : - aPrefix.IsEmpty(); -} - - PRBool nsNodeInfo::NamespaceEquals(const nsAString& aNamespaceURI) const { diff --git a/content/base/src/nsNodeInfo.h b/content/base/src/nsNodeInfo.h index 61a40793001..cee6d8df991 100644 --- a/content/base/src/nsNodeInfo.h +++ b/content/base/src/nsNodeInfo.h @@ -60,12 +60,6 @@ public: // nsINodeInfo virtual nsresult GetNamespaceURI(nsAString& aNameSpaceURI) const; - virtual PRBool Equals(const nsAString& aName) const; - virtual PRBool Equals(const nsAString& aName, - const nsAString& aPrefix) const; - virtual PRBool Equals(const nsAString& aName, PRInt32 aNamespaceID) const; - virtual PRBool Equals(const nsAString& aName, const nsAString& aPrefix, - PRInt32 aNamespaceID) const; virtual PRBool NamespaceEquals(const nsAString& aNamespaceURI) const; // nsNodeInfo