Open Bug 1637671 Opened 5 years ago Updated 4 years ago

referrer policy changed by <meta> is not reverted between prescan and DOM building phase

Categories

(Core :: DOM: Core & HTML, defect)

defect

Tracking

()

People

(Reporter: mayhemer, Unassigned)

References

(Blocks 1 open bug)

Details

With a following markup:

<head>
<link rel="preload" as="font" type="font/woff2" href="/assets/fonts/adellesans-regular-webfont.woff2" crossorigin>
<meta name="referrer" content="no-referrer-when-downgrade" />
</head>

we start a preload as a speculative load during the prescan phase with referrer-policy = none (empty) while at the tree building phase, when an HTMLLinkElement is added, we don't find the preload and start a new (never used) load because referrer policy is calculated as "no-referrer-when-downgrade" now, regardless that the <meta> is present later in the markup.

interestingly, FontFaceSet::StartLoad finds the speculatively initiated preload because referrer policy is empty for the given font face src.

this reproduces with the current Nighty and network.preload true.

A life example is https://clearleft.com/

This can be seen on Yahoo Mail site and is one of the causes of https://bugzilla.mozilla.org/show_bug.cgi?id=1641532

Blocks: 1641532

I wonder if we should check referrer policy at all for the purposes of caching stylesheet loads, fwiw. In bug 1599160 I've left the policy check, but chances are we should remove it? What does the network cache do?

(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)

What does the network cache do?

We (HTTP cache) don't isolate by referrer policy at all. (modulo cached "vary: referer" response header.)

No longer blocks: 1641532
You need to log in before you can comment on or make changes to this bug.