[Web Animations] Expose Web Animations CSS integration as an experimental feature
[WebKit-https.git] / Source / WebCore / testing / InternalSettings.cpp
index f0e8592..24e4aae 100644 (file)
 #include "InternalSettings.h"
 
 #include "CaptionUserPreferences.h"
+#include "DeprecatedGlobalSettings.h"
 #include "Document.h"
-#include "ExceptionCode.h"
+#include "FontCache.h"
+#include "Frame.h"
 #include "FrameView.h"
-#include "Language.h"
 #include "LocaleToScriptMapping.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PageGroup.h"
+#include "RenderTheme.h"
 #include "RuntimeEnabledFeatures.h"
 #include "Settings.h"
 #include "Supplementable.h"
-#include "TextRun.h"
+#include <wtf/Language.h>
 
 #if ENABLE(INPUT_TYPE_COLOR)
 #include "ColorChooser.h"
 #endif
 
-#define InternalSettingsGuardForSettingsReturn(returnValue) \
-    if (!settings()) { \
-        ec = INVALID_ACCESS_ERR; \
-        return returnValue; \
-    }
-
-#define InternalSettingsGuardForSettings()  \
-    if (!settings()) { \
-        ec = INVALID_ACCESS_ERR; \
-        return; \
-    }
-
-#define InternalSettingsGuardForPage() \
-    if (!page()) { \
-        ec = INVALID_ACCESS_ERR; \
-        return; \
-    }
+#if USE(SOUP)
+#include "SoupNetworkSession.h"
+#endif
 
 namespace WebCore {
 
 InternalSettings::Backup::Backup(Settings& settings)
     : m_originalEditingBehavior(settings.editingBehaviorType())
-#if ENABLE(TEXT_AUTOSIZING) || ENABLE(IOS_TEXT_AUTOSIZING)
+#if ENABLE(TEXT_AUTOSIZING)
     , m_originalTextAutosizingEnabled(settings.textAutosizingEnabled())
     , m_originalTextAutosizingWindowSizeOverride(settings.textAutosizingWindowSizeOverride())
 #endif
-#if ENABLE(TEXT_AUTOSIZING)
-    , m_originalTextAutosizingFontScaleFactor(settings.textAutosizingFontScaleFactor())
-#endif
     , m_originalMediaTypeOverride(settings.mediaTypeOverride())
     , m_originalCanvasUsesAcceleratedDrawing(settings.canvasUsesAcceleratedDrawing())
-    , m_originalMockScrollbarsEnabled(settings.mockScrollbarsEnabled())
-    , m_langAttributeAwareFormControlUIEnabled(RuntimeEnabledFeatures::sharedFeatures().langAttributeAwareFormControlUIEnabled())
+    , m_originalMockScrollbarsEnabled(DeprecatedGlobalSettings::mockScrollbarsEnabled())
     , m_imagesEnabled(settings.areImagesEnabled())
     , m_preferMIMETypeForImages(settings.preferMIMETypeForImages())
-    , m_minimumTimerInterval(settings.minimumDOMTimerInterval())
+    , m_minimumDOMTimerInterval(settings.minimumDOMTimerInterval())
 #if ENABLE(VIDEO_TRACK)
     , m_shouldDisplaySubtitles(settings.shouldDisplaySubtitles())
     , m_shouldDisplayCaptions(settings.shouldDisplayCaptions())
@@ -91,10 +74,11 @@ InternalSettings::Backup::Backup(Settings& settings)
     , m_originalTimeWithoutMouseMovementBeforeHidingControls(settings.timeWithoutMouseMovementBeforeHidingControls())
     , m_useLegacyBackgroundSizeShorthandBehavior(settings.useLegacyBackgroundSizeShorthandBehavior())
     , m_autoscrollForDragAndDropEnabled(settings.autoscrollForDragAndDropEnabled())
-    , m_pluginReplacementEnabled(settings.pluginReplacementEnabled())
+    , m_quickTimePluginReplacementEnabled(settings.quickTimePluginReplacementEnabled())
+    , m_youTubeFlashPluginReplacementEnabled(settings.youTubeFlashPluginReplacementEnabled())
     , m_shouldConvertPositionStyleOnCopy(settings.shouldConvertPositionStyleOnCopy())
     , m_fontFallbackPrefersPictographs(settings.fontFallbackPrefersPictographs())
-    , m_webFontsAlwaysFallBack(settings.webFontsAlwaysFallBack())
+    , m_shouldIgnoreFontLoadCompletions(settings.shouldIgnoreFontLoadCompletions())
     , m_backgroundShouldExtendBeyondPage(settings.backgroundShouldExtendBeyondPage())
     , m_storageBlockingPolicy(settings.storageBlockingPolicy())
     , m_scrollingTreeIncludesFrames(settings.scrollingTreeIncludesFrames())
@@ -107,12 +91,38 @@ InternalSettings::Backup::Backup(Settings& settings)
     , m_allowsInlineMediaPlayback(settings.allowsInlineMediaPlayback())
     , m_allowsInlineMediaPlaybackAfterFullscreen(settings.allowsInlineMediaPlaybackAfterFullscreen())
     , m_inlineMediaPlaybackRequiresPlaysInlineAttribute(settings.inlineMediaPlaybackRequiresPlaysInlineAttribute())
-#if ENABLE(INDEXED_DATABASE_IN_WORKERS)
-    , m_indexedDBWorkersEnabled(RuntimeEnabledFeatures::sharedFeatures().indexedDBWorkersEnabled())
+    , m_deferredCSSParserEnabled(settings.deferredCSSParserEnabled())
+    , m_inputEventsEnabled(settings.inputEventsEnabled())
+#if ENABLE(ACCESSIBILITY_EVENTS)
+    , m_accessibilityEventsEnabled(settings.accessibilityEventsEnabled())
 #endif
     , m_userInterfaceDirectionPolicy(settings.userInterfaceDirectionPolicy())
     , m_systemLayoutDirection(settings.systemLayoutDirection())
     , m_pdfImageCachingPolicy(settings.pdfImageCachingPolicy())
+    , m_forcedColorsAreInvertedAccessibilityValue(settings.forcedColorsAreInvertedAccessibilityValue())
+    , m_forcedDisplayIsMonochromeAccessibilityValue(settings.forcedDisplayIsMonochromeAccessibilityValue())
+    , m_forcedPrefersReducedMotionAccessibilityValue(settings.forcedPrefersReducedMotionAccessibilityValue())
+    , m_fontLoadTimingOverride(settings.fontLoadTimingOverride())
+    , m_frameFlattening(settings.frameFlattening())
+#if ENABLE(INDEXED_DATABASE_IN_WORKERS)
+    , m_indexedDBWorkersEnabled(RuntimeEnabledFeatures::sharedFeatures().indexedDBWorkersEnabled())
+#endif
+#if ENABLE(WEBGL2)
+    , m_webGL2Enabled(RuntimeEnabledFeatures::sharedFeatures().webGL2Enabled())
+#endif
+#if ENABLE(WEBGPU)
+    , m_webGPUEnabled(RuntimeEnabledFeatures::sharedFeatures().webGPUEnabled())
+#endif
+    , m_webVREnabled(RuntimeEnabledFeatures::sharedFeatures().webVREnabled())
+#if ENABLE(MEDIA_STREAM)
+    , m_setScreenCaptureEnabled(RuntimeEnabledFeatures::sharedFeatures().screenCaptureEnabled())
+#endif
+    , m_shouldMockBoldSystemFontForAccessibility(RenderTheme::singleton().shouldMockBoldSystemFontForAccessibility())
+#if USE(AUDIO_SESSION)
+    , m_shouldManageAudioSessionCategory(DeprecatedGlobalSettings::shouldManageAudioSessionCategory())
+#endif
+    , m_customPasteboardDataEnabled(RuntimeEnabledFeatures::sharedFeatures().customPasteboardDataEnabled())
+    , m_promptForStorageAccessAPIEnabled(RuntimeEnabledFeatures::sharedFeatures().storageAccessPromptsEnabled())
 {
 }
 
@@ -148,19 +158,15 @@ void InternalSettings::Backup::restoreTo(Settings& settings)
         settings.setPictographFontFamily(pictographFont.value, static_cast<UScriptCode>(pictographFont.key));
     m_pictographFontFamilies.clear();
 
-#if ENABLE(TEXT_AUTOSIZING) || ENABLE(IOS_TEXT_AUTOSIZING)
+#if ENABLE(TEXT_AUTOSIZING)
     settings.setTextAutosizingEnabled(m_originalTextAutosizingEnabled);
     settings.setTextAutosizingWindowSizeOverride(m_originalTextAutosizingWindowSizeOverride);
 #endif
-#if ENABLE(TEXT_AUTOSIZING)
-    settings.setTextAutosizingFontScaleFactor(m_originalTextAutosizingFontScaleFactor);
-#endif
     settings.setMediaTypeOverride(m_originalMediaTypeOverride);
     settings.setCanvasUsesAcceleratedDrawing(m_originalCanvasUsesAcceleratedDrawing);
-    RuntimeEnabledFeatures::sharedFeatures().setLangAttributeAwareFormControlUIEnabled(m_langAttributeAwareFormControlUIEnabled);
     settings.setImagesEnabled(m_imagesEnabled);
     settings.setPreferMIMETypeForImages(m_preferMIMETypeForImages);
-    settings.setMinimumDOMTimerInterval(m_minimumTimerInterval);
+    settings.setMinimumDOMTimerInterval(m_minimumDOMTimerInterval);
 #if ENABLE(VIDEO_TRACK)
     settings.setShouldDisplaySubtitles(m_shouldDisplaySubtitles);
     settings.setShouldDisplayCaptions(m_shouldDisplayCaptions);
@@ -173,7 +179,7 @@ void InternalSettings::Backup::restoreTo(Settings& settings)
     settings.setAutoscrollForDragAndDropEnabled(m_autoscrollForDragAndDropEnabled);
     settings.setShouldConvertPositionStyleOnCopy(m_shouldConvertPositionStyleOnCopy);
     settings.setFontFallbackPrefersPictographs(m_fontFallbackPrefersPictographs);
-    settings.setWebFontsAlwaysFallBack(m_webFontsAlwaysFallBack);
+    settings.setShouldIgnoreFontLoadCompletions(m_shouldIgnoreFontLoadCompletions);
     settings.setBackgroundShouldExtendBeyondPage(m_backgroundShouldExtendBeyondPage);
     settings.setStorageBlockingPolicy(m_storageBlockingPolicy);
     settings.setScrollingTreeIncludesFrames(m_scrollingTreeIncludesFrames);
@@ -183,14 +189,45 @@ void InternalSettings::Backup::restoreTo(Settings& settings)
     settings.setAllowsInlineMediaPlayback(m_allowsInlineMediaPlayback);
     settings.setAllowsInlineMediaPlaybackAfterFullscreen(m_allowsInlineMediaPlaybackAfterFullscreen);
     settings.setInlineMediaPlaybackRequiresPlaysInlineAttribute(m_inlineMediaPlaybackRequiresPlaysInlineAttribute);
-    settings.setPluginReplacementEnabled(m_pluginReplacementEnabled);
-#if ENABLE(INDEXED_DATABASE_IN_WORKERS)
-    RuntimeEnabledFeatures::sharedFeatures().setIndexedDBWorkersEnabled(m_indexedDBWorkersEnabled);
-#endif
+    settings.setQuickTimePluginReplacementEnabled(m_quickTimePluginReplacementEnabled);
+    settings.setYouTubeFlashPluginReplacementEnabled(m_youTubeFlashPluginReplacementEnabled);
+    settings.setDeferredCSSParserEnabled(m_deferredCSSParserEnabled);
+    settings.setInputEventsEnabled(m_inputEventsEnabled);
     settings.setUserInterfaceDirectionPolicy(m_userInterfaceDirectionPolicy);
     settings.setSystemLayoutDirection(m_systemLayoutDirection);
     settings.setPdfImageCachingPolicy(m_pdfImageCachingPolicy);
-    Settings::setAllowsAnySSLCertificate(false);
+    settings.setForcedColorsAreInvertedAccessibilityValue(m_forcedColorsAreInvertedAccessibilityValue);
+    settings.setForcedDisplayIsMonochromeAccessibilityValue(m_forcedDisplayIsMonochromeAccessibilityValue);
+    settings.setForcedPrefersReducedMotionAccessibilityValue(m_forcedPrefersReducedMotionAccessibilityValue);
+    settings.setFontLoadTimingOverride(m_fontLoadTimingOverride);
+    DeprecatedGlobalSettings::setAllowsAnySSLCertificate(false);
+    RenderTheme::singleton().setShouldMockBoldSystemFontForAccessibility(m_shouldMockBoldSystemFontForAccessibility);
+    FontCache::singleton().setShouldMockBoldSystemFontForAccessibility(m_shouldMockBoldSystemFontForAccessibility);
+    settings.setFrameFlattening(m_frameFlattening);
+#if ENABLE(ACCESSIBILITY_EVENTS)
+    settings.setAccessibilityEventsEnabled(m_accessibilityEventsEnabled);
+#endif
+
+#if ENABLE(INDEXED_DATABASE_IN_WORKERS)
+    RuntimeEnabledFeatures::sharedFeatures().setIndexedDBWorkersEnabled(m_indexedDBWorkersEnabled);
+#endif
+#if ENABLE(WEBGL2)
+    RuntimeEnabledFeatures::sharedFeatures().setWebGL2Enabled(m_webGL2Enabled);
+#endif
+#if ENABLE(WEBGPU)
+    RuntimeEnabledFeatures::sharedFeatures().setWebGPUEnabled(m_webGPUEnabled);
+#endif
+    RuntimeEnabledFeatures::sharedFeatures().setWebVREnabled(m_webVREnabled);
+#if ENABLE(MEDIA_STREAM)
+    RuntimeEnabledFeatures::sharedFeatures().setScreenCaptureEnabled(m_setScreenCaptureEnabled);
+#endif
+    RuntimeEnabledFeatures::sharedFeatures().setCustomPasteboardDataEnabled(m_customPasteboardDataEnabled);
+
+#if USE(AUDIO_SESSION)
+    DeprecatedGlobalSettings::setShouldManageAudioSessionCategory(m_shouldManageAudioSessionCategory);
+#endif
+
+    RuntimeEnabledFeatures::sharedFeatures().setStorageAccessPromptsEnabled(m_promptForStorageAccessAPIEnabled);
 }
 
 class InternalSettingsWrapper : public Supplement<Page> {
@@ -219,8 +256,9 @@ InternalSettings* InternalSettings::from(Page* page)
     return static_cast<InternalSettingsWrapper*>(Supplement<Page>::from(page, supplementName()))->internalSettings();
 }
 
