Bug 845374 - Part h: Move nsContentUtils::NameChanged out of line; r=khuey

This commit is contained in:
Ms2ger 2013-03-17 08:55:14 +01:00
parent eb52584f84
commit a94aa82b0a
2 changed files with 17 additions and 11 deletions

View File

@ -677,17 +677,8 @@ public:
* Convenience method to create a new nodeinfo that differs only by name
* from aNodeInfo.
*/
static nsresult NameChanged(nsINodeInfo *aNodeInfo, nsIAtom *aName,
nsINodeInfo** aResult)
{
nsNodeInfoManager *niMgr = aNodeInfo->NodeInfoManager();
*aResult = niMgr->GetNodeInfo(aName, aNodeInfo->GetPrefixAtom(),
aNodeInfo->NamespaceID(),
aNodeInfo->NodeType(),
aNodeInfo->GetExtraName()).get();
return *aResult ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
static nsresult NameChanged(nsINodeInfo* aNodeInfo, nsIAtom* aName,
nsINodeInfo** aResult);
/**
* Returns the appropriate event argument names for the specified

View File

@ -2875,6 +2875,21 @@ nsContentUtils::IsDraggableLink(const nsIContent* aContent) {
return aContent->IsLink(getter_AddRefs(absURI));
}
// static
nsresult
nsContentUtils::NameChanged(nsINodeInfo* aNodeInfo, nsIAtom* aName,
nsINodeInfo** aResult)
{
nsNodeInfoManager *niMgr = aNodeInfo->NodeInfoManager();
*aResult = niMgr->GetNodeInfo(aName, aNodeInfo->GetPrefixAtom(),
aNodeInfo->NamespaceID(),
aNodeInfo->NodeType(),
aNodeInfo->GetExtraName()).get();
return *aResult ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
static bool
TestSitePerm(nsIPrincipal* aPrincipal, const char* aType, uint32_t aPerm, bool aExactHostMatch)
{