Fixing bug 202636. Patch by psolanki@myrealbox.com. Adding document.referrer to all document types. r+sr=jst@mozilla.jstenback.com

git-svn-id: svn://10.0.0.236/trunk@151886 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jst%mozilla.jstenback.com
2004-01-27 04:41:12 +00:00
parent 6d00103488
commit bdd7b1f7ab
5 changed files with 17 additions and 42 deletions

View File

@@ -712,29 +712,6 @@ nsHTMLDocument::StartAutodetection(nsIDocShell *aDocShell, nsACString& aCharset,
}
}
void
nsHTMLDocument::RetrieveRelevantHeaders(nsIChannel *aChannel)
{
mChannel = aChannel;
mHttpChannel = do_QueryInterface(aChannel);
nsDocument::RetrieveRelevantHeaders(aChannel);
if (mHttpChannel) {
nsCAutoString header;
nsresult rv;
// The misspelled key 'referer' is as per the HTTP spec
rv = mHttpChannel->GetRequestHeader(NS_LITERAL_CSTRING("referer"),
header);
if (NS_SUCCEEDED(rv)) {
SetReferrer(NS_ConvertASCIItoUCS2(header));
}
}
return;
}
nsresult
nsHTMLDocument::StartDocumentLoad(const char* aCommand,
nsIChannel* aChannel,
@@ -1198,14 +1175,6 @@ nsHTMLDocument::InternalGetNumberOfStyleSheets() const
return count;
}
NS_IMETHODIMP
nsHTMLDocument::SetReferrer(const nsAString& aReferrer)
{
mReferrer.Assign(aReferrer);
return NS_OK;
}
nsICSSLoader*
nsHTMLDocument::GetCSSLoader()
{
@@ -1805,9 +1774,7 @@ nsHTMLDocument::GetTitle(nsAString& aTitle)
NS_IMETHODIMP
nsHTMLDocument::GetReferrer(nsAString& aReferrer)
{
aReferrer.Assign(mReferrer);
return NS_OK;
return nsDocument::GetReferrer(aReferrer);
}
void