Index: webkitgtk-2.46.6/Source/cmake/OptionsGTK.cmake
===================================================================
--- webkitgtk-2.46.6.orig/Source/cmake/OptionsGTK.cmake
+++ webkitgtk-2.46.6/Source/cmake/OptionsGTK.cmake
@@ -8,8 +8,7 @@ SET_PROJECT_VERSION(2 46 6)
 set(USER_AGENT_BRANDING "" CACHE STRING "Branding to add to user agent string")
 
 find_package(Cairo 1.15.2 REQUIRED)
-find_package(LibGcrypt 1.7.0 REQUIRED)
-find_package(Libtasn1 REQUIRED)
+find_package(LibGcrypt 1.6.0 REQUIRED)
 find_package(HarfBuzz 1.4.2 REQUIRED COMPONENTS ICU)
 find_package(ICU 52.1 REQUIRED COMPONENTS data i18n uc)
 find_package(JPEG REQUIRED)
@@ -108,6 +107,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PDFJS PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SPELLCHECK PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TOUCH_EVENTS PUBLIC ON)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_CRYPTO PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBDRIVER PUBLIC ON)
 
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(USE_AVIF PUBLIC ON)
@@ -325,6 +325,16 @@ if (ENABLE_DOCUMENTATION AND NOT GIDocge
     message(FATAL_ERROR "ENABLE_DOCUMENTATION is needed for gi-docgen.")
 endif ()
 
+if (ENABLE_WEB_CRYPTO)
+    find_package(Libtasn1 REQUIRED)
+    if (NOT LIBTASN1_FOUND)
+        message(FATAL_ERROR "libtasn1 is required to enable Web Crypto API support.")
+    endif ()
+    if (LibGcrypt_VERSION VERSION_LESS 1.7.0)
+        message(FATAL_ERROR "libgcrypt 1.7.0 is required to enable Web Crypto API support.")
+    endif ()
+endif ()
+
 if (ENABLE_WEBDRIVER)
     SET_AND_EXPOSE_TO_BUILD(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS ON)
     SET_AND_EXPOSE_TO_BUILD(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS ON)
Index: webkitgtk-2.46.6/Source/cmake/WebKitFeatures.cmake
===================================================================
--- webkitgtk-2.46.6.orig/Source/cmake/WebKitFeatures.cmake
+++ webkitgtk-2.46.6/Source/cmake/WebKitFeatures.cmake
@@ -258,6 +258,7 @@ macro(WEBKIT_OPTION_BEGIN)
     WEBKIT_OPTION_DEFINE(ENABLE_WEB_AUDIO "Toggle Web Audio support" PRIVATE ON)
     WEBKIT_OPTION_DEFINE(ENABLE_WEB_AUTHN "Toggle Web AuthN support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_WEB_CODECS "Toggle WebCodecs support" PRIVATE OFF)
+    WEBKIT_OPTION_DEFINE(ENABLE_WEB_CRYPTO "Toggle WebCrypto Subtle-Crypto support" PRIVATE ON)
     WEBKIT_OPTION_DEFINE(ENABLE_WEB_RTC "Toggle WebRTC support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_WIRELESS_PLAYBACK_TARGET "Toggle wireless playback target support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_XSLT "Toggle XSLT support" PRIVATE ON)
Index: webkitgtk-2.46.6/Source/WebCore/bindings/js/SerializedScriptValue.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/bindings/js/SerializedScriptValue.cpp
+++ webkitgtk-2.46.6/Source/WebCore/bindings/js/SerializedScriptValue.cpp
@@ -200,7 +200,9 @@ enum SerializationTag {
     MapObjectTag = 30,
     NonMapPropertiesTag = 31,
     NonSetPropertiesTag = 32,
+#if ENABLE(WEB_CRYPTO)
     CryptoKeyTag = 33,
+#endif
     SharedArrayBufferTag = 34,
 #if ENABLE(WEBASSEMBLY)
     WasmModuleTag = 35,
@@ -303,7 +305,9 @@ static ASCIILiteral name(SerializationTa
     case MapObjectTag: return "MapObjectTag"_s;
     case NonMapPropertiesTag: return "NonMapPropertiesTag"_s;
     case NonSetPropertiesTag: return "NonSetPropertiesTag"_s;
+#if ENABLE(WEB_CRYPTO)
     case CryptoKeyTag: return "CryptoKeyTag"_s;
+#endif
     case SharedArrayBufferTag: return "SharedArrayBufferTag"_s;
 #if ENABLE(WEBASSEMBLY)
     case WasmModuleTag: return "WasmModuleTag"_s;
@@ -461,7 +465,9 @@ static bool isTypeExposedToGlobalObject(
     case FileListTag:
     case ImageDataTag:
     case BlobTag:
+#if ENABLE(WEB_CRYPTO)
     case CryptoKeyTag:
+#endif
     case DOMPointReadOnlyTag:
     case DOMPointTag:
     case DOMRectReadOnlyTag:
@@ -622,6 +628,8 @@ static String agentClusterIDFromGlobalOb
 }
 #endif
 
+#if ENABLE(WEB_CRYPTO)
+
 const uint32_t currentKeyFormatVersion = 1;
 
 enum class CryptoKeyClassSubtag {
@@ -694,6 +702,8 @@ enum class CryptoKeyOKPOpNameTag {
     ED25519 = 1,
 };
 const uint8_t cryptoKeyOKPOpNameTagMaximumValue = 1;
+#endif
+
 static constexpr unsigned CurrentMajorVersion = 15;
 static constexpr unsigned CurrentMinorVersion = 0;
 static constexpr unsigned majorVersionFor(unsigned version) { return version & 0x00FFFFFF; }
@@ -963,6 +973,7 @@ protected:
     StackCheck m_stackCheck;
 };
 
+#if ENABLE(WEB_CRYPTO)
 static std::optional<Vector<uint8_t>> wrapCryptoKey(JSGlobalObject* lexicalGlobalObject, const Vector<uint8_t>& key)
 {
     auto context = executionContext(lexicalGlobalObject);
@@ -980,6 +991,7 @@ static std::optional<Vector<uint8_t>> un
 
     return context->unwrapCryptoKey(wrappedKey);
 }
+#endif
 
 #if ASSUME_LITTLE_ENDIAN
 template <typename T> static void writeLittleEndian(Vector<uint8_t>& buffer, T value)
@@ -2013,6 +2025,7 @@ private:
                 addToObjectPool<ArrayBufferViewTag>(obj);
                 return success;
             }
+#if ENABLE(WEB_CRYPTO)
             if (auto* key = JSCryptoKey::toWrapped(vm, obj)) {
                 write(CryptoKeyTag);
                 Vector<uint8_t> serializedKey;
@@ -2074,6 +2087,7 @@ private:
                 write(*wrappedKey);
                 return true;
             }
+#endif
 #if ENABLE(WEB_RTC)
             if (auto* rtcCertificate = JSRTCCertificate::toWrapped(vm, obj)) {
                 write(RTCCertificateTag);
@@ -2221,6 +2235,7 @@ private:
         writeLittleEndian<uint8_t>(m_buffer, static_cast<uint8_t>(tag));
     }
 
+#if ENABLE(WEB_CRYPTO)
     void write(CryptoKeyClassSubtag tag)
     {
         writeLittleEndian<uint8_t>(m_buffer, static_cast<uint8_t>(tag));
@@ -2245,6 +2260,7 @@ private:
     {
         writeLittleEndian<uint8_t>(m_buffer, static_cast<uint8_t>(tag));
     }
+#endif
 
     void write(bool b)
     {
@@ -2460,6 +2476,7 @@ private:
         write(DestinationColorSpaceSRGBTag);
     }
 
+#if ENABLE(WEB_CRYPTO)
     void write(CryptoKeyOKP::NamedCurve curve)
     {
         switch (curve) {
@@ -2664,11 +2681,14 @@ private:
             break;
         }
     }
+#endif
 
+#if ENABLE(WEB_CRYPTO)
     UseCryptoKit isUsingCryptoKit()
     {
         return executionContext(m_lexicalGlobalObject)->settingsValues().cryptoKitEnabled ? UseCryptoKit::Yes : UseCryptoKit::No;
     }
+#endif
 
     void write(std::span<const uint8_t> data)
     {
@@ -3318,10 +3338,12 @@ private:
 
     enum class VisitNamedMemberResult : uint8_t { Error, Break, Start, Unknown };
 
+#if ENABLE(WEB_CRYPTO)
     UseCryptoKit isUsingCryptoKit()
     {
         return executionContext(m_lexicalGlobalObject)->settingsValues().cryptoKitEnabled ? UseCryptoKit::Yes : UseCryptoKit::No;
     }
+#endif
 
     template<WalkerState endState>
     ALWAYS_INLINE VisitNamedMemberResult startVisitNamedMember(MarkedVector<JSObject*, 32>& outputObjectStack, Vector<Identifier, 16>& propertyNameStack, Vector<WalkerState, 16>& stateStack, JSValue& outValue)
@@ -3950,6 +3972,7 @@ private:
         return false;
     }
 
+#if ENABLE(WEB_CRYPTO)
     bool read(CryptoKeyOKP::NamedCurve& result)
     {
         uint8_t nameTag;
@@ -4321,6 +4344,7 @@ private:
         cryptoKey = getJSValue(result.get());
         return true;
     }
+#endif
 
     bool read(SerializableErrorType& errorType)
     {
@@ -5292,6 +5316,7 @@ private:
             addToObjectPool<ArrayBufferViewTag>(arrayBufferView);
             return arrayBufferView;
         }
+#if ENABLE(WEB_CRYPTO)
         case CryptoKeyTag: {
             Vector<uint8_t> wrappedKey;
             if (!read(wrappedKey)) {
@@ -5316,6 +5341,7 @@ private:
             }
             return cryptoKey;
         }
+#endif
         case DOMPointReadOnlyTag:
             return readDOMPoint<DOMPointReadOnly>();
         case DOMPointTag:
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESCBC.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESCBC.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESCBC.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmAESCBC.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmAesCbcCfbParams.h"
 #include "CryptoAlgorithmAesKeyParams.h"
 #include "CryptoKeyAES.h"
@@ -193,3 +195,5 @@ ExceptionOr<size_t> CryptoAlgorithmAESCB
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESCBC.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESCBC.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESCBC.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmAesCbcCfbParams;
@@ -57,3 +59,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESCFB.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESCFB.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESCFB.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmAESCFB.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmAesCbcCfbParams.h"
 #include "CryptoAlgorithmAesKeyParams.h"
 #include "CryptoKeyAES.h"
@@ -193,3 +195,5 @@ ExceptionOr<size_t> CryptoAlgorithmAESCF
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESCFB.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESCFB.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESCFB.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmAesCbcCfbParams;
@@ -54,3 +56,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESCTR.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESCTR.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESCTR.cpp
@@ -27,6 +27,8 @@
 #include "config.h"
 #include "CryptoAlgorithmAESCTR.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmAesCtrParams.h"
 #include "CryptoAlgorithmAesKeyParams.h"
 #include "CryptoKeyAES.h"
@@ -314,3 +316,5 @@ auto CryptoAlgorithmAESCTR::CounterBlock
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESCTR.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESCTR.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESCTR.h
@@ -28,6 +28,8 @@
 
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmAesCtrParams;
@@ -82,3 +84,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESGCM.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESGCM.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESGCM.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmAESGCM.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmAesGcmParams.h"
 #include "CryptoAlgorithmAesKeyParams.h"
 #include "CryptoKeyAES.h"
@@ -242,3 +244,5 @@ ExceptionOr<size_t> CryptoAlgorithmAESGC
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESGCM.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESGCM.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESGCM.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmAesGcmParams;
@@ -55,3 +57,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESKW.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESKW.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESKW.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmAESKW.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmAesKeyParams.h"
 #include "CryptoKeyAES.h"
 #include <variant>
@@ -182,3 +184,5 @@ ExceptionOr<size_t> CryptoAlgorithmAESKW
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESKW.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESKW.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmAESKW.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoKeyAES;
@@ -54,3 +56,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDH.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDH.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDH.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmECDH.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmEcKeyParams.h"
 #include "CryptoAlgorithmEcdhKeyDeriveParams.h"
 #include "CryptoKeyEC.h"
@@ -229,3 +231,5 @@ void CryptoAlgorithmECDH::exportKey(Cryp
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDH.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDH.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDH.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoKeyEC;
@@ -51,3 +53,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDSA.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDSA.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDSA.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmECDSA.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmEcKeyParams.h"
 #include "CryptoAlgorithmEcdsaParams.h"
 #include "CryptoKeyEC.h"
@@ -218,3 +220,5 @@ void CryptoAlgorithmECDSA::exportKey(Cry
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDSA.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDSA.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDSA.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmEcdsaParams;
@@ -53,3 +55,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmEd25519.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmEd25519.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmEd25519.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmEd25519.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoKeyOKP.h"
 #include "NotImplemented.h"
 #include "ScriptExecutionContext.h"
@@ -196,3 +198,4 @@ void CryptoAlgorithmEd25519::exportKey(C
 }
 
 } // namespace WebCore
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmEd25519.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmEd25519.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmEd25519.h
@@ -26,6 +26,7 @@
 
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
 namespace WebCore {
 
 constexpr auto ed25519KeySize = 32;
@@ -59,3 +60,5 @@ inline CryptoAlgorithmIdentifier CryptoA
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmHKDF.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmHKDF.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmHKDF.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmHKDF.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmHkdfParams.h"
 #include "CryptoKeyRaw.h"
 #include "ScriptExecutionContext.h"
@@ -82,3 +84,5 @@ ExceptionOr<size_t> CryptoAlgorithmHKDF:
 }
     
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmHKDF.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmHKDF.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmHKDF.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmHkdfParams;
@@ -50,3 +52,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmHMAC.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmHmacKeyParams.h"
 #include "CryptoKeyHMAC.h"
 #include "ScriptExecutionContext.h"
@@ -198,4 +200,6 @@ ExceptionOr<size_t> CryptoAlgorithmHMAC:
     return CryptoKeyHMAC::getKeyLength(parameters);
 }
 
-} // namespace WebCore
+}
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoKeyHMAC;
@@ -54,3 +56,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmPBKDF2.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmPBKDF2.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmPBKDF2.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmPBKDF2.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmPbkdf2Params.h"
 #include "CryptoKeyRaw.h"
 #include <JavaScriptCore/JSCJSValueInlines.h>
@@ -80,3 +82,5 @@ ExceptionOr<size_t> CryptoAlgorithmPBKDF
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmPBKDF2.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmPBKDF2.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmPBKDF2.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmPbkdf2Params;
@@ -50,3 +52,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmRSAES_PKCS1_v1_5.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmRsaKeyGenParams.h"
 #include "CryptoKeyPair.h"
 #include "CryptoKeyRSA.h"
@@ -184,4 +186,6 @@ void CryptoAlgorithmRSAES_PKCS1_v1_5::ex
     callback(format, WTFMove(result));
 }
 
-} // namespace WebCore
+}
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoKeyRSA;
@@ -52,3 +54,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmRSA_OAEP.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmRsaHashedImportParams.h"
 #include "CryptoAlgorithmRsaHashedKeyGenParams.h"
 #include "CryptoAlgorithmRsaOaepParams.h"
