Backed out 3 changesets (bug 1645234) for causing leaks. CLOSED TREE

Backed out changeset 6097753dbefa (bug 1645234)
Backed out changeset f74844ba692a (bug 1645234)
Backed out changeset a90a3c1efdc5 (bug 1645234)
This commit is contained in:
Csoregi Natalia 2020-07-10 01:54:09 +03:00
parent a1cb850855
commit 55e9fe527f
7 changed files with 0 additions and 134 deletions

View File

@ -129,7 +129,6 @@ support-files =
test-message-categories-workers.js
test-mixedcontent-securityerrors.html
test-navigate-to-parse-error.html
test-nested-iframe-storageaccess-errors.html
test-network-exceptions.html
test-network-request.html
test-network.html
@ -147,7 +146,6 @@ support-files =
test-sourcemap.min.js
test-sourcemap.min.js.map
test-stacktrace-location-debugger-link.html
test-storageaccess-errors.html
test-subresource-security-error.html
test-subresource-security-error.js
test-subresource-security-error.js^headers^
@ -319,7 +317,6 @@ skip-if = (os == "linux" && fission && !ccov) || (os == "win" && fission) #Bug 1
[browser_webconsole_promise_rejected_object.js]
[browser_webconsole_reopen_closed_tab.js]
[browser_webconsole_repeat_different_objects.js]
[browser_webconsole_requestStorageAccess_errors.js]
[browser_webconsole_reverse_search.js]
[browser_webconsole_reverse_search_initial_value.js]
[browser_webconsole_reverse_search_keyboard_navigation.js]

View File

@ -1,63 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const TEST_URI =
"https://example.com/browser/devtools/client/webconsole/test/browser/test-storageaccess-errors.html";
const LEARN_MORE_URI =
"https://developer.mozilla.org/docs/Web/API/Document/requestStorageAccess" +
DOCS_GA_PARAMS;
const { UrlClassifierTestUtils } = ChromeUtils.import(
"resource://testing-common/UrlClassifierTestUtils.jsm"
);
UrlClassifierTestUtils.addTestTrackers();
registerCleanupFunction(function() {
UrlClassifierTestUtils.cleanupTestTrackers();
});
add_task(async function() {
const hud = await openNewTabAndConsole(TEST_URI);
async function checkErrorMessage(text) {
const message = await waitFor(
() => findMessage(hud, text, ".message.error"),
undefined,
100
);
ok(true, "Error message is visible: " + text);
const checkLink = ({ link, where, expectedLink, expectedTab }) => {
is(link, expectedLink, `Clicking the provided link opens ${link}`);
is(
where,
expectedTab,
`Clicking the provided link opens in expected tab`
);
};
info("Clicking on the Learn More link");
const learnMoreLink = message.querySelector(".learn-more-link");
const linkSimulation = await simulateLinkClick(learnMoreLink);
checkLink({
...linkSimulation,
expectedLink: LEARN_MORE_URI,
expectedTab: "tab",
});
}
const userGesture =
"document.requestStorageAccess() may only be requested from inside a short running user-generated event handler";
const nested =
"document.requestStorageAccess() may not be called in a nested iframe.";
const nullPrincipal =
"document.requestStorageAccess() may not be called on a document with an opaque origin, such as a sandboxed iframe without allow-same-origin in its sandbox attribute.";
const sandboxed =
"document.requestStorageAccess() may not be called in a sandboxed iframe without allow-storage-access-by-user-activation in its sandbox attribute.";
await checkErrorMessage(userGesture);
await checkErrorMessage(nullPrincipal);
await checkErrorMessage(nested);
await checkErrorMessage(sandboxed);
});

View File

@ -1,14 +0,0 @@
<!DOCTYPE HTML>
<html dir="ltr" xml:lang="en-US" lang="en-US">
<head>
<meta charset="utf8">
<title>requestStorageAccess test</title>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
</head>
<body>
<iframe src="https://itisatracker.org/browser/devtools/client/webconsole/test/browser/test-storageaccess-errors.html"></iframe>
</body>
</html>

View File

@ -1,28 +0,0 @@
<!DOCTYPE HTML>
<html dir="ltr" xml:lang="en-US" lang="en-US">
<head>
<meta charset="utf8">
<title>requestStorageAccess test</title>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
</head>
<body>
<iframe id="testNested"></iframe>
<iframe id="testNullPrincipal" sandbox="allow-scripts"></iframe>
<iframe id="testSandboxed" sandbox="allow-same-origin allow-scripts"></iframe>
<iframe id="testUserGesture"></iframe>
<script>
'use strict';
if (window.location.host != "itisatracker.org") {
document.getElementById("testNested").setAttribute("src", "https://itisatracker.org/browser/devtools/client/webconsole/test/browser/test-nested-iframe-storageaccess-errors.html");
document.getElementById("testNullPrincipal").setAttribute("src", "https://itisatracker.org/browser/devtools/client/webconsole/test/browser/test-storageaccess-errors.html");
document.getElementById("testSandboxed").setAttribute("src", "https://itisatracker.org/browser/devtools/client/webconsole/test/browser/test-storageaccess-errors.html");
document.getElementById("testUserGesture").setAttribute("src", "https://itisatracker.org/browser/devtools/client/webconsole/test/browser/test-storageaccess-errors.html");
} else {
document.requestStorageAccess();
}
</script>
</body>
</html>

View File

@ -114,8 +114,6 @@ const TLS_LEARN_MORE =
"https://blog.mozilla.org/security/2018/10/15/removing-old-versions-of-tls/";
const X_FRAME_OPTIONS_LEARN_MORE =
"https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Frame-Options";
const REQUEST_STORAGE_ACCESS_LEARN_MORE =
"https://developer.mozilla.org/docs/Web/API/Document/requestStorageAccess";
const ErrorCategories = {
"X-Frame-Options": X_FRAME_OPTIONS_LEARN_MORE,
"Insecure Password Field": INSECURE_PASSWORDS_LEARN_MORE,
@ -128,7 +126,6 @@ const ErrorCategories = {
MIMEMISMATCH: MIME_TYPE_MISMATCH_LEARN_MORE,
"source map": SOURCE_MAP_LEARN_MORE,
TLS: TLS_LEARN_MORE,
requestStorageAccess: REQUEST_STORAGE_ACCESS_LEARN_MORE,
};
const baseCorsErrorUrl =

View File

@ -15886,10 +15886,6 @@ already_AddRefed<mozilla::dom::Promise> Document::RequestStorageAccess(
// Step 2. If the document has a null origin, reject.
if (NodePrincipal()->GetIsNullPrincipal()) {
nsContentUtils::ReportToConsole(nsIScriptError::errorFlag,
nsLiteralCString("requestStorageAccess"),
this, nsContentUtils::eDOM_PROPERTIES,
"RequestStorageAccessNullPrincipal");
promise->MaybeRejectWithUndefined();
return promise.forget();
}
@ -15939,9 +15935,6 @@ already_AddRefed<mozilla::dom::Promise> Document::RequestStorageAccess(
// Step 6. If the sub frame doesn't have the token
// "allow-storage-access-by-user-activation", reject.
if (StorageAccessSandboxed()) {
nsContentUtils::ReportToConsole(
nsIScriptError::errorFlag, nsLiteralCString("requestStorageAccess"),
this, nsContentUtils::eDOM_PROPERTIES, "RequestStorageAccessSandboxed");
promise->MaybeRejectWithUndefined();
return promise.forget();
}
@ -15949,19 +15942,12 @@ already_AddRefed<mozilla::dom::Promise> Document::RequestStorageAccess(
// Step 7. If the sub frame's parent frame is not the top frame, reject.
RefPtr<BrowsingContext> parentBC = bc->GetParent();
if (parentBC && !parentBC->IsTopContent()) {
nsContentUtils::ReportToConsole(
nsIScriptError::errorFlag, nsLiteralCString("requestStorageAccess"),
this, nsContentUtils::eDOM_PROPERTIES, "RequestStorageAccessNested");
promise->MaybeRejectWithUndefined();
return promise.forget();
}
// Step 8. If the browser is not processing a user gesture, reject.
if (!UserActivation::IsHandlingUserInput()) {
nsContentUtils::ReportToConsole(nsIScriptError::errorFlag,
nsLiteralCString("requestStorageAccess"),
this, nsContentUtils::eDOM_PROPERTIES,
"RequestStorageAccessUserGesture");
promise->MaybeRejectWithUndefined();
return promise.forget();
}

View File

@ -394,12 +394,3 @@ UnknownProtocolNavigationPrevented=Prevented navigation to “%1$S” due to an
PostMessageSharedMemoryObjectToCrossOriginWarning=Cannot post message containing a shared memory object to a cross-origin window.
# LOCALIZATION NOTE: %S is the URL of the resource in question
UnusedLinkPreloadPending=The resource at “%S” preloaded with link preload was not used within a few seconds. Make sure all attributes of the preload tag are set correctly.
# LOCALIZATION NOTE: Do not translate document.requestStorageAccess(), iframe, allow-same-origin and sandbox (though you may translate "sandboxed").
RequestStorageAccessNullPrincipal=document.requestStorageAccess() may not be called on a document with an opaque origin, such as a sandboxed iframe without allow-same-origin in its sandbox attribute.
# LOCALIZATION NOTE: Do not translate document.requestStorageAccess(), iframe, allow-storage-access-by-user-activation and sandbox (though you may translate "sandboxed").
RequestStorageAccessSandboxed=document.requestStorageAccess() may not be called in a sandboxed iframe without allow-storage-access-by-user-activation in its sandbox attribute.
# LOCALIZATION NOTE: Do not translate document.requestStorageAccess() and iframe.
RequestStorageAccessNested=document.requestStorageAccess() may not be called in a nested iframe.
# LOCALIZATION NOTE: Do not translate document.requestStorageAccess(). In some locales it may be preferable to not translate "event handler", either.
RequestStorageAccessUserGesture=document.requestStorageAccess() may only be requested from inside a short running user-generated event handler.