return result;
SheetLoadData* data = new SheetLoadData(this, aURL, sheet, parentData, observer);  if (!data) { sheet->SetComplete(); return NS_ERROR_OUT_OF_MEMORY; }  NS_ADDREF(data);   return LoadSheet(data, state);
CSSLoaderImpl::LoadChildSheet(nsICSSStyleSheet* aParentSheet,                              nsIURL* aURL,                               const nsString& aMedia,                              PRInt32 aDefaultNameSpaceID,                              PRInt32 aIndex){  nsresult result = NS_ERROR_NULL_POINTER;  if (aURL) {    URLKey  key(aURL);    nsICSSStyleSheet* sheet = (nsICSSStyleSheet*)mLoadedSheets.Get(&key);    if (sheet && (NS_COMFALSE == sheet->IsUnmodified())) {  // if dirty, forget it      sheet = nsnull;    }    if (sheet) {  // already have one loaded and unmodified      nsICSSStyleSheet* clone = nsnull;      result = sheet->Clone(clone);      if (NS_SUCCEEDED(result)) {        SetMedia(clone, aMedia);        result = InsertChildSheet(clone, aParentSheet, aIndex);        NS_RELEASE(clone);      }    }    else {      SheetLoadData* data = new SheetLoadData(this, aURL, aMedia, aDefaultNameSpaceID,                                              aParentSheet, aIndex);      PRInt32 count = mParsingData.Count();      if (count) { // still parsing the parent (expected for @import)        // XXX assert that last parsing == parent sheet        SheetLoadData* parentData = (SheetLoadData*)mParsingData.ElementAt(count - 1);        data->mParentData = parentData;        // verify that sheet doesn't have new child as a parent         do {          if (parentData->mURL->Equals(aURL)) {  // houston, we have a loop, blow off this child            data->mParentData = nsnull;            delete data;            return NS_OK;          }          parentData = parentData->mParentData;        } while (parentData);                (data->mParentData->mPendingChildren)++;      }      result = LoadSheet(key, data);    }  }  return result;}