*getter_AddRefs(nodeInfo));
getter_AddRefs(nodeInfo));
HTMLContentSink::ProcessLINKTag(const nsIParserNode& aNode){  nsresult  result = NS_OK;  nsIHTMLContent* parent = nsnull;  if (mCurrentContext) {    parent = mCurrentContext->mStack[mCurrentContext->mStackPos - 1].mContent;  }  // XXX - Hack to fix the crash reported in bug 197015; Once the real   // problem, in CSSLoader, is fixed then this hack could be removed.  // Close the head context, that got opened up by the link tag, because  // our CSSLoader, on loading the linked style sheet, calls the parser's  // ContinueParsing() even if the parser is not  blocked and that causes   // the sink, whose current context is head, to go haywire.   // Note: CSS loading is initiated before unwinding off this stack and   // therefore the sink never got the chance to close its head context.  CloseHeadContext();  if (parent) {    // Create content object    nsCOMPtr<nsIHTMLContent> element;    nsCOMPtr<nsINodeInfo> nodeInfo;    mNodeInfoManager->GetNodeInfo(nsHTMLAtoms::link, nsnull, kNameSpaceID_None,                                  *getter_AddRefs(nodeInfo));    result = NS_CreateHTMLElement(getter_AddRefs(element), nodeInfo, PR_FALSE);    NS_ENSURE_SUCCESS(result, result);    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);    result = AddAttributes(aNode, element);    if (NS_FAILED(result)) {      return result;    }    parent->AppendChildTo(element, PR_FALSE, PR_FALSE);    if (ssle) {      ssle->SetEnableUpdates(PR_TRUE);      result = ssle->UpdateStyleSheet(nsnull, nsnull);      // look for <link rel="next" href="url">      nsAutoString relVal;      element->GetAttr(kNameSpaceID_None, nsHTMLAtoms::rel, relVal);      if (!relVal.IsEmpty()) {        // XXX seems overkill to generate this string array        nsStringArray linkTypes;        nsStyleLinkElement::ParseLinkTypes(relVal, linkTypes);        PRBool hasPrefetch = (linkTypes.IndexOf(NS_LITERAL_STRING("prefetch")) != -1);        if (hasPrefetch || linkTypes.IndexOf(NS_LITERAL_STRING("next")) != -1) {          nsAutoString hrefVal;          element->GetAttr(kNameSpaceID_None, nsHTMLAtoms::href, hrefVal);          if (!hrefVal.IsEmpty()) {            PrefetchHref(hrefVal, hasPrefetch);          }        }      }    }  }  return result;}