if (!aCanDrag) return NS_ERROR_NULL_POINTER;   *aCanDrag = PR_FALSE;     if (mIgnoreSpuriousDragEvent) { #ifdef DEBUG_cmanske printf(" *** IGNORING SPURIOUS DRAG EVENT!\n"); #endif mIgnoreSpuriousDragEvent = PR_FALSE; return NS_OK; }  nsCOMPtr<nsISelection> selection; nsresult res = GetSelection(getter_AddRefs(selection)); if (NS_FAILED(res)) return res;  PRBool isCollapsed; res = selection->GetIsCollapsed(&isCollapsed); if (NS_FAILED(res)) return res;   if ( isCollapsed ) return NS_OK;  nsCOMPtr<nsIDOMEventTarget> eventTarget;  nsCOMPtr<nsIDOMNSEvent> nsevent(do_QueryInterface(aDragEvent));  if (nsevent) { res = nsevent->GetOriginalTarget(getter_AddRefs(eventTarget)); if (NS_FAILED(res)) { return res; } }  if ( eventTarget ) { nsCOMPtr<nsIDOMNode> eventTargetDomNode = do_QueryInterface(eventTarget); if ( eventTargetDomNode ) { PRBool isTargetedCorrectly = PR_FALSE; res = selection->ContainsNode(eventTargetDomNode, PR_FALSE, &isTargetedCorrectly); if (NS_FAILED(res)) return res;  *aCanDrag = isTargetedCorrectly; } }  return NS_OK;
return nsPlaintextEditor::CanDrag(aDragEvent, aCanDrag);
NS_IMETHODIMP nsHTMLEditor::CanDrag(nsIDOMEvent *aDragEvent, PRBool *aCanDrag){  if (!aCanDrag)    return NS_ERROR_NULL_POINTER;  /* we really should be checking the XY coordinates of the mouseevent and ensure that   * that particular point is actually within the selection (not just that there is a selection)   */  *aCanDrag = PR_FALSE;   // KLUDGE to work around bug 50703  // After double click and object property editing,   //  we get a spurious drag event  if (mIgnoreSpuriousDragEvent)  {#ifdef DEBUG_cmanske    printf(" *** IGNORING SPURIOUS DRAG EVENT!\n");#endif    mIgnoreSpuriousDragEvent = PR_FALSE;    return NS_OK;  }     nsCOMPtr<nsISelection> selection;  nsresult res = GetSelection(getter_AddRefs(selection));  if (NS_FAILED(res)) return res;      PRBool isCollapsed;  res = selection->GetIsCollapsed(&isCollapsed);  if (NS_FAILED(res)) return res;    // if we are collapsed, we have no selection so nothing to drag  if ( isCollapsed )    return NS_OK;  nsCOMPtr<nsIDOMEventTarget> eventTarget;  nsCOMPtr<nsIDOMNSEvent> nsevent(do_QueryInterface(aDragEvent));  if (nsevent) {    res = nsevent->GetOriginalTarget(getter_AddRefs(eventTarget));    if (NS_FAILED(res)) {      return res;    }  }  if ( eventTarget )  {    nsCOMPtr<nsIDOMNode> eventTargetDomNode = do_QueryInterface(eventTarget);    if ( eventTargetDomNode )    {      PRBool isTargetedCorrectly = PR_FALSE;      res = selection->ContainsNode(eventTargetDomNode, PR_FALSE, &isTargetedCorrectly);      if (NS_FAILED(res)) return res;      *aCanDrag = isTargetedCorrectly;    }  }  return NS_OK;}