else {
else if (mParser) {
HTMLContentSink::ProcessHeaderData(nsIAtom* aHeader,const nsAReadableString& aValue,nsIHTMLContent* aContent){  nsresult rv=NS_OK;  // XXX necko isn't going to process headers coming in from the parser            //NS_WARNING("need to fix how necko adds mime headers (in HTMLContentSink::ProcessMETATag)");  mDocument->SetHeaderData(aHeader, aValue);    // see if we have a refresh "header".  if (aHeader == nsHTMLAtoms::refresh) {    // first get our baseURI    nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(mWebShell, &rv);    if (NS_FAILED(rv)) return rv;        nsCOMPtr<nsIURI> baseURI;    nsCOMPtr<nsIWebNavigation> webNav = do_QueryInterface(docShell);    rv = webNav->GetCurrentURI(getter_AddRefs(baseURI));    if (NS_FAILED(rv)) return rv;    nsCOMPtr<nsIRefreshURI> reefer = do_QueryInterface(mWebShell);    if (reefer) {      rv = reefer->RefreshURIFromHeader(baseURI, aValue);      if (NS_FAILED(rv)) return rv;    }  } // END refresh  else if (aHeader == nsHTMLAtoms::setcookie) {    nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(mWebShell, &rv);    if (NS_FAILED(rv)) return rv;    nsCOMPtr<nsICookieService> cookieServ = do_GetService(NS_COOKIESERVICE_CONTRACTID, &rv);    if (NS_FAILED(rv)) return rv;        nsCOMPtr<nsIURI> baseURI;    nsCOMPtr<nsIWebNavigation> webNav = do_QueryInterface(docShell);    rv = webNav->GetCurrentURI(getter_AddRefs(baseURI));    if (NS_FAILED(rv)) return rv;    char *cookie = ToNewUTF8String(aValue);    nsCOMPtr<nsIScriptGlobalObject> globalObj;    nsCOMPtr<nsIPrompt> prompt;    mDocument->GetScriptGlobalObject(getter_AddRefs(globalObj));    if (globalObj) {      nsCOMPtr<nsIDOMWindowInternal> window (do_QueryInterface(globalObj));      if (window) {        window->GetPrompter(getter_AddRefs(prompt));      }    }    rv = cookieServ->SetCookieString(baseURI, prompt, cookie);    nsCRT::free(cookie);    if (NS_FAILED(rv)) return rv;  } // END set-cookie  else if (aHeader == nsHTMLAtoms::link) {    rv = ProcessLink(aContent, aValue);  }  else if (aHeader == nsHTMLAtoms::headerContentBase) {    ProcessBaseHref(aValue);  }  else if (aHeader == nsHTMLAtoms::headerWindowTarget) {    ProcessBaseTarget(aValue);  }  else {    // we also need to report back HTTP-EQUIV headers to the channel    // so that it can process things like pragma: no-cache or other    // cache-control headers. Ideally this should also be the way for    // cookies to be set! But we'll worry about that in the next    // iteration    nsCOMPtr<nsIChannel> channel;    if (NS_SUCCEEDED(mParser->GetChannel(getter_AddRefs(channel)))) {      nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));      if (httpChannel) {        const PRUnichar *header = 0;        (void)aHeader->GetUnicode(&header);        (void)httpChannel->SetResponseHeader(                       NS_ConvertUCS2toUTF8(header).get(),                       NS_ConvertUCS2toUTF8(aValue).get());      }    }  }    return rv;}