referrer policy changed by <meta> is not reverted between prescan and DOM building phase
Categories
(Core :: DOM: Core & HTML, 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.
Reporter | ||
Comment 1•5 years ago
|
||
A life example is https://clearleft.com/
Updated•5 years ago
|
Reporter | ||
Comment 2•4 years ago
|
||
This can be seen on Yahoo Mail site and is one of the causes of https://bugzilla.mozilla.org/show_bug.cgi?id=1641532
Comment 3•4 years ago
|
||
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?
Reporter | ||
Comment 4•4 years ago
|
||
(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.)
Description
•