if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) { nsIDOMSelection *temp = (nsIDOMSelection *)this; *aInstancePtr = (void*)(nsISupports *)temp; NS_ADDREF_THIS(); return NS_OK; } if (aIID.Equals(nsIDOMSelection::GetIID())) { *aInstancePtr = (void*) this; NS_ADDREF_THIS(); return NS_OK; } if (aIID.Equals(nsIEnumerator::GetIID())) { nsRangeListIterator *iter = new nsRangeListIterator(this); *aInstancePtr = (void*) (nsIEnumerator *) iter; NS_ADDREF_THIS(); return NS_OK; } if (aIID.Equals(nsIBidirectionalEnumerator::GetIID())) { nsRangeListIterator *iter = new nsRangeListIterator(this); *aInstancePtr = (void*) (nsIBidirectionalEnumerator *) iter; NS_ADDREF_THIS(); return NS_OK; } if (aIID.Equals(nsIScriptObjectOwner::GetIID())) { nsIScriptObjectOwner* tmp = this;
if (aIID.Equals(nsIFrameSelection::GetIID())) { nsIFrameSelection* tmp = this;
nsDOMSelection::QueryInterface(REFNSIID aIID, void** aInstancePtr){  if (NULL == aInstancePtr) {    return NS_ERROR_NULL_POINTER;  }  if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {    nsIDOMSelection *temp = (nsIDOMSelection *)this;    *aInstancePtr = (void*)(nsISupports *)temp;    NS_ADDREF_THIS();    return NS_OK;  }  if (aIID.Equals(nsIDOMSelection::GetIID())) {    *aInstancePtr = (void*) this;    NS_ADDREF_THIS();    return NS_OK;  }  if (aIID.Equals(nsIEnumerator::GetIID())) {    nsRangeListIterator *iter = new nsRangeListIterator(this);    *aInstancePtr = (void*) (nsIEnumerator *) iter;    NS_ADDREF_THIS();    return NS_OK;  }  if (aIID.Equals(nsIBidirectionalEnumerator::GetIID())) {    nsRangeListIterator *iter = new nsRangeListIterator(this);    *aInstancePtr = (void*) (nsIBidirectionalEnumerator *) iter;    NS_ADDREF_THIS();    return NS_OK;  }  if (aIID.Equals(nsIScriptObjectOwner::GetIID())) {    nsIScriptObjectOwner* tmp = this;    *aInstancePtr = (void*) tmp;    NS_ADDREF_THIS();    return NS_OK;  }  //NS_ASSERTION(PR_FALSE,"bad query interface in nsDOMSelection");  //do not assert here javascript will assert here sometimes thats OK  return NS_NOINTERFACE;}