if (!mFrameSelection) return NS_OK; return mFrameSelection->DeleteFromDocument();
nsresult res;     PRBool isCollapsed; PRInt8 index = GetIndexFromSelectionType(nsISelectionController::SELECTION_NORMAL); mDomSelections[index]->GetIsCollapsed( &isCollapsed); if (isCollapsed) {  if (mDomSelections[index]->FetchFocusOffset() > 0) { mDomSelections[index]->Extend(mDomSelections[index]->FetchFocusNode(), mDomSelections[index]->FetchFocusOffset() - 1); } else {  printf("Sorry, don't know how to delete across frame boundaries yet\n"); return NS_ERROR_NOT_IMPLEMENTED; } }   nsSelectionIterator iter(mDomSelections[index]); res = iter.First(); if (!NS_SUCCEEDED(res)) return res;  nsCOMPtr<nsIDOMRange> range; while (iter.IsDone()) { res = iter.CurrentItem(NS_STATIC_CAST(nsIDOMRange**, getter_AddRefs(range))); if (!NS_SUCCEEDED(res)) return res; res = range->DeleteContents(); if (!NS_SUCCEEDED(res)) return res; iter.Next(); }     if (isCollapsed) mDomSelections[index]->Collapse(mDomSelections[index]->FetchAnchorNode(), mDomSelections[index]->FetchAnchorOffset()-1); else if (mDomSelections[index]->FetchAnchorOffset() > 0) mDomSelections[index]->Collapse(mDomSelections[index]->FetchAnchorNode(), mDomSelections[index]->FetchAnchorOffset()); #ifdef DEBUG else printf("Don't know how to set selection back past frame boundary\n"); #endif  return NS_OK;
nsTypedSelection::DeleteFromDocument(){  if (!mFrameSelection)    return NS_OK;//nothing to do  return mFrameSelection->DeleteFromDocument();}