nsISupportsKey key(ins); nsCOMPtr<nsIDOMNodeList> nodeList = getter_AddRefs(NS_STATIC_CAST(nsIDOMNodeList*, mContentListTable->Get(&key))); if (nodeList) { nsCOMPtr<nsIAnonymousContentList> contentList(do_QueryInterface(nodeList)); if (contentList) {   PRUint32 count; contentList->GetInsertionPointCount(&count); for (PRUint32 i =0; i < count; i++) { nsCOMPtr<nsIXBLInsertionPoint> point; contentList->GetInsertionPointAt(i, getter_AddRefs(point)); PRInt32 index; point->GetInsertionIndex(&index); if (index != -1) {   for (PRInt32 j = aNewIndexInContainer; j < childCount; j++) { aContainer->ChildAt(j, *getter_AddRefs(child)); point->AddChild(child); SetInsertionParent(child, ins); } break;
nsCOMPtr<nsIDOMNodeList> nodeList; PRBool isAnonymousContentList; GetXBLChildNodesInternal(ins, getter_AddRefs(nodeList), &isAnonymousContentList);  if (nodeList && isAnonymousContentList) {   nsAnonymousContentList* contentList = NS_STATIC_CAST(nsAnonymousContentList*, NS_STATIC_CAST(nsIDOMNodeList*, nodeList.get()));  PRInt32 count = contentList->GetInsertionPointCount(); for (PRInt32 i = 0; i < count; i++) { nsXBLInsertionPoint* point = contentList->GetInsertionPointAt(i); PRInt32 index = point->GetInsertionIndex(); if (index != -1) {   for (PRInt32 j = aNewIndexInContainer; j < childCount; j++) { child = aContainer->GetChildAt(j); point->AddChild(child); SetInsertionParent(child, ins);
nsBindingManager::ContentAppended(nsIDocument* aDocument,			                            nsIContent* aContainer,                                  PRInt32     aNewIndexInContainer){  // XXX This is hacked and not quite correct. See below.  if (aNewIndexInContainer == -1 || !mContentListTable)    // It's anonymous.    return NS_OK;  PRInt32 childCount;  nsCOMPtr<nsIContent> child;  aContainer->ChildCount(childCount);  aContainer->ChildAt(aNewIndexInContainer, *getter_AddRefs(child));    nsCOMPtr<nsIContent> ins;  GetNestedInsertionPoint(aContainer, child, getter_AddRefs(ins));  if (ins) {    nsISupportsKey key(ins);    nsCOMPtr<nsIDOMNodeList> nodeList = getter_AddRefs(NS_STATIC_CAST(nsIDOMNodeList*, mContentListTable->Get(&key)));    if (nodeList) {      nsCOMPtr<nsIAnonymousContentList> contentList(do_QueryInterface(nodeList));      if (contentList) {        // Find a non-pseudo-insertion point and just jam ourselves in.        // This is not 100% correct.  Hack city, baby.        PRUint32 count;        contentList->GetInsertionPointCount(&count);        for (PRUint32 i =0; i < count; i++) {          nsCOMPtr<nsIXBLInsertionPoint> point;          contentList->GetInsertionPointAt(i, getter_AddRefs(point));          PRInt32 index;          point->GetInsertionIndex(&index);          if (index != -1) {            // We're real. Jam all the kids in.            // XXX Check the filters to find the correct points.            for (PRInt32 j = aNewIndexInContainer; j < childCount; j++) {              aContainer->ChildAt(j, *getter_AddRefs(child));              point->AddChild(child);              SetInsertionParent(child, ins);            }            break;          }        }      }    }  }   return NS_OK;}