content->GetTag(*getter_AddRefs(tag));
content->GetTag(getter_AddRefs(tag));
nsTypedSelection::Collapse(nsIDOMNode* aParentNode, PRInt32 aOffset){  if (!aParentNode)    return NS_ERROR_INVALID_ARG;  mFrameSelection->InvalidateDesiredX();  if (!IsValidSelectionPoint(mFrameSelection, aParentNode))    return NS_ERROR_FAILURE;  nsresult result;  // Delete all of the current ranges  if (NS_FAILED(SetOriginalAnchorPoint(aParentNode,aOffset)))    return NS_ERROR_FAILURE; //???  nsCOMPtr<nsIPresContext>  presContext;  GetPresContext(getter_AddRefs(presContext));  Clear(presContext);  // Turn off signal for table selection  if (mFrameSelection)    mFrameSelection->ClearTableCellSelection();  nsCOMPtr<nsIDOMRange> range;  NS_NewRange(getter_AddRefs(range));  if (! range){    NS_ASSERTION(PR_FALSE,"Couldn't make a range - nsSelection::Collapse");    return NS_ERROR_UNEXPECTED;  }  result = range->SetEnd(aParentNode, aOffset);  if (NS_FAILED(result))    return result;  result = range->SetStart(aParentNode, aOffset);  if (NS_FAILED(result))    return result;#ifdef DEBUG_SELECTION  if (aParentNode)  {    nsCOMPtr<nsIContent>content;    content = do_QueryInterface(aParentNode);    if (!content)      return NS_ERROR_FAILURE;    nsCOMPtr<nsIAtom> tag;    content->GetTag(*getter_AddRefs(tag));    if (tag)    {      nsAutoString tagString;      tag->ToString(tagString);      char * tagCString = ToNewCString(tagString);      printf ("Sel. Collapse to %p %s %d\n", content, tagCString, aOffset);      delete [] tagCString;    }  }  else {    printf ("Sel. Collapse set to null parent.\n");  }#endif  result = AddItem(range);  setAnchorFocusRange(0);  selectFrames(presContext, range,PR_TRUE);  if (NS_FAILED(result))    return result;  if (!mFrameSelection)    return NS_OK;//nothing to do  return mFrameSelection->NotifySelectionListeners(GetType());}