bug 450777:deCOMtaminate nsNodeInfoManager::GetNodeInfo r+sr=jst

This commit is contained in:
Taras Glek 2008-09-12 15:32:18 -07:00
parent 2082181641
commit c26ce8e1ab
42 changed files with 192 additions and 254 deletions

View File

@ -692,8 +692,9 @@ public:
{
nsNodeInfoManager *niMgr = aNodeInfo->NodeInfoManager();
return niMgr->GetNodeInfo(aName, aNodeInfo->GetPrefixAtom(),
aNodeInfo->NamespaceID(), aResult);
*aResult = niMgr->GetNodeInfo(aName, aNodeInfo->GetPrefixAtom(),
aNodeInfo->NamespaceID()).get();
return *aResult ? NS_OK : NS_ERROR_FAILURE;
}
/**
@ -705,8 +706,9 @@ public:
{
nsNodeInfoManager *niMgr = aNodeInfo->NodeInfoManager();
return niMgr->GetNodeInfo(aNodeInfo->NameAtom(), aPrefix,
aNodeInfo->NamespaceID(), aResult);
*aResult = niMgr->GetNodeInfo(aNodeInfo->NameAtom(), aPrefix,
aNodeInfo->NamespaceID()).get();
return *aResult ? NS_OK : NS_ERROR_FAILURE;
}
/**

View File

@ -146,10 +146,10 @@ nsDOMAttribute::SetOwnerDocument(nsIDocument* aDocument)
}
nsCOMPtr<nsINodeInfo> newNodeInfo;
nsresult rv = aDocument->NodeInfoManager()->
newNodeInfo = aDocument->NodeInfoManager()->
GetNodeInfo(mNodeInfo->NameAtom(), mNodeInfo->GetPrefixAtom(),
mNodeInfo->NamespaceID(), getter_AddRefs(newNodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
mNodeInfo->NamespaceID());
NS_ENSURE_TRUE(newNodeInfo, NS_ERROR_FAILURE);
NS_ASSERTION(newNodeInfo, "GetNodeInfo lies");
mNodeInfo.swap(newNodeInfo);

View File

@ -384,9 +384,8 @@ nsDOMAttributeMap::Item(PRUint32 aIndex, nsIDOMNode** aReturn)
// Don't use the nodeinfo even if one exists since it can
// have the wrong owner document.
nsCOMPtr<nsINodeInfo> ni;
mContent->NodeInfo()->NodeInfoManager()->
GetNodeInfo(name->LocalName(), name->GetPrefix(), name->NamespaceID(),
getter_AddRefs(ni));
ni = mContent->NodeInfo()->NodeInfoManager()->
GetNodeInfo(name->LocalName(), name->GetPrefix(), name->NamespaceID());
NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE);
return GetAttribute(ni, aReturn);
@ -454,9 +453,8 @@ nsDOMAttributeMap::GetNamedItemNSInternal(const nsAString& aNamespaceURI,
if (nameSpaceID == attrNS &&
nameAtom->EqualsUTF8(utf8Name)) {
nsCOMPtr<nsINodeInfo> ni;
mContent->NodeInfo()->NodeInfoManager()->
GetNodeInfo(nameAtom, name->GetPrefix(), nameSpaceID,
getter_AddRefs(ni));
ni = mContent->NodeInfo()->NodeInfoManager()->
GetNodeInfo(nameAtom, name->GetPrefix(), nameSpaceID);
NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE);
return GetAttribute(ni, aReturn, aRemove);

View File

@ -85,9 +85,9 @@ NS_NewDOMDocumentType(nsIDOMDocumentType** aDocType,
}
nsCOMPtr<nsINodeInfo> ni;
rv = nimgr->GetNodeInfo(nsGkAtoms::documentTypeNodeName, nsnull,
kNameSpaceID_None, getter_AddRefs(ni));
NS_ENSURE_SUCCESS(rv, rv);
ni = nimgr->GetNodeInfo(nsGkAtoms::documentTypeNodeName, nsnull,
kNameSpaceID_None);
NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE);
*aDocType = new nsDOMDocumentType(ni, aName, aEntities, aNotations,
aPublicId, aSystemId, aInternalSubset);
@ -254,14 +254,13 @@ nsDOMDocumentType::BindToTree(nsIDocument *aDocument, nsIContent *aParent,
// break inserting DOMDocumentType nodes through other DOM methods
// though.
nsNodeInfoManager *nimgr = aParent ?
aParent->NodeInfo()->NodeInfoManager() :
aDocument->NodeInfoManager();
aParent->NodeInfo()->NodeInfoManager() :
aDocument->NodeInfoManager();
nsCOMPtr<nsINodeInfo> newNodeInfo;
nsresult rv = nimgr->GetNodeInfo(mNodeInfo->NameAtom(),
newNodeInfo = nimgr->GetNodeInfo(mNodeInfo->NameAtom(),
mNodeInfo->GetPrefixAtom(),
mNodeInfo->NamespaceID(),
getter_AddRefs(newNodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
mNodeInfo->NamespaceID());
NS_ENSURE_TRUE(newNodeInfo, NS_ERROR_FAILURE);
mNodeInfo.swap(newNodeInfo);
@ -273,8 +272,8 @@ nsDOMDocumentType::BindToTree(nsIDocument *aDocument, nsIContent *aParent,
JSContext *cx = nsnull;
JSObject *oldScope = nsnull, *newScope = nsnull;
rv = nsContentUtils::GetContextAndScopes(oldOwnerDoc, newOwnerDoc, &cx,
&oldScope, &newScope);
nsresult rv = nsContentUtils::GetContextAndScopes(oldOwnerDoc, newOwnerDoc, &cx,
&oldScope, &newScope);
if (cx && xpc) {
nsISupports *node = NS_ISUPPORTS_CAST(nsIContent*, this);
nsCOMPtr<nsIXPConnectJSObjectHolder> oldWrapper;

View File

@ -4447,8 +4447,8 @@ nsDocument::SetTitle(const nsAString& aTitle)
{
nsCOMPtr<nsINodeInfo> titleInfo;
mNodeInfoManager->GetNodeInfo(nsGkAtoms::title, nsnull,
kNameSpaceID_None, getter_AddRefs(titleInfo));
titleInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::title, nsnull,
kNameSpaceID_None);
if (!titleInfo)
return NS_OK;
title = NS_NewHTMLTitleElement(titleInfo);
@ -6159,7 +6159,6 @@ nsresult
nsDocument::CreateElem(nsIAtom *aName, nsIAtom *aPrefix, PRInt32 aNamespaceID,
PRBool aDocumentDefaultType, nsIContent **aResult)
{
nsresult rv;
#ifdef DEBUG
nsAutoString qName;
if (aPrefix) {
@ -6182,12 +6181,11 @@ nsDocument::CreateElem(nsIAtom *aName, nsIAtom *aPrefix, PRInt32 aNamespaceID,
*aResult = nsnull;
PRInt32 elementType = aDocumentDefaultType ? mDefaultElementType :
aNamespaceID;
aNamespaceID;
nsCOMPtr<nsINodeInfo> nodeInfo;
rv = mNodeInfoManager->GetNodeInfo(aName, aPrefix, aNamespaceID,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = mNodeInfoManager->GetNodeInfo(aName, aPrefix, aNamespaceID);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
return NS_NewElement(aResult, elementType, nodeInfo, PR_FALSE);
}

View File

@ -165,11 +165,9 @@ NS_NewDocumentFragment(nsIDOMDocumentFragment** aInstancePtrResult,
NS_ENSURE_ARG(aNodeInfoManager);
nsCOMPtr<nsINodeInfo> nodeInfo;
nsresult rv =
aNodeInfoManager->GetNodeInfo(nsGkAtoms::documentFragmentNodeName,
nsnull, kNameSpaceID_None,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = aNodeInfoManager->GetNodeInfo(nsGkAtoms::documentFragmentNodeName,
nsnull, kNameSpaceID_None);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
nsDocumentFragment *it = new nsDocumentFragment(nodeInfo);
if (!it) {

View File

@ -2994,8 +2994,8 @@ nsGenericElement::GetExistingAttrNameFromQName(const nsAString& aStr) const
nsINodeInfo* nodeInfo;
if (name->IsAtom()) {
mNodeInfo->NodeInfoManager()->GetNodeInfo(name->Atom(), nsnull,
kNameSpaceID_None, &nodeInfo);
nodeInfo = mNodeInfo->NodeInfoManager()->GetNodeInfo(name->Atom(), nsnull,
kNameSpaceID_None).get();
}
else {
NS_ADDREF(nodeInfo = name->NodeInfo());
@ -4317,10 +4317,9 @@ nsGenericElement::SetAttrAndNotify(PRInt32 aNamespaceID,
}
else {
nsCOMPtr<nsINodeInfo> ni;
rv = mNodeInfo->NodeInfoManager()->GetNodeInfo(aName, aPrefix,
aNamespaceID,
getter_AddRefs(ni));
NS_ENSURE_SUCCESS(rv, rv);
ni = mNodeInfo->NodeInfoManager()->GetNodeInfo(aName, aPrefix,
aNamespaceID);
NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE);
rv = mAttrsAndChildren.SetAndTakeAttr(ni, aParsedValue);
}

View File

@ -214,11 +214,11 @@ nsNodeInfoManager::DropDocumentReference()
}
nsresult
already_AddRefed<nsINodeInfo>
nsNodeInfoManager::GetNodeInfo(nsIAtom *aName, nsIAtom *aPrefix,
PRInt32 aNamespaceID, nsINodeInfo** aNodeInfo)
PRInt32 aNamespaceID)
{
NS_ENSURE_ARG_POINTER(aName);
NS_ENSURE_TRUE(aName, nsnull);
NS_ASSERTION(!aName->Equals(EmptyString()),
"Don't pass an empty string to GetNodeInfo, fix caller.");
@ -227,28 +227,27 @@ nsNodeInfoManager::GetNodeInfo(nsIAtom *aName, nsIAtom *aPrefix,
void *node = PL_HashTableLookup(mNodeInfoHash, &tmpKey);
if (node) {
*aNodeInfo = static_cast<nsINodeInfo *>(node);
nsINodeInfo* nodeInfo = static_cast<nsINodeInfo *>(node);
NS_ADDREF(*aNodeInfo);
NS_ADDREF(nodeInfo);
return NS_OK;
return nodeInfo;
}
nsNodeInfo *newNodeInfo = nsNodeInfo::Create();
NS_ENSURE_TRUE(newNodeInfo, NS_ERROR_OUT_OF_MEMORY);
NS_ADDREF(newNodeInfo);
nsRefPtr<nsNodeInfo> newNodeInfo = nsNodeInfo::Create();
NS_ENSURE_TRUE(newNodeInfo, nsnull);
nsresult rv = newNodeInfo->Init(aName, aPrefix, aNamespaceID, this);
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_SUCCESS(rv, nsnull);
PLHashEntry *he;
he = PL_HashTableAdd(mNodeInfoHash, &newNodeInfo->mInner, newNodeInfo);
NS_ENSURE_TRUE(he, NS_ERROR_OUT_OF_MEMORY);
NS_ENSURE_TRUE(he, nsnull);
*aNodeInfo = newNodeInfo;
nsNodeInfo *nodeInfo = nsnull;
newNodeInfo.swap(nodeInfo);
return NS_OK;
return nodeInfo;
}
@ -257,8 +256,8 @@ nsNodeInfoManager::GetNodeInfo(const nsAString& aName, nsIAtom *aPrefix,
PRInt32 aNamespaceID, nsINodeInfo** aNodeInfo)
{
nsCOMPtr<nsIAtom> name = do_GetAtom(aName);
return nsNodeInfoManager::GetNodeInfo(name, aPrefix, aNamespaceID,
aNodeInfo);
*aNodeInfo = nsNodeInfoManager::GetNodeInfo(name, aPrefix, aNamespaceID).get();
return *aNodeInfo ? NS_OK : NS_ERROR_FAILURE;
}
@ -301,15 +300,15 @@ nsNodeInfoManager::GetNodeInfo(const nsAString& aQualifiedName,
NS_ENSURE_SUCCESS(rv, rv);
}
return GetNodeInfo(nameAtom, prefixAtom, nsid, aNodeInfo);
*aNodeInfo = GetNodeInfo(nameAtom, prefixAtom, nsid).get();
return *aNodeInfo ? NS_OK : NS_ERROR_FAILURE;
}
already_AddRefed<nsINodeInfo>
nsNodeInfoManager::GetTextNodeInfo()
{
if (!mTextNodeInfo) {
GetNodeInfo(nsGkAtoms::textTagName, nsnull, kNameSpaceID_None,
&mTextNodeInfo);
mTextNodeInfo = GetNodeInfo(nsGkAtoms::textTagName, nsnull, kNameSpaceID_None).get();
}
else {
NS_ADDREF(mTextNodeInfo);
@ -322,8 +321,7 @@ already_AddRefed<nsINodeInfo>
nsNodeInfoManager::GetCommentNodeInfo()
{
if (!mCommentNodeInfo) {
GetNodeInfo(nsGkAtoms::commentTagName, nsnull, kNameSpaceID_None,
&mCommentNodeInfo);
mCommentNodeInfo = GetNodeInfo(nsGkAtoms::commentTagName, nsnull, kNameSpaceID_None).get();
}
else {
NS_ADDREF(mCommentNodeInfo);
@ -336,8 +334,7 @@ already_AddRefed<nsINodeInfo>
nsNodeInfoManager::GetDocumentNodeInfo()
{
if (!mDocumentNodeInfo) {
GetNodeInfo(nsGkAtoms::documentNodeName, nsnull, kNameSpaceID_None,
&mDocumentNodeInfo);
mDocumentNodeInfo = GetNodeInfo(nsGkAtoms::documentNodeName, nsnull, kNameSpaceID_None).get();
}
else {
NS_ADDREF(mDocumentNodeInfo);

View File

@ -85,8 +85,8 @@ public:
/**
* Methods for creating nodeinfo's from atoms and/or strings.
*/
nsresult GetNodeInfo(nsIAtom *aName, nsIAtom *aPrefix,
PRInt32 aNamespaceID, nsINodeInfo** aNodeInfo);
already_AddRefed<nsINodeInfo> GetNodeInfo(nsIAtom *aName, nsIAtom *aPrefix,
PRInt32 aNamespaceID);
nsresult GetNodeInfo(const nsAString& aName, nsIAtom *aPrefix,
PRInt32 aNamespaceID, nsINodeInfo** aNodeInfo);
nsresult GetNodeInfo(const nsAString& aQualifiedName,

View File

@ -516,11 +516,10 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, PRBool aClone, PRBool aDeep,
nsINodeInfo *nodeInfo = aNode->mNodeInfo;
nsCOMPtr<nsINodeInfo> newNodeInfo;
if (nodeInfoManager) {
rv = nodeInfoManager->GetNodeInfo(nodeInfo->NameAtom(),
nodeInfo->GetPrefixAtom(),
nodeInfo->NamespaceID(),
getter_AddRefs(newNodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
newNodeInfo = nodeInfoManager->GetNodeInfo(nodeInfo->NameAtom(),
nodeInfo->GetPrefixAtom(),
nodeInfo->NamespaceID());
NS_ENSURE_TRUE(newNodeInfo, NS_ERROR_FAILURE);
nodeInfo = newNodeInfo;
}

View File

@ -162,17 +162,15 @@ NS_NewHTMLImageElement(nsINodeInfo *aNodeInfo, PRBool aFromParser)
* if someone says "var img = new Image();" in JavaScript, in a case like
* that we request the nsINodeInfo from the document's nodeinfo list.
*/
nsresult rv;
nsCOMPtr<nsINodeInfo> nodeInfo(aNodeInfo);
if (!nodeInfo) {
nsCOMPtr<nsIDocument> doc =
do_QueryInterface(nsContentUtils::GetDocumentFromCaller());
NS_ENSURE_TRUE(doc, nsnull);
rv = doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::img, nsnull,
kNameSpaceID_None,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, nsnull);
nodeInfo = doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::img, nsnull,
kNameSpaceID_None);
NS_ENSURE_TRUE(nodeInfo, nsnull);
}
return new nsHTMLImageElement(nodeInfo);

View File

@ -145,17 +145,15 @@ NS_NewHTMLOptionElement(nsINodeInfo *aNodeInfo, PRBool aFromParser)
* if someone says "var opt = new Option();" in JavaScript, in a case like
* that we request the nsINodeInfo from the document's nodeinfo list.
*/
nsresult rv;
nsCOMPtr<nsINodeInfo> nodeInfo(aNodeInfo);
if (!nodeInfo) {
nsCOMPtr<nsIDocument> doc =
do_QueryInterface(nsContentUtils::GetDocumentFromCaller());
NS_ENSURE_TRUE(doc, nsnull);
rv = doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::option, nsnull,
kNameSpaceID_None,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, nsnull);
nodeInfo = doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::option, nsnull,
kNameSpaceID_None);
NS_ENSURE_TRUE(nodeInfo, nsnull);
}
return new nsHTMLOptionElement(nodeInfo);

