зеркало из https://github.com/mozilla/pjs.git
Bug 614171 part 5. Inline the cheap Equals() methods on nsINodeInfo. r=sicking
This commit is contained in:
Родитель
673e82e321
Коммит
bb79ff6e4c
|
@ -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
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче