From ffa99d7088ac46dd6bbc0e9d88018ef80a068e0e Mon Sep 17 00:00:00 2001 From: Valentin Gosu Date: Wed, 31 May 2023 07:45:46 +0000 Subject: [PATCH] Bug 1677718 - Completely remove AppCache API implementation r=necko-reviewers,emilio,jesup Depends on D179337 Differential Revision: https://phabricator.services.mozilla.com/D179420 --- .../base/content/test/sanitize/browser.ini | 2 - dom/base/UseCounters.conf | 13 -- dom/base/nsGlobalWindowInner.cpp | 62 ------- dom/base/nsGlobalWindowInner.h | 6 - dom/base/nsPIDOMWindow.h | 3 - dom/bindings/Bindings.conf | 4 - dom/moz.build | 1 - dom/offline/crashtests/408431-1.html | 25 --- dom/offline/crashtests/crashtests.list | 1 - dom/offline/moz.build | 22 --- dom/offline/nsDOMOfflineResourceList.cpp | 160 ------------------ dom/offline/nsDOMOfflineResourceList.h | 95 ----------- .../mochitest/general/test_interfaces.js | 6 - dom/webidl/OfflineResourceList.webidl | 124 -------------- dom/webidl/Window.webidl | 5 - dom/webidl/moz.build | 1 - layout/build/moz.build | 1 - modules/libpref/init/StaticPrefList.yaml | 5 - netwerk/cache2/nsICacheStorageService.idl | 1 - netwerk/ipc/NeckoChannelParams.ipdlh | 1 - netwerk/test/unit/test_bug650995.js | 1 - testing/crashtest/crashtests.list | 1 - testing/profiles/web-platform/user.js | 2 - .../offline/application-cache-api/__dir__.ini | 1 + .../api_status_checking-manual.html.ini | 2 - .../api_status_downloading-manual.html.ini | 2 - .../api_status_obsolete-manual.html.ini | 2 - .../api_status_updateready-manual.html.ini | 2 - .../api_swapcache-manual.html.ini | 2 - .../service-worker/clients-get.https.html.ini | 1 - .../defaults/backgroundtasks.js | 1 - .../app/TelemetryEnvironment.sys.mjs | 1 - 32 files changed, 1 insertion(+), 555 deletions(-) delete mode 100644 dom/offline/crashtests/408431-1.html delete mode 100644 dom/offline/crashtests/crashtests.list delete mode 100644 dom/offline/moz.build delete mode 100644 dom/offline/nsDOMOfflineResourceList.cpp delete mode 100644 dom/offline/nsDOMOfflineResourceList.h delete mode 100644 dom/webidl/OfflineResourceList.webidl delete mode 100644 testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_checking-manual.html.ini delete mode 100644 testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_downloading-manual.html.ini delete mode 100644 testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_obsolete-manual.html.ini delete mode 100644 testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_updateready-manual.html.ini delete mode 100644 testing/web-platform/meta/html/browsers/offline/application-cache-api/api_swapcache-manual.html.ini diff --git a/browser/base/content/test/sanitize/browser.ini b/browser/base/content/test/sanitize/browser.ini index e06ea031e0af..2a0a77a288bd 100644 --- a/browser/base/content/test/sanitize/browser.ini +++ b/browser/base/content/test/sanitize/browser.ini @@ -3,8 +3,6 @@ support-files= head.js dummy.js dummy_page.html -prefs= - browser.cache.offline.enable=true [browser_cookiePermission.js] [browser_cookiePermission_aboutURL.js] diff --git a/dom/base/UseCounters.conf b/dom/base/UseCounters.conf index 8ee5137eb419..f00105a1ddb0 100644 --- a/dom/base/UseCounters.conf +++ b/dom/base/UseCounters.conf @@ -48,19 +48,6 @@ method PushSubscription.unsubscribe // window.sidebar attribute Window.sidebar -// AppCache API -method OfflineResourceList.swapCache -method OfflineResourceList.update -attribute OfflineResourceList.status -attribute OfflineResourceList.onchecking -attribute OfflineResourceList.onerror -attribute OfflineResourceList.onnoupdate -attribute OfflineResourceList.ondownloading -attribute OfflineResourceList.onprogress -attribute OfflineResourceList.onupdateready -attribute OfflineResourceList.oncached -attribute OfflineResourceList.onobsolete - // DataTransfer API (gecko-only methods) method DataTransfer.addElement attribute DataTransfer.mozItemCount diff --git a/dom/base/nsGlobalWindowInner.cpp b/dom/base/nsGlobalWindowInner.cpp index 7ec71920867c..d73d91e107d9 100644 --- a/dom/base/nsGlobalWindowInner.cpp +++ b/dom/base/nsGlobalWindowInner.cpp @@ -209,7 +209,6 @@ #include "nsCycleCollectionNoteChild.h" #include "nsCycleCollectionTraversalCallback.h" #include "nsDOMNavigationTiming.h" -#include "nsDOMOfflineResourceList.h" #include "nsDebug.h" #include "nsDeviceContext.h" #include "nsDocShell.h" @@ -1181,12 +1180,6 @@ void nsGlobalWindowInner::FreeInnerObjects() { // Remove our reference to the document and the document principal. mFocusedElement = nullptr; - if (mApplicationCache) { - static_cast(mApplicationCache.get()) - ->Disconnect(); - mApplicationCache = nullptr; - } - if (mIndexedDB) { mIndexedDB->DisconnectFromGlobal(this); mIndexedDB = nullptr; @@ -1408,7 +1401,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGlobalWindowInner) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSharedWorkers) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLocalStorage) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSessionStorage) - NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mApplicationCache) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mIndexedDB) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocumentPrincipal) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocumentCookiePrincipal) @@ -1520,11 +1512,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGlobalWindowInner) NS_IMPL_CYCLE_COLLECTION_UNLINK(mLocalStorage) } NS_IMPL_CYCLE_COLLECTION_UNLINK(mSessionStorage) - if (tmp->mApplicationCache) { - static_cast(tmp->mApplicationCache.get()) - ->Disconnect(); - NS_IMPL_CYCLE_COLLECTION_UNLINK(mApplicationCache) - } if (tmp->mIndexedDB) { tmp->mIndexedDB->DisconnectFromGlobal(tmp); NS_IMPL_CYCLE_COLLECTION_UNLINK(mIndexedDB) @@ -3338,38 +3325,6 @@ bool nsGlobalWindowInner::CachesEnabled(JSContext* aCx, JSObject*) { return true; } -nsDOMOfflineResourceList* nsGlobalWindowInner::GetApplicationCache( - ErrorResult& aError) { - if (!mApplicationCache) { - nsCOMPtr webNav(do_QueryInterface(GetDocShell())); - if (!webNav || !mDoc) { - aError.Throw(NS_ERROR_FAILURE); - return nullptr; - } - - nsCOMPtr uri; - aError = webNav->GetCurrentURI(getter_AddRefs(uri)); - if (aError.Failed()) { - return nullptr; - } - - nsCOMPtr manifestURI; - nsContentUtils::GetOfflineAppManifest(mDoc, getter_AddRefs(manifestURI)); - - RefPtr applicationCache = - new nsDOMOfflineResourceList(manifestURI, uri, mDoc->NodePrincipal(), - this); - - mApplicationCache = applicationCache; - } - - return mApplicationCache; -} - -nsDOMOfflineResourceList* nsGlobalWindowInner::GetApplicationCache() { - return GetApplicationCache(IgnoreErrors()); -} - Crypto* nsGlobalWindowInner::GetCrypto(ErrorResult& aError) { if (!mCrypto) { mCrypto = new Crypto(this); @@ -5447,18 +5402,6 @@ nsresult nsGlobalWindowInner::Observe(nsISupports* aSubject, const char* aTopic, return NS_OK; } - if (!nsCRT::strcmp(aTopic, "offline-cache-update-added")) { - if (mApplicationCache) return NS_OK; - - // Instantiate the application object now. It observes update belonging to - // this window's document and correctly updates the applicationCache object - // state. - nsCOMPtr observer = GetApplicationCache(); - if (observer) observer->Observe(aSubject, aTopic, aData); - - return NS_OK; - } - if (!nsCRT::strcmp(aTopic, PERMISSION_CHANGED_TOPIC)) { nsCOMPtr perm(do_QueryInterface(aSubject)); if (!perm) { @@ -6151,11 +6094,6 @@ StorageAccess nsGlobalWindowInner::GetStorageAccess() { } nsresult nsGlobalWindowInner::FireDelayedDOMEvents(bool aIncludeSubWindows) { - if (mApplicationCache) { - static_cast(mApplicationCache.get()) - ->FirePendingEvents(); - } - // Fires an offline status event if the offline status has changed FireOfflineStatusEventIfChanged(); diff --git a/dom/base/nsGlobalWindowInner.h b/dom/base/nsGlobalWindowInner.h index affe32800bfb..fd2c8a78e5e1 100644 --- a/dom/base/nsGlobalWindowInner.h +++ b/dom/base/nsGlobalWindowInner.h @@ -57,7 +57,6 @@ class nsIContent; class nsICSSDeclaration; class nsIDocShellTreeOwner; class nsIDOMWindowUtils; -class nsDOMOfflineResourceList; class nsIScrollableFrame; class nsIControllers; class nsIScriptContext; @@ -651,9 +650,6 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget, mozilla::dom::Nullable Open( const nsAString& aUrl, const nsAString& aName, const nsAString& aOptions, mozilla::ErrorResult& aError); - nsDOMOfflineResourceList* GetApplicationCache(mozilla::ErrorResult& aError); - nsDOMOfflineResourceList* GetApplicationCache() override; - int16_t Orientation(mozilla::dom::CallerType aCallerType); already_AddRefed GetConsole(JSContext* aCx, @@ -1504,8 +1500,6 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget, nsCOMPtr mLastOpenedURI; #endif - RefPtr mApplicationCache; - RefPtr mIndexedDB; // This flag keeps track of whether this window is currently diff --git a/dom/base/nsPIDOMWindow.h b/dom/base/nsPIDOMWindow.h index f7b24d13b7c4..998161b550b4 100644 --- a/dom/base/nsPIDOMWindow.h +++ b/dom/base/nsPIDOMWindow.h @@ -26,7 +26,6 @@ #define DOM_WINDOW_FROZEN_TOPIC "dom-window-frozen" #define DOM_WINDOW_THAWED_TOPIC "dom-window-thawed" -class nsDOMOfflineResourceList; class nsGlobalWindowInner; class nsGlobalWindowOuter; class nsIArray; @@ -614,8 +613,6 @@ class nsPIDOMWindowInner : public mozIDOMWindow { mozilla::dom::Element& aElt, const nsAString& aPseudoElt, mozilla::ErrorResult& aError) = 0; - virtual nsDOMOfflineResourceList* GetApplicationCache() = 0; - virtual bool GetFullScreen() = 0; virtual nsresult Focus(mozilla::dom::CallerType aCallerType) = 0; diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index e09a35c37c89..688252114957 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -611,10 +611,6 @@ DOMInterfaces = { 'nativeType': 'mozilla::dom::AudioContext', }, -'OfflineResourceList': { - 'nativeType': 'nsDOMOfflineResourceList', -}, - 'OffscreenCanvasRenderingContext2D': { 'implicitJSContext': [ 'createImageData', 'getImageData', 'isPointInPath', 'isPointInStroke' diff --git a/dom/moz.build b/dom/moz.build index 070ae2c81645..5a3b2d26d347 100644 --- a/dom/moz.build +++ b/dom/moz.build @@ -58,7 +58,6 @@ DIRS += [ "media", "midi", "notification", - "offline", "power", "push", "quota", diff --git a/dom/offline/crashtests/408431-1.html b/dom/offline/crashtests/408431-1.html deleted file mode 100644 index 14bb2203f150..000000000000 --- a/dom/offline/crashtests/408431-1.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/dom/offline/crashtests/crashtests.list b/dom/offline/crashtests/crashtests.list deleted file mode 100644 index a185168c2634..000000000000 --- a/dom/offline/crashtests/crashtests.list +++ /dev/null @@ -1 +0,0 @@ -load 408431-1.html diff --git a/dom/offline/moz.build b/dom/offline/moz.build deleted file mode 100644 index 938d4d107de2..000000000000 --- a/dom/offline/moz.build +++ /dev/null @@ -1,22 +0,0 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -with Files("**"): - BUG_COMPONENT = ("Core", "Networking") - -EXPORTS += [ - "nsDOMOfflineResourceList.h", -] -UNIFIED_SOURCES += [ - "nsDOMOfflineResourceList.cpp", -] - -LOCAL_INCLUDES += [ - "/dom/base", - "/uriloader/prefetch", -] - -FINAL_LIBRARY = "xul" diff --git a/dom/offline/nsDOMOfflineResourceList.cpp b/dom/offline/nsDOMOfflineResourceList.cpp deleted file mode 100644 index feb010074f23..000000000000 --- a/dom/offline/nsDOMOfflineResourceList.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsDOMOfflineResourceList.h" -#include "nsError.h" -#include "mozilla/Components.h" -#include "mozilla/dom/DOMStringList.h" -#include "nsNetUtil.h" -#include "nsNetCID.h" -#include "nsServiceManagerUtils.h" -#include "nsICookieJarSettings.h" -#include "nsIInterfaceRequestorUtils.h" -#include "nsContentUtils.h" -#include "nsILoadContext.h" -#include "nsIObserverService.h" -#include "nsIScriptGlobalObject.h" -#include "nsIWebNavigation.h" -#include "mozilla/dom/Document.h" -#include "mozilla/dom/Event.h" -#include "mozilla/dom/OfflineResourceListBinding.h" -#include "mozilla/EventDispatcher.h" -#include "mozilla/EventListenerManager.h" -#include "mozilla/Preferences.h" -#include "mozilla/BasePrincipal.h" -#include "mozilla/StaticPrefs_browser.h" - -#include "nsXULAppAPI.h" -#define IS_CHILD_PROCESS() (GeckoProcessType_Default != XRE_GetProcessType()) - -using namespace mozilla; -using namespace mozilla::dom; - -// -// nsDOMOfflineResourceList -// - -NS_IMPL_CYCLE_COLLECTION_WEAK_INHERITED(nsDOMOfflineResourceList, - DOMEventTargetHelper) - -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMOfflineResourceList) - NS_INTERFACE_MAP_ENTRY(nsIObserver) - NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) -NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper) - -NS_IMPL_ADDREF_INHERITED(nsDOMOfflineResourceList, DOMEventTargetHelper) -NS_IMPL_RELEASE_INHERITED(nsDOMOfflineResourceList, DOMEventTargetHelper) - -nsDOMOfflineResourceList::nsDOMOfflineResourceList( - nsIURI* aManifestURI, nsIURI* aDocumentURI, nsIPrincipal* aLoadingPrincipal, - nsPIDOMWindowInner* aWindow) - : DOMEventTargetHelper(aWindow) {} - -nsDOMOfflineResourceList::~nsDOMOfflineResourceList() { ClearCachedKeys(); } - -JSObject* nsDOMOfflineResourceList::WrapObject( - JSContext* aCx, JS::Handle aGivenProto) { - return OfflineResourceList_Binding::Wrap(aCx, this, aGivenProto); -} - -void nsDOMOfflineResourceList::Disconnect() {} - -already_AddRefed nsDOMOfflineResourceList::GetMozItems( - ErrorResult& aRv) { - if (IS_CHILD_PROCESS()) { - aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); - return nullptr; - } - - RefPtr items = new DOMStringList(); - return items.forget(); -} - -bool nsDOMOfflineResourceList::MozHasItem(const nsAString& aURI, - ErrorResult& aRv) { - return false; -} - -uint32_t nsDOMOfflineResourceList::GetMozLength(ErrorResult& aRv) { - if (IS_CHILD_PROCESS()) { - aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); - return 0; - } - - return 0; -} - -void nsDOMOfflineResourceList::MozItem(uint32_t aIndex, nsAString& aURI, - ErrorResult& aRv) { - aRv.Throw(NS_ERROR_NOT_AVAILABLE); -} - -void nsDOMOfflineResourceList::IndexedGetter(uint32_t aIndex, bool& aFound, - nsAString& aURI, - ErrorResult& aRv) { - if (IS_CHILD_PROCESS()) { - aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); - return; - } - - aFound = false; -} - -void nsDOMOfflineResourceList::MozAdd(const nsAString& aURI, ErrorResult& aRv) { -} - -void nsDOMOfflineResourceList::MozRemove(const nsAString& aURI, - ErrorResult& aRv) {} - -uint16_t nsDOMOfflineResourceList::GetStatus(ErrorResult& aRv) { - return OfflineResourceList_Binding::UNCACHED; -} - -void nsDOMOfflineResourceList::Update(ErrorResult& aRv) {} - -void nsDOMOfflineResourceList::SwapCache(ErrorResult& aRv) {} - -void nsDOMOfflineResourceList::FirePendingEvents() {} - -void nsDOMOfflineResourceList::SendEvent(const nsAString& aEventName) {} - -// -// nsDOMOfflineResourceList::nsIObserver -// -NS_IMETHODIMP -nsDOMOfflineResourceList::Observe(nsISupports* aSubject, const char* aTopic, - const char16_t* aData) { - return NS_OK; -} - -nsresult nsDOMOfflineResourceList::GetCacheKey(const nsAString& aURI, - nsCString& aKey) { - nsCOMPtr requestedURI; - nsresult rv = NS_NewURI(getter_AddRefs(requestedURI), aURI); - NS_ENSURE_SUCCESS(rv, rv); - - return GetCacheKey(requestedURI, aKey); -} - -nsresult nsDOMOfflineResourceList::GetCacheKey(nsIURI* aURI, nsCString& aKey) { - nsresult rv = aURI->GetAsciiSpec(aKey); - NS_ENSURE_SUCCESS(rv, rv); - - // url fragments aren't used in cache keys - nsAutoCString::const_iterator specStart, specEnd; - aKey.BeginReading(specStart); - aKey.EndReading(specEnd); - if (FindCharInReadable('#', specStart, specEnd)) { - aKey.BeginReading(specEnd); - aKey = Substring(specEnd, specStart); - } - - return NS_OK; -} - -nsresult nsDOMOfflineResourceList::CacheKeys() { return NS_OK; } - -void nsDOMOfflineResourceList::ClearCachedKeys() {} diff --git a/dom/offline/nsDOMOfflineResourceList.h b/dom/offline/nsDOMOfflineResourceList.h deleted file mode 100644 index bdc1c16ff47b..000000000000 --- a/dom/offline/nsDOMOfflineResourceList.h +++ /dev/null @@ -1,95 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nsDOMOfflineResourceList_h___ -#define nsDOMOfflineResourceList_h___ - -#include "nscore.h" -#include "nsTArray.h" -#include "nsString.h" -#include "nsIURI.h" -#include "nsCOMPtr.h" -#include "nsWeakReference.h" -#include "nsCOMArray.h" -#include "nsIObserver.h" -#include "nsIScriptContext.h" -#include "nsCycleCollectionParticipant.h" -#include "nsPIDOMWindow.h" -#include "mozilla/DOMEventTargetHelper.h" -#include "mozilla/ErrorResult.h" -#include "mozilla/Maybe.h" - -namespace mozilla::dom { -class DOMStringList; -class Event; -} // namespace mozilla::dom - -class nsDOMOfflineResourceList final : public mozilla::DOMEventTargetHelper, - public nsIObserver, - public nsSupportsWeakReference { - using ErrorResult = mozilla::ErrorResult; - - public: - NS_DECL_ISUPPORTS_INHERITED - NS_DECL_NSIOBSERVER - - NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDOMOfflineResourceList, - mozilla::DOMEventTargetHelper) - - nsDOMOfflineResourceList(nsIURI* aManifestURI, nsIURI* aDocumentURI, - nsIPrincipal* aLoadingPrincipal, - nsPIDOMWindowInner* aWindow); - - void FirePendingEvents(); - void Disconnect(); - - nsPIDOMWindowInner* GetParentObject() const { return GetOwner(); } - virtual JSObject* WrapObject(JSContext* aCx, - JS::Handle aGivenProto) override; - - uint16_t GetStatus(ErrorResult& aRv); - - void Update(ErrorResult& aRv); - - void SwapCache(ErrorResult& aRv); - - IMPL_EVENT_HANDLER(checking) - IMPL_EVENT_HANDLER(error) - IMPL_EVENT_HANDLER(noupdate) - IMPL_EVENT_HANDLER(downloading) - IMPL_EVENT_HANDLER(progress) - IMPL_EVENT_HANDLER(cached) - IMPL_EVENT_HANDLER(updateready) - IMPL_EVENT_HANDLER(obsolete) - - already_AddRefed GetMozItems(ErrorResult& aRv); - bool MozHasItem(const nsAString& aURI, ErrorResult& aRv); - uint32_t GetMozLength(ErrorResult& aRv); - void MozItem(uint32_t aIndex, nsAString& aURI, ErrorResult& aRv); - void IndexedGetter(uint32_t aIndex, bool& aFound, nsAString& aURI, - ErrorResult& aRv); - uint32_t Length() { - mozilla::IgnoredErrorResult rv; - uint32_t length = GetMozLength(rv); - return rv.Failed() ? 0 : length; - } - void MozAdd(const nsAString& aURI, ErrorResult& aRv); - void MozRemove(const nsAString& aURI, ErrorResult& aRv); - - protected: - virtual ~nsDOMOfflineResourceList(); - - private: - void SendEvent(const nsAString& aEventName); - - nsresult GetCacheKey(const nsAString& aURI, nsCString& aKey); - nsresult GetCacheKey(nsIURI* aURI, nsCString& aKey); - - nsresult CacheKeys(); - void ClearCachedKeys(); -}; - -#endif diff --git a/dom/tests/mochitest/general/test_interfaces.js b/dom/tests/mochitest/general/test_interfaces.js index b49864c9e204..13cb90aec32b 100644 --- a/dom/tests/mochitest/general/test_interfaces.js +++ b/dom/tests/mochitest/general/test_interfaces.js @@ -893,12 +893,6 @@ let interfaceNamesInGlobalScope = [ // IMPORTANT: Do not change this list without review from a DOM peer! { name: "OfflineAudioContext", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! - { - name: "OfflineResourceList", - insecureContext: false, - disabled: isEarlyBetaOrEarlier, - }, - // IMPORTANT: Do not change this list without review from a DOM peer! { name: "OffscreenCanvas", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! { name: "OffscreenCanvasRenderingContext2D", insecureContext: true }, diff --git a/dom/webidl/OfflineResourceList.webidl b/dom/webidl/OfflineResourceList.webidl deleted file mode 100644 index 498416c3bf9e..000000000000 --- a/dom/webidl/OfflineResourceList.webidl +++ /dev/null @@ -1,124 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -[SecureContext, Pref="browser.cache.offline.enable", -Exposed=Window] -interface OfflineResourceList : EventTarget { - /** - * State of the application cache this object is associated with. - */ - - /* This object is not associated with an application cache. */ - const unsigned short UNCACHED = 0; - - /* The application cache is not being updated. */ - const unsigned short IDLE = 1; - - /* The manifest is being fetched and checked for updates */ - const unsigned short CHECKING = 2; - - /* Resources are being downloaded to be added to the cache */ - const unsigned short DOWNLOADING = 3; - - /* There is a new version of the application cache available */ - const unsigned short UPDATEREADY = 4; - - /* The application cache group is now obsolete. */ - const unsigned short OBSOLETE = 5; - - [Throws, UseCounter] - readonly attribute unsigned short status; - - /** - * Begin the application update process on the associated application cache. - */ - [Throws, UseCounter] - undefined update(); - - /** - * Swap in the newest version of the application cache, or disassociate - * from the cache if the cache group is obsolete. - */ - [Throws, UseCounter] - undefined swapCache(); - - /* Events */ - [UseCounter] - attribute EventHandler onchecking; - [UseCounter] - attribute EventHandler onerror; - [UseCounter] - attribute EventHandler onnoupdate; - [UseCounter] - attribute EventHandler ondownloading; - [UseCounter] - attribute EventHandler onprogress; - [UseCounter] - attribute EventHandler onupdateready; - [UseCounter] - attribute EventHandler oncached; - [UseCounter] - attribute EventHandler onobsolete; -}; - -// Mozilla extensions. -partial interface OfflineResourceList { - /** - * Get the list of dynamically-managed entries. - */ - [Throws] - readonly attribute DOMStringList mozItems; - - /** - * Check that an entry exists in the list of dynamically-managed entries. - * - * @param uri - * The resource to check. - */ - [Throws] - boolean mozHasItem(DOMString uri); - - /** - * Get the number of dynamically-managed entries. - * @status DEPRECATED - * Clients should use the "items" attribute. - */ - [Throws] - readonly attribute unsigned long mozLength; - - /** - * Get the URI of a dynamically-managed entry. - * @status DEPRECATED - * Clients should use the "items" attribute. - */ - [Throws] - getter DOMString mozItem(unsigned long index); - - /** - * We need a "length" to actually be valid Web IDL, given that we have an - * indexed getter. - */ - readonly attribute unsigned long length; - - /** - * Add an item to the list of dynamically-managed entries. The resource - * will be fetched into the application cache. - * - * @param uri - * The resource to add. - */ - [Throws] - undefined mozAdd(DOMString uri); - - /** - * Remove an item from the list of dynamically-managed entries. If this - * was the last reference to a URI in the application cache, the cache - * entry will be removed. - * - * @param uri - * The resource to remove. - */ - [Throws] - undefined mozRemove(DOMString uri); -}; diff --git a/dom/webidl/Window.webidl b/dom/webidl/Window.webidl index 0f3e7dfcba11..07203687cb68 100644 --- a/dom/webidl/Window.webidl +++ b/dom/webidl/Window.webidl @@ -25,15 +25,11 @@ interface XULControllers; interface nsIDOMWindowUtils; interface nsIPrintSettings; -typedef OfflineResourceList ApplicationCache; - // http://www.whatwg.org/specs/web-apps/current-work/ [Global, LegacyUnenumerableNamedProperties, NeedResolve, Exposed=Window, InstrumentedProps=(AbsoluteOrientationSensor, Accelerometer, - ApplicationCache, - ApplicationCacheErrorEvent, Atomics, AudioParamMap, AudioWorklet, @@ -248,7 +244,6 @@ typedef OfflineResourceList ApplicationCache; readonly attribute Navigator clientInformation; [Replaceable] readonly attribute External external; - [Throws, SecureContext, Pref="browser.cache.offline.enable"] readonly attribute ApplicationCache applicationCache; // user prompts [Throws, NeedsSubjectPrincipal] undefined alert(); diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build index f30cadabbbb9..0ca37b988e1b 100644 --- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -756,7 +756,6 @@ WEBIDL_FILES = [ "NotificationEvent.webidl", "NotifyPaintEvent.webidl", "OfflineAudioContext.webidl", - "OfflineResourceList.webidl", "OffscreenCanvas.webidl", "OffscreenCanvasRenderingContext2D.webidl", "OscillatorNode.webidl", diff --git a/layout/build/moz.build b/layout/build/moz.build index c7869a01a373..b2059e396efe 100644 --- a/layout/build/moz.build +++ b/layout/build/moz.build @@ -40,7 +40,6 @@ LOCAL_INCLUDES += [ "/dom/html", "/dom/jsurl", "/dom/media", - "/dom/offline", "/dom/storage", "/dom/xslt/base", "/dom/xslt/xml", diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index e0ffd58700cb..977bad5dcc8c 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -968,11 +968,6 @@ value: true mirror: always -- name: browser.cache.offline.enable - type: bool - value: false - mirror: always - - name: browser.cache.disk.enable type: RelaxedAtomicBool value: true diff --git a/netwerk/cache2/nsICacheStorageService.idl b/netwerk/cache2/nsICacheStorageService.idl index 063f95646a49..f0a4cf5b652a 100644 --- a/netwerk/cache2/nsICacheStorageService.idl +++ b/netwerk/cache2/nsICacheStorageService.idl @@ -6,7 +6,6 @@ interface nsICacheStorage; interface nsILoadContextInfo; -interface nsIApplicationCache; interface nsIEventTarget; interface nsICacheStorageConsumptionObserver; interface nsICacheStorageVisitor; diff --git a/netwerk/ipc/NeckoChannelParams.ipdlh b/netwerk/ipc/NeckoChannelParams.ipdlh index f1b6ec8cc910..0aaacd2bd021 100644 --- a/netwerk/ipc/NeckoChannelParams.ipdlh +++ b/netwerk/ipc/NeckoChannelParams.ipdlh @@ -338,7 +338,6 @@ struct HttpChannelOpenArgs bool uploadStreamHasHeaders; bool allowSTS; bool resumeAt; - bool chooseApplicationCache; bool allowSpdy; bool allowHttp3; bool allowAltSvc; diff --git a/netwerk/test/unit/test_bug650995.js b/netwerk/test/unit/test_bug650995.js index ed625446d041..4eff87c72195 100644 --- a/netwerk/test/unit/test_bug650995.js +++ b/netwerk/test/unit/test_bug650995.js @@ -166,7 +166,6 @@ function run_test() { httpserver.registerPathHandler("/bug650995", handler); httpserver.start(-1); - prefService.setBoolPref("browser.cache.offline.enable", false); prefService.setBoolPref("network.http.rcwn.enabled", false); nextTest(); diff --git a/testing/crashtest/crashtests.list b/testing/crashtest/crashtests.list index f5b9af4a39fe..bd4dee31a6a5 100644 --- a/testing/crashtest/crashtests.list +++ b/testing/crashtest/crashtests.list @@ -25,7 +25,6 @@ include ../../dom/media/webvtt/test/crashtests/crashtests.list skip-if(!webrtc) include ../../dom/media/tests/crashtests/crashtests.list skip-if(!webrtc) include ../../dom/media/webrtc/tests/crashtests/crashtests.list include ../../dom/media/webspeech/synth/crashtests/crashtests.list -include ../../dom/offline/crashtests/crashtests.list include ../../dom/plugins/test/crashtests/crashtests.list include ../../dom/security/test/crashtests/crashtests.list include ../../dom/serializers/crashtests/crashtests.list diff --git a/testing/profiles/web-platform/user.js b/testing/profiles/web-platform/user.js index dccc408ae0d1..82dc408e982f 100644 --- a/testing/profiles/web-platform/user.js +++ b/testing/profiles/web-platform/user.js @@ -69,8 +69,6 @@ user_pref("widget.disable-dark-scrollbar", true); // be confusing for tests that send click events before the first paint. user_pref("nglayout.initialpaint.unsuppress_with_no_background", true); user_pref("media.block-autoplay-until-in-foreground", false); -// Enable AppCache globally for now whilst it's being removed in Bug 1584984 -user_pref("browser.cache.offline.enable", true); // Force a light color scheme unless explicitly overriden by pref. user_pref("layout.css.prefers-color-scheme.content-override", 1); // Force OffscreenCanvas support diff --git a/testing/web-platform/meta/html/browsers/offline/application-cache-api/__dir__.ini b/testing/web-platform/meta/html/browsers/offline/application-cache-api/__dir__.ini index cd0eb6d97242..fad77a6551bc 100644 --- a/testing/web-platform/meta/html/browsers/offline/application-cache-api/__dir__.ini +++ b/testing/web-platform/meta/html/browsers/offline/application-cache-api/__dir__.ini @@ -1 +1,2 @@ +disabled: true lsan-allowed: [Alloc, AllocateProtoAndIfaceCache, Malloc, Realloc, mozilla::detail::HashTable, mozilla::dom::Console::CreateInstance, mozilla::dom::Performance::CreateForMainThread, mozilla::dom::PerformanceMainThread::CreateNavigationTimingEntry, mozilla::dom::ProtoAndIfaceCache::PageTableCache::EntrySlotOrCreate, mozilla::net::nsStandardURL::TemplatedMutator, nsGlobalWindowInner::GetApplicationCache, nsSupportsWeakReference::GetWeakReference] diff --git a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_checking-manual.html.ini b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_checking-manual.html.ini deleted file mode 100644 index 3882ec7bd07c..000000000000 --- a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_checking-manual.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[api_status_checking-manual.html] - prefs: [browser.cache.offline.enable:true] diff --git a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_downloading-manual.html.ini b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_downloading-manual.html.ini deleted file mode 100644 index 406ed7258d9a..000000000000 --- a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_downloading-manual.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[api_status_downloading-manual.html] - prefs: [browser.cache.offline.enable:true] diff --git a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_obsolete-manual.html.ini b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_obsolete-manual.html.ini deleted file mode 100644 index 6f29d88808c0..000000000000 --- a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_obsolete-manual.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[api_status_obsolete-manual.html] - prefs: [browser.cache.offline.enable:true] diff --git a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_updateready-manual.html.ini b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_updateready-manual.html.ini deleted file mode 100644 index 91b669c00612..000000000000 --- a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_updateready-manual.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[api_status_updateready-manual.html] - prefs: [browser.cache.offline.enable:true] diff --git a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_swapcache-manual.html.ini b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_swapcache-manual.html.ini deleted file mode 100644 index 67769b5a3377..000000000000 --- a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_swapcache-manual.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[api_swapcache-manual.html] - prefs: [browser.cache.offline.enable:true] diff --git a/testing/web-platform/meta/service-workers/service-worker/clients-get.https.html.ini b/testing/web-platform/meta/service-workers/service-worker/clients-get.https.html.ini index e7bc0961e924..038167c06284 100644 --- a/testing/web-platform/meta/service-workers/service-worker/clients-get.https.html.ini +++ b/testing/web-platform/meta/service-workers/service-worker/clients-get.https.html.ini @@ -1,5 +1,4 @@ [clients-get.https.html] - prefs: [browser.cache.offline.enable:true] disabled: if debug and (os == "mac"): https://bugzilla.mozilla.org/show_bug.cgi?id=1586420 expected: diff --git a/toolkit/components/backgroundtasks/defaults/backgroundtasks.js b/toolkit/components/backgroundtasks/defaults/backgroundtasks.js index 31ccd251ffd7..4aff06f9d7f5 100644 --- a/toolkit/components/backgroundtasks/defaults/backgroundtasks.js +++ b/toolkit/components/backgroundtasks/defaults/backgroundtasks.js @@ -11,7 +11,6 @@ pref("browser.dom.window.dump.enabled", true); pref("devtools.console.stdout.chrome", true); -pref("browser.cache.offline.enable", false); pref("browser.cache.disk.enable", false); pref("permissions.memory_only", true); diff --git a/toolkit/components/telemetry/app/TelemetryEnvironment.sys.mjs b/toolkit/components/telemetry/app/TelemetryEnvironment.sys.mjs index 10b0e712692e..0098efc95093 100644 --- a/toolkit/components/telemetry/app/TelemetryEnvironment.sys.mjs +++ b/toolkit/components/telemetry/app/TelemetryEnvironment.sys.mjs @@ -223,7 +223,6 @@ const DEFAULT_ENVIRONMENT_PREFS = new Map([ ["browser.cache.disk.enable", { what: RECORD_PREF_VALUE }], ["browser.cache.disk.capacity", { what: RECORD_PREF_VALUE }], ["browser.cache.memory.enable", { what: RECORD_PREF_VALUE }], - ["browser.cache.offline.enable", { what: RECORD_PREF_VALUE }], ["browser.formfill.enable", { what: RECORD_PREF_VALUE }], ["browser.fixup.alternate.enabled", { what: RECORD_DEFAULTPREF_VALUE }], ["browser.migrate.interactions.bookmarks", { what: RECORD_PREF_VALUE }],