result = mCSSLoader->LoadStyleLink(aElement, url, aTitle, aMedia, kNameSpaceID_Unknown, mStyleSheetCount++, ((blockParser) ? mParser : nsnull), doneLoading); if (NS_SUCCEEDED(result) && blockParser && (! doneLoading)) { result = NS_ERROR_HTMLPARSER_BLOCK;
rv = mCSSLoader->LoadStyleLink(aElement, url, aTitle, aMedia, kNameSpaceID_Unknown, mStyleSheetCount++, ((blockParser) ? mParser : nsnull), doneLoading); if (NS_SUCCEEDED(rv) && blockParser && (! doneLoading)) { rv = NS_ERROR_HTMLPARSER_BLOCK;
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 result = NS_OK;    if (aAlternate) { // if alternate, does it have title?        if (0 == aTitle.Length()) { // alternates must have title            return NS_OK; //return without error, for now        }    }    nsAutoString  mimeType;    nsAutoString  params;    SplitMimeType(aType, mimeType, params);    if ((0 == mimeType.Length()) || mimeType.EqualsIgnoreCase(kCSSType)) {        nsCOMPtr<nsIURI> url;        result = NS_NewURI(getter_AddRefs(url), aHref, mDocumentURL);        if (NS_OK != result) {            return NS_OK; // The URL is bad, move along, don't propagate the error (for now)        }        PRBool blockParser = PR_FALSE;        if (! aAlternate) {            if (0 < aTitle.Length()) {  // possibly preferred sheet                if (0 == mPreferredStyle.Length()) {                    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;            }        }        // XXX Note that mStyleSheetCount is going to place the style        // sheet in a fairly random location if we're loading an        // overlay. Should we just use a Very Large Number?        PRBool doneLoading;        result = mCSSLoader->LoadStyleLink(aElement, url, aTitle, aMedia, kNameSpaceID_Unknown,                                           mStyleSheetCount++,                                            ((blockParser) ? mParser : nsnull),                                           doneLoading);        if (NS_SUCCEEDED(result) && blockParser && (! doneLoading)) {            result = NS_ERROR_HTMLPARSER_BLOCK;        }    }    return result;}