Backed out changeset 1313a6a0c641 (bug 1669453) for causing wpt failures in history_pushstate_url_rewriting.html CLOSED TREE

This commit is contained in:
Cristian Tuns 2024-01-10 21:16:11 -05:00
Родитель 3face5ef94
Коммит 31c5852d57
3 изменённых файлов: 22 добавлений и 9 удалений

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

@ -11264,19 +11264,16 @@ nsDocShell::AddState(JS::Handle<JS::Value> aData, const nsAString& aTitle,
// It's very important that we check that newURI is of the same
// origin as currentURI, not docBaseURI, because a page can
// set docBaseURI arbitrarily to any domain.
bool isPrivateWin =
document->NodePrincipal()->OriginAttributesRef().mPrivateBrowsingId >
0;
if (NS_FAILED(secMan->CheckSameOriginURI(currentURI, newURI, true,
isPrivateWin))) {
return NS_ERROR_DOM_SECURITY_ERR;
}
nsAutoCString currentUserPass, newUserPass;
NS_ENSURE_SUCCESS(currentURI->GetUserPass(currentUserPass),
NS_ERROR_FAILURE);
NS_ENSURE_SUCCESS(newURI->GetUserPass(newUserPass), NS_ERROR_FAILURE);
if (!currentUserPass.Equals(newUserPass)) {
bool isPrivateWin =
document->NodePrincipal()->OriginAttributesRef().mPrivateBrowsingId >
0;
if (NS_FAILED(secMan->CheckSameOriginURI(currentURI, newURI, true,
isPrivateWin)) ||
!currentUserPass.Equals(newUserPass)) {
return NS_ERROR_DOM_SECURITY_ERR;
}
} else {

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

@ -0,0 +1,8 @@
[001.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[pushState must not be allowed to create cross-origin URLs (about:blank)]
expected: FAIL
[pushState must not be allowed to create cross-origin URLs (data:URI)]
expected: FAIL

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

@ -0,0 +1,8 @@
[002.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[replaceState must not be allowed to create cross-origin URLs (about:blank)]
expected: FAIL
[replaceState must not be allowed to create cross-origin URLs (data:URI)]
expected: FAIL