@@ -254,4 +256,6 @@ void CryptoAlgorithmRSA_OAEP::exportKey(
     callback(format, WTFMove(result));
 }
 
-} // namespace WebCore
+}
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmRsaOaepParams;
@@ -53,3 +55,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "CryptoAlgorithmRSA_PSS.h"
 
-#if HAVE(RSA_PSS)
+#if ENABLE(WEB_CRYPTO) && HAVE(RSA_PSS)
 
 #include "CryptoAlgorithmRsaHashedImportParams.h"
 #include "CryptoAlgorithmRsaHashedKeyGenParams.h"
@@ -244,4 +244,4 @@ void CryptoAlgorithmRSA_PSS::exportKey(C
 
 }
 
-#endif // HAVE(RSA_PSS)
+#endif // ENABLE(WEB_CRYPTO) && HAVE(RSA_PSS)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.h
@@ -27,7 +27,7 @@
 
 #include "CryptoAlgorithm.h"
 
-#if HAVE(RSA_PSS)
+#if ENABLE(WEB_CRYPTO) && HAVE(RSA_PSS)
 
 namespace WebCore {
 
@@ -56,4 +56,4 @@ private:
 
 } // namespace WebCore
 
-#endif // HAVE(RSA_PSS)
+#endif // ENABLE(WEB_CRYPTO) && HAVE(RSA_PSS)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmRSASSA_PKCS1_v1_5.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmRsaHashedImportParams.h"
 #include "CryptoAlgorithmRsaHashedKeyGenParams.h"
 #include "CryptoKeyPair.h"
@@ -238,4 +240,6 @@ void CryptoAlgorithmRSASSA_PKCS1_v1_5::e
     callback(format, WTFMove(result));
 }
 
-} // namespace WebCore
+}
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoKeyRSA;
@@ -52,3 +54,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmSHA1.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "ScriptExecutionContext.h"
 #include <pal/crypto/CryptoDigest.h>
 
@@ -46,4 +48,6 @@ void CryptoAlgorithmSHA1::digest(Vector<
     CryptoAlgorithm::dispatchDigest(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), WTFMove(message), PAL::CryptoDigest::Algorithm::SHA_1);
 }
 
-} // namespace WebCore
+}
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmSHA1 final : public CryptoAlgorithm {
@@ -42,3 +44,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA224.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA224.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA224.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmSHA224.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "ScriptExecutionContext.h"
 #include <pal/crypto/CryptoDigest.h>
 
@@ -58,4 +60,6 @@ void CryptoAlgorithmSHA224::digest(Vecto
     });
 }
 
-} // namespace WebCore
+}
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA224.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA224.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA224.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmSHA224 final : public CryptoAlgorithm {
@@ -42,3 +44,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA256.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA256.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA256.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmSHA256.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "ScriptExecutionContext.h"
 #include <pal/crypto/CryptoDigest.h>
 
@@ -46,4 +48,6 @@ void CryptoAlgorithmSHA256::digest(Vecto
     CryptoAlgorithm::dispatchDigest(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), WTFMove(message), PAL::CryptoDigest::Algorithm::SHA_256);
 }
 
-} // namespace WebCore
+}
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA256.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA256.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA256.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmSHA256 final : public CryptoAlgorithm {
@@ -42,3 +44,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA384.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA384.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA384.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmSHA384.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "ScriptExecutionContext.h"
 #include <pal/crypto/CryptoDigest.h>
 
@@ -46,4 +48,6 @@ void CryptoAlgorithmSHA384::digest(Vecto
     CryptoAlgorithm::dispatchDigest(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), WTFMove(message), PAL::CryptoDigest::Algorithm::SHA_384);
 }
 
-} // namespace WebCore
+}
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA384.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA384.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA384.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmSHA384 final : public CryptoAlgorithm {
@@ -42,3 +44,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA512.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA512.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA512.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmSHA512.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "ScriptExecutionContext.h"
 #include <pal/crypto/CryptoDigest.h>
 
@@ -46,4 +48,6 @@ void CryptoAlgorithmSHA512::digest(Vecto
     CryptoAlgorithm::dispatchDigest(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), WTFMove(message), PAL::CryptoDigest::Algorithm::SHA_512);
 }
 
