result = caret->GetCaretCoordinates(nsICaret::eClosestViewCoordinates, mDomSelections[index], &coord, &collapsed);
result = caret->GetCaretCoordinates(nsICaret::eClosestViewCoordinates, mDomSelections[index], &coord, &collapsed, nsnull);
nsSelection::FetchDesiredX(nscoord &aDesiredX) //the x position requested by the Key Handling for up down{  if (!mTracker)  {    NS_ASSERTION(0,"fetch desired X failed\n");    return NS_ERROR_FAILURE;  }  if (mDesiredXSet)  {    aDesiredX = mDesiredX;    return NS_OK;  }  nsCOMPtr<nsIPresContext> context;  nsresult result = mTracker->GetPresContext(getter_AddRefs(context));  if (NS_FAILED(result))    return result;  if (!context)    return NS_ERROR_NULL_POINTER;  nsCOMPtr<nsIPresShell> shell;  result = context->GetShell(getter_AddRefs(shell));  if (NS_FAILED(result))    return result;  if (!shell)    return NS_ERROR_NULL_POINTER;  nsCOMPtr<nsICaret> caret;  result = shell->GetCaret(getter_AddRefs(caret));  if (NS_FAILED(result))    return result;  if (!caret)    return NS_ERROR_NULL_POINTER;  nsRect coord;  PRBool  collapsed;  PRInt8 index = GetIndexFromSelectionType(nsISelectionController::SELECTION_NORMAL);  result = caret->SetCaretDOMSelection(mDomSelections[index]);  if (NS_FAILED(result))    return result;  result = caret->GetCaretCoordinates(nsICaret::eClosestViewCoordinates, mDomSelections[index], &coord, &collapsed);  if (NS_FAILED(result))    return result;     aDesiredX = coord.x;  return NS_OK;}