-InternalSettings::~InternalSettings()
+void InternalSettings::hostDestroyed()
 {
+    m_page = nullptr;
 }
 
 InternalSettings::InternalSettings(Page* page)
@@ -231,191 +269,226 @@ InternalSettings::InternalSettings(Page* page)
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
     setAllowsAirPlayForMediaPlayback(false);
 #endif
+#if ENABLE(MEDIA_STREAM)
+    setMediaCaptureRequiresSecureConnection(false);
+#endif
+}
+
+Ref<InternalSettings> InternalSettings::create(Page* page)
+{
+    return adoptRef(*new InternalSettings(page));
 }
 
 void InternalSettings::resetToConsistentState()
 {
-    page()->setPageScaleFactor(1, { 0, 0 });
-    page()->mainFrame().setPageAndTextZoomFactors(1, 1);
-    page()->setCanStartMedia(true);
-    page()->settings().setForcePendingWebGLPolicy(false);
+    m_page->setPageScaleFactor(1, { 0, 0 });
+    m_page->mainFrame().setPageAndTextZoomFactors(1, 1);
+    m_page->setCanStartMedia(true);
+
+    settings().setForcePendingWebGLPolicy(false);
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
-    setAllowsAirPlayForMediaPlayback(false);
+    settings().setAllowsAirPlayForMediaPlayback(false);
+#endif
+#if ENABLE(MEDIA_STREAM)
+    setMediaCaptureRequiresSecureConnection(false);
 #endif
 
-    m_backup.restoreTo(*settings());
-    m_backup = Backup(*settings());
+    m_backup.restoreTo(settings());
+    m_backup = Backup { settings() };
 
     InternalSettingsGenerated::resetToConsistentState();
 }
 
