Fix for bug 460512 (Avoid AddRef/Release in scriptable helper methods for NodeList). r/sr=bz.
This commit is contained in:
@@ -456,10 +456,15 @@ nsIContent::FindFirstNonNativeAnonymous() const
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsChildContentList::~nsChildContentList()
|
||||
{
|
||||
MOZ_COUNT_DTOR(nsChildContentList);
|
||||
}
|
||||
NS_IMPL_ADDREF(nsChildContentList)
|
||||
NS_IMPL_RELEASE(nsChildContentList)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsChildContentList)
|
||||
NS_INTERFACE_MAP_ENTRY(nsINodeList)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNodeList)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsINodeList)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(NodeList)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsChildContentList::GetLength(PRUint32* aLength)
|
||||
@@ -469,6 +474,19 @@ nsChildContentList::GetLength(PRUint32* aLength)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsChildContentList::Item(PRUint32 aIndex, nsIDOMNode** aReturn)
|
||||
{
|
||||
nsINode* node = GetNodeAt(aIndex);
|
||||
if (!node) {
|
||||
*aReturn = nsnull;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return CallQueryInterface(node, aReturn);
|
||||
}
|
||||
|
||||
nsINode*
|
||||
nsChildContentList::GetNodeAt(PRUint32 aIndex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user