From 4080dcfd5b6faca7f85b2071929e9c1734a9c659 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 10 Jun 2024 06:12:33 -0700 Subject: [PATCH] AppCache removal: remove applicationCache property https://bugs.webkit.org/show_bug.cgi?id=275312 Reviewed by Youenn Fablet. Follows 279811@main as another small incremental step towards fully removing AppCache. * Source/WebCore/bindings/js/WebCoreBuiltinNames.h: * Source/WebCore/page/DOMWindow.cpp: * Source/WebCore/page/DOMWindow.h: * Source/WebCore/page/DOMWindow.idl: * Source/WebCore/page/LocalDOMWindow.cpp: (WebCore::LocalDOMWindow::applicationCache): Deleted. * Source/WebCore/page/LocalDOMWindow.h: * Source/WebKitLegacy/mac/WebKit.exp: * Source/WebKitLegacy/mac/WebView/WebFrame.mm: (-[WebFrame _cacheabilityDictionary]): * Source/WebKitLegacy/mac/WebView/WebFramePrivate.h: Canonical link: https://commits.webkit.org/279873@main --- Source/WebCore/bindings/js/WebCoreBuiltinNames.h | 1 - Source/WebCore/page/DOMWindow.cpp | 8 -------- Source/WebCore/page/DOMWindow.h | 2 -- Source/WebCore/page/DOMWindow.idl | 2 -- Source/WebCore/page/LocalDOMWindow.cpp | 8 -------- Source/WebCore/page/LocalDOMWindow.h | 4 ---- Source/WebKitLegacy/mac/WebKit.exp | 1 - Source/WebKitLegacy/mac/WebView/WebFrame.mm | 3 --- Source/WebKitLegacy/mac/WebView/WebFramePrivate.h | 1 - 9 files changed, 30 deletions(-) diff --git a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h index a5a6d8a0c426d..af0dd9da9a4a1 100644 --- a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h +++ b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h @@ -529,7 +529,6 @@ namespace WebCore { macro(abortSteps) \ macro(addAbortAlgorithmToSignal) \ macro(appendFromJS) \ - macro(applicationCache) \ macro(associatedReadableByteStreamController) \ macro(autoAllocateChunkSize) \ macro(backingMap) \ diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp index 85bb921bec67a..86f1980d7f4ce 100644 --- a/Source/WebCore/page/DOMWindow.cpp +++ b/Source/WebCore/page/DOMWindow.cpp @@ -415,14 +415,6 @@ ExceptionOr DOMWindow::navigator() return localThis->navigator(); } -ExceptionOr DOMWindow::applicationCache() -{ - auto* localThis = dynamicDowncast(*this); - if (!localThis) - return Exception { ExceptionCode::SecurityError }; - return localThis->applicationCache(); -} - ExceptionOr DOMWindow::offscreenBuffering() const { auto* localThis = dynamicDowncast(*this); diff --git a/Source/WebCore/page/DOMWindow.h b/Source/WebCore/page/DOMWindow.h index 470e534efeb93..8a0e8439a29f9 100644 --- a/Source/WebCore/page/DOMWindow.h +++ b/Source/WebCore/page/DOMWindow.h @@ -41,7 +41,6 @@ class CSSStyleDeclaration; class CookieStore; class Crypto; class CustomElementRegistry; -class DOMApplicationCache; class DOMSelection; class DOMWrapperWorld; class Document; @@ -157,7 +156,6 @@ class DOMWindow : public RefCounted, public EventTarget { ExceptionOr scrollY() const; ExceptionOr frameElement() const; ExceptionOr navigator(); - ExceptionOr applicationCache(); ExceptionOr offscreenBuffering() const; ExceptionOr cookieStore(); ExceptionOr screen(); diff --git a/Source/WebCore/page/DOMWindow.idl b/Source/WebCore/page/DOMWindow.idl index 2e6130f38f769..fb8ba53f83909 100644 --- a/Source/WebCore/page/DOMWindow.idl +++ b/Source/WebCore/page/DOMWindow.idl @@ -84,8 +84,6 @@ // the user agent readonly attribute Navigator navigator; [Replaceable, ImplementedAs=navigator] readonly attribute Navigator clientInformation; - // FIXME: This is specified to be [SecureContext] - [EnabledByQuirk=shouldEnableApplicationCache] readonly attribute DOMApplicationCache applicationCache; // user prompts undefined alert(); diff --git a/Source/WebCore/page/LocalDOMWindow.cpp b/Source/WebCore/page/LocalDOMWindow.cpp index ea58680c93f6c..39b1b3cfbcac0 100644 --- a/Source/WebCore/page/LocalDOMWindow.cpp +++ b/Source/WebCore/page/LocalDOMWindow.cpp @@ -43,7 +43,6 @@ #include "CrossOriginOpenerPolicy.h" #include "Crypto.h" #include "CustomElementRegistry.h" -#include "DOMApplicationCache.h" #include "DOMSelection.h" #include "DOMStringList.h" #include "DOMTimer.h" @@ -754,13 +753,6 @@ BarProp& LocalDOMWindow::toolbar() return *m_toolbar; } -DOMApplicationCache& LocalDOMWindow::applicationCache() -{ - if (!m_applicationCache) - m_applicationCache = DOMApplicationCache::create(*this); - return *m_applicationCache; -} - Navigator& LocalDOMWindow::navigator() { if (!m_navigator) diff --git a/Source/WebCore/page/LocalDOMWindow.h b/Source/WebCore/page/LocalDOMWindow.h index 7daee35f1de8a..75040fde6ddfc 100644 --- a/Source/WebCore/page/LocalDOMWindow.h +++ b/Source/WebCore/page/LocalDOMWindow.h @@ -280,9 +280,6 @@ class LocalDOMWindow final Storage* optionalSessionStorage() const { return m_sessionStorage.get(); } Storage* optionalLocalStorage() const { return m_localStorage.get(); } - DOMApplicationCache& applicationCache(); - DOMApplicationCache* optionalApplicationCache() const { return m_applicationCache.get(); } - CustomElementRegistry* customElementRegistry() { return m_customElementRegistry.get(); } CustomElementRegistry& ensureCustomElementRegistry(); @@ -432,7 +429,6 @@ class LocalDOMWindow final mutable RefPtr m_sessionStorage; mutable RefPtr m_localStorage; - mutable RefPtr m_applicationCache; RefPtr m_customElementRegistry; diff --git a/Source/WebKitLegacy/mac/WebKit.exp b/Source/WebKitLegacy/mac/WebKit.exp index d006c1fb441ff..edb94be3332de 100644 --- a/Source/WebKitLegacy/mac/WebKit.exp +++ b/Source/WebKitLegacy/mac/WebKit.exp @@ -205,7 +205,6 @@ _WebFrameCanSuspendActiveDOMObjects _WebFrameHasPlugins _WebFrameHasUnloadListener _WebFrameMainDocumentError -_WebFrameUsesApplicationCache _WebFrameUsesDatabases _WebFrameUsesGeolocation _WebHistoryAllItemsRemovedNotification diff --git a/Source/WebKitLegacy/mac/WebView/WebFrame.mm b/Source/WebKitLegacy/mac/WebView/WebFrame.mm index b560abccfdd9b..01a0322ecbb8c 100644 --- a/Source/WebKitLegacy/mac/WebView/WebFrame.mm +++ b/Source/WebKitLegacy/mac/WebView/WebFrame.mm @@ -191,7 +191,6 @@ Repeat load of the same URL (by any other means of navigation other than the rel NSString *WebFrameHasUnloadListener = @"WebFrameHasUnloadListenerKey"; NSString *WebFrameUsesDatabases = @"WebFrameUsesDatabasesKey"; NSString *WebFrameUsesGeolocation = @"WebFrameUsesGeolocationKey"; -NSString *WebFrameUsesApplicationCache = @"WebFrameUsesApplicationCacheKey"; NSString *WebFrameCanSuspendActiveDOMObjects = @"WebFrameCanSuspendActiveDOMObjectsKey"; // FIXME: Remove when this key becomes publicly defined @@ -2040,8 +2039,6 @@ - (NSMutableDictionary *)_cacheabilityDictionary if (auto* domWindow = _private->coreFrame->document()->domWindow()) { if (domWindow->hasEventListeners(WebCore::eventNames().unloadEvent)) [result setObject:@YES forKey:WebFrameHasUnloadListener]; - if (domWindow->optionalApplicationCache()) - [result setObject:@YES forKey:WebFrameUsesApplicationCache]; } if (auto* document = _private->coreFrame->document()) { diff --git a/Source/WebKitLegacy/mac/WebView/WebFramePrivate.h b/Source/WebKitLegacy/mac/WebView/WebFramePrivate.h index d88540ed01b7b..0784326601f4a 100644 --- a/Source/WebKitLegacy/mac/WebView/WebFramePrivate.h +++ b/Source/WebKitLegacy/mac/WebView/WebFramePrivate.h @@ -56,7 +56,6 @@ extern NSString *WebFrameHasPlugins; extern NSString *WebFrameHasUnloadListener; extern NSString *WebFrameUsesDatabases; extern NSString *WebFrameUsesGeolocation; -extern NSString *WebFrameUsesApplicationCache; extern NSString *WebFrameCanSuspendActiveDOMObjects; typedef enum {