if (aIID.Equals(NS_GET_IID(nsIEnumerator))) { *aInstancePtr = NS_STATIC_CAST(nsIEnumerator*, this);
if (aIID.Equals(NS_GET_IID(nsIFrameSelection))) { nsIFrameSelection* tmp = this; *aInstancePtr = (void*) tmp;
nsSelectionIterator::QueryInterface(REFNSIID aIID, void** aInstancePtr){  if (nsnull == aInstancePtr) {    return NS_ERROR_NULL_POINTER;  }  if (aIID.Equals(NS_GET_IID(nsIEnumerator))) {    *aInstancePtr = NS_STATIC_CAST(nsIEnumerator*, this);    NS_ADDREF_THIS();    return NS_OK;  }  if (aIID.Equals(NS_GET_IID(nsIBidirectionalEnumerator))) {    *aInstancePtr = NS_STATIC_CAST(nsIBidirectionalEnumerator*, this);    NS_ADDREF_THIS();    return NS_OK;  }  return mDomSelection->QueryInterface(aIID, aInstancePtr);}