Bug 502937. Part 2.5. Provide an API to get the flattened tree parent of an nsIContent. r=bzbarsky

This commit is contained in:
Timothy Nikkel
2010-04-16 13:15:28 -05:00
parent c9a954285a
commit 58288238ff
8 changed files with 42 additions and 13 deletions

View File

@@ -631,6 +631,23 @@ nsIContent::FindFirstNonNativeAnonymous() const
return nsnull;
}
nsIContent*
nsIContent::GetFlattenedTreeParent() const
{
nsIContent *parent = GetParent();
if (parent && parent->HasFlag(NODE_MAY_BE_IN_BINDING_MNGR)) {
nsIDocument *doc = parent->GetOwnerDoc();
if (doc) {
nsIContent* insertionElement =
doc->BindingManager()->GetNestedInsertionPoint(parent, this);
if (insertionElement) {
parent = insertionElement;
}
}
}
return parent;
}
//----------------------------------------------------------------------
NS_IMPL_ADDREF(nsChildContentList)