mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Rename nsNameSpaceMap to nsXMLNameSpaceMap to avoid symbol collision in static builds (bug 281728). r=dbaron.
This commit is contained in:
parent
daf8a9bcb6
commit
59496a3bd0
@ -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 = \
|
||||
|
@ -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;
|
||||
};
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
@ -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.
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ public:
|
||||
nsCOMPtr<nsIURI> mSheetURI; // for error reports, etc.
|
||||
nsCOMPtr<nsIURI> mBaseURI; // for resolving relative URIs
|
||||
nsISupportsArray* mOrderedRules;
|
||||
nsAutoPtr<nsNameSpaceMap> mNameSpaceMap;
|
||||
nsAutoPtr<nsXMLNameSpaceMap> 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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user