nsISupports *supports = (nsISupports *)(nsIDOMStyleSheetCollection *)this; nsISupports *parent = (nsISupports *)mDocument;
NS_WITH_SERVICE(nsIDOMScriptObjectFactory, factory, kDOMScriptObjectFactoryCID, &result);
nsDOMStyleSheetCollection::GetScriptObject(nsIScriptContext *aContext, void** aScriptObject){  nsresult res = NS_OK;  if (nsnull == mScriptObject) {    nsISupports *supports = (nsISupports *)(nsIDOMStyleSheetCollection *)this;    nsISupports *parent = (nsISupports *)mDocument;    // XXX Should be done through factory    res = NS_NewScriptStyleSheetCollection(aContext,                                            supports,                                           parent,                                           (void**)&mScriptObject);  }  *aScriptObject = mScriptObject;  return res;}