View File

@ -545,8 +545,7 @@ HTMLContentSink::CreateContentObject(const nsIParserNode& aNode,
ToLowerCase(tmp);
nsCOMPtr<nsIAtom> name = do_GetAtom(tmp);
mNodeInfoManager->GetNodeInfo(name, nsnull, kNameSpaceID_None,
getter_AddRefs(nodeInfo));
nodeInfo = mNodeInfoManager->GetNodeInfo(name, nsnull, kNameSpaceID_None);
}
else if (mNodeInfoCache[aNodeType]) {
nodeInfo = mNodeInfoCache[aNodeType];
@ -559,8 +558,7 @@ HTMLContentSink::CreateContentObject(const nsIParserNode& aNode,
nsIAtom *name = parserService->HTMLIdToAtomTag(aNodeType);
NS_ASSERTION(name, "What? Reverse mapping of id to string broken!!!");
mNodeInfoManager->GetNodeInfo(name, nsnull, kNameSpaceID_None,
getter_AddRefs(nodeInfo));
nodeInfo = mNodeInfoManager->GetNodeInfo(name, nsnull, kNameSpaceID_None);
NS_IF_ADDREF(mNodeInfoCache[aNodeType] = nodeInfo);
}
@ -1704,10 +1702,9 @@ HTMLContentSink::Init(nsIDocument* aDoc,
mMaxTextRun = nsContentUtils::GetIntPref("content.maxtextrun", 8191);
nsCOMPtr<nsINodeInfo> nodeInfo;
rv = mNodeInfoManager->GetNodeInfo(nsGkAtoms::html, nsnull,
kNameSpaceID_None,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::html, nsnull,
kNameSpaceID_None);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
// Make root part
nsIContent *doc_root = mDocument->GetRootContent();
@ -1733,10 +1730,9 @@ HTMLContentSink::Init(nsIDocument* aDoc,
}
// Make head part
rv = mNodeInfoManager->GetNodeInfo(nsGkAtoms::head,
nsnull, kNameSpaceID_None,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::head,
nsnull, kNameSpaceID_None);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
mHead = NS_NewHTMLHeadElement(nodeInfo);
if (NS_FAILED(rv)) {
@ -2917,8 +2913,7 @@ HTMLContentSink::ProcessLINKTag(const nsIParserNode& aNode)
// Create content object
nsCOMPtr<nsIContent> element;
nsCOMPtr<nsINodeInfo> nodeInfo;
mNodeInfoManager->GetNodeInfo(nsGkAtoms::link, nsnull, kNameSpaceID_None,
getter_AddRefs(nodeInfo));
nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::link, nsnull, kNameSpaceID_None);
result = NS_NewHTMLElement(getter_AddRefs(element), nodeInfo, PR_FALSE);
NS_ENSURE_SUCCESS(result, result);

View File

@ -420,9 +420,8 @@ nsHTMLFragmentContentSink::OpenContainer(const nsIParserNode& aNode)
ToLowerCase(tmp);
nsCOMPtr<nsIAtom> name = do_GetAtom(tmp);
result = mNodeInfoManager->GetNodeInfo(name, nsnull, kNameSpaceID_None,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(result, result);
nodeInfo = mNodeInfoManager->GetNodeInfo(name, nsnull, kNameSpaceID_None);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
}
else if (mNodeInfoCache[nodeType]) {
nodeInfo = mNodeInfoCache[nodeType];
@ -435,9 +434,8 @@ nsHTMLFragmentContentSink::OpenContainer(const nsIParserNode& aNode)
nsIAtom *name = parserService->HTMLIdToAtomTag(nodeType);
NS_ASSERTION(name, "This should not happen!");
result = mNodeInfoManager->GetNodeInfo(name, nsnull, kNameSpaceID_None,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(result, result);
nodeInfo = mNodeInfoManager->GetNodeInfo(name, nsnull, kNameSpaceID_None);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
NS_ADDREF(mNodeInfoCache[nodeType] = nodeInfo);
}
@ -523,10 +521,9 @@ nsHTMLFragmentContentSink::AddLeaf(const nsIParserNode& aNode)
ToLowerCase(tmp);
nsCOMPtr<nsIAtom> name = do_GetAtom(tmp);
result = mNodeInfoManager->GetNodeInfo(name, nsnull,
kNameSpaceID_None,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(result, result);
nodeInfo = mNodeInfoManager->GetNodeInfo(name, nsnull,
kNameSpaceID_None);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
}
else if (mNodeInfoCache[nodeType]) {
nodeInfo = mNodeInfoCache[nodeType];
@ -535,10 +532,9 @@ nsHTMLFragmentContentSink::AddLeaf(const nsIParserNode& aNode)
nsIAtom *name = parserService->HTMLIdToAtomTag(nodeType);
NS_ASSERTION(name, "This should not happen!");
result = mNodeInfoManager->GetNodeInfo(name, nsnull,
kNameSpaceID_None,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(result, result);
nodeInfo = mNodeInfoManager->GetNodeInfo(name, nsnull,
kNameSpaceID_None);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
NS_ADDREF(mNodeInfoCache[nodeType] = nodeInfo);
}
@ -1179,10 +1175,9 @@ nsHTMLParanoidFragmentSink::AddLeaf(const nsIParserNode& aNode)
nsIParserService* parserService = nsContentUtils::GetParserService();
if (!parserService)
return NS_ERROR_OUT_OF_MEMORY;
rv = mNodeInfoManager->GetNodeInfo(name, nsnull,
kNameSpaceID_None,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = mNodeInfoManager->GetNodeInfo(name, nsnull,
kNameSpaceID_None);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
rv = NS_NewHTMLElement(getter_AddRefs(content), nodeInfo, PR_FALSE);
NS_ENSURE_SUCCESS(rv, rv);
AddAttributes(aNode, content);

View File

@ -616,10 +616,9 @@ nsImageDocument::CreateSyntheticDocument()
}
nsCOMPtr<nsINodeInfo> nodeInfo;
rv = mNodeInfoManager->GetNodeInfo(nsGkAtoms::img, nsnull,
kNameSpaceID_None,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::img, nsnull,
kNameSpaceID_None);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
mImageContent = NS_NewHTMLImageElement(nodeInfo);
if (!mImageContent) {

View File

@ -233,10 +233,9 @@ nsMediaDocument::CreateSyntheticDocument()
nsresult rv;
nsCOMPtr<nsINodeInfo> nodeInfo;
rv = mNodeInfoManager->GetNodeInfo(nsGkAtoms::html, nsnull,
kNameSpaceID_None,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::html, nsnull,
kNameSpaceID_None);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
nsRefPtr<nsGenericHTMLElement> root = NS_NewHTMLHtmlElement(nodeInfo);
if (!root) {
@ -247,10 +246,9 @@ nsMediaDocument::CreateSyntheticDocument()
rv = AppendChildTo(root, PR_FALSE);
NS_ENSURE_SUCCESS(rv, rv);
rv = mNodeInfoManager->GetNodeInfo(nsGkAtoms::head, nsnull,
kNameSpaceID_None,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::head, nsnull,
kNameSpaceID_None);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
// Create a <head> so our title has somewhere to live
nsRefPtr<nsGenericHTMLElement> head = NS_NewHTMLHeadElement(nodeInfo);
@ -260,10 +258,9 @@ nsMediaDocument::CreateSyntheticDocument()
root->AppendChildTo(head, PR_FALSE);
rv = mNodeInfoManager->GetNodeInfo(nsGkAtoms::body, nsnull,
kNameSpaceID_None,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::body, nsnull,
kNameSpaceID_None);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
nsRefPtr<nsGenericHTMLElement> body = NS_NewHTMLBodyElement(nodeInfo);
if (!body) {

View File

@ -241,10 +241,9 @@ nsPluginDocument::CreateSyntheticPluginDocument()
// make plugin content
nsCOMPtr<nsINodeInfo> nodeInfo;
rv = mNodeInfoManager->GetNodeInfo(nsGkAtoms::embed, nsnull,
kNameSpaceID_None,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::embed, nsnull,
kNameSpaceID_None);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
rv = NS_NewHTMLElement(getter_AddRefs(mPluginContent), nodeInfo, PR_FALSE);
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -1114,10 +1114,9 @@ nsSVGElement::AddMappedSVGValue(nsIAtom* aName, nsISupports* aValue,
}
else {
nsCOMPtr<nsINodeInfo> ni;
rv = mNodeInfo->NodeInfoManager()->GetNodeInfo(aName, nsnull,
aNamespaceID,
getter_AddRefs(ni));
NS_ENSURE_SUCCESS(rv, rv);
ni = mNodeInfo->NodeInfoManager()->GetNodeInfo(aName, nsnull,
aNamespaceID);
NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE);
rv = mMappedAttributes.SetAndTakeAttr(ni, attrVal);
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -321,8 +321,7 @@ nsSVGUseElement::CreateAnonymousContent()
return nsnull;
nsCOMPtr<nsINodeInfo> nodeInfo;
nodeInfoManager->GetNodeInfo(nsGkAtoms::svg, nsnull, kNameSpaceID_SVG,
getter_AddRefs(nodeInfo));
nodeInfo = nodeInfoManager->GetNodeInfo(nsGkAtoms::svg, nsnull, kNameSpaceID_SVG);
if (!nodeInfo)
return nsnull;

View File

@ -946,8 +946,7 @@ nsXBLContentSink::AddAttributesToXULPrototype(const PRUnichar **aAtts,
}
else {
nsCOMPtr<nsINodeInfo> ni;
mNodeInfoManager->GetNodeInfo(localName, prefix, nameSpaceID,
getter_AddRefs(ni));
ni = mNodeInfoManager->GetNodeInfo(localName, prefix, nameSpaceID);
attrs[i].mName.SetTo(ni);
}

View File

@ -82,10 +82,9 @@ NS_NewXMLCDATASection(nsIContent** aInstancePtrResult,
*aInstancePtrResult = nsnull;
nsCOMPtr<nsINodeInfo> ni;
nsresult rv = aNodeInfoManager->GetNodeInfo(nsGkAtoms::cdataTagName,
nsnull, kNameSpaceID_None,
getter_AddRefs(ni));
NS_ENSURE_SUCCESS(rv, rv);
ni = aNodeInfoManager->GetNodeInfo(nsGkAtoms::cdataTagName,
nsnull, kNameSpaceID_None);
NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE);
nsXMLCDATASection *instance = new nsXMLCDATASection(ni);
if (!instance) {

View File

@ -58,11 +58,9 @@ NS_NewXMLProcessingInstruction(nsIContent** aInstancePtrResult,
*aInstancePtrResult = nsnull;
nsCOMPtr<nsINodeInfo> ni;
nsresult rv =
aNodeInfoManager->GetNodeInfo(nsGkAtoms::processingInstructionTagName,
nsnull, kNameSpaceID_None,
getter_AddRefs(ni));
NS_ENSURE_SUCCESS(rv, rv);
ni = aNodeInfoManager->GetNodeInfo(nsGkAtoms::processingInstructionTagName,
nsnull, kNameSpaceID_None);
NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE);
nsXMLProcessingInstruction *instance =
new nsXMLProcessingInstruction(ni, aTarget, aData);

View File

@ -259,11 +259,9 @@ NS_NewXMLStylesheetProcessingInstruction(nsIContent** aInstancePtrResult,
*aInstancePtrResult = nsnull;
nsCOMPtr<nsINodeInfo> ni;
nsresult rv =
aNodeInfoManager->GetNodeInfo(nsGkAtoms::processingInstructionTagName,
nsnull, kNameSpaceID_None,
getter_AddRefs(ni));
NS_ENSURE_SUCCESS(rv, rv);
ni = aNodeInfoManager->GetNodeInfo(nsGkAtoms::processingInstructionTagName,
nsnull, kNameSpaceID_None);
NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE);
nsXMLStylesheetPI *instance = new nsXMLStylesheetPI(ni, aData);
if (!instance) {

View File

@ -1001,9 +1001,8 @@ nsXMLContentSink::HandleStartElement(const PRUnichar *aName,
}
nsCOMPtr<nsINodeInfo> nodeInfo;
result = mNodeInfoManager->GetNodeInfo(localName, prefix, nameSpaceID,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(result, result);
nodeInfo = mNodeInfoManager->GetNodeInfo(localName, prefix, nameSpaceID);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
result = CreateElement(aAtts, aAttsCount, nodeInfo, aLineNumber,
getter_AddRefs(content), &appendContent);

View File

@ -621,9 +621,8 @@ nsXHTMLParanoidFragmentSink::AddAttributes(const PRUnichar** aAtts,
while (*aAtts) {
nsContentUtils::SplitExpatName(aAtts[0], getter_AddRefs(prefix),
getter_AddRefs(localName), &nameSpaceID);
rv = mNodeInfoManager->GetNodeInfo(localName, prefix, nameSpaceID,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = mNodeInfoManager->GetNodeInfo(localName, prefix, nameSpaceID);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
// check the attributes we allow that contain URIs
if (IsAttrURI(nodeInfo->NameAtom())) {
if (!aAtts[1])
@ -670,9 +669,8 @@ nsXHTMLParanoidFragmentSink::HandleStartElement(const PRUnichar *aName,
return NS_OK;
nsCOMPtr<nsINodeInfo> nodeInfo;
rv = mNodeInfoManager->GetNodeInfo(localName, prefix, nameSpaceID,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = mNodeInfoManager->GetNodeInfo(localName, prefix, nameSpaceID);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
// bounce it if it's not on the whitelist or we're inside
// <script> or <style>
@ -692,9 +690,8 @@ nsXHTMLParanoidFragmentSink::HandleStartElement(const PRUnichar *aName,
for (PRUint32 i = 0; i < aAttsCount; i += 2) {
nsContentUtils::SplitExpatName(aAtts[i], getter_AddRefs(prefix),
getter_AddRefs(localName), &nameSpaceID);
rv = mNodeInfoManager->GetNodeInfo(localName, prefix, nameSpaceID,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = mNodeInfoManager->GetNodeInfo(localName, prefix, nameSpaceID);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
name = nodeInfo->NameAtom();
// Add if it's xmlns, xml: or on the HTML whitelist
@ -717,7 +714,6 @@ nsXHTMLParanoidFragmentSink::HandleStartElement(const PRUnichar *aName,
NS_IMETHODIMP
nsXHTMLParanoidFragmentSink::HandleEndElement(const PRUnichar *aName)
{
nsresult rv;
PRInt32 nameSpaceID;
nsCOMPtr<nsIAtom> prefix, localName;
nsContentUtils::SplitExpatName(aName, getter_AddRefs(prefix),
@ -729,9 +725,8 @@ nsXHTMLParanoidFragmentSink::HandleEndElement(const PRUnichar *aName)
}
nsCOMPtr<nsINodeInfo> nodeInfo;
rv = mNodeInfoManager->GetNodeInfo(localName, prefix, nameSpaceID,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = mNodeInfoManager->GetNodeInfo(localName, prefix, nameSpaceID);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
nsCOMPtr<nsIAtom> name = nodeInfo->NameAtom();
if (mSkipLevel != 0) {

View File

@ -288,9 +288,9 @@ txMozillaTextOutput::createXHTMLElement(nsIAtom* aName,
*aResult = nsnull;
nsCOMPtr<nsINodeInfo> ni;
nsresult rv = mDocument->NodeInfoManager()->
GetNodeInfo(aName, nsnull, kNameSpaceID_XHTML, getter_AddRefs(ni));
NS_ENSURE_SUCCESS(rv, rv);
ni = mDocument->NodeInfoManager()->
GetNodeInfo(aName, nsnull, kNameSpaceID_XHTML);
NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE);
return NS_NewHTMLElement(aResult, ni, PR_FALSE);
}

View File

@ -534,9 +534,8 @@ txMozillaXMLOutput::startElementInternal(nsIAtom* aPrefix,
// Create the element
nsCOMPtr<nsINodeInfo> ni;
rv = mNodeInfoManager->GetNodeInfo(aLocalName, aPrefix, aNsID,
getter_AddRefs(ni));
NS_ENSURE_SUCCESS(rv, rv);
ni = mNodeInfoManager->GetNodeInfo(aLocalName, aPrefix, aNsID);
NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE);
NS_NewElement(getter_AddRefs(mOpenedElement), aElemType, ni, PR_FALSE);
@ -967,10 +966,9 @@ txMozillaXMLOutput::createHTMLElement(nsIAtom* aName,
*aResult = nsnull;
nsCOMPtr<nsINodeInfo> ni;
nsresult rv = mNodeInfoManager->GetNodeInfo(aName, nsnull,
kNameSpaceID_None,
getter_AddRefs(ni));
NS_ENSURE_SUCCESS(rv, rv);
ni = mNodeInfoManager->GetNodeInfo(aName, nsnull,
kNameSpaceID_None);
NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE);
return NS_NewHTMLElement(aResult, ni, PR_FALSE);
}

View File

@ -528,7 +528,7 @@ nsXTFElementWrapper::GetExistingAttrNameFromQName(const nsAString& aStr) const
if (!nodeInfo) {
nsCOMPtr<nsIAtom> nameAtom = do_GetAtom(aStr);
if (HandledByInner(nameAtom))
mNodeInfo->NodeInfoManager()->GetNodeInfo(nameAtom, nsnull, kNameSpaceID_None, &nodeInfo);
nodeInfo = mNodeInfo->NodeInfoManager()->GetNodeInfo(nameAtom, nsnull, kNameSpaceID_None).get();
}
return nodeInfo;

View File

@ -329,14 +329,12 @@ nsXULElement::Create(nsXULPrototypeElement* aPrototype,
return NS_ERROR_NULL_POINTER;
nsCOMPtr<nsINodeInfo> nodeInfo;
nsresult rv;
if (aDocument) {
nsINodeInfo* ni = aPrototype->mNodeInfo;
rv = aDocument->NodeInfoManager()->GetNodeInfo(ni->NameAtom(),
ni->GetPrefixAtom(),
ni->NamespaceID(),
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = aDocument->NodeInfoManager()->GetNodeInfo(ni->NameAtom(),
ni->GetPrefixAtom(),
ni->NamespaceID());
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
}
else {
nodeInfo = aPrototype->mNodeInfo;
@ -2702,9 +2700,9 @@ nsXULPrototypeElement::Serialize(nsIObjectOutputStream* aStream,
for (i = 0; i < mNumAttributes; ++i) {
nsCOMPtr<nsINodeInfo> ni;
if (mAttributes[i].mName.IsAtom()) {
mNodeInfo->NodeInfoManager()->
ni = mNodeInfo->NodeInfoManager()->
GetNodeInfo(mAttributes[i].mName.Atom(), nsnull,
kNameSpaceID_None, getter_AddRefs(ni));
kNameSpaceID_None);
NS_ASSERTION(ni, "the nodeinfo should already exist");
}
else {

View File

@ -478,10 +478,9 @@ XULContentSinkImpl::NormalizeAttributeString(const PRUnichar *aExpatName,
}
nsCOMPtr<nsINodeInfo> ni;
nsresult rv = mNodeInfoManager->GetNodeInfo(localName, prefix,
nameSpaceID,
getter_AddRefs(ni));
NS_ENSURE_SUCCESS(rv, rv);
ni = mNodeInfoManager->GetNodeInfo(localName, prefix,
nameSpaceID);
NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE);
aName.SetTo(ni);
@ -533,10 +532,10 @@ XULContentSinkImpl::HandleStartElement(const PRUnichar *aName,
getter_AddRefs(localName), &nameSpaceID);
nsCOMPtr<nsINodeInfo> nodeInfo;
nsresult rv = mNodeInfoManager->GetNodeInfo(localName, prefix, nameSpaceID,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = mNodeInfoManager->GetNodeInfo(localName, prefix, nameSpaceID);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
nsresult rv = NS_OK;
switch (mState) {
case eInProlog:
// We're the root document element

View File

@ -3569,11 +3569,10 @@ nsXULDocument::CreateElementFromPrototype(nsXULPrototypeElement* aPrototype,
// into the element. Get a nodeinfo from our nodeinfo manager
// for this node.
nsCOMPtr<nsINodeInfo> newNodeInfo;
rv = mNodeInfoManager->GetNodeInfo(aPrototype->mNodeInfo->NameAtom(),
aPrototype->mNodeInfo->GetPrefixAtom(),
aPrototype->mNodeInfo->NamespaceID(),
getter_AddRefs(newNodeInfo));
if (NS_FAILED(rv)) return rv;
newNodeInfo = mNodeInfoManager->GetNodeInfo(aPrototype->mNodeInfo->NameAtom(),
aPrototype->mNodeInfo->GetPrefixAtom(),
aPrototype->mNodeInfo->NamespaceID());
if (!newNodeInfo) return NS_ERROR_FAILURE;
rv = NS_NewElement(getter_AddRefs(result), newNodeInfo->NamespaceID(),
newNodeInfo, PR_FALSE);
if (NS_FAILED(rv)) return rv;

View File

@ -363,10 +363,9 @@ GetNodeInfos(nsXULPrototypeElement* aPrototype,
nsCOMPtr<nsINodeInfo> ni;
nsAttrName* name = &aPrototype->mAttributes[i].mName;
if (name->IsAtom()) {
rv = aPrototype->mNodeInfo->NodeInfoManager()->
GetNodeInfo(name->Atom(), nsnull, kNameSpaceID_None,
getter_AddRefs(ni));
NS_ENSURE_SUCCESS(rv, rv);
ni = aPrototype->mNodeInfo->NodeInfoManager()->
GetNodeInfo(name->Atom(), nsnull, kNameSpaceID_None);
NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE);
}
else {
ni = name->NodeInfo();

View File

@ -1627,8 +1627,7 @@ nsXULContentBuilder::CreateElement(PRInt32 aNameSpaceID,
nsCOMPtr<nsIContent> result;
nsCOMPtr<nsINodeInfo> nodeInfo;
doc->NodeInfoManager()->GetNodeInfo(aTag, nsnull, aNameSpaceID,
getter_AddRefs(nodeInfo));
nodeInfo = doc->NodeInfoManager()->GetNodeInfo(aTag, nsnull, aNameSpaceID);
rv = NS_NewElement(getter_AddRefs(result), aNameSpaceID, nodeInfo,
PR_FALSE);

View File

@ -1964,9 +1964,8 @@ nsCSSFrameConstructor::CreateGeneratedContent(nsIContent* aParentContent,
// XXX Check if it's an image type we can handle...
nsCOMPtr<nsINodeInfo> nodeInfo;
mDocument->NodeInfoManager()->GetNodeInfo(nsGkAtoms::mozgeneratedcontentimage, nsnull,
kNameSpaceID_XHTML,
getter_AddRefs(nodeInfo));
nodeInfo = mDocument->NodeInfoManager()->GetNodeInfo(nsGkAtoms::mozgeneratedcontentimage, nsnull,
kNameSpaceID_XHTML);
nsCOMPtr<nsIContent> content;
NS_NewGenConImageContent(getter_AddRefs(content), nodeInfo,
@ -2137,9 +2136,8 @@ nsCSSFrameConstructor::CreateGeneratedContentFrame(nsFrameConstructorState& aSta
nsCOMPtr<nsINodeInfo> nodeInfo;
nsIAtom* elemName = aPseudoElement == nsCSSPseudoElements::before ?
nsGkAtoms::mozgeneratedcontentbefore : nsGkAtoms::mozgeneratedcontentafter;
mDocument->NodeInfoManager()->GetNodeInfo(elemName, nsnull,
kNameSpaceID_None,
getter_AddRefs(nodeInfo));
nodeInfo = mDocument->NodeInfoManager()->GetNodeInfo(elemName, nsnull,
kNameSpaceID_None);
nsIContent* container;
nsresult rv = NS_NewXMLElement(&container, nodeInfo);
if (NS_FAILED(rv))

View File

@ -350,18 +350,15 @@ nsContentDLF::CreateBlankDocument(nsILoadGroup *aLoadGroup,
nsCOMPtr<nsINodeInfo> htmlNodeInfo;
// generate an html html element
nim->GetNodeInfo(nsGkAtoms::html, 0, kNameSpaceID_None,
getter_AddRefs(htmlNodeInfo));
htmlNodeInfo = nim->GetNodeInfo(nsGkAtoms::html, 0, kNameSpaceID_None);
nsCOMPtr<nsIContent> htmlElement = NS_NewHTMLHtmlElement(htmlNodeInfo);
// generate an html head element
nim->GetNodeInfo(nsGkAtoms::head, 0, kNameSpaceID_None,
getter_AddRefs(htmlNodeInfo));
htmlNodeInfo = nim->GetNodeInfo(nsGkAtoms::head, 0, kNameSpaceID_None);
nsCOMPtr<nsIContent> headElement = NS_NewHTMLHeadElement(htmlNodeInfo);
// generate an html body element
nim->GetNodeInfo(nsGkAtoms::body, 0, kNameSpaceID_None,
getter_AddRefs(htmlNodeInfo));
htmlNodeInfo = nim->GetNodeInfo(nsGkAtoms::body, 0, kNameSpaceID_None);
nsCOMPtr<nsIContent> bodyElement = NS_NewHTMLBodyElement(htmlNodeInfo);
// blat in the structure

View File

@ -1045,8 +1045,7 @@ nsComboboxControlFrame::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
return NS_ERROR_OUT_OF_MEMORY;
nsCOMPtr<nsINodeInfo> nodeInfo;
nimgr->GetNodeInfo(nsGkAtoms::input, nsnull, kNameSpaceID_None,
getter_AddRefs(nodeInfo));
nodeInfo = nimgr->GetNodeInfo(nsGkAtoms::input, nsnull, kNameSpaceID_None);
// create button which drops the list down
NS_NewHTMLElement(getter_AddRefs(mButtonContent), nodeInfo, PR_FALSE);

View File

@ -153,9 +153,8 @@ nsFileControlFrame::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
nsCOMPtr<nsIDocument> doc = mContent->GetDocument();
nsCOMPtr<nsINodeInfo> nodeInfo;
doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::input, nsnull,
kNameSpaceID_None,
getter_AddRefs(nodeInfo));
nodeInfo = doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::input, nsnull,
kNameSpaceID_None);
// Create the text content
NS_NewHTMLElement(getter_AddRefs(mTextContent), nodeInfo, PR_FALSE);

View File

@ -191,8 +191,7 @@ nsIsIndexFrame::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
// Create an hr
nsCOMPtr<nsINodeInfo> hrInfo;
nimgr->GetNodeInfo(nsGkAtoms::hr, nsnull, kNameSpaceID_None,
getter_AddRefs(hrInfo));
hrInfo = nimgr->GetNodeInfo(nsGkAtoms::hr, nsnull, kNameSpaceID_None);
NS_NewHTMLElement(getter_AddRefs(mPreHr), hrInfo, PR_FALSE);
if (!mPreHr || !aElements.AppendElement(mPreHr))
@ -210,8 +209,7 @@ nsIsIndexFrame::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
// Create text input field
nsCOMPtr<nsINodeInfo> inputInfo;
nimgr->GetNodeInfo(nsGkAtoms::input, nsnull, kNameSpaceID_None,
getter_AddRefs(inputInfo));
inputInfo = nimgr->GetNodeInfo(nsGkAtoms::input, nsnull, kNameSpaceID_None);
NS_NewHTMLElement(getter_AddRefs(mInputContent), inputInfo, PR_FALSE);
if (!mInputContent)

View File

@ -1712,12 +1712,11 @@ nsTextControlFrame::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
// Now create a DIV and add it to the anonymous content child list.
nsCOMPtr<nsINodeInfo> nodeInfo;
nsresult rv = doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::div, nsnull,
kNameSpaceID_XHTML,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::div, nsnull,
kNameSpaceID_XHTML);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
rv = NS_NewHTMLElement(getter_AddRefs(mAnonymousDiv), nodeInfo, PR_FALSE);
nsresult rv = NS_NewHTMLElement(getter_AddRefs(mAnonymousDiv), nodeInfo, PR_FALSE);
NS_ENSURE_SUCCESS(rv, rv);
// Set the div native anonymous, so CSS will be its style language

View File

@ -1711,9 +1711,9 @@ nsGfxScrollFrameInner::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
nsNodeInfoManager *nodeInfoManager =
presContext->Document()->NodeInfoManager();
nsCOMPtr<nsINodeInfo> nodeInfo;
rv = nodeInfoManager->GetNodeInfo(nsGkAtoms::scrollbar, nsnull,
kNameSpaceID_XUL, getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = nodeInfoManager->GetNodeInfo(nsGkAtoms::scrollbar, nsnull,
kNameSpaceID_XUL);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
if (canHaveHorizontal) {
rv = NS_NewElement(getter_AddRefs(mHScrollbarContent),
@ -1736,8 +1736,8 @@ nsGfxScrollFrameInner::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
}
if (canHaveHorizontal && canHaveVertical) {
nodeInfoManager->GetNodeInfo(nsGkAtoms::scrollcorner, nsnull,
kNameSpaceID_XUL, getter_AddRefs(nodeInfo));
nodeInfo = nodeInfoManager->GetNodeInfo(nsGkAtoms::scrollcorner, nsnull,
kNameSpaceID_XUL);
rv = NS_NewElement(getter_AddRefs(mScrollCornerContent),
kNameSpaceID_XUL, nodeInfo, PR_FALSE);
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -99,11 +99,11 @@ nsVideoFrame::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
nsNodeInfoManager *nodeInfoManager =
presContext->Document()->NodeInfoManager();
nsCOMPtr<nsINodeInfo> nodeInfo;
nsresult rv = nodeInfoManager->GetNodeInfo(nsGkAtoms::videocontrols, nsnull,
kNameSpaceID_XUL, getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = nodeInfoManager->GetNodeInfo(nsGkAtoms::videocontrols, nsnull,
kNameSpaceID_XUL);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
rv = NS_NewElement(getter_AddRefs(mVideoControls), kNameSpaceID_XUL, nodeInfo, PR_FALSE);
nsresult rv = NS_NewElement(getter_AddRefs(mVideoControls), kNameSpaceID_XUL, nodeInfo, PR_FALSE);
NS_ENSURE_SUCCESS(rv, rv);
if (!aElements.AppendElement(mVideoControls))
return NS_ERROR_OUT_OF_MEMORY;

View File

@ -121,21 +121,20 @@ nsDocElementBoxFrame::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
// create the top-secret popupgroup node. shhhhh!
nsCOMPtr<nsINodeInfo> nodeInfo;
nsresult rv = nodeInfoManager->GetNodeInfo(nsGkAtoms::popupgroup,
nsnull, kNameSpaceID_XUL,
getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = nodeInfoManager->GetNodeInfo(nsGkAtoms::popupgroup,
nsnull, kNameSpaceID_XUL);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
rv = NS_NewXULElement(getter_AddRefs(mPopupgroupContent), nodeInfo);
nsresult rv = NS_NewXULElement(getter_AddRefs(mPopupgroupContent), nodeInfo);
NS_ENSURE_SUCCESS(rv, rv);
if (!aElements.AppendElement(mPopupgroupContent))
return NS_ERROR_OUT_OF_MEMORY;
// create the top-secret default tooltip node. shhhhh!
rv = nodeInfoManager->GetNodeInfo(nsGkAtoms::tooltip, nsnull,
kNameSpaceID_XUL, getter_AddRefs(nodeInfo));
NS_ENSURE_SUCCESS(rv, rv);
nodeInfo = nodeInfoManager->GetNodeInfo(nsGkAtoms::tooltip, nsnull,
kNameSpaceID_XUL);
NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
rv = NS_NewXULElement(getter_AddRefs(mTooltipContent), nodeInfo);
NS_ENSURE_SUCCESS(rv, rv);