Backed out 3 changesets (bug 1776109) for causing multiple failures. CLOSED TREE

Backed out changeset 8e76401f7c43 (bug 1776109)
Backed out changeset 1cdbbad1d996 (bug 1776109)
Backed out changeset 66bb4c49d615 (bug 1776109)
This commit is contained in:
criss 2022-06-30 03:23:01 +03:00
Родитель 8fdac7788a
Коммит a78fdd3dc0
41 изменённых файлов: 128 добавлений и 626 удалений

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

@ -3253,14 +3253,6 @@ bool nsGlobalWindowInner::CachesEnabled(JSContext* aCx, JSObject*) {
if (!StaticPrefs::dom_caches_enabled()) {
return false;
}
if (StaticPrefs::dom_caches_hide_in_pbmode_enabled()) {
if (const nsCOMPtr<nsIGlobalObject> global =
xpc::CurrentNativeGlobal(aCx)) {
if (global->GetStorageAccess() == StorageAccess::ePrivateBrowsing) {
return false;
}
}
}
if (!JS::GetIsSecureContext(js::GetContextRealm(aCx))) {
return StaticPrefs::dom_caches_testing_enabled() ||
StaticPrefs::dom_serviceWorkers_testing_enabled();

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

@ -82,6 +82,3 @@ support-files = file_title.xhtml
[test_swapFrameLoaders.xhtml]
skip-if = os == 'mac' # bug 1674413
[test_bug1339722.html]
[test_hide_in_pbmode.html]
support-files =
file_hide_in_pbmode.js

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

@ -1,68 +0,0 @@
/* global importScripts */
const isWorker = typeof DedicatedWorkerGlobalScope === "function";
function check(content, expected, item) {
const exposed = expected ? "is exposed without" : "is not exposed with";
const worker = isWorker ? "in worker" : "in window";
is(
content.eval(`!!globalThis.${item}`),
expected,
`${item} ${exposed} pbmode ${worker}`
);
}
function checkCaches(content, expected) {
check(content, expected, "caches");
check(content, expected, "Cache");
check(content, expected, "CacheStorage");
}
function checkIDB(content, expected) {
check(content, expected, "indexedDB");
check(content, expected, "IDBCursor");
check(content, expected, "IDBDatabase");
check(content, expected, "IDBFactory");
check(content, expected, "IDBIndex");
check(content, expected, "IDBKeyRange");
check(content, expected, "IDBObjectStore");
check(content, expected, "IDBOpenDBRequest");
check(content, expected, "IDBRequest");
check(content, expected, "IDBTransaction");
check(content, expected, "IDBVersionChangeEvent");
}
function checkSW(content, expected) {
if (isWorker) {
// Currently not supported. Bug 1131324
return;
}
check(content, expected, "navigator.serviceWorker");
check(content, expected, "ServiceWorker");
check(content, expected, "ServiceWorkerContainer");
check(content, expected, "ServiceWorkerRegistration");
check(content, expected, "NavigationPreloadManager");
check(content, expected, "PushManager");
check(content, expected, "PushSubscription");
check(content, expected, "PushSubscriptionOptions");
}
function checkAll(content, expected) {
checkCaches(content, expected);
checkIDB(content, expected);
checkSW(content, expected);
}
if (isWorker) {
importScripts("/tests/SimpleTest/WorkerSimpleTest.js");
globalThis.onmessage = ev => {
const { expected } = ev.data;
checkAll(globalThis, expected);
postMessage({
kind: "info",
next: true,
description: "Worker test finished",
});
};
}

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

@ -1,70 +0,0 @@
<!DOCTYPE html>
<title>Test for hiding features in Private Browsing</title>
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script src="chrome://mochikit/content/tests/SimpleTest/WorkerHandler.js"></script>
<script src="file_hide_in_pbmode.js"></script>
<link rel="stylesheet" href="chrome://mochikit/content/tests/SimpleTest/test.css">
<script>
const { BrowserTestUtils } = ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm");
const contentPage = "https://example.org/chrome/dom/workers/test/empty.html";
function openBrowserWindow(url, { private }) {
return new Promise(resolve => {
const win = window.browsingContext.topChromeWindow.OpenBrowserWindow({ private });
win.addEventListener("load", () => {
const listener = () => {
if (win.content.location.href != contentPage) {
BrowserTestUtils.loadURI(win.gBrowser, contentPage);
return;
}
win.removeEventListener("DOMContentLoaded", listener);
resolve(win);
}
win.addEventListener("DOMContentLoaded", listener);
}, { once: true });
});
}
function runWorkerTest(content, expected) {
return new Promise((resolve, reject) => {
/** @type {Worker} */
const worker = content.eval("new Worker('/chrome/dom/base/test/chrome/file_hide_in_pbmode.js')");
worker.postMessage({ expected });
worker.onerror = reject;
listenForTests(worker);
worker.addEventListener("message", ev => {
if (ev.data.next) {
worker.terminate();
resolve();
}
});
});
}
async function runTest() {
// sanity check
let win = await openBrowserWindow(contentPage, { private: false });
checkAll(win.content, true);
await runWorkerTest(win.content, true);
win.close();
win = await openBrowserWindow(contentPage, { private: true });
checkAll(win.content, false);
await runWorkerTest(win.content, false);
win.close();
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({
set: [
["dom.caches.hide_in_pbmode.enabled", true],
["dom.indexedDB.hide_in_pbmode.enabled", true],
["dom.serviceWorkers.hide_in_pbmode.enabled", true],
]
}, runTest);
</script>

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

@ -359,21 +359,6 @@ bool IDBFactory::AllowedForPrincipal(nsIPrincipal* aPrincipal,
return !aPrincipal->GetIsNullPrincipal();
}
bool IDBFactory::IsEnabled(JSContext* aCx, JSObject* aGlobal) {
if (StaticPrefs::dom_indexedDB_privateBrowsing_enabled()) {
return true;
}
if (StaticPrefs::dom_indexedDB_hide_in_pbmode_enabled()) {
if (const nsCOMPtr<nsIGlobalObject> global =
xpc::CurrentNativeGlobal(aCx)) {
if (global->GetStorageAccess() == StorageAccess::ePrivateBrowsing) {
return false;
}
}
}
return true;
}
void IDBFactory::UpdateActiveTransactionCount(int32_t aDelta) {
AssertIsOnOwningThread();
MOZ_DIAGNOSTIC_ASSERT(aDelta > 0 || (mActiveTransactionCount + aDelta) <

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

@ -97,8 +97,6 @@ class IDBFactory final : public nsISupports, public nsWrapperCache {
static bool AllowedForPrincipal(nsIPrincipal* aPrincipal,
bool* aIsSystemPrincipal = nullptr);
static bool IsEnabled(JSContext* aCx, JSObject* aGlobal);
void AssertIsOnOwningThread() const { NS_ASSERT_OWNINGTHREAD(IDBFactory); }
nsISerialEventTarget* EventTarget() const {

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

@ -16,7 +16,6 @@
#include "mozilla/dom/PushSubscriptionOptionsBinding.h"
#include "mozilla/dom/PushUtil.h"
#include "mozilla/dom/RootedDictionary.h"
#include "mozilla/dom/ServiceWorker.h"
#include "mozilla/dom/WorkerRunnable.h"
#include "mozilla/dom/WorkerScope.h"
@ -410,10 +409,6 @@ already_AddRefed<PushManager> PushManager::Constructor(GlobalObject& aGlobal,
return ret.forget();
}
bool PushManager::IsEnabled(JSContext* aCx, JSObject* aGlobal) {
return StaticPrefs::dom_push_enabled() && ServiceWorkerVisible(aCx, aGlobal);
}
already_AddRefed<Promise> PushManager::Subscribe(
const PushSubscriptionOptionsInit& aOptions, ErrorResult& aRv) {
if (mImpl) {

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

@ -74,8 +74,6 @@ class PushManager final : public nsISupports, public nsWrapperCache {
const nsAString& aScope,
ErrorResult& aRv);
static bool IsEnabled(JSContext* aCx, JSObject* aGlobal);
already_AddRefed<Promise> PerformSubscriptionActionFromWorker(
SubscriptionAction aAction, ErrorResult& aRv);

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

@ -7,14 +7,14 @@
#include "NavigationPreloadManager.h"
#include "ServiceWorkerUtils.h"
#include "nsNetUtil.h"
#include "mozilla/StaticPrefs_dom.h"
#include "mozilla/dom/NavigationPreloadManagerBinding.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/ServiceWorker.h"
#include "mozilla/ipc/MessageChannel.h"
namespace mozilla::dom {
using mozilla::ipc::ResponseRejectReason;
NS_IMPL_CYCLE_COLLECTING_ADDREF(NavigationPreloadManager)
NS_IMPL_CYCLE_COLLECTING_RELEASE(NavigationPreloadManager)
@ -30,11 +30,6 @@ bool NavigationPreloadManager::IsValidHeader(const nsACString& aHeader) {
return NS_IsReasonableHTTPHeaderValue(aHeader);
}
bool NavigationPreloadManager::IsEnabled(JSContext* aCx, JSObject* aGlobal) {
return StaticPrefs::dom_serviceWorkers_navigationPreload_enabled() &&
ServiceWorkerVisible(aCx, aGlobal);
}
NavigationPreloadManager::NavigationPreloadManager(
nsCOMPtr<nsIGlobalObject>&& aGlobal,
RefPtr<ServiceWorkerRegistration::Inner>& aInner)

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

@ -28,8 +28,6 @@ class NavigationPreloadManager final : public nsISupports,
static bool IsValidHeader(const nsACString& aHeader);
static bool IsEnabled(JSContext* aCx, JSObject* aGlobal);
NavigationPreloadManager(nsCOMPtr<nsIGlobalObject>&& aGlobal,
RefPtr<ServiceWorkerRegistration::Inner>& aInner);

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

@ -19,11 +19,9 @@
#include "mozilla/dom/ClientIPCTypes.h"
#include "mozilla/dom/ClientState.h"
#include "mozilla/dom/MessagePortBinding.h"
#include "mozilla/dom/Navigator.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/ServiceWorkerGlobalScopeBinding.h"
#include "mozilla/dom/WorkerPrivate.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/StaticPrefs_dom.h"
#include "mozilla/StorageAccess.h"
@ -31,67 +29,17 @@
# undef PostMessage
#endif
using mozilla::ErrorResult;
using namespace mozilla::dom;
namespace mozilla::dom {
static bool IsServiceWorkersTestingEnabledInWindow(JSObject* const aGlobal) {
if (const nsCOMPtr<nsPIDOMWindowInner> innerWindow =
Navigator::GetWindowFromGlobal(aGlobal)) {
if (auto* bc = innerWindow->GetBrowsingContext()) {
return bc->Top()->ServiceWorkersTestingEnabled();
}
}
return false;
}
bool ServiceWorkersEnabled(JSContext* aCx, JSObject* aGlobal) {
MOZ_ASSERT(NS_IsMainThread());
if (!StaticPrefs::dom_serviceWorkers_enabled()) {
return false;
}
if (StaticPrefs::dom_serviceWorkers_hide_in_pbmode_enabled()) {
if (const nsCOMPtr<nsIGlobalObject> global =
xpc::CurrentNativeGlobal(aCx)) {
if (global->GetStorageAccess() == StorageAccess::ePrivateBrowsing) {
return false;
}
}
}
// Allow a webextension principal to register a service worker script with
// a moz-extension url only if 'extensions.service_worker_register.allowed'
// is true.
if (!StaticPrefs::extensions_serviceWorkerRegister_allowed()) {
nsIPrincipal* principal = nsContentUtils::SubjectPrincipal(aCx);
if (principal && BasePrincipal::Cast(principal)->AddonPolicy()) {
return false;
}
}
if (IsSecureContextOrObjectIsFromSecureContext(aCx, aGlobal)) {
return true;
}
return StaticPrefs::dom_serviceWorkers_testing_enabled() ||
IsServiceWorkersTestingEnabledInWindow(aGlobal);
}
bool ServiceWorkerVisible(JSContext* aCx, JSObject* aGlobal) {
bool ServiceWorkerVisible(JSContext* aCx, JSObject* aObj) {
if (NS_IsMainThread()) {
// We want to expose ServiceWorker interface only when
// navigator.serviceWorker is available. Currently it may not be available
// with some reasons:
// 1. navigator.serviceWorker is not supported in workers. (bug 1131324)
// 2. `dom.serviceWorkers.hide_in_pbmode.enabled` wants to hide it in
// private browsing mode.
return ServiceWorkersEnabled(aCx, aGlobal);
return StaticPrefs::dom_serviceWorkers_enabled();
}
// We are already in ServiceWorker and interfaces need to be exposed for e.g.
// globalThis.registration.serviceWorker. Note that navigator.serviceWorker
// is still not supported. (bug 1131324)
return IS_INSTANCE_OF(ServiceWorkerGlobalScope, aGlobal);
return IS_INSTANCE_OF(ServiceWorkerGlobalScope, aObj);
}
// static

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

@ -30,9 +30,7 @@ struct StructuredSerializeOptions;
} \
}
bool ServiceWorkersEnabled(JSContext* aCx, JSObject* aGlobal);
bool ServiceWorkerVisible(JSContext* aCx, JSObject* aGlobal);
bool ServiceWorkerVisible(JSContext* aCx, JSObject* aObj);
class ServiceWorker final : public DOMEventTargetHelper {
public:

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

@ -20,6 +20,7 @@
#include "nsCycleCollectionParticipant.h"
#include "nsServiceManagerUtils.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/LoadInfo.h"
#include "mozilla/SchedulerGroup.h"
#include "mozilla/StaticPrefs_extensions.h"
@ -58,6 +59,63 @@ NS_IMPL_RELEASE_INHERITED(ServiceWorkerContainer, DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_INHERITED(ServiceWorkerContainer, DOMEventTargetHelper,
mControllerWorker, mReadyPromise)
namespace {
bool IsInPrivateBrowsing(JSContext* const aCx) {
if (const nsCOMPtr<nsIGlobalObject> global = xpc::CurrentNativeGlobal(aCx)) {
if (const nsCOMPtr<nsIPrincipal> principal = global->PrincipalOrNull()) {
return principal->GetPrivateBrowsingId() > 0;
}
}
return false;
}
bool IsServiceWorkersTestingEnabledInWindow(JSObject* const aGlobal) {
if (const nsCOMPtr<nsPIDOMWindowInner> innerWindow =
Navigator::GetWindowFromGlobal(aGlobal)) {
if (auto* bc = innerWindow->GetBrowsingContext()) {
return bc->Top()->ServiceWorkersTestingEnabled();
}
}
return false;
}
} // namespace
/* static */
bool ServiceWorkerContainer::IsEnabled(JSContext* aCx, JSObject* aGlobal) {
MOZ_ASSERT(NS_IsMainThread());
// FIXME: Why does this need to root? Shouldn't the caller root aGlobal for
// us?
JS::Rooted<JSObject*> global(aCx, aGlobal);
if (!StaticPrefs::dom_serviceWorkers_enabled()) {
return false;
}
if (IsInPrivateBrowsing(aCx)) {
return false;
}
// Allow a webextension principal to register a service worker script with
// a moz-extension url only if 'extensions.service_worker_register.allowed'
// is true.
if (!StaticPrefs::extensions_serviceWorkerRegister_allowed()) {
nsIPrincipal* principal = nsContentUtils::SubjectPrincipal(aCx);
if (principal && BasePrincipal::Cast(principal)->AddonPolicy()) {
return false;
}
}
if (IsSecureContextOrObjectIsFromSecureContext(aCx, global)) {
return true;
}
return StaticPrefs::dom_serviceWorkers_testing_enabled() ||
IsServiceWorkersTestingEnabledInWindow(global);
}
// static
already_AddRefed<ServiceWorkerContainer> ServiceWorkerContainer::Create(
nsIGlobalObject* aGlobal) {

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

@ -942,11 +942,14 @@ var interfaceNamesInGlobalScope = [
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "PublicKeyCredential" },
// IMPORTANT: Do not change this list without review from a DOM peer!
"PushManager",
{ name: "PushManager", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
"PushSubscription",
{ name: "PushSubscription", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
"PushSubscriptionOptions",
{
name: "PushSubscriptionOptions",
insecureContext: true,
},
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "RadioNodeList", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
@ -1026,11 +1029,11 @@ var interfaceNamesInGlobalScope = [
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "Selection", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
"ServiceWorker",
{ name: "ServiceWorker", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
"ServiceWorkerContainer",
{ name: "ServiceWorkerContainer", insecureContext: false },
// IMPORTANT: Do not change this list without review from a DOM peer!
"ServiceWorkerRegistration",
{ name: "ServiceWorkerRegistration", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "ScopedCredential", insecureContext: true, disabled: true },
// IMPORTANT: Do not change this list without review from a DOM peer!

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

@ -14,7 +14,7 @@ enum IDBCursorDirection {
"prevunique"
};
[Exposed=(Window,Worker), Func="IDBFactory::IsEnabled"]
[Exposed=(Window,Worker)]
interface IDBCursor {
readonly attribute (IDBObjectStore or IDBIndex) source;
@ -45,7 +45,7 @@ interface IDBCursor {
IDBRequest delete ();
};
[Exposed=(Window,Worker), Func="IDBFactory::IsEnabled"]
[Exposed=(Window,Worker)]
interface IDBCursorWithValue : IDBCursor {
[Throws]
readonly attribute any value;

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

@ -10,7 +10,7 @@
* liability, trademark and document use rules apply.
*/
[Exposed=(Window,Worker), Func="IDBFactory::IsEnabled"]
[Exposed=(Window,Worker)]
interface IDBDatabase : EventTarget {
readonly attribute DOMString name;
readonly attribute unsigned long long version;

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

@ -23,7 +23,7 @@ dictionary IDBOpenDBOptions
* http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBFactory
* for more information.
*/
[Exposed=(Window,Worker), Func="IDBFactory::IsEnabled"]
[Exposed=(Window,Worker)]
interface IDBFactory {
[Throws, NeedsCallerType]
IDBOpenDBRequest

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

@ -18,7 +18,7 @@ dictionary IDBIndexParameters {
DOMString? locale = null;
};
[Exposed=(Window,Worker), Func="IDBFactory::IsEnabled"]
[Exposed=(Window,Worker)]
interface IDBIndex {
[SetterThrows]
attribute DOMString name;

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

@ -9,7 +9,7 @@
* liability, trademark and document use rules apply.
*/
[Exposed=(Window,Worker), Func="IDBFactory::IsEnabled"]
[Exposed=(Window,Worker)]
interface IDBKeyRange {
[Throws]
readonly attribute any lower;

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

@ -12,7 +12,7 @@ dictionary IDBObjectStoreParameters {
boolean autoIncrement = false;
};
[Exposed=(Window,Worker), Func="IDBFactory::IsEnabled"]
[Exposed=(Window,Worker)]
interface IDBObjectStore {
[SetterThrows]
attribute DOMString name;

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

@ -7,7 +7,7 @@
* https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBOpenDBRequest
*/
[Exposed=(Window,Worker), Func="IDBFactory::IsEnabled"]
[Exposed=(Window,Worker)]
interface IDBOpenDBRequest : IDBRequest {
attribute EventHandler onblocked;

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

@ -13,7 +13,7 @@ enum IDBRequestReadyState {
"done"
};
[Exposed=(Window,Worker), Func="IDBFactory::IsEnabled"]
[Exposed=(Window,Worker)]
interface IDBRequest : EventTarget {
[Throws]
readonly attribute any result;

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

@ -19,7 +19,7 @@ enum IDBTransactionMode {
"versionchange"
};
[Exposed=(Window,Worker), Func="IDBFactory::IsEnabled"]
[Exposed=(Window,Worker)]
interface IDBTransaction : EventTarget {
[Throws]
readonly attribute IDBTransactionMode mode;

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

@ -15,7 +15,7 @@ dictionary IDBVersionChangeEventInit : EventInit {
unsigned long long? newVersion = null;
};
[Exposed=(Window,Worker), Func="IDBFactory::IsEnabled"]
[Exposed=(Window,Worker)]
interface IDBVersionChangeEvent : Event {
constructor(DOMString type,
optional IDBVersionChangeEventInit eventInitDict = {});

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

@ -7,7 +7,7 @@
* https://w3c.github.io/ServiceWorker/#navigation-preload-manager
*/
[Func="NavigationPreloadManager::IsEnabled", SecureContext,
[Pref="dom.serviceWorkers.navigationPreload.enabled", SecureContext,
Exposed=(Window,Worker)]
interface NavigationPreloadManager {
[NewObject]

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

@ -263,7 +263,7 @@ partial interface Navigator {
// Service Workers/Navigation Controllers
partial interface Navigator {
[Func="ServiceWorkersEnabled", SameObject]
[Func="ServiceWorkerContainer::IsEnabled", SameObject]
readonly attribute ServiceWorkerContainer serviceWorker;
};

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

@ -26,7 +26,7 @@ interface PushManagerImpl {
Promise<PermissionState> permissionState(optional PushSubscriptionOptionsInit options = {});
};
[Exposed=(Window,Worker), Func="PushManager::IsEnabled"]
[Exposed=(Window,Worker), Pref="dom.push.enabled"]
interface PushManager {
[Throws, ChromeOnly]
constructor(DOMString scope);

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

@ -41,7 +41,7 @@ dictionary PushSubscriptionInit
EpochTimeStamp? expirationTime = null;
};
[Exposed=(Window,Worker), Func="ServiceWorkerVisible"]
[Exposed=(Window,Worker), Pref="dom.push.enabled"]
interface PushSubscription
{
[Throws, ChromeOnly]

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

@ -7,7 +7,7 @@
* https://w3c.github.io/push-api/
*/
[Exposed=(Window,Worker), Func="ServiceWorkerVisible"]
[Exposed=(Window,Worker), Pref="dom.push.enabled"]
interface PushSubscriptionOptions
{
[SameObject, Throws]

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

@ -8,7 +8,7 @@
*
*/
[Func="ServiceWorkersEnabled",
[Func="ServiceWorkerContainer::IsEnabled",
Exposed=Window]
interface ServiceWorkerContainer : EventTarget {
// FIXME(nsm):

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

@ -9,7 +9,7 @@
* https://notifications.spec.whatwg.org/
*/
[Func="ServiceWorkerVisible",
[Pref="dom.serviceWorkers.enabled",
Exposed=(Window,Worker)]
interface ServiceWorkerRegistration : EventTarget {
readonly attribute ServiceWorker? installing;

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

@ -69,8 +69,8 @@ partial interface mixin WindowOrWorkerGlobalScope {
// http://w3c.github.io/IndexedDB/#factory-interface
partial interface mixin WindowOrWorkerGlobalScope {
// readonly attribute IDBFactory indexedDB; // bug 1776789
[Throws, Func="IDBFactory::IsEnabled"]
// readonly attribute IDBFactory indexedDB;
[Throws]
readonly attribute IDBFactory? indexedDB;
};

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

@ -224,6 +224,8 @@ var interfaceNamesInGlobalScope = [
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "MessagePort", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
"NavigationPreloadManager",
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "NetworkInformation", insecureContext: true, disabled: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "Notification", insecureContext: true },
@ -250,6 +252,14 @@ var interfaceNamesInGlobalScope = [
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "PromiseRejectionEvent", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "PushManager", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "PushSubscription", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{
name: "PushSubscriptionOptions",
insecureContext: true,
},
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "ReadableByteStreamController", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
@ -275,6 +285,8 @@ var interfaceNamesInGlobalScope = [
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "Scheduler", insecureContext: true, nightly: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "ServiceWorkerRegistration", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "StorageManager", fennec: false },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "SubtleCrypto" },

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

@ -2051,12 +2051,6 @@
value: false
mirror: always
# Disable CacheStorage in private browsing mode.
- name: dom.caches.hide_in_pbmode.enabled
type: RelaxedAtomicBool
value: @IS_NIGHTLY_BUILD@
mirror: always
# Disable capture attribute for input elements; only supported on GeckoView.
- name: dom.capture.enabled
type: bool
@ -2540,18 +2534,12 @@
value: false
mirror: always
# Enable indexedDB in private browsing mode with encryption
# Enable indexedDB in private browsing mode.
- name: dom.indexedDB.privateBrowsing.enabled
type: RelaxedAtomicBool
value: false
mirror: always
# Disable IndexedDB in private browsing mode.
- name: dom.indexedDB.hide_in_pbmode.enabled
type: RelaxedAtomicBool
value: @IS_NIGHTLY_BUILD@
mirror: always
- name: dom.input_events.beforeinput.enabled
type: bool
value: true
@ -3606,12 +3594,6 @@
value: false
mirror: always
# Disable ServiceWorker in private browsing mode.
- name: dom.serviceWorkers.hide_in_pbmode.enabled
type: RelaxedAtomicBool
value: true
mirror: always
- name: dom.workers.requestAnimationFrame
type: RelaxedAtomicBool
value: true

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

@ -91,12 +91,6 @@ prefs: [dom.webnotifications.requireinteraction.enabled:true, dom.webnotificatio
[Notification interface: attribute badge]
expected: FAIL
[ServiceWorkerRegistration interface: operation showNotification(DOMString, optional NotificationOptions)]
expected: FAIL
[ServiceWorkerRegistration interface: operation getNotifications(optional GetNotificationOptions)]
expected: FAIL
[idlharness.https.any.sharedworker.html]
[Notification interface: attribute image]
@ -132,8 +126,3 @@ prefs: [dom.webnotifications.requireinteraction.enabled:true, dom.webnotificatio
[Notification interface: attribute badge]
expected: FAIL
[ServiceWorkerRegistration interface: operation showNotification(DOMString, optional NotificationOptions)]
expected: FAIL
[ServiceWorkerRegistration interface: operation getNotifications(optional GetNotificationOptions)]
expected: FAIL

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

@ -33,86 +33,13 @@
[PushManager interface: attribute supportedContentEncodings]
expected: FAIL
[PushManager interface: existence and properties of interface object]
expected: FAIL
[PushManager interface object name]
expected: FAIL
[PushManager interface: existence and properties of interface prototype object]
expected: FAIL
[PushManager interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[PushManager interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[PushManager interface: operation subscribe(optional PushSubscriptionOptionsInit)]
expected: FAIL
[PushManager interface: operation getSubscription()]
expected: FAIL
[PushManager interface: operation permissionState(optional PushSubscriptionOptionsInit)]
expected: FAIL
[ServiceWorkerRegistration interface: attribute pushManager]
expected: FAIL
[PushSubscription interface: existence and properties of interface object]
expected: FAIL
[PushSubscription interface object name]
expected: FAIL
[PushSubscription interface: existence and properties of interface prototype object]
expected: FAIL
[PushSubscription interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[PushSubscription interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[PushSubscription interface: attribute endpoint]
expected: FAIL
[PushSubscription interface: attribute expirationTime]
expected: FAIL
[PushSubscription interface: attribute options]
expected: FAIL
[PushSubscription interface: operation getKey(PushEncryptionKeyName)]
expected: FAIL
[PushSubscription interface: operation unsubscribe()]
expected: FAIL
[PushSubscription interface: operation toJSON()]
expected: FAIL
[PushSubscriptionOptions interface: existence and properties of interface object]
expected: FAIL
[PushSubscriptionOptions interface object length]
expected: FAIL
[PushSubscriptionOptions interface object name]
expected: FAIL
[PushSubscriptionOptions interface: existence and properties of interface prototype object]
expected: FAIL
[PushSubscriptionOptions interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[PushSubscriptionOptions interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[PushSubscriptionOptions interface: attribute applicationServerKey]
expected: FAIL
expected:
if (os == "mac") and debug: PASS
if (os == "android") and swgl: PASS
if (os == "linux") and debug: PASS
if os == "win": PASS
[PASS, FAIL]
[idlharness.https.any.serviceworker.html]
@ -186,83 +113,10 @@
[PushManager interface: attribute supportedContentEncodings]
expected: FAIL
[PushManager interface: existence and properties of interface object]
expected: FAIL
[PushManager interface object name]
expected: FAIL
[PushManager interface: existence and properties of interface prototype object]
expected: FAIL
[PushManager interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[PushManager interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[PushManager interface: operation subscribe(optional PushSubscriptionOptionsInit)]
expected: FAIL
[PushManager interface: operation getSubscription()]
expected: FAIL
[PushManager interface: operation permissionState(optional PushSubscriptionOptionsInit)]
expected: FAIL
[ServiceWorkerRegistration interface: attribute pushManager]
expected: FAIL
[PushSubscription interface: existence and properties of interface object]
expected: FAIL
[PushSubscription interface object name]
expected: FAIL
[PushSubscription interface: existence and properties of interface prototype object]
expected: FAIL
[PushSubscription interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[PushSubscription interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[PushSubscription interface: attribute endpoint]
expected: FAIL
[PushSubscription interface: attribute expirationTime]
expected: FAIL
[PushSubscription interface: attribute options]
expected: FAIL
[PushSubscription interface: operation getKey(PushEncryptionKeyName)]
expected: FAIL
[PushSubscription interface: operation unsubscribe()]
expected: FAIL
[PushSubscription interface: operation toJSON()]
expected: FAIL
[PushSubscriptionOptions interface: existence and properties of interface object]
expected: FAIL
[PushSubscriptionOptions interface object length]
expected: FAIL
[PushSubscriptionOptions interface object name]
expected: FAIL
[PushSubscriptionOptions interface: existence and properties of interface prototype object]
expected: FAIL
[PushSubscriptionOptions interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[PushSubscriptionOptions interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[PushSubscriptionOptions interface: attribute applicationServerKey]
expected: FAIL
expected:
if (os == "mac") and debug: PASS
if (os == "linux") and debug: PASS
if (os == "android") and swgl: PASS
if os == "win": PASS
[PASS, FAIL]

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

@ -122,81 +122,6 @@
[ServiceWorker interface: operation postMessage(any, optional StructuredSerializeOptions)]
expected: FAIL
[ServiceWorkerRegistration interface: existence and properties of interface object]
expected: FAIL
[ServiceWorkerRegistration interface object length]
expected: FAIL
[ServiceWorkerRegistration interface object name]
expected: FAIL
[ServiceWorkerRegistration interface: existence and properties of interface prototype object]
expected: FAIL
[ServiceWorkerRegistration interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[ServiceWorkerRegistration interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[ServiceWorkerRegistration interface: attribute installing]
expected: FAIL
[ServiceWorkerRegistration interface: attribute waiting]
expected: FAIL
[ServiceWorkerRegistration interface: attribute active]
expected: FAIL
[ServiceWorkerRegistration interface: attribute navigationPreload]
expected: FAIL
[ServiceWorkerRegistration interface: attribute scope]
expected: FAIL
[ServiceWorkerRegistration interface: attribute updateViaCache]
expected: FAIL
[ServiceWorkerRegistration interface: operation update()]
expected: FAIL
[ServiceWorkerRegistration interface: operation unregister()]
expected: FAIL
[ServiceWorkerRegistration interface: attribute onupdatefound]
expected: FAIL
[NavigationPreloadManager interface: existence and properties of interface object]
expected: FAIL
[NavigationPreloadManager interface object length]
expected: FAIL
[NavigationPreloadManager interface object name]
expected: FAIL
[NavigationPreloadManager interface: existence and properties of interface prototype object]
expected: FAIL
[NavigationPreloadManager interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[NavigationPreloadManager interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[NavigationPreloadManager interface: operation enable()]
expected: FAIL
[NavigationPreloadManager interface: operation disable()]
expected: FAIL
[NavigationPreloadManager interface: operation setHeaderValue(ByteString)]
expected: FAIL
[NavigationPreloadManager interface: operation getState()]
expected: FAIL
[idlharness.https.any.worker.html]
[ServiceWorkerContainer interface: operation startMessages()]
@ -322,87 +247,11 @@
[ServiceWorker interface: operation postMessage(any, optional StructuredSerializeOptions)]
expected: FAIL
[ServiceWorkerRegistration interface: existence and properties of interface object]
expected: FAIL
[ServiceWorkerRegistration interface object length]
expected: FAIL
[ServiceWorkerRegistration interface object name]
expected: FAIL
[ServiceWorkerRegistration interface: existence and properties of interface prototype object]
expected: FAIL
[ServiceWorkerRegistration interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[ServiceWorkerRegistration interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[ServiceWorkerRegistration interface: attribute installing]
expected: FAIL
[ServiceWorkerRegistration interface: attribute waiting]
expected: FAIL
[ServiceWorkerRegistration interface: attribute active]
expected: FAIL
[ServiceWorkerRegistration interface: attribute navigationPreload]
expected: FAIL
[ServiceWorkerRegistration interface: attribute scope]
expected: FAIL
[ServiceWorkerRegistration interface: attribute updateViaCache]
expected: FAIL
[ServiceWorkerRegistration interface: operation update()]
expected: FAIL
[ServiceWorkerRegistration interface: operation unregister()]
expected: FAIL
[ServiceWorkerRegistration interface: attribute onupdatefound]
expected: FAIL
[NavigationPreloadManager interface: existence and properties of interface object]
expected: FAIL
[NavigationPreloadManager interface object length]
expected: FAIL
[NavigationPreloadManager interface object name]
expected: FAIL
[NavigationPreloadManager interface: existence and properties of interface prototype object]
expected: FAIL
[NavigationPreloadManager interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[NavigationPreloadManager interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[NavigationPreloadManager interface: operation enable()]
expected: FAIL
[NavigationPreloadManager interface: operation disable()]
expected: FAIL
[NavigationPreloadManager interface: operation setHeaderValue(ByteString)]
expected: FAIL
[NavigationPreloadManager interface: operation getState()]
expected: FAIL
[idlharness.https.any.html]
[CacheStorage interface object length]
expected: FAIL
[idlharness.https.any.serviceworker.html]
[ServiceWorker interface: serviceWorker must inherit property "scriptURL" with the proper type]
expected: FAIL

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

@ -235,16 +235,7 @@ StorageAccess StorageAllowedForWindow(nsPIDOMWindowInner* aWindow,
*aRejectedReason);
}
// No document? Try checking Private Browsing Mode without document
if (const nsCOMPtr<nsIGlobalObject> global = aWindow->AsGlobal()) {
if (const nsCOMPtr<nsIPrincipal> principal = global->PrincipalOrNull()) {
if (principal->GetPrivateBrowsingId() > 0) {
return StorageAccess::ePrivateBrowsing;
}
}
}
// Everything failed? Let's return a generic rejected reason.
// No document? Let's return a generic rejected reason.
return StorageAccess::eDeny;
}

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

@ -26,8 +26,7 @@ AntiTracking.runTestInNormalAndPrivateMode(
resolve()
);
});
},
[["dom.indexedDB.hide_in_pbmode.enabled", false]]
}
);
AntiTracking.runTestInNormalAndPrivateMode(
@ -98,7 +97,7 @@ AntiTracking.runTestInNormalAndPrivateMode(
);
});
},
[["dom.indexedDB.hide_in_pbmode.enabled", false]],
null,
false,
false
);

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

@ -70,6 +70,5 @@ AntiTracking.runTestInNormalAndPrivateMode(
resolve()
);
});
},
[["dom.indexedDB.hide_in_pbmode.enabled", false]]
}
);

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

@ -148,7 +148,7 @@ AntiTracking.runTestInNormalAndPrivateMode(
);
});
},
[["dom.indexedDB.hide_in_pbmode.enabled", false]],
null,
false,
false
);