-Settings* InternalSettings::settings() const
+Settings& InternalSettings::settings() const
 {
-    if (!page())
-        return 0;
-    return &page()->settings();
+    ASSERT(m_page);
+    return m_page->settings();
 }
 
-void InternalSettings::setTouchEventEmulationEnabled(bool enabled, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setTouchEventEmulationEnabled(bool enabled)
 {
+    if (!m_page)
+        return Exception { InvalidAccessError };
 #if ENABLE(TOUCH_EVENTS)
-    InternalSettingsGuardForSettings();
-    settings()->setTouchEventEmulationEnabled(enabled);
+    settings().setTouchEventEmulationEnabled(enabled);
 #else
     UNUSED_PARAM(enabled);
-    UNUSED_PARAM(ec);
 #endif
+    return { };
 }
 
-void InternalSettings::setStandardFontFamily(const String& family, const String& script, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setStandardFontFamily(const String& family, const String& script)
 {
-    InternalSettingsGuardForSettings();
+    if (!m_page)
+        return Exception { InvalidAccessError };
     UScriptCode code = scriptNameToCode(script);
     if (code == USCRIPT_INVALID_CODE)
-        return;
-    m_backup.m_standardFontFamilies.add(code, settings()->standardFontFamily(code));
-    settings()->setStandardFontFamily(family, code);
+        return { };
+    m_backup.m_standardFontFamilies.add(code, settings().standardFontFamily(code));
+    settings().setStandardFontFamily(family, code);
+    return { };
 }
 
-void InternalSettings::setSerifFontFamily(const String& family, const String& script, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setSerifFontFamily(const String& family, const String& script)
 {
-    InternalSettingsGuardForSettings();
+    if (!m_page)
+        return Exception { InvalidAccessError };
     UScriptCode code = scriptNameToCode(script);
     if (code == USCRIPT_INVALID_CODE)
-        return;
-    m_backup.m_serifFontFamilies.add(code, settings()->serifFontFamily(code));
-    settings()->setSerifFontFamily(family, code);
+        return { };
+    m_backup.m_serifFontFamilies.add(code, settings().serifFontFamily(code));
+    settings().setSerifFontFamily(family, code);
+    return { };
 }
 
-void InternalSettings::setSansSerifFontFamily(const String& family, const String& script, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setSansSerifFontFamily(const String& family, const String& script)
 {
-    InternalSettingsGuardForSettings();
+    if (!m_page)
+        return Exception { InvalidAccessError };
     UScriptCode code = scriptNameToCode(script);
     if (code == USCRIPT_INVALID_CODE)
-        return;
-    m_backup.m_sansSerifFontFamilies.add(code, settings()->sansSerifFontFamily(code));
-    settings()->setSansSerifFontFamily(family, code);
+        return { };
+    m_backup.m_sansSerifFontFamilies.add(code, settings().sansSerifFontFamily(code));
+    settings().setSansSerifFontFamily(family, code);
+    return { };
 }
 
-void InternalSettings::setFixedFontFamily(const String& family, const String& script, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setFixedFontFamily(const String& family, const String& script)
 {
-    InternalSettingsGuardForSettings();
+    if (!m_page)
+        return Exception { InvalidAccessError };
     UScriptCode code = scriptNameToCode(script);
     if (code == USCRIPT_INVALID_CODE)
-        return;
-    m_backup.m_fixedFontFamilies.add(code, settings()->fixedFontFamily(code));
-    settings()->setFixedFontFamily(family, code);
+        return { };
+    m_backup.m_fixedFontFamilies.add(code, settings().fixedFontFamily(code));
+    settings().setFixedFontFamily(family, code);
+    return { };
 }
 
-void InternalSettings::setCursiveFontFamily(const String& family, const String& script, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setCursiveFontFamily(const String& family, const String& script)
 {
-    InternalSettingsGuardForSettings();
+    if (!m_page)
+        return Exception { InvalidAccessError };
     UScriptCode code = scriptNameToCode(script);
     if (code == USCRIPT_INVALID_CODE)
-        return;
-    m_backup.m_cursiveFontFamilies.add(code, settings()->cursiveFontFamily(code));
-    settings()->setCursiveFontFamily(family, code);
+        return { };
+    m_backup.m_cursiveFontFamilies.add(code, settings().cursiveFontFamily(code));
+    settings().setCursiveFontFamily(family, code);
+    return { };
 }
 
-void InternalSettings::setFantasyFontFamily(const String& family, const String& script, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setFantasyFontFamily(const String& family, const String& script)
 {
-    InternalSettingsGuardForSettings();
+    if (!m_page)
+        return Exception { InvalidAccessError };
     UScriptCode code = scriptNameToCode(script);
     if (code == USCRIPT_INVALID_CODE)
-        return;
-    m_backup.m_fantasyFontFamilies.add(code, settings()->fantasyFontFamily(code));
-    settings()->setFantasyFontFamily(family, code);
+        return { };
+    m_backup.m_fantasyFontFamilies.add(code, settings().fantasyFontFamily(code));
+    settings().setFantasyFontFamily(family, code);
+    return { };
 }
 
-void InternalSettings::setPictographFontFamily(const String& family, const String& script, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setPictographFontFamily(const String& family, const String& script)
 {
-    InternalSettingsGuardForSettings();
+    if (!m_page)
+        return Exception { InvalidAccessError };
     UScriptCode code = scriptNameToCode(script);
     if (code == USCRIPT_INVALID_CODE)
-        return;
-    m_backup.m_pictographFontFamilies.add(code, settings()->pictographFontFamily(code));
-    settings()->setPictographFontFamily(family, code);
+        return { };
+    m_backup.m_pictographFontFamilies.add(code, settings().pictographFontFamily(code));
+    settings().setPictographFontFamily(family, code);
+    return { };
 }
 
-void InternalSettings::setTextAutosizingEnabled(bool enabled, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setTextAutosizingEnabled(bool enabled)
 {
-#if ENABLE(TEXT_AUTOSIZING) || ENABLE(IOS_TEXT_AUTOSIZING)
-    InternalSettingsGuardForSettings();
-    settings()->setTextAutosizingEnabled(enabled);
+    if (!m_page)
+        return Exception { InvalidAccessError };
+#if ENABLE(TEXT_AUTOSIZING)
+    settings().setTextAutosizingEnabled(enabled);
 #else
     UNUSED_PARAM(enabled);
-    UNUSED_PARAM(ec);
 #endif
+    return { };
 }
 
-void InternalSettings::setTextAutosizingWindowSizeOverride(int width, int height, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setTextAutosizingWindowSizeOverride(int width, int height)
 {
-#if ENABLE(TEXT_AUTOSIZING) || ENABLE(IOS_TEXT_AUTOSIZING)
-    InternalSettingsGuardForSettings();
-    settings()->setTextAutosizingWindowSizeOverride(IntSize(width, height));
+    if (!m_page)
+        return Exception { InvalidAccessError };
+#if ENABLE(TEXT_AUTOSIZING)
+    settings().setTextAutosizingWindowSizeOverride(IntSize(width, height));
 #else
     UNUSED_PARAM(width);
     UNUSED_PARAM(height);
-    UNUSED_PARAM(ec);
 #endif
+    return { };
 }
 
-void InternalSettings::setMediaTypeOverride(const String& mediaType, ExceptionCode& ec)
-{
-    InternalSettingsGuardForSettings();
-    settings()->setMediaTypeOverride(mediaType);
-}
-
-void InternalSettings::setTextAutosizingFontScaleFactor(float fontScaleFactor, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setMediaTypeOverride(const String& mediaType)
 {
-#if ENABLE(TEXT_AUTOSIZING)
-    InternalSettingsGuardForSettings();
-    settings()->setTextAutosizingFontScaleFactor(fontScaleFactor);
-#else
-    UNUSED_PARAM(fontScaleFactor);
-    UNUSED_PARAM(ec);
-#endif
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setMediaTypeOverride(mediaType);
+    return { };
 }
 
-void InternalSettings::setCanStartMedia(bool enabled, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setCanStartMedia(bool enabled)
 {
-    InternalSettingsGuardForSettings();
+    if (!m_page)
+        return Exception { InvalidAccessError };
     m_page->setCanStartMedia(enabled);
+    return { };
 }
 
-void InternalSettings::setAllowsAirPlayForMediaPlayback(bool allows)
+ExceptionOr<void> InternalSettings::setAllowsAirPlayForMediaPlayback(bool allows)
 {
+    if (!m_page)
+        return Exception { InvalidAccessError };
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
-    m_page->settings().setAllowsAirPlayForMediaPlayback(allows);
+    settings().setAllowsAirPlayForMediaPlayback(allows);
 #else
     UNUSED_PARAM(allows);
 #endif
+    return { };
 }
 
-void InternalSettings::setEditingBehavior(const String& editingBehavior, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setMediaCaptureRequiresSecureConnection(bool requires)
 {
-    InternalSettingsGuardForSettings();
+    if (!m_page)
+        return Exception { InvalidAccessError };
+#if ENABLE(MEDIA_STREAM)
+    DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection(requires);
+#else
+    UNUSED_PARAM(requires);
+#endif
+    return { };
+}
+
+ExceptionOr<void> InternalSettings::setEditingBehavior(const String& editingBehavior)
+{
+    if (!m_page)
+        return Exception { InvalidAccessError };
     if (equalLettersIgnoringASCIICase(editingBehavior, "win"))
-        settings()->setEditingBehaviorType(EditingWindowsBehavior);
+        settings().setEditingBehaviorType(EditingWindowsBehavior);
     else if (equalLettersIgnoringASCIICase(editingBehavior, "mac"))
-        settings()->setEditingBehaviorType(EditingMacBehavior);
+        settings().setEditingBehaviorType(EditingMacBehavior);
     else if (equalLettersIgnoringASCIICase(editingBehavior, "unix"))
-        settings()->setEditingBehaviorType(EditingUnixBehavior);
+        settings().setEditingBehaviorType(EditingUnixBehavior);
     else if (equalLettersIgnoringASCIICase(editingBehavior, "ios"))
-        settings()->setEditingBehaviorType(EditingIOSBehavior);
+        settings().setEditingBehaviorType(EditingIOSBehavior);
     else
-        ec = SYNTAX_ERR;
+        return Exception { SyntaxError };
+    return { };
 }
 
-void InternalSettings::setShouldDisplayTrackKind(const String& kind, bool enabled, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setShouldDisplayTrackKind(const String& kind, bool enabled)
 {
-    InternalSettingsGuardForSettings();
-
+    if (!m_page)
+        return Exception { InvalidAccessError };
 #if ENABLE(VIDEO_TRACK)
-    if (!page())
-        return;
-
-    auto& captionPreferences = page()->group().captionPreferences();
+    auto& captionPreferences = m_page->group().captionPreferences();
     if (equalLettersIgnoringASCIICase(kind, "subtitles"))
         captionPreferences.setUserPrefersSubtitles(enabled);
     else if (equalLettersIgnoringASCIICase(kind, "captions"))
@@ -423,22 +496,20 @@ void InternalSettings::setShouldDisplayTrackKind(const String& kind, bool enable
     else if (equalLettersIgnoringASCIICase(kind, "textdescriptions"))
         captionPreferences.setUserPrefersTextDescriptions(enabled);
     else
-        ec = SYNTAX_ERR;
+        return Exception { SyntaxError };
 #else
     UNUSED_PARAM(kind);
     UNUSED_PARAM(enabled);
 #endif
+    return { };
 }
 
-bool InternalSettings::shouldDisplayTrackKind(const String& kind, ExceptionCode& ec)
+ExceptionOr<bool> InternalSettings::shouldDisplayTrackKind(const String& kind)
 {
-    InternalSettingsGuardForSettingsReturn(false);
-
+    if (!m_page)
+        return Exception { InvalidAccessError };
 #if ENABLE(VIDEO_TRACK)
-    if (!page())
-        return false;
-
-    auto& captionPreferences = page()->group().captionPreferences();
+    auto& captionPreferences = m_page->group().captionPreferences();
     if (equalLettersIgnoringASCIICase(kind, "subtitles"))
         return captionPreferences.userPrefersSubtitles();
     if (equalLettersIgnoringASCIICase(kind, "captions"))
@@ -446,151 +517,228 @@ bool InternalSettings::shouldDisplayTrackKind(const String& kind, ExceptionCode&
     if (equalLettersIgnoringASCIICase(kind, "textdescriptions"))
         return captionPreferences.userPrefersTextDescriptions();
 
-    ec = SYNTAX_ERR;
-    return false;
+    return Exception { SyntaxError };
 #else
     UNUSED_PARAM(kind);
     return false;
 #endif
 }
 
-void InternalSettings::setStorageBlockingPolicy(const String& mode, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setStorageBlockingPolicy(const String& mode)
 {
-    InternalSettingsGuardForSettings();
-
+    if (!m_page)
+        return Exception { InvalidAccessError };
     if (mode == "AllowAll")
-        settings()->setStorageBlockingPolicy(SecurityOrigin::AllowAllStorage);
+        settings().setStorageBlockingPolicy(SecurityOrigin::AllowAllStorage);
     else if (mode == "BlockThirdParty")
-        settings()->setStorageBlockingPolicy(SecurityOrigin::BlockThirdPartyStorage);
+        settings().setStorageBlockingPolicy(SecurityOrigin::BlockThirdPartyStorage);
     else if (mode == "BlockAll")
-        settings()->setStorageBlockingPolicy(SecurityOrigin::BlockAllStorage);
+        settings().setStorageBlockingPolicy(SecurityOrigin::BlockAllStorage);
     else
-        ec = SYNTAX_ERR;
+        return Exception { SyntaxError };
+    return { };
 }
 
-void InternalSettings::setLangAttributeAwareFormControlUIEnabled(bool enabled)
+ExceptionOr<void> InternalSettings::setPreferMIMETypeForImages(bool preferMIMETypeForImages)
 {
-    RuntimeEnabledFeatures::sharedFeatures().setLangAttributeAwareFormControlUIEnabled(enabled);
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setPreferMIMETypeForImages(preferMIMETypeForImages);
+    return { };
 }
 
-void InternalSettings::setPreferMIMETypeForImages(bool preferMIMETypeForImages, ExceptionCode &ec)
+ExceptionOr<void> InternalSettings::setImagesEnabled(bool enabled)
 {
-    InternalSettingsGuardForSettings();
-    settings()->setPreferMIMETypeForImages(preferMIMETypeForImages);
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setImagesEnabled(enabled);
+    return { };
 }
 
-void InternalSettings::setImagesEnabled(bool enabled, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setPDFImageCachingPolicy(const String& policy)
 {
-    InternalSettingsGuardForSettings();
-    settings()->setImagesEnabled(enabled);
-}
-
-void InternalSettings::setPDFImageCachingPolicy(const String& policy, ExceptionCode& ec)
-{
-    InternalSettingsGuardForSettings();
+    if (!m_page)
+        return Exception { InvalidAccessError };
     if (equalLettersIgnoringASCIICase(policy, "disabled"))
-        settings()->setPdfImageCachingPolicy(PDFImageCachingDisabled);
+        settings().setPdfImageCachingPolicy(PDFImageCachingDisabled);
     else if (equalLettersIgnoringASCIICase(policy, "belowmemorylimit"))
-        settings()->setPdfImageCachingPolicy(PDFImageCachingBelowMemoryLimit);
+        settings().setPdfImageCachingPolicy(PDFImageCachingBelowMemoryLimit);
     else if (equalLettersIgnoringASCIICase(policy, "clipboundsonly"))
-        settings()->setPdfImageCachingPolicy(PDFImageCachingClipBoundsOnly);
+        settings().setPdfImageCachingPolicy(PDFImageCachingClipBoundsOnly);
     else if (equalLettersIgnoringASCIICase(policy, "enabled"))
-        settings()->setPdfImageCachingPolicy(PDFImageCachingEnabled);
+        settings().setPdfImageCachingPolicy(PDFImageCachingEnabled);
     else
-        ec = SYNTAX_ERR;
+        return Exception { SyntaxError };
+    return { };
+}
+
+ExceptionOr<void> InternalSettings::setMinimumTimerInterval(double intervalInSeconds)
+{
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setMinimumDOMTimerInterval(Seconds { intervalInSeconds });
+    return { };
 }
 
-void InternalSettings::setMinimumTimerInterval(double intervalInSeconds, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setDefaultVideoPosterURL(const String& url)
 {
-    InternalSettingsGuardForSettings();
-    settings()->setMinimumDOMTimerInterval(std::chrono::milliseconds((std::chrono::milliseconds::rep)(intervalInSeconds * 1000)));
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setDefaultVideoPosterURL(url);
+    return { };
 }
 
-void InternalSettings::setDefaultVideoPosterURL(const String& url, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setForcePendingWebGLPolicy(bool forced)
 {
-    InternalSettingsGuardForSettings();
-    settings()->setDefaultVideoPosterURL(url);
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setForcePendingWebGLPolicy(forced);
+    return { };
 }
 
-void InternalSettings::setForcePendingWebGLPolicy(bool forced, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls(double time)
 {
-    InternalSettingsGuardForSettings();
-    settings()->setForcePendingWebGLPolicy(forced);
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setTimeWithoutMouseMovementBeforeHidingControls(Seconds { time });
+    return { };
 }
 
-void InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls(double time, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior(bool enabled)
 {
-    InternalSettingsGuardForSettings();
-    settings()->setTimeWithoutMouseMovementBeforeHidingControls(time);
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setUseLegacyBackgroundSizeShorthandBehavior(enabled);
+    return { };
 }
 
-void InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior(bool enabled, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setAutoscrollForDragAndDropEnabled(bool enabled)
 {
-    InternalSettingsGuardForSettings();
-    settings()->setUseLegacyBackgroundSizeShorthandBehavior(enabled);
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setAutoscrollForDragAndDropEnabled(enabled);
+    return { };
 }
 
-void InternalSettings::setAutoscrollForDragAndDropEnabled(bool enabled, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setFontFallbackPrefersPictographs(bool preferPictographs)
 {
-    InternalSettingsGuardForSettings();
-    settings()->setAutoscrollForDragAndDropEnabled(enabled);
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setFontFallbackPrefersPictographs(preferPictographs);
+    return { };
 }
 
-void InternalSettings::setFontFallbackPrefersPictographs(bool preferPictographs, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setFontLoadTimingOverride(const FontLoadTimingOverride& fontLoadTimingOverride)
 {
-    InternalSettingsGuardForSettings();
-    settings()->setFontFallbackPrefersPictographs(preferPictographs);
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    auto policy = Settings::FontLoadTimingOverride::None;
+    switch (fontLoadTimingOverride) {
+    case FontLoadTimingOverride::Block:
+        policy = Settings::FontLoadTimingOverride::Block;
+        break;
+    case FontLoadTimingOverride::Swap:
+        policy = Settings::FontLoadTimingOverride::Swap;
+        break;
+    case FontLoadTimingOverride::Failure:
+        policy = Settings::FontLoadTimingOverride::Failure;
+        break;
+    }
+    settings().setFontLoadTimingOverride(policy);
+    return { };
 }
 
-void InternalSettings::setWebFontsAlwaysFallBack(bool enable, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setShouldIgnoreFontLoadCompletions(bool ignore)
 {
-    InternalSettingsGuardForSettings();
-    settings()->setWebFontsAlwaysFallBack(enable);
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setShouldIgnoreFontLoadCompletions(ignore);
+    return { };
 }
 
-void InternalSettings::setPluginReplacementEnabled(bool enabled, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setQuickTimePluginReplacementEnabled(bool enabled)
 {
-    InternalSettingsGuardForSettings();
-    settings()->setPluginReplacementEnabled(enabled);
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setQuickTimePluginReplacementEnabled(enabled);
+    return { };
 }
 
-void InternalSettings::setBackgroundShouldExtendBeyondPage(bool hasExtendedBackground, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setYouTubeFlashPluginReplacementEnabled(bool enabled)
 {
-    InternalSettingsGuardForSettings();
-    settings()->setBackgroundShouldExtendBeyondPage(hasExtendedBackground);
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setYouTubeFlashPluginReplacementEnabled(enabled);
+    return { };
 }
 
-void InternalSettings::setShouldConvertPositionStyleOnCopy(bool convert, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setBackgroundShouldExtendBeyondPage(bool hasExtendedBackground)
 {
-    InternalSettingsGuardForSettings();
-    settings()->setShouldConvertPositionStyleOnCopy(convert);
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setBackgroundShouldExtendBeyondPage(hasExtendedBackground);
+    return { };
 }
 
-void InternalSettings::setScrollingTreeIncludesFrames(bool enabled, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setShouldConvertPositionStyleOnCopy(bool convert)
 {
-    InternalSettingsGuardForSettings();
-    settings()->setScrollingTreeIncludesFrames(enabled);
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setShouldConvertPositionStyleOnCopy(convert);
+    return { };
 }
 
-void InternalSettings::setAllowsInlineMediaPlayback(bool allows, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setScrollingTreeIncludesFrames(bool enabled)
 {
-    InternalSettingsGuardForSettings();
-    settings()->setAllowsInlineMediaPlayback(allows);
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setScrollingTreeIncludesFrames(enabled);
+    return { };
 }
 
-void InternalSettings::setAllowsInlineMediaPlaybackAfterFullscreen(bool allows, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setAllowUnclampedScrollPosition(bool allowUnclamped)
 {
-    InternalSettingsGuardForSettings();
-    settings()->setAllowsInlineMediaPlaybackAfterFullscreen(allows);
+    if (!m_page || !m_page->mainFrame().view())
+        return Exception { InvalidAccessError };
+
+    m_page->mainFrame().view()->setAllowsUnclampedScrollPositionForTesting(allowUnclamped);
+    return { };
 }
 
-void InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute(bool requires, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setAllowsInlineMediaPlayback(bool allows)
 {
-    InternalSettingsGuardForSettings();
-    settings()->setInlineMediaPlaybackRequiresPlaysInlineAttribute(requires);
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setAllowsInlineMediaPlayback(allows);
+    return { };
 }
 
-void InternalSettings::setIndexedDBWorkersEnabled(bool enabled, ExceptionCode&)
+ExceptionOr<void> InternalSettings::setAllowsInlineMediaPlaybackAfterFullscreen(bool allows)
+{
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setAllowsInlineMediaPlaybackAfterFullscreen(allows);
+    return { };
+}
+
+ExceptionOr<void> InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute(bool requires)
+{
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setInlineMediaPlaybackRequiresPlaysInlineAttribute(requires);
+    return { };
+}
+
+ExceptionOr<void> InternalSettings::setShouldMockBoldSystemFontForAccessibility(bool requires)
+{
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    RenderTheme::singleton().setShouldMockBoldSystemFontForAccessibility(requires);
+    FontCache::singleton().setShouldMockBoldSystemFontForAccessibility(requires);
+    return { };
+}
+
+void InternalSettings::setIndexedDBWorkersEnabled(bool enabled)
 {
 #if ENABLE(INDEXED_DATABASE_IN_WORKERS)
     RuntimeEnabledFeatures::sharedFeatures().setIndexedDBWorkersEnabled(enabled);
@@ -599,65 +747,226 @@ void InternalSettings::setIndexedDBWorkersEnabled(bool enabled, ExceptionCode&)
 #endif
 }
 
-String InternalSettings::userInterfaceDirectionPolicy(ExceptionCode& ec)
+void InternalSettings::setWebGL2Enabled(bool enabled)
+{
+#if ENABLE(WEBGL2)
+    RuntimeEnabledFeatures::sharedFeatures().setWebGL2Enabled(enabled);
+#else
+    UNUSED_PARAM(enabled);
+#endif
+}
+
+void InternalSettings::setWebGPUEnabled(bool enabled)
+{
+#if ENABLE(WEBGPU)
+    RuntimeEnabledFeatures::sharedFeatures().setWebGPUEnabled(enabled);
+#else
+    UNUSED_PARAM(enabled);
+#endif
+}
+
+void InternalSettings::setWebVREnabled(bool enabled)
+{
+    RuntimeEnabledFeatures::sharedFeatures().setWebVREnabled(enabled);
+}
+
+void InternalSettings::setScreenCaptureEnabled(bool enabled)
+{
+#if ENABLE(MEDIA_STREAM)
+    RuntimeEnabledFeatures::sharedFeatures().setScreenCaptureEnabled(enabled);
+#else
+    UNUSED_PARAM(enabled);
+#endif
+}
+
+void InternalSettings::setStorageAccessPromptsEnabled(bool enabled)
 {
-    InternalSettingsGuardForSettingsReturn("");
-    switch (settings()->userInterfaceDirectionPolicy()) {
+    RuntimeEnabledFeatures::sharedFeatures().setStorageAccessPromptsEnabled(enabled);
+}
+    
+ExceptionOr<String> InternalSettings::userInterfaceDirectionPolicy()
+{
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    switch (settings().userInterfaceDirectionPolicy()) {
     case UserInterfaceDirectionPolicy::Content:
-        return ASCIILiteral("Content");
+        return String { ASCIILiteral { "Content" } };
     case UserInterfaceDirectionPolicy::System:
-        return ASCIILiteral("View");
+        return String { ASCIILiteral { "View" } };
     }
     ASSERT_NOT_REACHED();
-    return String();
+    return Exception { InvalidAccessError };
 }
 
-void InternalSettings::setUserInterfaceDirectionPolicy(const String& policy, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setUserInterfaceDirectionPolicy(const String& policy)
 {
-    InternalSettingsGuardForSettings();
+    if (!m_page)
+        return Exception { InvalidAccessError };
     if (equalLettersIgnoringASCIICase(policy, "content")) {
-        settings()->setUserInterfaceDirectionPolicy(UserInterfaceDirectionPolicy::Content);
-        return;
+        settings().setUserInterfaceDirectionPolicy(UserInterfaceDirectionPolicy::Content);
+        return { };
     }
     if (equalLettersIgnoringASCIICase(policy, "view")) {
-        settings()->setUserInterfaceDirectionPolicy(UserInterfaceDirectionPolicy::System);
-        return;
+        settings().setUserInterfaceDirectionPolicy(UserInterfaceDirectionPolicy::System);
+        return { };
     }
-    ec = INVALID_ACCESS_ERR;
+    return Exception { InvalidAccessError };
 }
 
-String InternalSettings::systemLayoutDirection(ExceptionCode& ec)
+ExceptionOr<String> InternalSettings::systemLayoutDirection()
 {
-    InternalSettingsGuardForSettingsReturn("");
-    switch (settings()->systemLayoutDirection()) {
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    switch (settings().systemLayoutDirection()) {
     case LTR:
-        return ASCIILiteral("LTR");
+        return String { ASCIILiteral { "LTR" } };
     case RTL:
-        return ASCIILiteral("RTL");
+        return String { ASCIILiteral { "RTL" } };
     }
     ASSERT_NOT_REACHED();
-    return String();
+    return Exception { InvalidAccessError };
 }
 
-void InternalSettings::setSystemLayoutDirection(const String& direction, ExceptionCode& ec)
+ExceptionOr<void> InternalSettings::setSystemLayoutDirection(const String& direction)
 {
-    InternalSettingsGuardForSettings();
+    if (!m_page)
+        return Exception { InvalidAccessError };
     if (equalLettersIgnoringASCIICase(direction, "ltr")) {
-        settings()->setSystemLayoutDirection(LTR);
-        return;
+        settings().setSystemLayoutDirection(LTR);
+        return { };
     }
     if (equalLettersIgnoringASCIICase(direction, "rtl")) {
-        settings()->setSystemLayoutDirection(RTL);
-        return;
+        settings().setSystemLayoutDirection(RTL);
+        return { };
     }
-    ec = INVALID_ACCESS_ERR;
+    return Exception { InvalidAccessError };
+}
+
+ExceptionOr<void> InternalSettings::setFrameFlattening(FrameFlatteningValue frameFlattening)
+{
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setFrameFlattening(frameFlattening);
+    return { };
 }
 
 void InternalSettings::setAllowsAnySSLCertificate(bool allowsAnyCertificate)
 {
-    Settings::setAllowsAnySSLCertificate(allowsAnyCertificate);
+    DeprecatedGlobalSettings::setAllowsAnySSLCertificate(allowsAnyCertificate);
+#if USE(SOUP)
+    SoupNetworkSession::setShouldIgnoreTLSErrors(allowsAnyCertificate);
+#endif
+}
+
+ExceptionOr<bool> InternalSettings::deferredCSSParserEnabled()
+{
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    return settings().deferredCSSParserEnabled();
+}
+
+ExceptionOr<void> InternalSettings::setDeferredCSSParserEnabled(bool enabled)
+{
+    if (!m_page)
+        return Exception { InvalidAccessError };
+    settings().setDeferredCSSParserEnabled(enabled);
+    return { };
+}
+
+ExceptionOr<void> InternalSettings::setShouldManageAudioSessionCategory(bool should)
+{
+#if USE(AUDIO_SESSION)
+    DeprecatedGlobalSettings::setShouldManageAudioSessionCategory(should);
+    return { };
+#else
+    UNUSED_PARAM(should);
+    return Exception { InvalidAccessError };
+#endif
+}
+
+ExceptionOr<void> InternalSettings::setCustomPasteboardDataEnabled(bool enabled)
+{
+    RuntimeEnabledFeatures::sharedFeatures().setCustomPasteboardDataEnabled(enabled);
+    return { };
+}
+
+ExceptionOr<void> InternalSettings::setAccessibilityEventsEnabled(bool enabled)
+{
+    if (!m_page)
+        return Exception { InvalidAccessError };
+#if ENABLE(ACCESSIBILITY_EVENTS)
+    settings().setAccessibilityEventsEnabled(enabled);
+#else
+    UNUSED_PARAM(enabled);
+#endif
+    return { };
+}
+
+static InternalSettings::ForcedAccessibilityValue settingsToInternalSettingsValue(Settings::ForcedAccessibilityValue value)
+{
+    switch (value) {
+    case Settings::ForcedAccessibilityValue::System:
+        return InternalSettings::ForcedAccessibilityValue::System;
+    case Settings::ForcedAccessibilityValue::On:
+        return InternalSettings::ForcedAccessibilityValue::On;
+    case Settings::ForcedAccessibilityValue::Off:
+        return InternalSettings::ForcedAccessibilityValue::Off;
+    }
+
+    ASSERT_NOT_REACHED();
+    return InternalSettings::ForcedAccessibilityValue::Off;
+}
+
+static Settings::ForcedAccessibilityValue internalSettingsToSettingsValue(InternalSettings::ForcedAccessibilityValue value)
+{
+    switch (value) {
+    case InternalSettings::ForcedAccessibilityValue::System:
+        return Settings::ForcedAccessibilityValue::System;
+    case InternalSettings::ForcedAccessibilityValue::On:
+        return Settings::ForcedAccessibilityValue::On;
+    case InternalSettings::ForcedAccessibilityValue::Off:
+        return Settings::ForcedAccessibilityValue::Off;
+    }
+
+    ASSERT_NOT_REACHED();
+    return Settings::ForcedAccessibilityValue::Off;
+}
+
+InternalSettings::ForcedAccessibilityValue InternalSettings::forcedColorsAreInvertedAccessibilityValue() const
+{
+    return settingsToInternalSettingsValue(settings().forcedColorsAreInvertedAccessibilityValue());
+}
+
+void InternalSettings::setForcedColorsAreInvertedAccessibilityValue(InternalSettings::ForcedAccessibilityValue value)
+{
+    settings().setForcedColorsAreInvertedAccessibilityValue(internalSettingsToSettingsValue(value));
+}
+
+InternalSettings::ForcedAccessibilityValue InternalSettings::forcedDisplayIsMonochromeAccessibilityValue() const
+{
+    return settingsToInternalSettingsValue(settings().forcedDisplayIsMonochromeAccessibilityValue());
+}
+
+void InternalSettings::setForcedDisplayIsMonochromeAccessibilityValue(InternalSettings::ForcedAccessibilityValue value)
+{
+    settings().setForcedDisplayIsMonochromeAccessibilityValue(internalSettingsToSettingsValue(value));
+}
+
+InternalSettings::ForcedAccessibilityValue InternalSettings::forcedPrefersReducedMotionAccessibilityValue() const
+{
+    return settingsToInternalSettingsValue(settings().forcedPrefersReducedMotionAccessibilityValue());
+}
+
+void InternalSettings::setForcedPrefersReducedMotionAccessibilityValue(InternalSettings::ForcedAccessibilityValue value)
+{
+    settings().setForcedPrefersReducedMotionAccessibilityValue(internalSettingsToSettingsValue(value));
+}
+
+bool InternalSettings::webAnimationsCSSIntegrationEnabled()
+{
+    return RuntimeEnabledFeatures::sharedFeatures().webAnimationsCSSIntegrationEnabled();
 }
 
-// If you add to this list, make sure that you update the Backup class for test reproducability!
+// If you add to this class, make sure that you update the Backup class for test reproducability!
 
 }