if (offset >0)
if (offset >= 0)
nsDOMSelection::GetPrimaryFrameForFocusNode(nsIFrame **aReturnFrame){  if (!aReturnFrame)    return NS_ERROR_NULL_POINTER;    *aReturnFrame = 0;    nsresult	result = NS_OK;    nsCOMPtr<nsIDOMNode> node = dont_QueryInterface(FetchFocusNode());  if (!node)    return NS_ERROR_NULL_POINTER;  nsCOMPtr<nsIContent> content = do_QueryInterface(node, &result);  if (NS_FAILED(result) || !content)    return result;    PRBool canContainChildren = PR_FALSE;  result = content->CanContainChildren(canContainChildren);  if (NS_SUCCEEDED(result) && canContainChildren)  {    PRInt32 offset = FetchFocusOffset();    if (GetDirection() == eDirNext)      offset--;    if (offset >0)    {      nsCOMPtr<nsIContent> child;      result = content->ChildAt(offset, *getter_AddRefs(child));      if (NS_FAILED(result))        return result;      if (!child) //out of bounds?        return NS_ERROR_FAILURE;      content = child;//releases the focusnode    }  }  result = mRangeList->GetTracker()->GetPrimaryFrameFor(content,aReturnFrame);  return result;}