if (!aNode)
if (!theNode)
nsSelection::GetFrameForNodeOffset(nsIContent *aNode, PRInt32 aOffset, nsIFrame **aReturnFrame, PRInt32 *aReturnOffset){  if (!aNode || !aReturnFrame || !aReturnOffset)    return NS_ERROR_NULL_POINTER;  if (aOffset < 0)    return NS_ERROR_FAILURE;  *aReturnOffset = aOffset;  nsresult result;  PRBool canContainChildren = PR_FALSE;  result = aNode->CanContainChildren(canContainChildren);  if (NS_FAILED(result))    return result;  if (canContainChildren)  {    PRInt32 childIndex  = 0;    PRInt32 numChildren = 0;    if (mHint == HINTLEFT)    {      if (aOffset > 0)        childIndex = aOffset - 1;      else        childIndex = aOffset;    }    else // HINTRIGHT    {      result = aNode->ChildCount(numChildren);      if (NS_FAILED(result))        return result;      if (aOffset >= numChildren)      {        if (numChildren > 0)          childIndex = numChildren - 1;        else          childIndex = 0;      }      else        childIndex = aOffset;    }    result = aNode->ChildAt(childIndex, aNode);    if (NS_FAILED(result))      return result;    if (!aNode)      return NS_ERROR_FAILURE;#ifdef DONT_DO_THIS_YET    // XXX: We can't use this code yet because the hinting    //      can cause us to attatch to the wrong line frame.    // Now that we have the child node, check if it too    // can contain children. If so, call this method again!    result = aNode->CanContainChildren(canContainChildren);    if (NS_FAILED(result))      return result;    if (canContainChildren)    {      PRInt32 newOffset = 0;      if (aOffset > childIndex)      {        result = aNode->ChildCount(numChildren);        if (NS_FAILED(result))          return result;        newOffset = numChildren;      }      return GetFrameForNodeOffset(aNode, newOffset, aReturnFrame,aReturnOffset);    }    else#endif // DONT_DO_THIS_YET    {      // Check to see if aNode is a text node. If it is, translate      // aOffset into an offset into the text node.      nsCOMPtr<nsIDOMText> textNode = do_QueryInterface(aNode);      if (textNode)      {        if (aOffset > childIndex)        {          PRUint32 textLength = 0;          result = textNode->GetLength(&textLength);          if (NS_FAILED(result))            return NS_ERROR_FAILURE;          *aReturnOffset = (PRInt32)textLength;        }        else          *aReturnOffset = 0;      }    }  }    result = mTracker->GetPrimaryFrameFor(aNode, aReturnFrame);  if (NS_FAILED(result))    return result;	  if (!*aReturnFrame)    return NS_ERROR_UNEXPECTED;		  // find the child frame containing the offset we want  result = (*aReturnFrame)->GetChildFrameContainingOffset(*aReturnOffset, mHint, &aOffset, aReturnFrame);  return result;}