mCSSLoader = aDocument->GetCSSLoader(); NS_ENSURE_TRUE(mCSSLoader, NS_ERROR_OUT_OF_MEMORY);
mCSSLoader = aDocument->CSSLoader();
XULContentSinkImpl::Init(nsIDocument* aDocument, nsIXULPrototypeDocument* aPrototype){    NS_PRECONDITION(aDocument != nsnull, "null ptr");    if (! aDocument)        return NS_ERROR_NULL_POINTER;        nsresult rv;    mDocument    = do_GetWeakReference(aDocument);    mPrototype   = aPrototype;    rv = mPrototype->GetURI(getter_AddRefs(mDocumentURL));    if (NS_FAILED(rv)) return rv;    // XXX this presumes HTTP header info is already set in document    // XXX if it isn't we need to set it here...    nsCOMPtr<nsIAtom> defaultStyle = do_GetAtom("default-style");    if (! defaultStyle)        return NS_ERROR_OUT_OF_MEMORY;    rv = mPrototype->GetHeaderData(defaultStyle, mPreferredStyle);    if (NS_FAILED(rv)) return rv;    // Get the CSS loader from the document so we can load    // stylesheets    mCSSLoader = aDocument->GetCSSLoader();    NS_ENSURE_TRUE(mCSSLoader, NS_ERROR_OUT_OF_MEMORY);    mNodeInfoManager = aPrototype->GetNodeInfoManager();    if (! mNodeInfoManager)        return NS_ERROR_UNEXPECTED;    mState = eInProlog;    return NS_OK;}