|| (nodeType == nsIDOMNode::TEXT_NODE && (!nodeStartsBeforeRange || !nodeEndsAfterRange)))
|| (nodeType == nsIDOMNode::TEXT_NODE))
nsDOMSelection::ContainsNode(nsIDOMNode* aNode, PRBool aRecursive, PRBool* aYes){  if (!aYes)    return NS_ERROR_NULL_POINTER;  *aYes = PR_FALSE;  // Iterate over the ranges in the selection checking for the content:  if (!mRangeArray)    return NS_OK;  PRUint32 cnt;  nsresult rv = mRangeArray->Count(&cnt);  if (NS_FAILED(rv))    return rv;  for (PRUint32 i=0; i < cnt; ++i)  {    nsISupports* element = mRangeArray->ElementAt(i);    nsCOMPtr<nsIDOMRange>	range = do_QueryInterface(element);    if (!range)      return NS_ERROR_UNEXPECTED;    nsCOMPtr<nsIContent> content (do_QueryInterface(aNode));    if (content)    {      if (IsNodeIntersectsRange(content, range))      {        // If recursive, then we're done -- IsNodeIntersectsRange does the right thing        if (aRecursive)        {          *aYes = PR_TRUE;          return NS_OK;        }        // else not recursive -- node itself must be contained,        // so we need to do more checking        PRBool nodeStartsBeforeRange, nodeEndsAfterRange;        if (NS_SUCCEEDED(CompareNodeToRange(content, range,                                            &nodeStartsBeforeRange,                                            &nodeEndsAfterRange)))        {#ifdef DEBUG_ContainsNode          nsAutoString name, value;          aNode->GetNodeName(name);          aNode->GetNodeValue(value);          printf("%s [%s]: %d, %d\n", name.ToNewCString(), value.ToNewCString(),                 nodeStartsBeforeRange, nodeEndsAfterRange);#endif          PRUint16 nodeType;          aNode->GetNodeType(&nodeType);          if ((!nodeStartsBeforeRange && !nodeEndsAfterRange)              || (nodeType == nsIDOMNode::TEXT_NODE                  && (!nodeStartsBeforeRange || !nodeEndsAfterRange)))          {            *aYes = PR_TRUE;            return NS_OK;          }        }      }    }  }  return NS_OK;}