if (aIID.Equals(kIHTMLStyleSheetIID)) {
if (aIID.Equals(NS_GET_IID(nsIHTMLStyleSheet))) {
nsresult HTMLStyleSheetImpl::QueryInterface(const nsIID& aIID,                                            void** aInstancePtrResult){  NS_PRECONDITION(nsnull != aInstancePtrResult, "null pointer");  if (nsnull == aInstancePtrResult) {    return NS_ERROR_NULL_POINTER;  }  static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);  if (aIID.Equals(kIHTMLStyleSheetIID)) {    *aInstancePtrResult = (void*) ((nsIHTMLStyleSheet*)this);    NS_ADDREF_THIS();    return NS_OK;  }  if (aIID.Equals(kIStyleSheetIID)) {    *aInstancePtrResult = (void*) ((nsIStyleSheet*)this);    NS_ADDREF_THIS();    return NS_OK;  }  if (aIID.Equals(NS_GET_IID(nsIStyleRuleProcessor))) {    *aInstancePtrResult = (void*) ((nsIStyleRuleProcessor*)this);    NS_ADDREF_THIS();    return NS_OK;  }  if (aIID.Equals(kIStyleFrameConstructionIID)) {    // XXX this breaks XPCOM rules since it isn't a proper delegate    // This is a temporary method of connecting the constructor for now    nsCSSFrameConstructor* constructor = new nsCSSFrameConstructor();    if (nsnull != constructor) {      constructor->Init(mDocument);      nsresult result = constructor->QueryInterface(aIID, aInstancePtrResult);      if (NS_FAILED(result)) {        delete constructor;      }      return result;    }    return NS_ERROR_OUT_OF_MEMORY;  }  if (aIID.Equals(kISupportsIID)) {    *aInstancePtrResult = (void*) this;    NS_ADDREF_THIS();    return NS_OK;  }  return NS_NOINTERFACE;}