mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 43644. Add 'wildcard' atom to nsLayoutAtoms and use it instead of a statically leaked atom. r=jst,inaky.gonzales@intel.com
This commit is contained in:
parent
fcfba9cd7c
commit
52056b5489
@ -32,10 +32,9 @@
|
||||
#include "nsLayoutAtoms.h"
|
||||
#include "nsHTMLAtoms.h" // XXX until atoms get factored into nsLayoutAtoms
|
||||
|
||||
nsIAtom* nsContentList::gWildCardAtom = nsnull;
|
||||
|
||||
nsContentList::nsContentList(nsIDocument *aDocument)
|
||||
{
|
||||
nsLayoutAtoms::AddRefAtoms();
|
||||
NS_INIT_REFCNT();
|
||||
mScriptObject = nsnull;
|
||||
mFunc = nsnull;
|
||||
@ -51,12 +50,10 @@ nsContentList::nsContentList(nsIDocument *aDocument,
|
||||
PRInt32 aMatchNameSpaceId,
|
||||
nsIContent* aRootContent)
|
||||
{
|
||||
nsLayoutAtoms::AddRefAtoms();
|
||||
mMatchAtom = aMatchAtom;
|
||||
NS_IF_ADDREF(mMatchAtom);
|
||||
if (nsnull == gWildCardAtom) {
|
||||
gWildCardAtom = NS_NewAtom("*");
|
||||
}
|
||||
if (gWildCardAtom == mMatchAtom) {
|
||||
if (nsLayoutAtoms::wildcard == mMatchAtom) {
|
||||
mMatchAll = PR_TRUE;
|
||||
}
|
||||
else {
|
||||
@ -74,6 +71,7 @@ nsContentList::nsContentList(nsIDocument *aDocument,
|
||||
const nsString* aData,
|
||||
nsIContent* aRootContent)
|
||||
{
|
||||
nsLayoutAtoms::AddRefAtoms();
|
||||
mFunc = aFunc;
|
||||
if (nsnull != aData) {
|
||||
mData = new nsString(*aData);
|
||||
@ -115,6 +113,7 @@ nsContentList::~nsContentList()
|
||||
if (nsnull != mData) {
|
||||
delete mData;
|
||||
}
|
||||
nsLayoutAtoms::ReleaseAtoms();
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kIDOMNodeListIID, NS_IDOMNODELIST_IID);
|
||||
|
@ -134,8 +134,6 @@ protected:
|
||||
PRBool ContainsRoot(nsIContent* aContent);
|
||||
nsresult CheckDocumentExistence();
|
||||
|
||||
static nsIAtom* gWildCardAtom;
|
||||
|
||||
nsIAtom* mMatchAtom;
|
||||
PRInt32 mMatchNameSpaceId;
|
||||
nsContentListMatchFunc mFunc;
|
||||
|
@ -164,6 +164,9 @@ LAYOUT_ATOM(onoverflow, "onoverflow")
|
||||
LAYOUT_ATOM(onunderflow, "onunderflow")
|
||||
LAYOUT_ATOM(onoverflowchanged, "onoverflowchanged")
|
||||
|
||||
// other
|
||||
LAYOUT_ATOM(wildcard, "*")
|
||||
|
||||
#ifdef DEBUG
|
||||
// Alphabetical list of atoms used by debugging code
|
||||
LAYOUT_ATOM(cellMap, "TableCellMap")
|
||||
|
@ -164,6 +164,9 @@ LAYOUT_ATOM(onoverflow, "onoverflow")
|
||||
LAYOUT_ATOM(onunderflow, "onunderflow")
|
||||
LAYOUT_ATOM(onoverflowchanged, "onoverflowchanged")
|
||||
|
||||
// other
|
||||
LAYOUT_ATOM(wildcard, "*")
|
||||
|
||||
#ifdef DEBUG
|
||||
// Alphabetical list of atoms used by debugging code
|
||||
LAYOUT_ATOM(cellMap, "TableCellMap")
|
||||
|
@ -164,6 +164,9 @@ LAYOUT_ATOM(onoverflow, "onoverflow")
|
||||
LAYOUT_ATOM(onunderflow, "onunderflow")
|
||||
LAYOUT_ATOM(onoverflowchanged, "onoverflowchanged")
|
||||
|
||||
// other
|
||||
LAYOUT_ATOM(wildcard, "*")
|
||||
|
||||
#ifdef DEBUG
|
||||
// Alphabetical list of atoms used by debugging code
|
||||
LAYOUT_ATOM(cellMap, "TableCellMap")
|
||||
|
@ -32,10 +32,9 @@
|
||||
#include "nsLayoutAtoms.h"
|
||||
#include "nsHTMLAtoms.h" // XXX until atoms get factored into nsLayoutAtoms
|
||||
|
||||
nsIAtom* nsContentList::gWildCardAtom = nsnull;
|
||||
|
||||
nsContentList::nsContentList(nsIDocument *aDocument)
|
||||
{
|
||||
nsLayoutAtoms::AddRefAtoms();
|
||||
NS_INIT_REFCNT();
|
||||
mScriptObject = nsnull;
|
||||
mFunc = nsnull;
|
||||
@ -51,12 +50,10 @@ nsContentList::nsContentList(nsIDocument *aDocument,
|
||||
PRInt32 aMatchNameSpaceId,
|
||||
nsIContent* aRootContent)
|
||||
{
|
||||
nsLayoutAtoms::AddRefAtoms();
|
||||
mMatchAtom = aMatchAtom;
|
||||
NS_IF_ADDREF(mMatchAtom);
|
||||
if (nsnull == gWildCardAtom) {
|
||||
gWildCardAtom = NS_NewAtom("*");
|
||||
}
|
||||
if (gWildCardAtom == mMatchAtom) {
|
||||
if (nsLayoutAtoms::wildcard == mMatchAtom) {
|
||||
mMatchAll = PR_TRUE;
|
||||
}
|
||||
else {
|
||||
@ -74,6 +71,7 @@ nsContentList::nsContentList(nsIDocument *aDocument,
|
||||
const nsString* aData,
|
||||
nsIContent* aRootContent)
|
||||
{
|
||||
nsLayoutAtoms::AddRefAtoms();
|
||||
mFunc = aFunc;
|
||||
if (nsnull != aData) {
|
||||
mData = new nsString(*aData);
|
||||
@ -115,6 +113,7 @@ nsContentList::~nsContentList()
|
||||
if (nsnull != mData) {
|
||||
delete mData;
|
||||
}
|
||||
nsLayoutAtoms::ReleaseAtoms();
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kIDOMNodeListIID, NS_IDOMNODELIST_IID);
|
||||
|
@ -134,8 +134,6 @@ protected:
|
||||
PRBool ContainsRoot(nsIContent* aContent);
|
||||
nsresult CheckDocumentExistence();
|
||||
|
||||
static nsIAtom* gWildCardAtom;
|
||||
|
||||
nsIAtom* mMatchAtom;
|
||||
PRInt32 mMatchNameSpaceId;
|
||||
nsContentListMatchFunc mFunc;
|
||||
|
Loading…
Reference in New Issue
Block a user