Bug 680687, Follow COM rules - keep strong ref to object, r=jst
This commit is contained in:
Родитель
04c0aafd64
Коммит
2eb3f1bef8
|
@ -6125,7 +6125,7 @@ nsDocument::AdoptNode(nsIDOMNode *aAdoptedNode, nsIDOMNode **aResult)
|
|||
} while ((doc = doc->GetParentDocument()));
|
||||
|
||||
// Remove from parent.
|
||||
nsINode* parent = adoptedNode->GetNodeParent();
|
||||
nsCOMPtr<nsINode> parent = adoptedNode->GetNodeParent();
|
||||
if (parent) {
|
||||
rv = parent->RemoveChildAt(parent->IndexOf(adoptedNode), PR_TRUE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
|
|
@ -620,7 +620,7 @@ nsINode::Normalize()
|
|||
}
|
||||
|
||||
// Remove node
|
||||
nsINode* parent = node->GetNodeParent();
|
||||
nsCOMPtr<nsINode> parent = node->GetNodeParent();
|
||||
NS_ASSERTION(parent || hasRemoveListeners,
|
||||
"Should always have a parent unless "
|
||||
"mutation events messed us up");
|
||||
|
@ -3945,7 +3945,7 @@ nsINode::ReplaceOrInsertBefore(PRBool aReplace, nsINode* aNewChild,
|
|||
}
|
||||
|
||||
// Remove the new child from the old parent if one exists
|
||||
nsINode* oldParent = newContent->GetNodeParent();
|
||||
nsCOMPtr<nsINode> oldParent = newContent->GetNodeParent();
|
||||
if (oldParent) {
|
||||
PRInt32 removeIndex = oldParent->IndexOf(newContent);
|
||||
if (removeIndex < 0) {
|
||||
|
|
|
@ -1213,7 +1213,7 @@ nsXBLPrototypeBinding::ConstructInsertionTable(nsIContent* aContent)
|
|||
PRInt32 i;
|
||||
for (i = 0; i < count; i++) {
|
||||
nsIContent* child = childrenElements[i];
|
||||
nsIContent* parent = child->GetParent();
|
||||
nsCOMPtr<nsIContent> parent = child->GetParent();
|
||||
|
||||
// Create an XBL insertion point entry.
|
||||
nsXBLInsertionPointEntry* xblIns = nsXBLInsertionPointEntry::Create(parent);
|
||||
|
|
|
@ -4047,7 +4047,8 @@ nsXULDocument::OverlayForwardReference::Merge(nsIContent* aTargetNode,
|
|||
if (attr == nsGkAtoms::removeelement &&
|
||||
value.EqualsLiteral("true")) {
|
||||
|
||||
rv = RemoveElement(aTargetNode->GetParent(), aTargetNode);
|
||||
nsCOMPtr<nsIContent> parent = aTargetNode->GetParent();
|
||||
rv = RemoveElement(parent, aTargetNode);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -1324,7 +1324,7 @@ nsXULContentBuilder::RemoveGeneratedContent(nsIContent* aElement)
|
|||
while (0 != (count = ungenerated.Length())) {
|
||||
// Pull the next "ungenerated" element off the queue.
|
||||
PRUint32 last = count - 1;
|
||||
nsIContent* element = ungenerated[last];
|
||||
nsCOMPtr<nsIContent> element = ungenerated[last];
|
||||
ungenerated.RemoveElementAt(last);
|
||||
|
||||
PRUint32 i = element->GetChildCount();
|
||||
|
|
|
@ -280,7 +280,7 @@ nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder,
|
|||
case eTreeOpDetach: {
|
||||
nsIContent* node = *(mOne.node);
|
||||
aBuilder->FlushPendingAppendNotifications();
|
||||
nsIContent* parent = node->GetParent();
|
||||
nsCOMPtr<nsIContent> parent = node->GetParent();
|
||||
if (parent) {
|
||||
nsHtml5OtherDocUpdate update(parent->GetOwnerDoc(),
|
||||
aBuilder->GetDocument());
|
||||
|
@ -292,7 +292,7 @@ nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder,
|
|||
return rv;
|
||||
}
|
||||
case eTreeOpAppendChildrenToNewParent: {
|
||||
nsIContent* node = *(mOne.node);
|
||||
nsCOMPtr<nsIContent> node = *(mOne.node);
|
||||
nsIContent* parent = *(mTwo.node);
|
||||
aBuilder->FlushPendingAppendNotifications();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче