зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1534343 - Document should check if its mCookieSettings exists before using it, r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D23764 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
d0b98b2150
Коммит
13f97ffdb7
|
@ -11830,7 +11830,7 @@ DocumentAutoplayPolicy Document::AutoplayPolicy() const {
|
|||
}
|
||||
|
||||
void Document::MaybeAllowStorageForOpenerAfterUserInteraction() {
|
||||
if (mCookieSettings->GetCookieBehavior() !=
|
||||
if (CookieSettings()->GetCookieBehavior() !=
|
||||
nsICookieService::BEHAVIOR_REJECT_TRACKER) {
|
||||
return;
|
||||
}
|
||||
|
@ -12352,7 +12352,7 @@ already_AddRefed<mozilla::dom::Promise> Document::RequestStorageAccess(
|
|||
}
|
||||
|
||||
// Only enforce third-party checks when there is a reason to enforce them.
|
||||
if (mCookieSettings->GetCookieBehavior() !=
|
||||
if (CookieSettings()->GetCookieBehavior() !=
|
||||
nsICookieService::BEHAVIOR_REJECT_TRACKER) {
|
||||
// Step 3. If the document's frame is the main frame, resolve.
|
||||
if (IsTopLevelContentDocument()) {
|
||||
|
@ -12405,7 +12405,7 @@ already_AddRefed<mozilla::dom::Promise> Document::RequestStorageAccess(
|
|||
return promise.forget();
|
||||
}
|
||||
|
||||
if (mCookieSettings->GetCookieBehavior() ==
|
||||
if (CookieSettings()->GetCookieBehavior() ==
|
||||
nsICookieService::BEHAVIOR_REJECT_TRACKER &&
|
||||
inner) {
|
||||
// Only do something special for third-party tracking content.
|
||||
|
|
|
@ -11,3 +11,4 @@ support-files =
|
|||
[test_sharedWorker.html]
|
||||
[test_worker.html]
|
||||
[test_xhr.html]
|
||||
[test_xmlDocument.html]
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test for Document constructor</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<script type="application/javascript">
|
||||
|
||||
SpecialPowers.pushPrefEnv({set: [
|
||||
["dom.storage_access.enabled", true],
|
||||
]}).then(_ => {
|
||||
const doc = new Document();
|
||||
doc.requestStorageAccess().catch(__ => {}).then(___ => {
|
||||
ok(true, "No crash!");
|
||||
SimpleTest.finish();
|
||||
});
|
||||
});
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче