else if (atom == nsHTMLAtoms::tr)
else if (tag == nsHTMLAtoms::tr)
nsTypedSelection::GetTableSelectionType(nsIDOMRange* aRange, PRInt32* aTableSelectionType){  if (!aRange || !aTableSelectionType)    return NS_ERROR_NULL_POINTER;    *aTableSelectionType = nsISelectionPrivate::TABLESELECTION_NONE;   // Must have access to frame selection to get cell info  if(!mFrameSelection) return NS_OK;  nsCOMPtr<nsIDOMNode> startNode;  nsresult result = aRange->GetStartContainer(getter_AddRefs(startNode));  if (NS_FAILED(result)) return result;  if (!startNode) return NS_ERROR_FAILURE;    nsCOMPtr<nsIDOMNode> endNode;  result = aRange->GetEndContainer(getter_AddRefs(endNode));  if (NS_FAILED(result)) return result;  if (!endNode) return NS_ERROR_FAILURE;  // Not a single selected node  if (startNode != endNode) return NS_OK;  nsCOMPtr<nsIContent> content = do_QueryInterface(startNode);  if (!content) return NS_ERROR_FAILURE;  // if we simply cannot have children, return NS_OK as a non-failing,  // non-completing case for table selection  if (!content->CanContainChildren())    return NS_OK; //got to be a text node, definately not a table row/cell    PRInt32 startOffset;  PRInt32 endOffset;  result = aRange->GetEndOffset(&endOffset);  if (NS_FAILED(result)) return result;  result = aRange->GetStartOffset(&startOffset);  if (NS_FAILED(result)) return result;  // Not a single selected node  if ((endOffset - startOffset) != 1)    return NS_OK;  nsCOMPtr<nsIAtom> atom;  content->GetTag(getter_AddRefs(atom));  if (!atom) return NS_ERROR_FAILURE;  if (atom == nsHTMLAtoms::tr)  {    *aTableSelectionType = nsISelectionPrivate::TABLESELECTION_CELL;  }  else //check to see if we are selecting a table or row (column and all cells not done yet)  {    nsIContent *child = content->GetChildAt(startOffset);    if (!child)      return NS_ERROR_FAILURE;    child->GetTag(getter_AddRefs(atom));    if (atom == nsHTMLAtoms::table)      *aTableSelectionType = nsISelectionPrivate::TABLESELECTION_TABLE;    else if (atom == nsHTMLAtoms::tr)      *aTableSelectionType = nsISelectionPrivate::TABLESELECTION_ROW;  }  return result;}