ssle->InitStyleLinkElement(mParser, PR_TRUE);
ssle->InitStyleLinkElement(nsnull, PR_TRUE);
HTMLContentSink::ProcessSTYLETag(const nsIParserNode& aNode){  nsresult rv = NS_OK;  nsIHTMLContent* parent = nsnull;    if (mCurrentContext) {    parent = mCurrentContext->mStack[mCurrentContext->mStackPos - 1].mContent;  }  if (parent) {    // Create content object    nsCOMPtr<nsIHTMLContent> element;    nsCOMPtr<nsIStyleSheetLinkingElement> ssle;    nsCOMPtr<nsINodeInfo> nodeInfo;    mNodeInfoManager->GetNodeInfo(nsHTMLAtoms::style, nsnull,                                  kNameSpaceID_None,                                  *getter_AddRefs(nodeInfo));    rv = NS_CreateHTMLElement(getter_AddRefs(element), nodeInfo, PR_FALSE);    if (NS_SUCCEEDED(rv)) {      PRInt32 id;      mDocument->GetAndIncrementContentID(&id);          element->SetContentID(id);      ssle = do_QueryInterface(element);      if (ssle) {        // XXX need prefs. check here.        if (!mInsideNoXXXTag) {          ssle->InitStyleLinkElement(mParser, PR_FALSE);        }        else {          ssle->InitStyleLinkElement(mParser, PR_TRUE);        }        ssle->SetEnableUpdates(PR_FALSE);      }      // Add in the attributes and add the style content object to the      // head container.      element->SetDocument(mDocument, PR_FALSE, PR_TRUE);      rv = AddAttributes(aNode, element);      if (NS_FAILED(rv)) {        return rv;      }      parent->AppendChildTo(element, PR_FALSE, PR_FALSE);      if (ssle) {        ssle->SetEnableUpdates(PR_TRUE);        rv = ssle->UpdateStyleSheet(PR_TRUE, mDocument, mStyleSheetCount);        if (NS_SUCCEEDED(rv) || (rv == NS_ERROR_HTMLPARSER_BLOCK))          mStyleSheetCount++;      }    }    nsAutoString src;    element->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::src, src);    src.StripWhitespace();    if (!mInsideNoXXXTag && NS_SUCCEEDED(rv) && src.IsEmpty()) {      nsAutoString title;       nsAutoString type;       nsAutoString media;       element->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::title, title);      title.CompressWhitespace();      element->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::type, type);      element->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::media, media);      media.ToLowerCase(); // HTML4.0 spec is inconsistent, make it case INSENSITIVE      nsAutoString mimeType;      nsAutoString params;      nsStyleLinkElement::SplitMimeType(type, mimeType, params);      PRBool blockParser = kBlockByDefault;      if (mimeType.IsEmpty() || mimeType.Equals(NS_LITERAL_STRING("text/css"))) {         if (!title.IsEmpty()) {  // possibly preferred sheet          nsAutoString preferredStyle;          mDocument->GetHeaderData(nsHTMLAtoms::headerDefaultStyle, preferredStyle);          if (preferredStyle.IsEmpty()) {            mDocument->SetHeaderData(nsHTMLAtoms::headerDefaultStyle, title);          }        }        // The skipped content contains the inline style data        const nsString& content = aNode.GetSkippedContent();        PRBool doneLoading = PR_FALSE;        nsCOMPtr<nsIUnicharInputStream> uin;        // Create a text node holding the content        nsCOMPtr<nsIContent> text;        rv = NS_NewTextNode(getter_AddRefs(text));        if (NS_OK == rv) {          nsCOMPtr<nsIDOMText> tc = do_QueryInterface(text, &rv);          if (NS_OK == rv) {            tc->SetData(content);          }          element->AppendChildTo(text, PR_FALSE, PR_FALSE);          text->SetDocument(mDocument, PR_FALSE, PR_TRUE);        }        // Create a string to hold the data and wrap it up in a unicode        // input stream.        rv = NS_NewStringUnicharInputStream(getter_AddRefs(uin), new nsString(content));        if (NS_OK != rv) {          return rv;        }        // Now that we have a url and a unicode input stream, parse the        // style sheet.        rv = mCSSLoader->LoadInlineStyle(element, uin, title, media, kNameSpaceID_Unknown,                                         mStyleSheetCount++,                                          ((blockParser) ? mParser : nsnull),                                         doneLoading, this);        if (NS_SUCCEEDED(rv) && blockParser && (!doneLoading)) {          rv = NS_ERROR_HTMLPARSER_BLOCK;        }      }//if (mimeType.IsEmpty() || mimeType.Equals(NS_LITERAL_STRING("text/css")))    }//if (!mInsideNoXXXTag && NS_SUCCEEDED(rv) && src.IsEmpty())  }//if (parent)  return rv;}