-} // namespace WebCore
+}
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA512.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA512.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA512.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmSHA512 final : public CryptoAlgorithm {
@@ -42,3 +44,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmX25519.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmX25519.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmX25519.cpp
@@ -20,6 +20,8 @@
 #include "config.h"
 #include "CryptoAlgorithmX25519.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmEcKeyParams.h"
 #include "CryptoAlgorithmX25519Params.h"
 #include "CryptoKeyOKP.h"
@@ -225,3 +227,5 @@ void CryptoAlgorithmX25519::exportKey(Cr
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmX25519.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/algorithms/CryptoAlgorithmX25519.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/algorithms/CryptoAlgorithmX25519.h
@@ -21,6 +21,7 @@
 
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
 namespace WebCore {
 
 class CryptoKeyOKP;
@@ -44,3 +45,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/CommonCryptoUtilities.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/CommonCryptoUtilities.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/CommonCryptoUtilities.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CommonCryptoUtilities.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 bool getCommonCryptoDigestAlgorithm(CryptoAlgorithmIdentifier hashFunction, CCDigestAlgorithm& algorithm)
@@ -54,3 +56,5 @@ ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/CommonCryptoUtilities.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/CommonCryptoUtilities.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/CommonCryptoUtilities.h
@@ -25,6 +25,8 @@
 
 #pragma once
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmIdentifier.h"
 #include <CommonCrypto/CommonCryptor.h>
 #include <CommonCrypto/CommonRandom.h>
@@ -36,3 +38,5 @@ namespace WebCore {
 bool getCommonCryptoDigestAlgorithm(CryptoAlgorithmIdentifier, CCDigestAlgorithm&);
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/CryptoAlgorithm.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/CryptoAlgorithm.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/CryptoAlgorithm.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithm.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "ScriptExecutionContext.h"
 
 namespace WebCore {
@@ -131,4 +133,6 @@ void CryptoAlgorithm::dispatchDigest(Wor
     });
 }
 
-} // namespace WebCore
+}
+
+#endif
Index: webkitgtk-2.46.6/Source/WebCore/crypto/CryptoAlgorithm.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/CryptoAlgorithm.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/CryptoAlgorithm.h
@@ -39,6 +39,8 @@
 #include <wtf/Vector.h>
 #include <wtf/WorkQueue.h>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmParameters;
@@ -82,3 +84,5 @@ public:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/CryptoAlgorithmIdentifier.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/CryptoAlgorithmIdentifier.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/CryptoAlgorithmIdentifier.h
@@ -25,9 +25,11 @@
 
 #pragma once
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
-enum class CryptoAlgorithmIdentifier : uint8_t {
+enum class CryptoAlgorithmIdentifier {
     RSAES_PKCS1_v1_5 = 1,
     RSASSA_PKCS1_v1_5,
     RSA_PSS,
@@ -52,3 +54,5 @@ enum class CryptoAlgorithmIdentifier : u
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/CryptoAlgorithmParameters.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/CryptoAlgorithmParameters.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/CryptoAlgorithmParameters.h
@@ -29,12 +29,14 @@
 #include <wtf/TypeCasts.h>
 #include <wtf/text/WTFString.h>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmParameters {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    enum class Class : uint8_t {
+    enum class Class {
         None,
         AesCbcCfbParams,
         AesCtrParams,
@@ -69,3 +71,5 @@ public:
 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::CryptoAlgorithm##ToClassName) \
 static bool isType(const WebCore::CryptoAlgorithmParameters& parameters) { return parameters.parametersClass() == WebCore::CryptoAlgorithmParameters::Class::ToClassName; } \
 SPECIALIZE_TYPE_TRAITS_END()
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/CryptoAlgorithmParameters.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/CryptoAlgorithmParameters.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/CryptoAlgorithmParameters.idl
@@ -23,6 +23,8 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-dictionary CryptoAlgorithmParameters {
+[
+    Conditional=WEB_CRYPTO,
+] dictionary CryptoAlgorithmParameters {
     required DOMString name;
 };
Index: webkitgtk-2.46.6/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmRegistry.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithm.h"
 #include <wtf/NeverDestroyed.h>
 
@@ -96,3 +98,5 @@ void CryptoAlgorithmRegistry::registerAl
 
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/CryptoAlgorithmRegistry.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/CryptoAlgorithmRegistry.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/CryptoAlgorithmRegistry.h
@@ -32,6 +32,8 @@
 #include <wtf/Noncopyable.h>
 #include <wtf/text/StringHash.h>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithm;
@@ -67,3 +69,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/CryptoKey.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/CryptoKey.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/CryptoKey.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoKey.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmRegistry.h"
 #include "WebCoreOpaqueRoot.h"
 #include <wtf/CryptographicallyRandomNumber.h>
@@ -80,3 +82,5 @@ Vector<uint8_t> CryptoKey::randomData(si
 #endif
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/CryptoKeyFormat.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/CryptoKeyFormat.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/CryptoKeyFormat.h
@@ -25,13 +25,17 @@
 
 #pragma once
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
-enum class CryptoKeyFormat : uint8_t {
+enum class CryptoKeyFormat {
     Raw,
     Spki,
     Pkcs8,
     Jwk
 };
 
-} // namespace WebCore
+}
+
+#endif
Index: webkitgtk-2.46.6/Source/WebCore/crypto/CryptoKey.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/CryptoKey.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/CryptoKey.h
@@ -25,6 +25,8 @@
 
 #pragma once
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAesKeyAlgorithm.h"
 #include "CryptoAlgorithmIdentifier.h"
 #include "CryptoEcKeyAlgorithm.h"
@@ -98,3 +100,5 @@ WebCoreOpaqueRoot root(CryptoKey*);
 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToClassName) \
     static bool isType(const WebCore::CryptoKey& key) { return key.keyClass() == WebCore::KeyClass; } \
 SPECIALIZE_TYPE_TRAITS_END()
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/CryptoKey.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/CryptoKey.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/CryptoKey.idl
@@ -32,6 +32,7 @@ enum KeyType {
 typedef (CryptoKeyAlgorithm or CryptoAesKeyAlgorithm or CryptoEcKeyAlgorithm or CryptoHmacKeyAlgorithm or CryptoRsaHashedKeyAlgorithm or CryptoRsaKeyAlgorithm) KeyAlgorithm;
 
 [
+    Conditional=WEB_CRYPTO,
     Exposed=(Window,Worker),
     GenerateIsReachable=Impl,
     SecureContext,
Index: webkitgtk-2.46.6/Source/WebCore/crypto/CryptoKeyPair.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/CryptoKeyPair.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/CryptoKeyPair.h
@@ -27,6 +27,8 @@
 
 #include <wtf/RefPtr.h>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoKey;
@@ -37,3 +39,5 @@ struct CryptoKeyPair {
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/CryptoKeyPair.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/CryptoKeyPair.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/CryptoKeyPair.idl
@@ -24,6 +24,7 @@
  */
 
 [
+    Conditional=WEB_CRYPTO,
     JSGenerateToJSObject
 ] dictionary CryptoKeyPair {
     CryptoKey publicKey;
Index: webkitgtk-2.46.6/Source/WebCore/crypto/CryptoKeyType.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/CryptoKeyType.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/CryptoKeyType.h
@@ -25,12 +25,16 @@
 
 #pragma once
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
-enum class CryptoKeyType : uint8_t {
+enum class CryptoKeyType {
     Public,
     Private,
     Secret
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/CryptoKeyUsage.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/CryptoKeyUsage.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/CryptoKeyUsage.h
@@ -25,6 +25,8 @@
 
 #pragma once
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 enum {
@@ -53,3 +55,5 @@ enum class CryptoKeyUsage {
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/CryptoKeyUsage.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/CryptoKeyUsage.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/CryptoKeyUsage.idl
@@ -23,7 +23,9 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-enum CryptoKeyUsage {
+[
+    Conditional=WEB_CRYPTO,
+] enum CryptoKeyUsage {
     "encrypt",
     "decrypt",
     "sign",
Index: webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp
@@ -28,6 +28,8 @@
 #include "config.h"
 #include "CryptoAlgorithmECDH.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoKeyEC.h"
 #include "GCryptUtilities.h"
 #include <pal/crypto/gcrypt/Handle.h>
@@ -104,3 +106,5 @@ std::optional<Vector<uint8_t>> CryptoAlg
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp
@@ -28,6 +28,8 @@
 #include "config.h"
 #include "CryptoAlgorithmECDSA.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmEcdsaParams.h"
 #include "CryptoKeyEC.h"
 #include "GCryptUtilities.h"
@@ -185,3 +187,5 @@ ExceptionOr<bool> CryptoAlgorithmECDSA::
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmEd25519GCrypt.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/gcrypt/CryptoAlgorithmEd25519GCrypt.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmEd25519GCrypt.cpp
@@ -20,6 +20,8 @@
 #include "config.h"
 #include "CryptoAlgorithmEd25519.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoKeyOKP.h"
 #include "GCryptUtilities.h"
 
@@ -153,4 +155,5 @@ ExceptionOr<bool> CryptoAlgorithmEd25519
     return verifyEd25519(key.platformKey(), key.keySizeInBytes(), signature, data);
 }
 
-} // namespace WebCore
+}
+#endif
Index: webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp
@@ -28,6 +28,8 @@
 #include "config.h"
 #include "CryptoAlgorithmHKDF.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmHkdfParams.h"
 #include "CryptoKeyRaw.h"
 #include "GCryptUtilities.h"
@@ -159,3 +161,5 @@ ExceptionOr<Vector<uint8_t>> CryptoAlgor
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp
@@ -29,6 +29,8 @@
 #include "config.h"
 #include "CryptoAlgorithmHMAC.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoKeyHMAC.h"
 #include <pal/crypto/gcrypt/Handle.h>
 #include <wtf/CryptographicUtilities.h>
@@ -105,4 +107,6 @@ ExceptionOr<bool> CryptoAlgorithmHMAC::p
     return signature.size() == expectedSignature->size() && !constantTimeMemcmp(expectedSignature->data(), signature.data(), expectedSignature->size());
 }
 
-} // namespace WebCore
+}
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp
@@ -28,6 +28,8 @@
 #include "config.h"
 #include "CryptoAlgorithmPBKDF2.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmPbkdf2Params.h"
 #include "CryptoKeyRaw.h"
 #include "GCryptUtilities.h"
@@ -64,3 +66,5 @@ ExceptionOr<Vector<uint8_t>> CryptoAlgor
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "CryptoAlgorithmRegistry.h"
 
+#if ENABLE(WEB_CRYPTO)
 #include "CryptoAlgorithmAESCBC.h"
 #include "CryptoAlgorithmAESCTR.h"
 #include "CryptoAlgorithmAESGCM.h"
@@ -73,4 +74,6 @@ void CryptoAlgorithmRegistry::platformRe
     registerAlgorithm<CryptoAlgorithmX25519>();
 }
 
-} // namespace WebCore
+}
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmRSAES_PKCS1_v1_5.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoKeyRSA.h"
 #include "GCryptUtilities.h"
 
@@ -109,3 +111,5 @@ ExceptionOr<Vector<uint8_t>> CryptoAlgor
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmRSA_OAEP.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmRsaOaepParams.h"
 #include "CryptoKeyRSA.h"
 #include "GCryptUtilities.h"
@@ -126,3 +128,5 @@ ExceptionOr<Vector<uint8_t>> CryptoAlgor
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp
@@ -28,6 +28,8 @@
 #include "config.h"
 #include "CryptoAlgorithmRSA_PSS.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmRsaPssParams.h"
 #include "CryptoKeyRSA.h"
 #include "GCryptUtilities.h"
@@ -152,3 +154,5 @@ ExceptionOr<bool> CryptoAlgorithmRSA_PSS
 
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp
@@ -27,6 +27,8 @@
 #include "config.h"
 #include "CryptoAlgorithmRSASSA_PKCS1_v1_5.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoKeyRSA.h"
 #include "GCryptUtilities.h"
 #include "NotImplemented.h"
@@ -150,3 +152,5 @@ ExceptionOr<bool> CryptoAlgorithmRSASSA_
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmX25519GCrypt.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/gcrypt/CryptoAlgorithmX25519GCrypt.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoAlgorithmX25519GCrypt.cpp
@@ -20,6 +20,8 @@
 #include "config.h"
 #include "CryptoAlgorithmX25519.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoKeyOKP.h"
 #include "GCryptRFC7748.h"
 #include <pal/crypto/gcrypt/Handle.h>
@@ -38,3 +40,6 @@ std::optional<Vector<uint8_t>> CryptoAlg
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
+
Index: webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoKeyEC.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoKeyPair.h"
 #include "GCryptUtilities.h"
 #include "JsonWebKey.h"
@@ -726,3 +728,5 @@ Vector<uint8_t> CryptoKeyEC::platformExp
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoKeyOKPGCrypt.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/gcrypt/CryptoKeyOKPGCrypt.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoKeyOKPGCrypt.cpp
@@ -20,6 +20,8 @@
 #include "config.h"
 #include "CryptoKeyOKP.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoKeyPair.h"
 #include "GCryptRFC7748.h"
 #include "GCryptRFC8032.h"
@@ -512,3 +514,5 @@ Vector<uint8_t> CryptoKeyOKP::platformEx
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoKeyRSAGCrypt.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/gcrypt/CryptoKeyRSAGCrypt.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/CryptoKeyRSAGCrypt.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoKeyRSA.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmRegistry.h"
 #include "CryptoKeyPair.h"
 #include "CryptoKeyRSAComponents.h"
@@ -708,3 +710,5 @@ std::unique_ptr<CryptoKeyRSAComponents>
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "SerializedCryptoKeyWrap.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "NotImplemented.h"
 #include "WrappedCryptoKey.h"
 
@@ -64,4 +66,6 @@ std::optional<Vector<uint8_t>> unwrapCry
     return wrappedKey.encryptedKey;
 }
 
-} // namespace WebCore
+}
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/JsonWebKey.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/JsonWebKey.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/JsonWebKey.h
@@ -29,6 +29,8 @@
 #include "RsaOtherPrimesInfo.h"
 #include <wtf/Vector.h>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 struct JsonWebKey {
@@ -57,3 +59,5 @@ struct JsonWebKey {
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/JsonWebKey.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/JsonWebKey.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/JsonWebKey.idl
@@ -24,6 +24,7 @@
  */
 
 [
+    Conditional=WEB_CRYPTO,
     JSGenerateToJSObject,
     JSGenerateToNativeObject
 ] dictionary JsonWebKey {
Index: webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoAesKeyAlgorithm.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/keys/CryptoAesKeyAlgorithm.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoAesKeyAlgorithm.idl
@@ -24,6 +24,7 @@
  */
 
 [
+    Conditional=WEB_CRYPTO,
     JSGenerateToJSObject
 ] dictionary CryptoAesKeyAlgorithm : CryptoKeyAlgorithm {
     // The length, in bits, of the key.
Index: webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoEcKeyAlgorithm.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/keys/CryptoEcKeyAlgorithm.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoEcKeyAlgorithm.idl
@@ -26,6 +26,7 @@
 typedef DOMString NamedCurve;
 
 [
+    Conditional=WEB_CRYPTO,
     JSGenerateToJSObject
 ] dictionary CryptoEcKeyAlgorithm : CryptoKeyAlgorithm {
     // The named curve that the key uses
Index: webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoHmacKeyAlgorithm.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/keys/CryptoHmacKeyAlgorithm.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoHmacKeyAlgorithm.idl
@@ -24,6 +24,7 @@
  */
 
 [
+    Conditional=WEB_CRYPTO,
     JSGenerateToJSObject
 ] dictionary CryptoHmacKeyAlgorithm : CryptoKeyAlgorithm {
     // The inner hash function to use.
Index: webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyAES.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/keys/CryptoKeyAES.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyAES.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoKeyAES.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAesKeyAlgorithm.h"
 #include "CryptoAlgorithmAesKeyParams.h"
 #include "CryptoAlgorithmRegistry.h"
@@ -128,3 +130,5 @@ auto CryptoKeyAES::algorithm() const ->
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyAES.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/keys/CryptoKeyAES.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyAES.h
@@ -31,6 +31,8 @@
 #include <wtf/Function.h>
 #include <wtf/Vector.h>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmParameters;
@@ -75,3 +77,5 @@ private:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_KEY(CryptoKeyAES, CryptoKeyClass::AES)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyAlgorithm.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/keys/CryptoKeyAlgorithm.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyAlgorithm.idl
@@ -24,6 +24,7 @@
  */
 
 [
+    Conditional=WEB_CRYPTO,
     JSGenerateToJSObject
 ] dictionary CryptoKeyAlgorithm {
     required DOMString name;
Index: webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyEC.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/keys/CryptoKeyEC.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyEC.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoKeyEC.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmRegistry.h"
 #include "JsonWebKey.h"
 #if HAVE(SWIFT_CPP_INTEROP)
@@ -245,3 +247,5 @@ auto CryptoKeyEC::algorithm() const -> K
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyEC.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/keys/CryptoKeyEC.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyEC.h
@@ -29,6 +29,8 @@
 #include "CryptoKeyPair.h"
 #include "ExceptionOr.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #if OS(DARWIN) && !PLATFORM(GTK)
 #include "CommonCryptoUtilities.h"
 #if HAVE(SWIFT_CPP_INTEROP)
@@ -136,3 +138,5 @@ private:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_KEY(CryptoKeyEC, CryptoKeyClass::EC)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyHMAC.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/keys/CryptoKeyHMAC.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyHMAC.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoKeyHMAC.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmHmacKeyParams.h"
 #include "CryptoAlgorithmRegistry.h"
 #include "ExceptionOr.h"
@@ -147,3 +149,5 @@ auto CryptoKeyHMAC::algorithm() const ->
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyHMAC.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/keys/CryptoKeyHMAC.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyHMAC.h
@@ -25,6 +25,8 @@
 
 #pragma once
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoKey.h"
 #include "ExceptionOr.h"
 #include <wtf/Function.h>
@@ -70,3 +72,5 @@ private:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_KEY(CryptoKeyHMAC, CryptoKeyClass::HMAC)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyOKP.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/keys/CryptoKeyOKP.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyOKP.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoKeyOKP.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmRegistry.h"
 #include "JsonWebKey.h"
 #include <wtf/text/Base64.h>
@@ -255,3 +257,5 @@ Vector<uint8_t> CryptoKeyOKP::platformEx
 #endif
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyOKP.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/keys/CryptoKeyOKP.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyOKP.h
@@ -29,6 +29,8 @@
 #include "CryptoKeyPair.h"
 #include "ExceptionOr.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 struct JsonWebKey;
@@ -87,3 +89,5 @@ private:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_KEY(CryptoKeyOKP, CryptoKeyClass::OKP)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyRaw.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/keys/CryptoKeyRaw.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyRaw.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoKeyRaw.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmRegistry.h"
 
 namespace WebCore {
@@ -44,3 +46,5 @@ auto CryptoKeyRaw::algorithm() const ->
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyRaw.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/keys/CryptoKeyRaw.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyRaw.h
@@ -27,6 +27,8 @@
 
 #include "CryptoKey.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoKeyRaw final : public CryptoKey {
@@ -51,3 +53,5 @@ private:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_KEY(CryptoKeyRaw, CryptoKeyClass::Raw)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyRSAComponents.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/keys/CryptoKeyRSAComponents.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyRSAComponents.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoKeyRSAComponents.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 CryptoKeyRSAComponents::CryptoKeyRSAComponents(const Vector<uint8_t>& modulus, const Vector<uint8_t>& exponent)
@@ -87,3 +89,5 @@ CryptoKeyRSAComponents::CryptoKeyRSAComp
 CryptoKeyRSAComponents::~CryptoKeyRSAComponents() = default;
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyRSAComponents.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/keys/CryptoKeyRSAComponents.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyRSAComponents.h
@@ -27,11 +27,13 @@
 
 #include <wtf/Vector.h>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoKeyRSAComponents {
 public:
-    enum class Type : bool {
+    enum class Type {
         Public,
         Private
     };
@@ -109,3 +111,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyRSA.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/keys/CryptoKeyRSA.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyRSA.cpp
@@ -30,6 +30,8 @@
 #include "JsonWebKey.h"
 #include <wtf/text/Base64.h>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 RefPtr<CryptoKeyRSA> CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier algorithm, std::optional<CryptoAlgorithmIdentifier> hash, JsonWebKey&& keyData, bool extractable, CryptoKeyUsageBitmap usages)
@@ -172,3 +174,5 @@ JsonWebKey CryptoKeyRSA::exportJwk() con
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyRSA.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/keys/CryptoKeyRSA.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoKeyRSA.h
@@ -29,6 +29,8 @@
 #include "ExceptionOr.h"
 #include <wtf/Function.h>
 
+#if ENABLE(WEB_CRYPTO)
+
 #if OS(DARWIN) && !PLATFORM(GTK)
 #include "CommonCryptoUtilities.h"
 
@@ -108,3 +110,5 @@ private:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_KEY(CryptoKeyRSA, CryptoKeyClass::RSA)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoRsaHashedKeyAlgorithm.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/keys/CryptoRsaHashedKeyAlgorithm.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoRsaHashedKeyAlgorithm.idl
@@ -24,6 +24,7 @@
  */
 
 [
+    Conditional=WEB_CRYPTO,
     JSGenerateToJSObject
 ] dictionary CryptoRsaHashedKeyAlgorithm : CryptoRsaKeyAlgorithm {
     // The hash algorithm that is used with this key
Index: webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoRsaKeyAlgorithm.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/keys/CryptoRsaKeyAlgorithm.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/keys/CryptoRsaKeyAlgorithm.idl
@@ -26,6 +26,7 @@
 typedef Uint8Array BigInteger;
 
 [
+    Conditional=WEB_CRYPTO,
     JSGenerateToJSObject
 ] dictionary CryptoRsaKeyAlgorithm : CryptoKeyAlgorithm {
     // The length, in bits, of the RSA modulus
Index: webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoAlgorithmECDHOpenSSL.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/openssl/CryptoAlgorithmECDHOpenSSL.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoAlgorithmECDHOpenSSL.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmECDH.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoKeyEC.h"
 #include "OpenSSLUtilities.h"
 
@@ -59,3 +61,5 @@ std::optional<Vector<uint8_t>> CryptoAlg
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoAlgorithmECDSAOpenSSL.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/openssl/CryptoAlgorithmECDSAOpenSSL.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoAlgorithmECDSAOpenSSL.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmECDSA.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmEcdsaParams.h"
 #include "CryptoKeyEC.h"
 #include "OpenSSLUtilities.h"
@@ -97,3 +99,5 @@ ExceptionOr<bool> CryptoAlgorithmECDSA::
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoAlgorithmHKDFOpenSSL.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/openssl/CryptoAlgorithmHKDFOpenSSL.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoAlgorithmHKDFOpenSSL.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmHKDF.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmHkdfParams.h"
 #include "CryptoKeyRaw.h"
 #include "OpenSSLUtilities.h"
@@ -47,3 +49,5 @@ ExceptionOr<Vector<uint8_t>> CryptoAlgor
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoAlgorithmHMACOpenSSL.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/openssl/CryptoAlgorithmHMACOpenSSL.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoAlgorithmHMACOpenSSL.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmHMAC.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoKeyHMAC.h"
 #include "OpenSSLCryptoUniquePtr.h"
 #include "OpenSSLUtilities.h"
@@ -83,3 +85,5 @@ ExceptionOr<bool> CryptoAlgorithmHMAC::p
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoAlgorithmPBKDF2OpenSSL.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/openssl/CryptoAlgorithmPBKDF2OpenSSL.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoAlgorithmPBKDF2OpenSSL.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmPBKDF2.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmPbkdf2Params.h"
 #include "CryptoKeyRaw.h"
 #include "OpenSSLUtilities.h"
@@ -51,3 +53,5 @@ ExceptionOr<Vector<uint8_t>> CryptoAlgor
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoAlgorithmRegistryOpenSSL.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/openssl/CryptoAlgorithmRegistryOpenSSL.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoAlgorithmRegistryOpenSSL.cpp
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "CryptoAlgorithmRegistry.h"
 
+-#if ENABLE(WEB_CRYPTO)
 #include "CryptoAlgorithmAESCBC.h"
 #include "CryptoAlgorithmAESCFB.h"
 #include "CryptoAlgorithmAESCTR.h"
@@ -72,3 +73,5 @@ void CryptoAlgorithmRegistry::platformRe
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoAlgorithmRSAES_PKCS1_v1_5OpenSSL.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/openssl/CryptoAlgorithmRSAES_PKCS1_v1_5OpenSSL.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoAlgorithmRSAES_PKCS1_v1_5OpenSSL.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmRSAES_PKCS1_v1_5.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoKeyRSA.h"
 #include "OpenSSLUtilities.h"
 
@@ -80,3 +82,5 @@ ExceptionOr<Vector<uint8_t>> CryptoAlgor
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoAlgorithmRSA_OAEPOpenSSL.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/openssl/CryptoAlgorithmRSA_OAEPOpenSSL.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoAlgorithmRSA_OAEPOpenSSL.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmRSA_OAEP.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmRsaOaepParams.h"
 #include "CryptoKeyRSA.h"
 #include "OpenSSLUtilities.h"
@@ -131,3 +133,5 @@ ExceptionOr<Vector<uint8_t>> CryptoAlgor
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoAlgorithmRSA_PSSOpenSSL.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/openssl/CryptoAlgorithmRSA_PSSOpenSSL.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoAlgorithmRSA_PSSOpenSSL.cpp
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "CryptoAlgorithmRSA_PSS.h"
 
-#if HAVE(RSA_PSS)
+#if ENABLE(WEB_CRYPTO) && HAVE(RSA_PSS)
 
 #include "CryptoAlgorithmRsaPssParams.h"
 #include "CryptoKeyRSA.h"
@@ -119,4 +119,4 @@ ExceptionOr<bool> CryptoAlgorithmRSA_PSS
 
 } // namespace WebCore
 
-#endif // HAVE(RSA_PSS)
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoAlgorithmRSASSA_PKCS1_v1_5OpenSSL.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/openssl/CryptoAlgorithmRSASSA_PKCS1_v1_5OpenSSL.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoAlgorithmRSASSA_PKCS1_v1_5OpenSSL.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoAlgorithmRSASSA_PKCS1_v1_5.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoKeyRSA.h"
 #include "OpenSSLUtilities.h"
 
@@ -95,3 +97,5 @@ ExceptionOr<bool> CryptoAlgorithmRSASSA_
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoKeyECOpenSSL.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/openssl/CryptoKeyECOpenSSL.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoKeyECOpenSSL.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoKeyEC.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "JsonWebKey.h"
 #include "OpenSSLUtilities.h"
 #include <wtf/text/Base64.h>
@@ -458,3 +460,5 @@ Vector<uint8_t> CryptoKeyEC::platformExp
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoKeyRSAOpenSSL.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/openssl/CryptoKeyRSAOpenSSL.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/openssl/CryptoKeyRSAOpenSSL.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CryptoKeyRSA.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmRegistry.h"
 #include "CryptoKeyPair.h"
 #include "CryptoKeyRSAComponents.h"
@@ -402,3 +404,5 @@ std::unique_ptr<CryptoKeyRSAComponents>
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/openssl/OpenSSLUtilities.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/openssl/OpenSSLUtilities.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/openssl/OpenSSLUtilities.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "OpenSSLUtilities.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "OpenSSLCryptoUniquePtr.h"
 
 namespace WebCore {
@@ -131,3 +133,6 @@ AESKey::~AESKey()
 }
 
 } // namespace WebCore
+
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/openssl/OpenSSLUtilities.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/openssl/OpenSSLUtilities.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/openssl/OpenSSLUtilities.h
@@ -33,6 +33,8 @@
 #include <wtf/Noncopyable.h>
 #include <wtf/Vector.h>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 const EVP_MD* digestAlgorithm(CryptoAlgorithmIdentifier hashFunction);
@@ -59,3 +61,5 @@ private:
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/openssl/SerializedCryptoKeyWrapOpenSSL.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/openssl/SerializedCryptoKeyWrapOpenSSL.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/openssl/SerializedCryptoKeyWrapOpenSSL.cpp
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "SerializedCryptoKeyWrap.h"
 
+-#if ENABLE(WEB_CRYPTO)
 #include "CryptoAlgorithmAESCTR.h"
 #include "NotImplemented.h"
 #include "WrappedCryptoKey.h"
@@ -66,3 +67,5 @@ std::optional<Vector<uint8_t>> unwrapCry
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/AesCbcCfbParams.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/AesCbcCfbParams.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/AesCbcCfbParams.idl
@@ -27,6 +27,7 @@
 // https://www.w3.org/TR/WebCryptoAPI/#dfn-AesCbcParams, and
 // https://www.w3.org/TR/2014/CR-WebCryptoAPI-20141211/#dfn-AesCfbParams
 [
+    Conditional=WEB_CRYPTO,
     ImplementedAs=CryptoAlgorithmAesCbcCfbParams
 ] dictionary AesCbcCfbParams : CryptoAlgorithmParameters {
     // The initialization vector. MUST be 16 bytes.
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/AesCtrParams.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/AesCtrParams.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/AesCtrParams.idl
@@ -23,6 +23,7 @@
 */
 
 [
+    Conditional=WEB_CRYPTO,
     ImplementedAs=CryptoAlgorithmAesCtrParams
 ] dictionary AesCtrParams : CryptoAlgorithmParameters {
     // The initial value of the counter block. counter MUST be 16 bytes
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/AesGcmParams.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/AesGcmParams.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/AesGcmParams.idl
@@ -23,6 +23,7 @@
  */
 
 [
+    Conditional=WEB_CRYPTO,
     ImplementedAs=CryptoAlgorithmAesGcmParams
 ] dictionary AesGcmParams : CryptoAlgorithmParameters {
     // The initialization vector to use. May be up to 2^64-1 bytes long.
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/AesKeyParams.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/AesKeyParams.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/AesKeyParams.idl
@@ -27,6 +27,7 @@
 // https://www.w3.org/TR/WebCryptoAPI/#aes-derivedkey-params, and
 // https://www.w3.org/TR/WebCryptoAPI/#aes-keygen-params
 [
+    Conditional=WEB_CRYPTO,
     ImplementedAs=CryptoAlgorithmAesKeyParams
 ] dictionary AesKeyParams : CryptoAlgorithmParameters {
     // The length, in bits, of the key.
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h
@@ -29,6 +29,8 @@
 #include "CryptoAlgorithmParameters.h"
 #include <wtf/Vector.h>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmAesCbcCfbParams final : public CryptoAlgorithmParameters {
@@ -62,3 +64,5 @@ private:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(AesCbcCfbParams)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmAesCtrParams.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/CryptoAlgorithmAesCtrParams.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmAesCtrParams.h
@@ -29,6 +29,8 @@
 #include "CryptoAlgorithmParameters.h"
 #include <wtf/Vector.h>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmAesCtrParams final : public CryptoAlgorithmParameters {
@@ -64,3 +66,5 @@ private:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(AesCtrParams)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmAesGcmParams.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/CryptoAlgorithmAesGcmParams.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmAesGcmParams.h
@@ -29,6 +29,8 @@
 #include "CryptoAlgorithmParameters.h"
 #include <wtf/Vector.h>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmAesGcmParams final : public CryptoAlgorithmParameters {
@@ -82,3 +84,5 @@ private:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(AesGcmParams)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmAesKeyParams.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/CryptoAlgorithmAesKeyParams.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmAesKeyParams.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithmParameters.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmAesKeyParams final : public CryptoAlgorithmParameters {
@@ -39,3 +41,5 @@ public:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(AesKeyParams)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmEcdhKeyDeriveParams.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/CryptoAlgorithmEcdhKeyDeriveParams.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmEcdhKeyDeriveParams.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithmParameters.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoKey;
@@ -41,3 +43,5 @@ public:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(EcdhKeyDeriveParams)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmEcdsaParams.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/CryptoAlgorithmEcdsaParams.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmEcdsaParams.h
@@ -30,6 +30,8 @@
 #include <JavaScriptCore/Strong.h>
 #include <variant>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmEcdsaParams final : public CryptoAlgorithmParameters {
@@ -53,3 +55,5 @@ public:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(EcdsaParams)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmEcKeyParams.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/CryptoAlgorithmEcKeyParams.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmEcKeyParams.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithmParameters.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmEcKeyParams final : public CryptoAlgorithmParameters {
@@ -48,3 +50,5 @@ public:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(EcKeyParams)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmHkdfParams.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/CryptoAlgorithmHkdfParams.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmHkdfParams.h
@@ -31,6 +31,8 @@
 #include <JavaScriptCore/Strong.h>
 #include <wtf/Vector.h>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmHkdfParams final : public CryptoAlgorithmParameters {
@@ -80,3 +82,5 @@ private:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(HkdfParams)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h
@@ -25,6 +25,8 @@
 
 #pragma once
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "CryptoAlgorithmParameters.h"
 #include <JavaScriptCore/JSObject.h>
 #include <JavaScriptCore/Strong.h>
@@ -55,3 +57,5 @@ public:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(HmacKeyParams)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmPbkdf2Params.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/CryptoAlgorithmPbkdf2Params.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmPbkdf2Params.h
@@ -31,6 +31,8 @@
 #include <JavaScriptCore/Strong.h>
 #include <wtf/Vector.h>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmPbkdf2Params final : public CryptoAlgorithmParameters {
@@ -70,3 +72,5 @@ private:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(Pbkdf2Params)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h
@@ -30,6 +30,8 @@
 #include <JavaScriptCore/Strong.h>
 #include <variant>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmRsaHashedImportParams final : public CryptoAlgorithmParameters {
@@ -53,3 +55,5 @@ public:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(RsaHashedImportParams)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h
@@ -30,6 +30,8 @@
 #include <JavaScriptCore/Strong.h>
 #include <variant>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmRsaHashedKeyGenParams final : public CryptoAlgorithmRsaKeyGenParams {
@@ -44,3 +46,5 @@ public:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(RsaHashedKeyGenParams)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h
@@ -29,6 +29,8 @@
 #include <JavaScriptCore/Uint8Array.h>
 #include <wtf/Vector.h>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmRsaKeyGenParams : public CryptoAlgorithmParameters {
@@ -53,3 +55,5 @@ private:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(RsaKeyGenParams)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaOaepParams.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaOaepParams.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaOaepParams.h
@@ -29,6 +29,8 @@
 #include "CryptoAlgorithmParameters.h"
 #include <wtf/Vector.h>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmRsaOaepParams final : public CryptoAlgorithmParameters {
@@ -68,3 +70,5 @@ private:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(RsaOaepParams)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaPssParams.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaPssParams.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaPssParams.h
@@ -27,6 +27,8 @@
 
 #include "CryptoAlgorithmParameters.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmRsaPssParams final : public CryptoAlgorithmParameters {
@@ -48,3 +50,5 @@ public:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(RsaPssParams)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmX25519Params.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/CryptoAlgorithmX25519Params.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/CryptoAlgorithmX25519Params.h
@@ -25,6 +25,8 @@
 #include <JavaScriptCore/Strong.h>
 #include <variant>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 class CryptoAlgorithmX25519Params final : public CryptoAlgorithmParameters {
@@ -36,3 +38,5 @@ public:
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(X25519Params)
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/EcdhKeyDeriveParams.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/EcdhKeyDeriveParams.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/EcdhKeyDeriveParams.idl
@@ -24,6 +24,7 @@
  */
 
 [
+    Conditional=WEB_CRYPTO,
     ImplementedAs=CryptoAlgorithmEcdhKeyDeriveParams,
 ] dictionary EcdhKeyDeriveParams : CryptoAlgorithmParameters {
     // We should rename this to public once https://bugs.webkit.org/show_bug.cgi?id=169333 is fixed.
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/EcdsaParams.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/EcdsaParams.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/EcdsaParams.idl
@@ -26,6 +26,7 @@
 typedef (object or DOMString) HashAlgorithmIdentifier;
 
 [
+    Conditional=WEB_CRYPTO,
     ImplementedAs=CryptoAlgorithmEcdsaParams
 ] dictionary EcdsaParams : CryptoAlgorithmParameters {
     // The hash algorithm to use
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/EcKeyParams.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/EcKeyParams.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/EcKeyParams.idl
@@ -27,6 +27,7 @@
 // https://www.w3.org/TR/WebCryptoAPI/#EcKeyImportParams-dictionary, and
 // https://www.w3.org/TR/WebCryptoAPI/#EcKeyGenParams-dictionary
 [
+    Conditional=WEB_CRYPTO,
     ImplementedAs=CryptoAlgorithmEcKeyParams
 ] dictionary EcKeyParams : CryptoAlgorithmParameters {
     required DOMString namedCurve;
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/HkdfParams.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/HkdfParams.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/HkdfParams.idl
@@ -26,6 +26,7 @@
 typedef (object or DOMString) HashAlgorithmIdentifier;
 
 [
+    Conditional=WEB_CRYPTO,
     ImplementedAs=CryptoAlgorithmHkdfParams,
 ] dictionary HkdfParams : CryptoAlgorithmParameters {
     // The algorithm to use with HMAC (e.g.: SHA-256)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/HmacKeyParams.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/HmacKeyParams.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/HmacKeyParams.idl
@@ -29,6 +29,7 @@ typedef (object or DOMString) HashAlgori
 // https://www.w3.org/TR/WebCryptoAPI/#hmac-importparams, and
 // https://www.w3.org/TR/WebCryptoAPI/#hmac-keygen-params
 [
+    Conditional=WEB_CRYPTO,
     ImplementedAs=CryptoAlgorithmHmacKeyParams
 ] dictionary HmacKeyParams : CryptoAlgorithmParameters {
     // The inner hash function to use.
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/Pbkdf2Params.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/Pbkdf2Params.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/Pbkdf2Params.idl
@@ -26,6 +26,7 @@
 typedef (object or DOMString) HashAlgorithmIdentifier;
 
 [
+    Conditional=WEB_CRYPTO,
     ImplementedAs=CryptoAlgorithmPbkdf2Params,
 ] dictionary Pbkdf2Params : CryptoAlgorithmParameters {
     required BufferSource salt;
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/RsaHashedImportParams.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/RsaHashedImportParams.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/RsaHashedImportParams.idl
@@ -26,6 +26,7 @@
 typedef (object or DOMString) HashAlgorithmIdentifier;
 
 [
+    Conditional=WEB_CRYPTO,
     ImplementedAs=CryptoAlgorithmRsaHashedImportParams
 ] dictionary RsaHashedImportParams : CryptoAlgorithmParameters {
     // The hash algorithm to use
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/RsaHashedKeyGenParams.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/RsaHashedKeyGenParams.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/RsaHashedKeyGenParams.idl
@@ -26,6 +26,7 @@
 typedef (object or DOMString) HashAlgorithmIdentifier;
 
 [
+    Conditional=WEB_CRYPTO,
     ImplementedAs=CryptoAlgorithmRsaHashedKeyGenParams
 ] dictionary RsaHashedKeyGenParams : RsaKeyGenParams {
     // The hash algorithm to use
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/RsaKeyGenParams.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/RsaKeyGenParams.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/RsaKeyGenParams.idl
@@ -24,6 +24,7 @@
  */
 
 [
+    Conditional=WEB_CRYPTO,
     ImplementedAs=CryptoAlgorithmRsaKeyGenParams
 ] dictionary RsaKeyGenParams : CryptoAlgorithmParameters {
     // The length, in bits, of the RSA modulus
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/RsaOaepParams.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/RsaOaepParams.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/RsaOaepParams.idl
@@ -24,6 +24,7 @@
 */
 
 [
+    Conditional=WEB_CRYPTO,
     ImplementedAs=CryptoAlgorithmRsaOaepParams
 ] dictionary RsaOaepParams : CryptoAlgorithmParameters {
     // The optional label/application data to associate with the message
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/RsaPssParams.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/RsaPssParams.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/RsaPssParams.idl
@@ -24,6 +24,7 @@
  */
 
 [
+    Conditional=WEB_CRYPTO,
     ImplementedAs=CryptoAlgorithmRsaPssParams
 ] dictionary RsaPssParams : CryptoAlgorithmParameters {
     // The desired length of the random salt
Index: webkitgtk-2.46.6/Source/WebCore/crypto/parameters/X25519Params.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/parameters/X25519Params.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/parameters/X25519Params.idl
@@ -1,4 +1,5 @@
 [
+    Conditional=WEB_CRYPTO,
     ImplementedAs=CryptoAlgorithmX25519Params,
 ] dictionary X25519Params : CryptoAlgorithmParameters {
     required CryptoKey publicKey;
Index: webkitgtk-2.46.6/Source/WebCore/crypto/RsaOtherPrimesInfo.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/RsaOtherPrimesInfo.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/RsaOtherPrimesInfo.h
@@ -27,6 +27,8 @@
 
 #include <wtf/text/WTFString.h>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 struct RsaOtherPrimesInfo {
@@ -36,3 +38,5 @@ struct RsaOtherPrimesInfo {
 };
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/RsaOtherPrimesInfo.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/RsaOtherPrimesInfo.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/RsaOtherPrimesInfo.idl
@@ -24,6 +24,7 @@
  */
 
 [
+    Conditional=WEB_CRYPTO,
     JSGenerateToJSObject,
     JSGenerateToNativeObject
 ] dictionary RsaOtherPrimesInfo {
Index: webkitgtk-2.46.6/Source/WebCore/crypto/SerializedCryptoKeyWrap.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/SerializedCryptoKeyWrap.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/SerializedCryptoKeyWrap.h
@@ -28,6 +28,8 @@
 #include <wtf/Forward.h>
 #include <wtf/text/WTFString.h>
 
+#if ENABLE(WEB_CRYPTO)
+
 namespace WebCore {
 
 struct WrappedCryptoKey;
@@ -48,3 +50,5 @@ WEBCORE_EXPORT std::optional<WrappedCryp
 WEBCORE_EXPORT std::optional<Vector<uint8_t>> unwrapCryptoKey(const Vector<uint8_t>& masterKey, const struct WrappedCryptoKey& wrappedKey);
 
 } // namespace WebCore
+
+#endif // ENABLE(WEB_CRYPTO)
Index: webkitgtk-2.46.6/Source/WebCore/crypto/SubtleCrypto.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/SubtleCrypto.cpp
+++ webkitgtk-2.46.6/Source/WebCore/crypto/SubtleCrypto.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "SubtleCrypto.h"
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "ContextDestructionObserverInlines.h"
 #include "CryptoAlgorithm.h"
 #include "CryptoAlgorithmRegistry.h"
@@ -66,7 +68,7 @@ SubtleCrypto::SubtleCrypto(ScriptExecuti
 
 SubtleCrypto::~SubtleCrypto() = default;
 
-enum class Operations : uint8_t {
+enum class Operations {
     Encrypt,
     Decrypt,
     Sign,
@@ -1324,4 +1326,6 @@ void SubtleCrypto::unwrapKey(JSC::JSGlob
     unwrapAlgorithm->decrypt(*unwrapParams, unwrappingKey, WTFMove(wrappedKey), WTFMove(callback), WTFMove(exceptionCallback), *scriptExecutionContext(), m_workQueue);
 }
 
-} // namespace WebCore
+}
+
+#endif
Index: webkitgtk-2.46.6/Source/WebCore/crypto/SubtleCrypto.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/SubtleCrypto.h
+++ webkitgtk-2.46.6/Source/WebCore/crypto/SubtleCrypto.h
@@ -25,6 +25,8 @@
 
 #pragma once
 
+#if ENABLE(WEB_CRYPTO)
+
 #include "ContextDestructionObserver.h"
 #include "CryptoKeyFormat.h"
 #include <JavaScriptCore/Strong.h>
@@ -48,7 +50,7 @@ class BufferSource;
 class CryptoKey;
 class DeferredPromise;
 
-enum class CryptoAlgorithmIdentifier : uint8_t;
+enum class CryptoAlgorithmIdentifier;
 enum class CryptoKeyUsage;
 
 class SubtleCrypto : public ContextDestructionObserver, public RefCounted<SubtleCrypto>, public CanMakeWeakPtr<SubtleCrypto> {
@@ -84,4 +86,6 @@ private:
     HashMap<DeferredPromise*, Ref<DeferredPromise>> m_pendingPromises;
 };
 
-} // namespace WebCore
+}
+
+#endif
Index: webkitgtk-2.46.6/Source/WebCore/crypto/SubtleCrypto.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/crypto/SubtleCrypto.idl
+++ webkitgtk-2.46.6/Source/WebCore/crypto/SubtleCrypto.idl
@@ -28,6 +28,7 @@ enum KeyFormat { "raw", "spki", "pkcs8",
 typedef (object or DOMString) AlgorithmIdentifier;
 
 [
+    Conditional=WEB_CRYPTO,
     Exposed=(Window,Worker),
     GenerateIsReachable=ImplScriptExecutionContext,
     SecureContext,
Index: webkitgtk-2.46.6/Source/WebCore/dom/Document.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/dom/Document.cpp
+++ webkitgtk-2.46.6/Source/WebCore/dom/Document.cpp
@@ -9145,6 +9145,7 @@ void Document::ensurePlugInsInjectedScri
     m_hasInjectedPlugInsScript = true;
 }
 
+#if ENABLE(WEB_CRYPTO)
 std::optional<Vector<uint8_t>> Document::wrapCryptoKey(const Vector<uint8_t>& key)
 {
     RefPtr page = this->page();
@@ -9161,6 +9162,8 @@ std::optional<Vector<uint8_t>>Document::
     return page->cryptoClient().unwrapCryptoKey(wrappedKey);
 }
 
+#endif // ENABLE(WEB_CRYPTO)
+
 Element* Document::activeElement()
 {
     if (Element* element = treeScope().focusedElementInScope())
Index: webkitgtk-2.46.6/Source/WebCore/dom/Document.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/dom/Document.h
+++ webkitgtk-2.46.6/Source/WebCore/dom/Document.h
@@ -1621,8 +1621,10 @@ public:
 
     void setVisualUpdatesAllowedByClient(bool);
 
+#if ENABLE(WEB_CRYPTO)
     std::optional<Vector<uint8_t>> wrapCryptoKey(const Vector<uint8_t>&) final;
     std::optional<Vector<uint8_t>> unwrapCryptoKey(const Vector<uint8_t>&) final;
+#endif
 
     void setHasStyleWithViewportUnits() { m_hasStyleWithViewportUnits = true; }
     bool hasStyleWithViewportUnits() const { return m_hasStyleWithViewportUnits; }
Index: webkitgtk-2.46.6/Source/WebCore/dom/EmptyScriptExecutionContext.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/dom/EmptyScriptExecutionContext.h
+++ webkitgtk-2.46.6/Source/WebCore/dom/EmptyScriptExecutionContext.h
@@ -77,8 +77,10 @@ public:
     void postTask(Task&&) final { ASSERT_NOT_REACHED(); }
     EventTarget* errorEventTarget() final { return nullptr; };
 
+#if ENABLE(WEB_CRYPTO)
     std::optional<Vector<uint8_t>> wrapCryptoKey(const Vector<uint8_t>&) final { return std::nullopt; }
     std::optional<Vector<uint8_t>> unwrapCryptoKey(const Vector<uint8_t>&) final { return std::nullopt; }
+#endif
 
     JSC::VM& vm() final { return m_vm; }
 
Index: webkitgtk-2.46.6/Source/WebCore/dom/ScriptExecutionContext.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/dom/ScriptExecutionContext.h
+++ webkitgtk-2.46.6/Source/WebCore/dom/ScriptExecutionContext.h
@@ -279,11 +279,13 @@ public:
     DatabaseContext* databaseContext() { return m_databaseContext.get(); }
     void setDatabaseContext(DatabaseContext*);
 
+#if ENABLE(WEB_CRYPTO)
     // These two methods are used when CryptoKeys are serialized into IndexedDB. As a side effect, it is also
     // used for things that utilize the same structure clone algorithm, for example, message passing between
     // worker and document.
     virtual std::optional<Vector<uint8_t>> wrapCryptoKey(const Vector<uint8_t>& key) = 0;
     virtual std::optional<Vector<uint8_t>> unwrapCryptoKey(const Vector<uint8_t>& wrappedKey) = 0;
+#endif
 
     int timerNestingLevel() const { return m_timerNestingLevel; }
     void setTimerNestingLevel(int timerNestingLevel) { m_timerNestingLevel = timerNestingLevel; }
Index: webkitgtk-2.46.6/Source/WebCore/page/Crypto.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/page/Crypto.cpp
+++ webkitgtk-2.46.6/Source/WebCore/page/Crypto.cpp
@@ -46,7 +46,9 @@ namespace WebCore {
 
 Crypto::Crypto(ScriptExecutionContext* context)
     : ContextDestructionObserver(context)
+#if ENABLE(WEB_CRYPTO)
     , m_subtle(SubtleCrypto::create(context))
+#endif
 {
 }
 
@@ -72,9 +74,13 @@ String Crypto::randomUUID() const
     return createVersion4UUIDString();
 }
 
+#if ENABLE(WEB_CRYPTO)
+
 SubtleCrypto& Crypto::subtle()
 {
     return m_subtle;
 }
 
-} // namespace WebCore
+#endif
+
+}
Index: webkitgtk-2.46.6/Source/WebCore/page/Crypto.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/page/Crypto.h
+++ webkitgtk-2.46.6/Source/WebCore/page/Crypto.h
@@ -48,12 +48,16 @@ public:
     ExceptionOr<void> getRandomValues(JSC::ArrayBufferView&);
     String randomUUID() const;
 
+#if ENABLE(WEB_CRYPTO)
     SubtleCrypto& subtle();
+#endif
 
 private:
     Crypto(ScriptExecutionContext*);
 
+#if ENABLE(WEB_CRYPTO)
     Ref<SubtleCrypto> m_subtle;
+#endif
 };
 
 }
Index: webkitgtk-2.46.6/Source/WebCore/page/Crypto.idl
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/page/Crypto.idl
+++ webkitgtk-2.46.6/Source/WebCore/page/Crypto.idl
@@ -31,7 +31,7 @@
     Exposed=(Window,Worker),
     GenerateIsReachable=ImplScriptExecutionContext
 ] interface Crypto {
-    [SecureContext] readonly attribute SubtleCrypto subtle;
+    [Conditional=WEB_CRYPTO, SecureContext] readonly attribute SubtleCrypto subtle;
     ArrayBufferView getRandomValues([ReturnValue] ArrayBufferView array);
     [SecureContext] DOMString randomUUID();
 };
Index: webkitgtk-2.46.6/Source/WebCore/PAL/pal/PlatformGTK.cmake
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/PAL/pal/PlatformGTK.cmake
+++ webkitgtk-2.46.6/Source/WebCore/PAL/pal/PlatformGTK.cmake
@@ -3,16 +3,12 @@ list(APPEND PAL_PUBLIC_HEADERS
     crypto/gcrypt/Initialization.h
     crypto/gcrypt/Utilities.h
 
-    crypto/tasn1/Utilities.h
-
     system/glib/SleepDisablerGLib.h
 )
 
 list(APPEND PAL_SOURCES
     crypto/gcrypt/CryptoDigestGCrypt.cpp
 
-    crypto/tasn1/Utilities.cpp
-
     system/ClockGeneric.cpp
 
     system/glib/SleepDisablerGLib.cpp
@@ -24,6 +20,16 @@ list(APPEND PAL_SOURCES
     unix/LoggingUnix.cpp
 )
 
+if (ENABLE_WEB_CRYPTO)
+    list(APPEND PAL_PUBLIC_HEADERS
+        crypto/tasn1/Utilities.h
+    )
+
+    list(APPEND PAL_SOURCES
+        crypto/tasn1/Utilities.cpp
+    )
+endif ()
+
 list(APPEND PAL_LIBRARIES
     GTK::GTK
 )
Index: webkitgtk-2.46.6/Source/WebCore/platform/GCrypt.cmake
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/platform/GCrypt.cmake
+++ webkitgtk-2.46.6/Source/WebCore/platform/GCrypt.cmake
@@ -1,6 +1,8 @@
-list(APPEND WebCore_UNIFIED_SOURCE_LIST_FILES
-    "platform/SourcesGCrypt.txt"
-)
+if (ENABLE_WEB_CRYPTO)
+    list(APPEND WebCore_UNIFIED_SOURCE_LIST_FILES
+        "platform/SourcesGCrypt.txt"
+    )
+endif ()
 
 list(APPEND WebCore_LIBRARIES
     LibGcrypt::LibGcrypt
Index: webkitgtk-2.46.6/Source/WebCore/platform/LocalizedStrings.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/platform/LocalizedStrings.cpp
+++ webkitgtk-2.46.6/Source/WebCore/platform/LocalizedStrings.cpp
@@ -1469,11 +1469,17 @@ String useBlockedPlugInContextMenuTitle(
     return WEB_UI_STRING("Show in blocked plug-in", "Title of the context menu item to show when PDFPlugin was used instead of a blocked plugin");
 }
 
-#if PLATFORM(COCOA)
+#if ENABLE(WEB_CRYPTO) && PLATFORM(COCOA)
 
 String webCryptoMasterKeyKeychainLabel(const String& localizedApplicationName)
 {
+#if PLATFORM(COCOA)
     return WEB_UI_FORMAT_CFSTRING("%@ WebCrypto Master Key", "Name of application's single WebCrypto master key in Keychain", localizedApplicationName.createCFString().get());
+#elif USE(GLIB)
+    return WEB_UI_FORMAT_STRING("%s WebCrypto Master Key", "Name of application's single WebCrypto master key in Keychain", localizedApplicationName.utf8().data());
+#else
+    return makeStringByReplacingAll(WEB_UI_STRING("<application> WebCrypto Master Key", "Name of application's single WebCrypto master key in Keychain"), "<application>"_s, localizedApplicationName);
+#endif
 }
 
 String webCryptoMasterKeyKeychainComment()
Index: webkitgtk-2.46.6/Source/WebCore/platform/LocalizedStrings.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/platform/LocalizedStrings.h
+++ webkitgtk-2.46.6/Source/WebCore/platform/LocalizedStrings.h
@@ -376,7 +376,7 @@ namespace WebCore {
 
     WEBCORE_EXPORT String useBlockedPlugInContextMenuTitle();
 
-#if PLATFORM(COCOA)
+#if ENABLE(WEB_CRYPTO) && PLATFORM(COCOA)
     String webCryptoMasterKeyKeychainLabel(const String& localizedApplicationName);
     String webCryptoMasterKeyKeychainComment();
 #endif
Index: webkitgtk-2.46.6/Source/WebCore/platform/OpenSSL.cmake
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/platform/OpenSSL.cmake
+++ webkitgtk-2.46.6/Source/WebCore/platform/OpenSSL.cmake
@@ -1,3 +1,4 @@
+if (ENABLE_WEB_CRYPTO)
 list(APPEND WebCore_SOURCES
     crypto/openssl/CryptoAlgorithmAESCBCOpenSSL.cpp
     crypto/openssl/CryptoAlgorithmAESCFBOpenSSL.cpp
@@ -19,3 +20,4 @@ list(APPEND WebCore_SOURCES
     crypto/openssl/OpenSSLUtilities.cpp
     crypto/openssl/SerializedCryptoKeyWrapOpenSSL.cpp
 )
+endif
Index: webkitgtk-2.46.6/Source/WebCore/workers/WorkerGlobalScope.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/workers/WorkerGlobalScope.cpp
+++ webkitgtk-2.46.6/Source/WebCore/workers/WorkerGlobalScope.cpp
@@ -488,6 +488,7 @@ void WorkerGlobalScope::addMessage(Messa
     InspectorInstrumentation::addMessageToConsole(*this, WTFMove(message));
 }
 
+#if ENABLE(WEB_CRYPTO)
 std::optional<Vector<uint8_t>> WorkerGlobalScope::wrapCryptoKey(const Vector<uint8_t>& key)
 {
     Ref protectedThis { *this };
@@ -522,6 +523,8 @@ std::optional<Vector<uint8_t>> WorkerGlo
     return key;
 }
 
+#endif // ENABLE(WEB_CRYPTO)
+
 Crypto& WorkerGlobalScope::crypto()
 {
     if (!m_crypto)
Index: webkitgtk-2.46.6/Source/WebCore/workers/WorkerGlobalScope.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/workers/WorkerGlobalScope.h
+++ webkitgtk-2.46.6/Source/WebCore/workers/WorkerGlobalScope.h
@@ -206,8 +206,10 @@ private:
 
     bool shouldBypassMainWorldContentSecurityPolicy() const final { return m_shouldBypassMainWorldContentSecurityPolicy; }
 
+#if ENABLE(WEB_CRYPTO)
     std::optional<Vector<uint8_t>> wrapCryptoKey(const Vector<uint8_t>& key) final;
     std::optional<Vector<uint8_t>> unwrapCryptoKey(const Vector<uint8_t>& wrappedKey) final;
+#endif
 
     // ReportingClient.
     void notifyReportObservers(Ref<Report>&&) final;
Index: webkitgtk-2.46.6/Source/WebCore/worklets/WorkletGlobalScope.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebCore/worklets/WorkletGlobalScope.h
+++ webkitgtk-2.46.6/Source/WebCore/worklets/WorkletGlobalScope.h
@@ -104,8 +104,10 @@ private:
 
     EventTarget* errorEventTarget() final { return this; }
 
+#if ENABLE(WEB_CRYPTO)
     std::optional<Vector<uint8_t>> wrapCryptoKey(const Vector<uint8_t>&) final { RELEASE_ASSERT_NOT_REACHED(); return std::nullopt; }
     std::optional<Vector<uint8_t>> unwrapCryptoKey(const Vector<uint8_t>&) final { RELEASE_ASSERT_NOT_REACHED(); return std::nullopt; }
+#endif
     URL completeURL(const String&, ForceUTF8 = ForceUTF8::No) const final;
     String userAgent(const URL&) const final;
     const Settings::Values& settingsValues() const final { return m_settingsValues; }
Index: webkitgtk-2.46.6/Source/WebKit/UIProcess/API/C/WKPage.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebKit/UIProcess/API/C/WKPage.cpp
+++ webkitgtk-2.46.6/Source/WebKit/UIProcess/API/C/WKPage.cpp
@@ -2345,6 +2345,7 @@ void WKPageSetPageNavigationClient(WKPag
             return false;
         }
 
+#if ENABLE(WEB_CRYPTO)
         void legacyWebCryptoMasterKey(WebKit::WebPageProxy& page, CompletionHandler<void(std::optional<Vector<uint8_t>>&&)>&& completionHandler) override
         {
             if (m_client.copyWebCryptoMasterKey) {
@@ -2353,6 +2354,7 @@ void WKPageSetPageNavigationClient(WKPag
             }
             return completionHandler(defaultWebCryptoMasterKey());
         }
+#endif
 
         void navigationActionDidBecomeDownload(WebKit::WebPageProxy& page, API::NavigationAction& action, WebKit::DownloadProxy& download) override
         {
Index: webkitgtk-2.46.6/Source/WebKit/UIProcess/WebPageProxy.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebKit/UIProcess/WebPageProxy.cpp
+++ webkitgtk-2.46.6/Source/WebKit/UIProcess/WebPageProxy.cpp
@@ -11845,6 +11845,7 @@ void WebPageProxy::getWebCryptoMasterKey
 
 }
 
+#if ENABLE(WEB_CRYPTO)
 void WebPageProxy::wrapCryptoKey(Vector<uint8_t>&& key, CompletionHandler<void(std::optional<Vector<uint8_t>>&&)>&& completionHandler)
 {
     getWebCryptoMasterKey([key = WTFMove(key), completionHandler = WTFMove(completionHandler)](std::optional<Vector<uint8_t>> && masterKey) mutable {
@@ -11874,6 +11875,7 @@ void WebPageProxy::unwrapCryptoKey(Wrapp
     });
 
 }
+#endif
 
 void WebPageProxy::changeFontAttributes(WebCore::FontAttributeChanges&& changes)
 {
Index: webkitgtk-2.46.6/Source/WebKit/UIProcess/WebPageProxy.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebKit/UIProcess/WebPageProxy.h
+++ webkitgtk-2.46.6/Source/WebKit/UIProcess/WebPageProxy.h
@@ -1776,8 +1776,10 @@ public:
     RefPtr<ViewSnapshot> takeViewSnapshot(std::optional<WebCore::IntRect>&&, ForceSoftwareCapturingViewportSnapshot);
 #endif
 
+#if ENABLE(WEB_CRYPTO)
     void wrapCryptoKey(Vector<uint8_t>&&, CompletionHandler<void(std::optional<Vector<uint8_t>>&&)>&&);
     void unwrapCryptoKey(WebCore::WrappedCryptoKey&&, CompletionHandler<void(std::optional<Vector<uint8_t>>&&)>&&);
+#endif
 
     void takeSnapshot(WebCore::IntRect, WebCore::IntSize bitmapSize, SnapshotOptions, CompletionHandler<void(std::optional<WebCore::ShareableBitmapHandle>&&)>&&);
 
Index: webkitgtk-2.46.6/Source/WebKit/UIProcess/WebPageProxy.messages.in
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebKit/UIProcess/WebPageProxy.messages.in
+++ webkitgtk-2.46.6/Source/WebKit/UIProcess/WebPageProxy.messages.in
@@ -410,8 +410,10 @@ messages -> WebPageProxy {
 
     DidUpdateActivityState() CanDispatchOutOfOrder
 
+#if ENABLE(WEB_CRYPTO)
     WrapCryptoKey(Vector<uint8_t> key) -> (std::optional<Vector<uint8_t>> wrappedKey) Synchronous
     UnwrapCryptoKey(struct WebCore::WrappedCryptoKey wrappedKey) -> (std::optional<Vector<uint8_t>> key) Synchronous
+#endif
 
 
 #if ENABLE(TELEPHONE_NUMBER_DETECTION)
Index: webkitgtk-2.46.6/Source/WebKit/UIProcess/WebProcessProxy.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebKit/UIProcess/WebProcessProxy.cpp
+++ webkitgtk-2.46.6/Source/WebKit/UIProcess/WebProcessProxy.cpp
@@ -2663,6 +2663,7 @@ void WebProcessProxy::getNotifications(c
     WebNotificationManagerProxy::sharedServiceWorkerManager().getNotifications(registrationURL, tag, sessionID(), WTFMove(callback));
 }
 
+#if ENABLE(WEB_CRYPTO)
 void WebProcessProxy::getWebCryptoMasterKey(CompletionHandler<void(std::optional<Vector<uint8_t>>&&)>&& completionHandler)
 {
     m_websiteDataStore->client().webCryptoMasterKey([completionHandler = WTFMove(completionHandler)](std::optional<Vector<uint8_t>>&& key) mutable {
@@ -2671,7 +2672,9 @@ void WebProcessProxy::getWebCryptoMaster
         return completionHandler(WebCore::defaultWebCryptoMasterKey());
     });
 }
+#endif
 
+#if ENABLE(WEB_CRYPTO)
 void WebProcessProxy::wrapCryptoKey(Vector<uint8_t>&& key, CompletionHandler<void(std::optional<Vector<uint8_t>>&&)>&& completionHandler)
 {
     getWebCryptoMasterKey([key = WTFMove(key), completionHandler = WTFMove(completionHandler)](std::optional<Vector<uint8_t>> && masterKey) mutable {
@@ -2699,8 +2702,9 @@ void WebProcessProxy::unwrapCryptoKey(Wr
             return completionHandler(WTFMove(key));
         completionHandler(std::nullopt);
     });
-
 }
+#endif
+
 void WebProcessProxy::setAppBadge(std::optional<WebPageProxyIdentifier> pageIdentifier, const SecurityOriginData& origin, std::optional<uint64_t> badge)
 {
     if (!pageIdentifier) {
Index: webkitgtk-2.46.6/Source/WebKit/UIProcess/WebProcessProxy.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebKit/UIProcess/WebProcessProxy.h
+++ webkitgtk-2.46.6/Source/WebKit/UIProcess/WebProcessProxy.h
@@ -550,7 +550,9 @@ private:
 
     void validateFreezerStatus();
 
+#if ENABLE(WEB_CRYPTO)
     void getWebCryptoMasterKey(CompletionHandler<void(std::optional<Vector<uint8_t>>&&)>&&);
+#endif
     using WebProcessProxyMap = HashMap<WebCore::ProcessIdentifier, CheckedRef<WebProcessProxy>>;
     static WebProcessProxyMap& allProcessMap();
     static Vector<Ref<WebProcessProxy>> allProcesses();
Index: webkitgtk-2.46.6/Source/WebKit/UIProcess/WebProcessProxy.messages.in
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebKit/UIProcess/WebProcessProxy.messages.in
+++ webkitgtk-2.46.6/Source/WebKit/UIProcess/WebProcessProxy.messages.in
@@ -89,6 +89,8 @@ messages -> WebProcessProxy LegacyReceiv
     [EnabledBy=AppBadgeEnabled] SetAppBadge(std::optional<WebKit::WebPageProxyIdentifier> pageIdentifier, WebCore::SecurityOriginData origin, std::optional<uint64_t> badge)
     [EnabledBy=AppBadgeEnabled] SetClientBadge(WebKit::WebPageProxyIdentifier pageIdentifier, WebCore::SecurityOriginData origin, std::optional<uint64_t> badge)
 
+#if ENABLE(WEB_CRYPTO)
     WrapCryptoKey(Vector<uint8_t> key) -> (std::optional<Vector<uint8_t>> wrappedKey) Synchronous
     UnwrapCryptoKey(struct WebCore::WrappedCryptoKey wrappedKey) -> (std::optional<Vector<uint8_t>> key) Synchronous
+#endif
 }
Index: webkitgtk-2.46.6/Source/WebKit/WebProcess/WebCoreSupport/WebCryptoClient.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebKit/WebProcess/WebCoreSupport/WebCryptoClient.cpp
+++ webkitgtk-2.46.6/Source/WebKit/WebProcess/WebCoreSupport/WebCryptoClient.cpp
@@ -38,6 +38,7 @@ namespace WebKit {
 
 WTF_MAKE_TZONE_ALLOCATED_IMPL(WebCryptoClient);
 
+#if ENABLE(WEB_CRYPTO)
 std::optional<Vector<uint8_t>> WebCryptoClient::wrapCryptoKey(const Vector<uint8_t>& key) const
 {
     if (m_pageIdentifier) {
@@ -67,6 +68,7 @@ std::optional<Vector<uint8_t>> WebCrypto
     auto [unwrappedKey] = sendResult.takeReplyOr(std::nullopt);
     return unwrappedKey;
 }
+#endif
 
 WebCryptoClient::WebCryptoClient(WebCore::PageIdentifier pageIdentifier)
     : m_pageIdentifier(pageIdentifier)
Index: webkitgtk-2.46.6/Source/WebKit/WebProcess/WebCoreSupport/WebCryptoClient.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WebKit/WebProcess/WebCoreSupport/WebCryptoClient.h
+++ webkitgtk-2.46.6/Source/WebKit/WebProcess/WebCoreSupport/WebCryptoClient.h
@@ -40,8 +40,10 @@ public:
     WebCryptoClient(WebCore::PageIdentifier);
     WebCryptoClient() = default;
     ~WebCryptoClient() = default;
+#if ENABLE(WEB_CRYPTO)
     std::optional<Vector<uint8_t>> wrapCryptoKey(const Vector<uint8_t>&) const override;
     std::optional<Vector<uint8_t>> unwrapCryptoKey(const Vector<uint8_t>&) const override;
+#endif
 private:
     std::optional<WebCore::PageIdentifier> m_pageIdentifier;
 };
Index: webkitgtk-2.46.6/Source/WTF/wtf/PlatformEnableCocoa.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/WTF/wtf/PlatformEnableCocoa.h
+++ webkitgtk-2.46.6/Source/WTF/wtf/PlatformEnableCocoa.h
@@ -931,6 +931,10 @@
 #define ENABLE_WEB_CODECS 1
 #endif
 
+#if !defined(ENABLE_WEB_CRYPTO)
+#define ENABLE_WEB_CRYPTO 1
+#endif
+
 #if !defined(ENABLE_WEB_PLAYBACK_CONTROLS_MANAGER) && PLATFORM(MAC)
 #define ENABLE_WEB_PLAYBACK_CONTROLS_MANAGER 1
 #endif
