if (aIID.Equals(NS_GET_IID(nsIDOMNSHTMLElement))) { inst = NS_STATIC_CAST(nsIDOMNSHTMLElement *, this);
if (aIID.Equals(NS_GET_IID(nsIDOMNode))) { inst = NS_STATIC_CAST(nsIDOMNode *, aElement); } else if (aIID.Equals(NS_GET_IID(nsIDOMElement))) { inst = NS_STATIC_CAST(nsIDOMElement *, aElement); } else if (aIID.Equals(NS_GET_IID(nsIDOMHTMLElement))) { inst = NS_STATIC_CAST(nsIDOMHTMLElement *, aElement); } else if (aIID.Equals(NS_GET_IID(nsIDOMNSHTMLElement))) { inst = NS_STATIC_CAST(nsIDOMNSHTMLElement *, new nsGenericHTMLElementTearoff(this)); NS_ENSURE_TRUE(inst, NS_ERROR_OUT_OF_MEMORY);
nsGenericHTMLElementTearoff::QueryInterface(REFNSIID aIID, void** aInstancePtr){  NS_ENSURE_ARG_POINTER(aInstancePtr);  nsISupports *inst = nsnull;  if (aIID.Equals(NS_GET_IID(nsIDOMNSHTMLElement))) {    inst = NS_STATIC_CAST(nsIDOMNSHTMLElement *, this);  } else if (aIID.Equals(NS_GET_IID(nsIDOMElementCSSInlineStyle))) {    inst = NS_STATIC_CAST(nsIDOMElementCSSInlineStyle *, this);  } else {    return mElement->QueryInterface(aIID, aInstancePtr);  }  NS_ADDREF(inst);  *aInstancePtr = inst;  return NS_OK;}