if (mNextBinding) return mNextBinding->GetBaseTag(aResult);      nsAutoString extends; mBinding->GetAttribute(kNameSpaceID_None, kExtendsAtom, extends);  if (!extends.IsEmpty()) {  nsAutoString prefix; PRInt32 offset = extends.FindChar(kNameSpaceSeparator); if (-1 != offset) { extends.Left(prefix, offset); extends.Cut(0, offset+1); } if (prefix.Length() > 0) {  nsCOMPtr<nsIAtom> prefixAtom = getter_AddRefs(NS_NewAtom(prefix)); nsCOMPtr<nsINameSpace> nameSpace; nsCOMPtr<nsIXMLContent> xmlContent(do_QueryInterface(mBinding)); if (xmlContent) { xmlContent->GetContainingNameSpace(*getter_AddRefs(nameSpace));  nsCOMPtr<nsINameSpace> tagSpace; nameSpace->FindNameSpace(prefixAtom, *getter_AddRefs(tagSpace)); if (tagSpace) {   *aResult = NS_NewAtom(extends); } } } }
mPrototypeBinding->GetBaseTag(aNameSpaceID, aResult); if (!*aResult && mNextBinding) return mNextBinding->GetBaseTag(aNameSpaceID, aResult);
nsXBLBinding::GetBaseTag(nsIAtom** aResult){  if (mNextBinding)    return mNextBinding->GetBaseTag(aResult);  // XXX Cache the value as a "base" attribute so that we don't do this  // check over and over each time the bound element occurs.  // We are the base binding. Obtain the extends attribute.  nsAutoString extends;  mBinding->GetAttribute(kNameSpaceID_None, kExtendsAtom, extends);  if (!extends.IsEmpty()) {    // Obtain the namespace prefix.    nsAutoString prefix;    PRInt32 offset = extends.FindChar(kNameSpaceSeparator);    if (-1 != offset) {      extends.Left(prefix, offset);      extends.Cut(0, offset+1);    }    if (prefix.Length() > 0) {      // Look up the prefix.      nsCOMPtr<nsIAtom> prefixAtom = getter_AddRefs(NS_NewAtom(prefix));      nsCOMPtr<nsINameSpace> nameSpace;      nsCOMPtr<nsIXMLContent> xmlContent(do_QueryInterface(mBinding));      if (xmlContent) {        xmlContent->GetContainingNameSpace(*getter_AddRefs(nameSpace));        nsCOMPtr<nsINameSpace> tagSpace;        nameSpace->FindNameSpace(prefixAtom, *getter_AddRefs(tagSpace));        if (tagSpace) {          // Score! Return the tag.          // XXX We should really return the namespace as well.          *aResult = NS_NewAtom(extends); // The addref happens here        }      }    }  }  return NS_OK;}