NS_RELEASE(defaultStyle);
XULContentSinkImpl::ProcessStyleLink(nsIContent* aElement,                                     const nsString& aHref,                                     PRBool aAlternate,                                     const nsString& aTitle,                                     const nsString& aType,                                     const nsString& aMedia){    static const char kCSSType[] = "text/css";    nsresult rv = NS_OK;    if (aAlternate) { // if alternate, does it have title?        if (aTitle.IsEmpty()) { // alternates must have title            return NS_OK; //return without error, for now        }    }    nsAutoString mimeType;    nsAutoString params;    nsParserUtils::SplitMimeType(aType, mimeType, params);    if ((mimeType.IsEmpty()) || mimeType.EqualsIgnoreCase(kCSSType)) {        nsCOMPtr<nsIURI> url;        rv = NS_NewURI(getter_AddRefs(url), aHref, nsnull, mDocumentURL);        if (NS_OK != rv) {            return NS_OK; // The URL is bad, move along, don't propagate the error (for now)        }        // Add the style sheet reference to the prototype        mPrototype->AddStyleSheetReference(url);        // Nope, we need to load it asynchronously        PRBool blockParser = PR_FALSE;        if (! aAlternate) {            if (!aTitle.IsEmpty()) {  // possibly preferred sheet                if (mPreferredStyle.IsEmpty()) {                    mPreferredStyle = aTitle;                    mCSSLoader->SetPreferredSheet(aTitle);                    nsIAtom* defaultStyle = NS_NewAtom("default-style");                    if (defaultStyle) {                        mPrototype->SetHeaderData(defaultStyle, aTitle);                        NS_RELEASE(defaultStyle);                    }                }            }            else {  // persistent sheet, block                blockParser = PR_TRUE;            }        }        nsCOMPtr<nsIDocument> doc = do_QueryReferent(mDocument);        if (! doc)            return NS_ERROR_FAILURE; // doc went away!        PRBool doneLoading;        rv = mCSSLoader->LoadStyleLink(aElement, url, aTitle, aMedia, kNameSpaceID_Unknown,                                       ((blockParser) ? mParser : nsnull),                                       doneLoading, nsnull);        if (NS_SUCCEEDED(rv) && blockParser && (! doneLoading)) {          rv = NS_ERROR_HTMLPARSER_BLOCK;        }    }    return rv;}