Bug 1866277 - Fix <link rel=preload as=fetch> priority when fetchpriority disabled. r=emilio

This commit aligns the internal priority of <link rel=preload as=fetch>
when fetchpriority support is disabled with the fetchpriority=auto case
when the support is enabled. Also aligns unreachable code in
LinkRelPreloadFetch with that value.

Differential Revision: https://phabricator.services.mozilla.com/D199877
This commit is contained in:
Frédéric Wang 2024-02-05 16:34:04 +00:00
Родитель a8beb5525e
Коммит dfe20823f5
2 изменённых файлов: 2 добавлений и 10 удалений

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

@ -1,11 +1,3 @@
[fetchpriority-disabled.h2.html]
lsan-allowed: [mozilla::net::AddStaticElement, InitializeStaticHeaders, mozilla::net::nvFIFO::nvFIFO, mozilla::net::Http2BaseCompressor::Http2BaseCompressor] # https://bugzilla.mozilla.org/show_bug.cgi?id=1759310
prefs: [network.fetchpriority.enabled:false]
[link-initial-preload-fetch.h2.html: test different 'fetchpriority' values]
expected: FAIL
[link-dynamic-preload-fetch.h2.html: test different 'fetchpriority' values]
expected: FAIL
[link-header.h2.html?pipe=header(Link,<dummy.txt?1>; rel=preload; as=fetch; fetchpriority=low,True)|header(Link,<dummy.txt?2>; rel=preload; as=fetch; fetchpriority=high,True)|header(Link,<dummy.txt?3>; rel=preload; as=fetch; fetchpriority=auto,True)|header(Link,<dummy.txt?4>; rel=preload; as=fetch,True): test different 'fetchpriority' values]
expected: FAIL

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

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