NS_IMETHOD QueryInterface(REFNSIID aIID, void** aResult) { return mOuter->QueryInterface(aIID, aResult); }
nsXULElement::QueryInterface(REFNSIID iid, void** result) { if (! result) return NS_ERROR_NULL_POINTER; *result = nsnull;  nsresult rv;  if (iid.Equals(NS_GET_IID(nsIStyledContent)) || iid.Equals(kIContentIID) || iid.Equals(kISupportsIID)) { *result = NS_STATIC_CAST(nsIStyledContent*, this); } else if (iid.Equals(NS_GET_IID(nsIXMLContent))) { *result = NS_STATIC_CAST(nsIXMLContent*, this); } else if (iid.Equals(NS_GET_IID(nsIXULContent))) { *result = NS_STATIC_CAST(nsIXULContent*, this); } else if (iid.Equals(NS_GET_IID(nsIDOMXULElement)) || iid.Equals(kIDOMElementIID) || iid.Equals(kIDOMNodeIID)) { *result = NS_STATIC_CAST(nsIDOMElement*, this); } else if (iid.Equals(kIScriptObjectOwnerIID)) { *result = NS_STATIC_CAST(nsIScriptObjectOwner*, this); } else if (iid.Equals(NS_GET_IID(nsIScriptEventHandlerOwner))) { *result = NS_STATIC_CAST(nsIScriptEventHandlerOwner*, this); } else if (iid.Equals(kIDOMEventReceiverIID)) { *result = NS_STATIC_CAST(nsIDOMEventReceiver*, this); } else if (iid.Equals(kIDOMEventTargetIID)) { *result = NS_STATIC_CAST(nsIDOMEventTarget*, this); } else if (iid.Equals(kIJSScriptObjectIID)) { *result = NS_STATIC_CAST(nsIJSScriptObject*, this); } else if (iid.Equals(NS_GET_IID(nsIStyleRule))) { *result = NS_STATIC_CAST(nsIStyleRule*, this); } else if (iid.Equals(NS_GET_IID(nsIChromeEventHandler))) { *result = NS_STATIC_CAST(nsIChromeEventHandler*, this); } else if ((iid.Equals(NS_GET_IID(nsIDOMXULPopupElement))) && (NameSpaceID() == kNameSpaceID_XUL)) { nsCOMPtr<nsIAtom> tag; NS_WITH_SERVICE(nsIXBLService, xblService, "component: xblService->ResolveTag(NS_STATIC_CAST(nsIStyledContent*, this), getter_AddRefs(tag)); if ((tag.get() == kPopupAtom) || (tag.get() == kMenuPopupAtom)) {  if (! InnerXULElement()) { rv = EnsureSlots(); if (NS_FAILED(rv)) return rv;  if ((mSlots->mInnerXULElement = new nsXULPopupElement(this)) == nsnull) return NS_ERROR_OUT_OF_MEMORY; }  return InnerXULElement()->QueryInterface(iid, result); } else return NS_NOINTERFACE; } else if ((iid.Equals(NS_GET_IID(nsIDOMXULTreeElement)) || iid.Equals(NS_GET_IID(nsIXULTreeContent))) && (NameSpaceID() == kNameSpaceID_XUL)){ nsCOMPtr<nsIAtom> tag; NS_WITH_SERVICE(nsIXBLService, xblService, "component: xblService->ResolveTag(NS_STATIC_CAST(nsIStyledContent*, this), getter_AddRefs(tag)); if (tag.get() == kTreeAtom) {  if (! InnerXULElement()) { rv = EnsureSlots(); if (NS_FAILED(rv)) return rv;  if ((mSlots->mInnerXULElement = new nsXULTreeElement(this)) == nsnull) return NS_ERROR_OUT_OF_MEMORY; }  return InnerXULElement()->QueryInterface(iid, result); } else return NS_NOINTERFACE; } else if (iid.Equals(NS_GET_IID(nsIDOMXULIFrameElement)) && (NameSpaceID() == kNameSpaceID_XUL)) { nsCOMPtr<nsIAtom> tag; NS_WITH_SERVICE(nsIXBLService, xblService, "component: xblService->ResolveTag(NS_STATIC_CAST(nsIStyledContent*, this), getter_AddRefs(tag)); if (tag.get() == kIFrameAtom) {  if (! InnerXULElement()) { rv = EnsureSlots(); if (NS_FAILED(rv)) return rv;  if ((mSlots->mInnerXULElement = new nsXULIFrameElement(this)) == nsnull) return NS_ERROR_OUT_OF_MEMORY; }  return InnerXULElement()->QueryInterface(iid, result); } else return NS_NOINTERFACE; } else if (iid.Equals(NS_GET_IID(nsIDOMXULBrowserElement)) && (NameSpaceID() == kNameSpaceID_XUL)) { nsCOMPtr<nsIAtom> tag; NS_WITH_SERVICE(nsIXBLService, xblService, "component: xblService->ResolveTag(NS_STATIC_CAST(nsIStyledContent*, this), getter_AddRefs(tag)); if (tag.get() == kBrowserAtom) {  if (! InnerXULElement()) { rv = EnsureSlots(); if (NS_FAILED(rv)) return rv;  if ((mSlots->mInnerXULElement = new nsXULBrowserElement(this)) == nsnull) return NS_ERROR_OUT_OF_MEMORY; }  return InnerXULElement()->QueryInterface(iid, result); } else return NS_NOINTERFACE; } else if (iid.Equals(NS_GET_IID(nsIDOMXULTitledButtonElement)) && (NameSpaceID() == kNameSpaceID_XUL)) { nsCOMPtr<nsIAtom> tag; NS_WITH_SERVICE(nsIXBLService, xblService, "component: xblService->ResolveTag(NS_STATIC_CAST(nsIStyledContent*, this), getter_AddRefs(tag)); if (tag.get() == kTitledButtonAtom) {  if (! InnerXULElement()) { rv = EnsureSlots(); if (NS_FAILED(rv)) return rv;  if ((mSlots->mInnerXULElement = new nsXULTitledButtonElement(this)) == nsnull) return NS_ERROR_OUT_OF_MEMORY; }  return InnerXULElement()->QueryInterface(iid, result); } else return NS_NOINTERFACE; } else if (iid.Equals(NS_GET_IID(nsIDOMXULCheckboxElement)) && (NameSpaceID() == kNameSpaceID_XUL)) { nsCOMPtr<nsIAtom> tag; NS_WITH_SERVICE(nsIXBLService, xblService, "component: xblService->ResolveTag(NS_STATIC_CAST(nsIStyledContent*, this), getter_AddRefs(tag)); if (tag.get() == kCheckboxAtom) {  if (! InnerXULElement()) { rv = EnsureSlots(); if (NS_FAILED(rv)) return rv;  if ((mSlots->mInnerXULElement = new nsXULCheckboxElement(this)) == nsnull) return NS_ERROR_OUT_OF_MEMORY; }  return InnerXULElement()->QueryInterface(iid, result); } else return NS_NOINTERFACE; } else if (iid.Equals(NS_GET_IID(nsIDOMXULRadioElement)) && (NameSpaceID() == kNameSpaceID_XUL)) { nsCOMPtr<nsIAtom> tag; NS_WITH_SERVICE(nsIXBLService, xblService, "component: xblService->ResolveTag(NS_STATIC_CAST(nsIStyledContent*, this), getter_AddRefs(tag)); if (tag.get() == kRadioAtom) {  if (! InnerXULElement()) { rv = EnsureSlots(); if (NS_FAILED(rv)) return rv;  if ((mSlots->mInnerXULElement = new nsXULRadioElement(this)) == nsnull) return NS_ERROR_OUT_OF_MEMORY; }  return InnerXULElement()->QueryInterface(iid, result); } else return NS_NOINTERFACE; } else if (iid.Equals(NS_GET_IID(nsIDOMXULRadioGroupElement)) && (NameSpaceID() == kNameSpaceID_XUL)) { nsCOMPtr<nsIAtom> tag; NS_WITH_SERVICE(nsIXBLService, xblService, "component: xblService->ResolveTag(NS_STATIC_CAST(nsIStyledContent*, this), getter_AddRefs(tag)); if (tag.get() == kRadioGroupAtom) {  if (! InnerXULElement()) { rv = EnsureSlots(); if (NS_FAILED(rv)) return rv;  if ((mSlots->mInnerXULElement = new nsXULRadioGroupElement(this)) == nsnull) return NS_ERROR_OUT_OF_MEMORY; }  return InnerXULElement()->QueryInterface(iid, result); } else return NS_NOINTERFACE; } else if (iid.Equals(NS_GET_IID(nsIDOMXULMenuListElement)) && (NameSpaceID() == kNameSpaceID_XUL)) { nsCOMPtr<nsIAtom> tag; NS_WITH_SERVICE(nsIXBLService, xblService, "component: xblService->ResolveTag(NS_STATIC_CAST(nsIStyledContent*, this), getter_AddRefs(tag)); if (tag.get() == kMenuListAtom) {  if (! InnerXULElement()) { rv = EnsureSlots(); if (NS_FAILED(rv)) return rv;  if ((mSlots->mInnerXULElement = new nsXULMenuListElement(this)) == nsnull) return NS_ERROR_OUT_OF_MEMORY; }  return InnerXULElement()->QueryInterface(iid, result); } else return NS_NOINTERFACE; } else if (iid.Equals(NS_GET_IID(nsIDOMXULEditorElement)) && (NameSpaceID() == kNameSpaceID_XUL)) { nsCOMPtr<nsIAtom> tag; NS_WITH_SERVICE(nsIXBLService, xblService, "component: xblService->ResolveTag(NS_STATIC_CAST(nsIStyledContent*, this), getter_AddRefs(tag)); if (tag.get() == kEditorAtom) {  if (! InnerXULElement()) { rv = EnsureSlots(); if (NS_FAILED(rv)) return rv;  if ((mSlots->mInnerXULElement = new nsXULEditorElement(this)) == nsnull) return NS_ERROR_OUT_OF_MEMORY; }  return InnerXULElement()->QueryInterface(iid, result); } else return NS_NOINTERFACE; } else { *result = nsnull; return NS_NOINTERFACE; }   NS_ADDREF(this); return NS_OK; }
    NS_IMETHOD QueryInterface(REFNSIID aIID, void** aResult) {        return mOuter->QueryInterface(aIID, aResult);    }