Bug 433758, r+sr=jst, a=ss
git-svn-id: svn://10.0.0.236/trunk@253722 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
12e22dd5a5
commit
d5e97bb9f1
@ -3881,19 +3881,21 @@ nsHTMLDocument::GetDocumentAllResult(const nsAString& aID, nsISupports** aResult
|
||||
NS_ENSURE_TRUE(entry->mDocAllList, NS_ERROR_OUT_OF_MEMORY);
|
||||
}
|
||||
|
||||
nsRefPtr<nsContentList> docAllList = entry->mDocAllList;
|
||||
|
||||
// Check if there are more than 1 entries. Do this by getting the second one
|
||||
// rather than the length since getting the length always requires walking
|
||||
// the entire document.
|
||||
|
||||
nsIContent* cont = entry->mDocAllList->Item(1, PR_TRUE);
|
||||
nsIContent* cont = docAllList->Item(1, PR_TRUE);
|
||||
if (cont) {
|
||||
NS_ADDREF(*aResult = static_cast<nsIDOMNodeList*>(entry->mDocAllList));
|
||||
NS_ADDREF(*aResult = static_cast<nsIDOMNodeList*>(docAllList));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// There's only 0 or 1 items. Return the first one or null.
|
||||
NS_IF_ADDREF(*aResult = entry->mDocAllList->Item(0, PR_TRUE));
|
||||
NS_IF_ADDREF(*aResult = docAllList->Item(0, PR_TRUE));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user