diff --git a/content/base/public/Makefile.in b/content/base/public/Makefile.in index 471407f033cf..0ce53157ba25 100644 --- a/content/base/public/Makefile.in +++ b/content/base/public/Makefile.in @@ -56,7 +56,6 @@ nsContentUtils.h \ nsIDocument.h \ nsIDocumentEncoder.h \ nsIDocumentObserver.h \ -nsNameSpaceMap.h \ nsINameSpaceManager.h \ nsINodeInfo.h \ nsIRangeUtils.h \ @@ -72,6 +71,7 @@ mozISanitizingSerializer.h \ nsContentCID.h \ nsCopySupport.h \ nsContentCreatorFunctions.h \ +nsXMLNameSpaceMap.h \ $(NULL) SDK_XPIDLSRCS = \ diff --git a/content/base/public/nsNameSpaceMap.h b/content/base/public/nsXMLNameSpaceMap.h similarity index 87% rename from content/base/public/nsNameSpaceMap.h rename to content/base/public/nsXMLNameSpaceMap.h index 80b33929703a..411a2d5f2ca9 100755 --- a/content/base/public/nsNameSpaceMap.h +++ b/content/base/public/nsXMLNameSpaceMap.h @@ -36,25 +36,25 @@ * * ***** END LICENSE BLOCK ***** */ -#ifndef nsNameSpaceMap_h_ -#define nsNameSpaceMap_h_ +#ifndef nsXMLNameSpaceMap_h_ +#define nsXMLNameSpaceMap_h_ #include "nsVoidArray.h" class nsIAtom; /** - * nsNameSpaceMap contains a set of prefixes which are mapped onto namespaces. - * It allows the set to be searched by prefix or by namespace ID. + * nsXMLNameSpaceMap contains a set of prefixes which are mapped onto + * namespaces. It allows the set to be searched by prefix or by namespace ID. */ -class nsNameSpaceMap +class nsXMLNameSpaceMap { public: /** - * Allocates a new nsNameSpaceMap (with new()) and initializes it with the + * Allocates a new nsXMLNameSpaceMap (with new()) and initializes it with the * xmlns and xml namespaces. */ - static NS_HIDDEN_(nsNameSpaceMap*) Create(); + static NS_HIDDEN_(nsXMLNameSpaceMap*) Create(); /** * Add a prefix and its corresponding namespace ID to the map. @@ -89,10 +89,10 @@ public: /* Removes all prefix mappings. */ NS_HIDDEN_(void) Clear(); - ~nsNameSpaceMap() { Clear(); } + ~nsXMLNameSpaceMap() { Clear(); } private: - nsNameSpaceMap() NS_HIDDEN; // use Create() to create new instances + nsXMLNameSpaceMap() NS_HIDDEN; // use Create() to create new instances nsVoidArray mNameSpaces; }; diff --git a/content/base/src/Makefile.in b/content/base/src/Makefile.in index c1c1393dcbf4..b525518a44ca 100644 --- a/content/base/src/Makefile.in +++ b/content/base/src/Makefile.in @@ -111,7 +111,6 @@ CPPSRCS = \ nsImageLoadingContent.cpp \ nsMappedAttributes.cpp \ nsNameSpaceManager.cpp \ - nsNameSpaceMap.cpp \ nsNodeInfo.cpp \ nsNodeInfoManager.cpp \ nsParserUtils.cpp \ @@ -127,6 +126,7 @@ CPPSRCS = \ nsTextNode.cpp \ nsTreeWalker.cpp \ nsXMLContentSerializer.cpp \ + nsXMLNameSpaceMap.cpp \ $(NULL) # we don't want the shared lib, but we want to force the creation of a diff --git a/content/base/src/nsNameSpaceMap.cpp b/content/base/src/nsXMLNameSpaceMap.cpp similarity index 90% rename from content/base/src/nsNameSpaceMap.cpp rename to content/base/src/nsXMLNameSpaceMap.cpp index 8652f3ca117a..7149753ab765 100755 --- a/content/base/src/nsNameSpaceMap.cpp +++ b/content/base/src/nsXMLNameSpaceMap.cpp @@ -36,7 +36,7 @@ * * ***** END LICENSE BLOCK ***** */ -#include "nsNameSpaceMap.h" +#include "nsXMLNameSpaceMap.h" #include "nsIAtom.h" #include "nsCOMPtr.h" #include "nsINameSpaceManager.h" @@ -52,10 +52,10 @@ struct nsNameSpaceEntry PRInt32 nameSpaceID; }; -/* static */ nsNameSpaceMap* -nsNameSpaceMap::Create() +/* static */ nsXMLNameSpaceMap* +nsXMLNameSpaceMap::Create() { - nsNameSpaceMap *map = new nsNameSpaceMap(); + nsXMLNameSpaceMap *map = new nsXMLNameSpaceMap(); NS_ENSURE_TRUE(map, nsnull); nsresult rv = map->AddPrefix(nsLayoutAtoms::xmlnsNameSpace, @@ -70,13 +70,13 @@ nsNameSpaceMap::Create() return map; } -nsNameSpaceMap::nsNameSpaceMap() +nsXMLNameSpaceMap::nsXMLNameSpaceMap() : mNameSpaces(4) { } nsresult -nsNameSpaceMap::AddPrefix(nsIAtom *aPrefix, PRInt32 aNameSpaceID) +nsXMLNameSpaceMap::AddPrefix(nsIAtom *aPrefix, PRInt32 aNameSpaceID) { PRInt32 count = mNameSpaces.Count(); nsNameSpaceEntry *foundEntry = nsnull; @@ -108,7 +108,7 @@ nsNameSpaceMap::AddPrefix(nsIAtom *aPrefix, PRInt32 aNameSpaceID) } nsresult -nsNameSpaceMap::AddPrefix(nsIAtom *aPrefix, nsString &aURI) +nsXMLNameSpaceMap::AddPrefix(nsIAtom *aPrefix, nsString &aURI) { PRInt32 id; nsresult rv = nsContentUtils::GetNSManagerWeakRef()->RegisterNameSpace(aURI, @@ -120,7 +120,7 @@ nsNameSpaceMap::AddPrefix(nsIAtom *aPrefix, nsString &aURI) } void -nsNameSpaceMap::RemovePrefix(nsIAtom *aPrefix) +nsXMLNameSpaceMap::RemovePrefix(nsIAtom *aPrefix) { PRInt32 count = mNameSpaces.Count(); @@ -138,7 +138,7 @@ nsNameSpaceMap::RemovePrefix(nsIAtom *aPrefix) } PRInt32 -nsNameSpaceMap::FindNameSpaceID(nsIAtom *aPrefix) const +nsXMLNameSpaceMap::FindNameSpaceID(nsIAtom *aPrefix) const { PRInt32 count = mNameSpaces.Count(); @@ -160,7 +160,7 @@ nsNameSpaceMap::FindNameSpaceID(nsIAtom *aPrefix) const } nsIAtom* -nsNameSpaceMap::FindPrefix(PRInt32 aNameSpaceID) const +nsXMLNameSpaceMap::FindPrefix(PRInt32 aNameSpaceID) const { PRInt32 count = mNameSpaces.Count(); @@ -185,7 +185,7 @@ PR_STATIC_CALLBACK(PRBool) DeleteEntry(void *aElement, void *aData) } void -nsNameSpaceMap::Clear() +nsXMLNameSpaceMap::Clear() { mNameSpaces.EnumerateForwards(DeleteEntry, nsnull); } diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index 9014e25dd332..845013274e3d 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -68,7 +68,7 @@ #include "nsCSSPseudoElements.h" #include "nsCSSAnonBoxes.h" #include "nsINameSpaceManager.h" -#include "nsNameSpaceMap.h" +#include "nsXMLNameSpaceMap.h" #include "nsThemeConstants.h" #include "nsContentErrors.h" #include "nsUnitConversion.h" @@ -367,7 +367,7 @@ protected: }; nsCSSSection mSection; - nsNameSpaceMap *mNameSpaceMap; // weak, mSheet owns it + nsXMLNameSpaceMap *mNameSpaceMap; // weak, mSheet owns it // After an UngetToken is done this flag is true. The next call to // GetToken clears the flag. diff --git a/layout/style/nsCSSStyleRule.cpp b/layout/style/nsCSSStyleRule.cpp index 3b589f9af6a0..7ab0d98b99bf 100644 --- a/layout/style/nsCSSStyleRule.cpp +++ b/layout/style/nsCSSStyleRule.cpp @@ -61,7 +61,7 @@ #include "nsIDOMCSSStyleDeclaration.h" #include "nsDOMCSSDeclaration.h" #include "nsINameSpaceManager.h" -#include "nsNameSpaceMap.h" +#include "nsXMLNameSpaceMap.h" #include "nsILookAndFeel.h" #include "nsRuleNode.h" #include "nsUnicharUtils.h" @@ -580,7 +580,7 @@ void nsCSSSelector::ToStringInternal(nsAString& aString, // before it. aString.Append(PRUnichar('|')); } else { - nsNameSpaceMap *sheetNS = aSheet->GetNameSpaceMap(); + nsXMLNameSpaceMap *sheetNS = aSheet->GetNameSpaceMap(); // sheetNS is non-null if and only if we had an @namespace rule. If it's // null, that means that the only namespaces we could have are the @@ -669,7 +669,7 @@ void nsCSSSelector::ToStringInternal(nsAString& aString, aString.Append(PRUnichar('[')); // Append the namespace prefix if (list->mNameSpace > 0) { - nsNameSpaceMap *sheetNS = aSheet->GetNameSpaceMap(); + nsXMLNameSpaceMap *sheetNS = aSheet->GetNameSpaceMap(); // will return null if namespace was the default nsIAtom *prefixAtom = sheetNS->FindPrefix(list->mNameSpace); if (prefixAtom) { diff --git a/layout/style/nsCSSStyleSheet.cpp b/layout/style/nsCSSStyleSheet.cpp index e795f2529c81..35ef34aabafb 100644 --- a/layout/style/nsCSSStyleSheet.cpp +++ b/layout/style/nsCSSStyleSheet.cpp @@ -86,7 +86,7 @@ #include "nsRuleWalker.h" #include "nsCSSPseudoClasses.h" #include "nsINameSpaceManager.h" -#include "nsNameSpaceMap.h" +#include "nsXMLNameSpaceMap.h" #include "nsITextContent.h" #include "prlog.h" #include "nsCOMPtr.h" @@ -1317,8 +1317,8 @@ CreateNameSpace(nsISupports* aRule, void* aNameSpacePtr) rule->GetType(type); if (nsICSSRule::NAMESPACE_RULE == type) { nsICSSNameSpaceRule* nameSpaceRule = (nsICSSNameSpaceRule*)rule; - nsNameSpaceMap *nameSpaceMap = - NS_STATIC_CAST(nsNameSpaceMap*, aNameSpacePtr); + nsXMLNameSpaceMap *nameSpaceMap = + NS_STATIC_CAST(nsXMLNameSpaceMap*, aNameSpacePtr); nsIAtom* prefix = nsnull; nsAutoString urlSpec; @@ -1339,7 +1339,7 @@ nsCSSStyleSheetInner::RebuildNameSpaces() if (mNameSpaceMap) { mNameSpaceMap->Clear(); } else { - mNameSpaceMap = nsNameSpaceMap::Create(); + mNameSpaceMap = nsXMLNameSpaceMap::Create(); if (!mNameSpaceMap) { return; // out of memory } @@ -1870,7 +1870,7 @@ nsCSSStyleSheet::AppendStyleRule(nsICSSRule* aRule) aRule->GetType(type); if (nsICSSRule::NAMESPACE_RULE == type) { if (!mInner->mNameSpaceMap) { - mInner->mNameSpaceMap = nsNameSpaceMap::Create(); + mInner->mNameSpaceMap = nsXMLNameSpaceMap::Create(); NS_ENSURE_TRUE(mInner->mNameSpaceMap, NS_ERROR_OUT_OF_MEMORY); } @@ -1946,7 +1946,7 @@ nsCSSStyleSheet::GetStyleRuleAt(PRInt32 aIndex, nsICSSRule*& aRule) const return result; } -nsNameSpaceMap* +nsXMLNameSpaceMap* nsCSSStyleSheet::GetNameSpaceMap() const { if (mInner) @@ -2486,7 +2486,7 @@ nsCSSStyleSheet::InsertRule(const nsAString& aRule, cssRule->GetType(type); if (type == nsICSSRule::NAMESPACE_RULE) { if (!mInner->mNameSpaceMap) { - mInner->mNameSpaceMap = nsNameSpaceMap::Create(); + mInner->mNameSpaceMap = nsXMLNameSpaceMap::Create(); NS_ENSURE_TRUE(mInner->mNameSpaceMap, NS_ERROR_OUT_OF_MEMORY); } diff --git a/layout/style/nsCSSStyleSheet.h b/layout/style/nsCSSStyleSheet.h index af89bdc2b20c..11cad8e3e984 100644 --- a/layout/style/nsCSSStyleSheet.h +++ b/layout/style/nsCSSStyleSheet.h @@ -73,7 +73,7 @@ public: nsCOMPtr mSheetURI; // for error reports, etc. nsCOMPtr mBaseURI; // for resolving relative URIs nsISupportsArray* mOrderedRules; - nsAutoPtr mNameSpaceMap; + nsAutoPtr mNameSpaceMap; PRPackedBool mComplete; }; @@ -138,7 +138,7 @@ public: NS_IMETHOD SetOwningNode(nsIDOMNode* aOwningNode); NS_IMETHOD SetOwnerRule(nsICSSImportRule* aOwnerRule); NS_IMETHOD GetOwnerRule(nsICSSImportRule** aOwnerRule); - virtual NS_HIDDEN_(nsNameSpaceMap*) GetNameSpaceMap() const; + virtual NS_HIDDEN_(nsXMLNameSpaceMap*) GetNameSpaceMap() const; NS_IMETHOD Clone(nsICSSStyleSheet* aCloneParent, nsICSSImportRule* aCloneOwnerRule, nsIDocument* aCloneDocument, diff --git a/layout/style/nsICSSStyleSheet.h b/layout/style/nsICSSStyleSheet.h index d773e0c0a953..6972f60996f1 100644 --- a/layout/style/nsICSSStyleSheet.h +++ b/layout/style/nsICSSStyleSheet.h @@ -42,7 +42,7 @@ class nsICSSRule; class nsIDOMNode; -class nsNameSpaceMap; +class nsXMLNameSpaceMap; class nsCSSRuleProcessor; class nsIMediaList; class nsICSSGroupRule; @@ -92,7 +92,7 @@ public: NS_IMETHOD GetOwnerRule(nsICSSImportRule** aOwnerRule) = 0; // get namespace map for sheet - virtual NS_HIDDEN_(nsNameSpaceMap*) GetNameSpaceMap() const = 0; + virtual NS_HIDDEN_(nsXMLNameSpaceMap*) GetNameSpaceMap() const = 0; NS_IMETHOD Clone(nsICSSStyleSheet* aCloneParent, nsICSSImportRule* aCloneOwnerRule,