Bug 1880433 - Restore previous internal priority of <link rel=preload as=fetch>. r=valentin,necko-reviewers

In bug 1866277 we aligned internal priority of
`<link rel=preload as=fetch>` when `network.fetchpriority` is disabled
with the case of `fetchpriority=auto` (PRIORITY_HIGH), effectively
exposing a behavior change in M124. This commit restores the previous
behavior when `network.fetchpriority` is disabled (PRIORITY_NORMAL)
and instead aligns `fetchpriority=auto` with that value.

Differential Revision: https://phabricator.services.mozilla.com/D201944
This commit is contained in:
Frédéric Wang 2024-02-15 09:07:21 +00:00
Родитель 12ca0b3d27
Коммит f3ac8a2b4f
2 изменённых файлов: 9 добавлений и 9 удалений

Просмотреть файл

@ -149,25 +149,25 @@ const kExpectedRequestsOfLinkPreloadFetch = [
internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_HIGH
},
{ fileNameAndSuffix: "dummy.txt?3",
internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_HIGH
internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_NORMAL
},
{ fileNameAndSuffix: "dummy.txt?4",
internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_HIGH
internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_NORMAL
},
];
const kExpectedRequestsOfLinkPreloadFetchDisabled = [
{ fileNameAndSuffix: "dummy.txt?1",
internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_HIGH
internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_NORMAL
},
{ fileNameAndSuffix: "dummy.txt?2",
internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_HIGH
internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_NORMAL
},
{ fileNameAndSuffix: "dummy.txt?3",
internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_HIGH
internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_NORMAL
},
{ fileNameAndSuffix: "dummy.txt?4",
internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_HIGH
internalPriority: SpecialPowers.Ci.nsISupportsPriority.PRIORITY_NORMAL
},
];

Просмотреть файл

@ -163,12 +163,12 @@ class SupportsPriorityValueFor {
static int32_t LinkRelPreloadFetch(const FetchPriority aFetchPriority) {
if (!StaticPrefs::network_fetchpriority_enabled()) {
return nsISupportsPriority::PRIORITY_HIGH;
return nsISupportsPriority::PRIORITY_NORMAL;
}
switch (aFetchPriority) {
case FetchPriority::Auto:
return nsISupportsPriority::PRIORITY_HIGH;
return nsISupportsPriority::PRIORITY_NORMAL;
case FetchPriority::High:
return nsISupportsPriority::PRIORITY_HIGH;
case FetchPriority::Low:
@ -176,7 +176,7 @@ class SupportsPriorityValueFor {
}
MOZ_ASSERT_UNREACHABLE();
return nsISupportsPriority::PRIORITY_HIGH;
return nsISupportsPriority::PRIORITY_NORMAL;
}
};