const nsString& content = aNode.GetSkippedContent();
nsCOMPtr<nsIDTD> dtd; mParser->GetDTD(getter_AddRefs(dtd)); NS_ENSURE_TRUE(dtd, NS_ERROR_FAILURE);  nsAutoString content; PRInt32 lineNo = 0;  dtd->CollectSkippedContent(eHTMLTag_style, content, lineNo);
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<nsINodeInfo> nodeInfo;    mNodeInfoManager->GetNodeInfo(nsHTMLAtoms::style, nsnull,                                  kNameSpaceID_None,                                  *getter_AddRefs(nodeInfo));    nsCOMPtr<nsIHTMLContent> element;    rv = NS_CreateHTMLElement(getter_AddRefs(element), nodeInfo, PR_FALSE);    if (NS_SUCCEEDED(rv)) {      PRInt32 id;      mDocument->GetAndIncrementContentID(&id);          element->SetContentID(id);      nsCOMPtr<nsIStyleSheetLinkingElement> ssle = do_QueryInterface(element);      if (ssle) {        // XXX need prefs. check here.        if (!mInsideNoXXXTag) {          ssle->InitStyleLinkElement(mParser, PR_FALSE);          ssle->SetEnableUpdates(PR_FALSE);        }        else {          ssle->InitStyleLinkElement(nsnull, PR_TRUE);        }      }      // 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;      }      // The skipped content contains the inline style data      const nsString& content = aNode.GetSkippedContent();      if (!content.IsEmpty()) {        // Create a text node holding the content        nsCOMPtr<nsIContent> text;        rv = NS_NewTextNode(getter_AddRefs(text));        if (NS_SUCCEEDED(rv)) {          nsCOMPtr<nsIDOMText> tc = do_QueryInterface(text);          if (tc) {            tc->SetData(content);          }          element->AppendChildTo(text, PR_FALSE, PR_FALSE);        }      }      parent->AppendChildTo(element, PR_FALSE, PR_FALSE);      if (ssle) {        ssle->SetEnableUpdates(PR_TRUE);        rv = ssle->UpdateStyleSheet(nsnull, mStyleSheetCount);        if (NS_SUCCEEDED(rv) || (rv == NS_ERROR_HTMLPARSER_BLOCK)) {          mStyleSheetCount++;        }      }    }  }  return rv;}