Bug 1165501 - using most recent referrer policy found in the document. r=sstamm

This commit is contained in:
Franziskus Kiefer
2015-05-27 13:29:00 -07:00
parent 63572c89e4
commit cc22ddddd1
6 changed files with 94 additions and 45 deletions

View File

@@ -63,7 +63,6 @@ static nsITimer* gFlushTimer = nullptr;
nsHtml5TreeOpExecutor::nsHtml5TreeOpExecutor()
: nsHtml5DocumentBuilder(false)
, mPreloadedURLs(23) // Mean # of preloadable resources per page on dmoz
, mSpeculationReferrerPolicyWasSet(false)
, mSpeculationReferrerPolicy(mozilla::net::RP_Default)
{
// zeroing operator new for everything else
@@ -1010,20 +1009,10 @@ nsHtml5TreeOpExecutor::SetSpeculationReferrerPolicy(const nsAString& aReferrerPo
void
nsHtml5TreeOpExecutor::SetSpeculationReferrerPolicy(ReferrerPolicy aReferrerPolicy)
{
if (mSpeculationReferrerPolicyWasSet &&
aReferrerPolicy != mSpeculationReferrerPolicy) {
// According to the Referrer Policy spec, if there's already been a policy
// set and another attempt is made to set a _different_ policy, the result
// is a "No Referrer" policy.
mSpeculationReferrerPolicy = mozilla::net::RP_No_Referrer;
}
else {
// Record "speculated" referrer policy locally and thread through the
// speculation phase. The actual referrer policy will be set by
// HTMLMetaElement::BindToTree().
mSpeculationReferrerPolicyWasSet = true;
mSpeculationReferrerPolicy = aReferrerPolicy;
}
// Record "speculated" referrer policy locally and thread through the
// speculation phase. The actual referrer policy will be set by
// HTMLMetaElement::BindToTree().
mSpeculationReferrerPolicy = aReferrerPolicy;
}
#ifdef DEBUG_NS_HTML5_TREE_OP_EXECUTOR_FLUSH