diff --git a/dom/fetch/Request.cpp b/dom/fetch/Request.cpp index dcc800fde7aa..fe65bf59ba0e 100644 --- a/dom/fetch/Request.cpp +++ b/dom/fetch/Request.cpp @@ -322,9 +322,11 @@ already_AddRefed Request::Constructor(const GlobalObject& aGlobal, ? aInit.mCredentials.Value() : fallbackCredentials; - if (mode == RequestMode::Navigate || - (aInit.IsAnyMemberPresent() && - request->Mode() == RequestMode::Navigate)) { + if (mode == RequestMode::Navigate) { + aRv.ThrowTypeError(NS_LITERAL_STRING("navigate")); + return nullptr; + } + if (aInit.IsAnyMemberPresent() && request->Mode() == RequestMode::Navigate) { mode = RequestMode::Same_origin; } diff --git a/testing/web-platform/meta/fetch/api/request/request-error.html.ini b/testing/web-platform/meta/fetch/api/request/request-error.html.ini index b8da81855247..b74d414a242d 100644 --- a/testing/web-platform/meta/fetch/api/request/request-error.html.ini +++ b/testing/web-platform/meta/fetch/api/request/request-error.html.ini @@ -2,9 +2,6 @@ [RequestInit's window is not null] expected: FAIL - [RequestInit's mode is navigate] - expected: FAIL - [RequestInit's mode is no-cors and integrity is not empty] expected: FAIL