Issue #2641 - Speculative load changes for referrerpolicy

This commit is contained in:
Moonchild 2024-10-20 09:35:39 +02:00 committed by roytam1
commit f6f046930d
20 changed files with 262 additions and 128 deletions

View file

@ -1941,6 +1941,7 @@ Loader::LoadInlineStyle(nsIContent* aElement,
uint32_t aLineNumber,
const nsAString& aTitle,
const nsAString& aMedia,
ReferrerPolicy aReferrerPolicy,
Element* aScopeElement,
nsICSSLoaderObserver* aObserver,
bool* aCompleted,
@ -1964,11 +1965,12 @@ Loader::LoadInlineStyle(nsIContent* aElement,
// Since we're not planning to load a URI, no need to hand a principal to the
// load data or to CreateSheet(). Also, OK to use CORS_NONE for the CORS
// mode and mDocument's ReferrerPolicy.
// mode.
StyleSheetState state;
RefPtr<StyleSheet> sheet;
nsresult rv = CreateSheet(nullptr, aElement, nullptr, eAuthorSheetFeatures,
CORS_NONE, mDocument->GetReferrerPolicy(),
CORS_NONE, aReferrerPolicy,
EmptyString(), // no inline integrity checks
false, false, aTitle, state, aIsAlternate,
&sheet);