PRBool canContainChildren = PR_FALSE; result = aNode->CanContainChildren(canContainChildren); if (canContainChildren) { if (aOffset >= 0) { result = aNode->ChildAt(aOffset, aNode); if (NS_FAILED(result)) return result; if (!aNode) return NS_ERROR_FAILURE; } }
nsRangeList::GetFrameForNodeOffset(nsIContent *aNode, PRInt32 aOffset, nsIFrame **aReturnFrame){  if (!aNode || !aReturnFrame)    return NS_ERROR_NULL_POINTER;  nsresult result;	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(aOffset, mHint, &aOffset, aReturnFrame);	return result;}