nsCOMPtr<nsIContent> selectAllContent; selectAllFrame->GetContent(getter_AddRefs(selectAllContent));
nsIContent* selectAllContent = selectAllFrame->GetContent();
nsSelection::AdjustOffsetsFromStyle(nsIFrame *aFrame, PRBool *changeSelection,      nsIContent** outContent, PRInt32* outStartOffset, PRInt32* outEndOffset){    *changeSelection = PR_FALSE;  *outContent = nsnull;    nsresult  rv;    nsIFrame*   selectAllFrame;  rv = FrameOrParentHasSpecialSelectionStyle(aFrame, NS_STYLE_USER_SELECT_ALL, &selectAllFrame);  if (NS_FAILED(rv)) return rv;    if (!selectAllFrame)    return NS_OK;    nsCOMPtr<nsIContent> selectAllContent;  selectAllFrame->GetContent(getter_AddRefs(selectAllContent));  if (selectAllContent)  {    nsCOMPtr<nsIContent> parentContent = selectAllContent->GetParent();    if (parentContent)    {      PRInt32 startOffset;      rv = parentContent->IndexOf(selectAllContent, startOffset);      if (NS_FAILED(rv)) return rv;      if (startOffset < 0)      {        // hrmm, this is probably anonymous content. Let's go up another level        // do we need to do this if we get the right frameSelection to start with?        nsCOMPtr<nsIContent> superParent = parentContent->GetParent();        if (superParent)        {          PRInt32 superStartOffset;          rv = superParent->IndexOf(parentContent, superStartOffset);          if (NS_FAILED(rv)) return rv;          if (superStartOffset < 0)            return NS_ERROR_FAILURE;    // give up                  parentContent = superParent;          startOffset = superStartOffset;        }      }            NS_IF_ADDREF(*outContent = parentContent);      *outStartOffset = startOffset;      *outEndOffset = startOffset + 1;      *changeSelection = PR_TRUE;    }      }  return NS_OK;}