Bug 1546041 - Throw TypeError if mode is Navigate r=baku

According to spec, we should throw TypeError if the mode is Navigate.

Differential Revision: https://phabricator.services.mozilla.com/D31245

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kershaw Chang 2019-05-15 20:36:09 +00:00
Родитель 899bfb263a
Коммит b53ba78d32
2 изменённых файлов: 5 добавлений и 6 удалений

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

@ -322,9 +322,11 @@ already_AddRefed<Request> 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<MSG_INVALID_REQUEST_MODE>(NS_LITERAL_STRING("navigate"));
return nullptr;
}
if (aInit.IsAnyMemberPresent() && request->Mode() == RequestMode::Navigate) {
mode = RequestMode::Same_origin;
}

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

@ -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