AX: AOM: respect the accessibility setting for dispatching the accessible events
[WebKit-https.git] / Source / WebCore / testing / InternalSettings.cpp
index 74b2713..6b17e87 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"
@@ -61,7 +60,7 @@ InternalSettings::Backup::Backup(Settings& settings)
 #endif
     , m_originalMediaTypeOverride(settings.mediaTypeOverride())
     , m_originalCanvasUsesAcceleratedDrawing(settings.canvasUsesAcceleratedDrawing())
-    , m_originalMockScrollbarsEnabled(settings.mockScrollbarsEnabled())
+    , m_originalMockScrollbarsEnabled(DeprecatedGlobalSettings::mockScrollbarsEnabled())
     , m_imagesEnabled(settings.areImagesEnabled())
     , m_preferMIMETypeForImages(settings.preferMIMETypeForImages())
     , m_minimumDOMTimerInterval(settings.minimumDOMTimerInterval())
@@ -79,7 +78,7 @@ InternalSettings::Backup::Backup(Settings& settings)
     , 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())
@@ -94,26 +93,35 @@ InternalSettings::Backup::Backup(Settings& settings)
     , m_inlineMediaPlaybackRequiresPlaysInlineAttribute(settings.inlineMediaPlaybackRequiresPlaysInlineAttribute())
     , 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
-    , m_cssGridLayoutEnabled(RuntimeEnabledFeatures::sharedFeatures().isCSSGridLayoutEnabled())
 #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(Settings::shouldManageAudioSessionCategory())
+    , m_shouldManageAudioSessionCategory(DeprecatedGlobalSettings::shouldManageAudioSessionCategory())
 #endif
+    , m_customPasteboardDataEnabled(RuntimeEnabledFeatures::sharedFeatures().customPasteboardDataEnabled())
 {
 }
 
@@ -170,7 +178,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);
@@ -190,23 +198,32 @@ void InternalSettings::Backup::restoreTo(Settings& settings)
     settings.setForcedColorsAreInvertedAccessibilityValue(m_forcedColorsAreInvertedAccessibilityValue);
     settings.setForcedDisplayIsMonochromeAccessibilityValue(m_forcedDisplayIsMonochromeAccessibilityValue);
     settings.setForcedPrefersReducedMotionAccessibilityValue(m_forcedPrefersReducedMotionAccessibilityValue);
-    Settings::setAllowsAnySSLCertificate(false);
+    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
-    RuntimeEnabledFeatures::sharedFeatures().setCSSGridLayoutEnabled(m_cssGridLayoutEnabled);
 #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)
-    Settings::setShouldManageAudioSessionCategory(m_shouldManageAudioSessionCategory);
+    DeprecatedGlobalSettings::setShouldManageAudioSessionCategory(m_shouldManageAudioSessionCategory);
 #endif
 }
 
@@ -288,7 +305,7 @@ Settings& InternalSettings::settings() const
 ExceptionOr<void> InternalSettings::setTouchEventEmulationEnabled(bool enabled)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
 #if ENABLE(TOUCH_EVENTS)
     settings().setTouchEventEmulationEnabled(enabled);
 #else
@@ -300,7 +317,7 @@ ExceptionOr<void> InternalSettings::setTouchEventEmulationEnabled(bool enabled)
 ExceptionOr<void> InternalSettings::setStandardFontFamily(const String& family, const String& script)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     UScriptCode code = scriptNameToCode(script);
     if (code == USCRIPT_INVALID_CODE)
         return { };
@@ -312,7 +329,7 @@ ExceptionOr<void> InternalSettings::setStandardFontFamily(const String& family,
 ExceptionOr<void> InternalSettings::setSerifFontFamily(const String& family, const String& script)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     UScriptCode code = scriptNameToCode(script);
     if (code == USCRIPT_INVALID_CODE)
         return { };
@@ -324,7 +341,7 @@ ExceptionOr<void> InternalSettings::setSerifFontFamily(const String& family, con
 ExceptionOr<void> InternalSettings::setSansSerifFontFamily(const String& family, const String& script)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     UScriptCode code = scriptNameToCode(script);
     if (code == USCRIPT_INVALID_CODE)
         return { };
@@ -336,7 +353,7 @@ ExceptionOr<void> InternalSettings::setSansSerifFontFamily(const String& family,
 ExceptionOr<void> InternalSettings::setFixedFontFamily(const String& family, const String& script)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     UScriptCode code = scriptNameToCode(script);
     if (code == USCRIPT_INVALID_CODE)
         return { };
@@ -348,7 +365,7 @@ ExceptionOr<void> InternalSettings::setFixedFontFamily(const String& family, con
 ExceptionOr<void> InternalSettings::setCursiveFontFamily(const String& family, const String& script)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     UScriptCode code = scriptNameToCode(script);
     if (code == USCRIPT_INVALID_CODE)
         return { };
@@ -360,7 +377,7 @@ ExceptionOr<void> InternalSettings::setCursiveFontFamily(const String& family, c
 ExceptionOr<void> InternalSettings::setFantasyFontFamily(const String& family, const String& script)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     UScriptCode code = scriptNameToCode(script);
     if (code == USCRIPT_INVALID_CODE)
         return { };
@@ -372,7 +389,7 @@ ExceptionOr<void> InternalSettings::setFantasyFontFamily(const String& family, c
 ExceptionOr<void> InternalSettings::setPictographFontFamily(const String& family, const String& script)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     UScriptCode code = scriptNameToCode(script);
     if (code == USCRIPT_INVALID_CODE)
         return { };
@@ -384,7 +401,7 @@ ExceptionOr<void> InternalSettings::setPictographFontFamily(const String& family
 ExceptionOr<void> InternalSettings::setTextAutosizingEnabled(bool enabled)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
 #if ENABLE(TEXT_AUTOSIZING)
     settings().setTextAutosizingEnabled(enabled);
 #else
@@ -396,7 +413,7 @@ ExceptionOr<void> InternalSettings::setTextAutosizingEnabled(bool enabled)
 ExceptionOr<void> InternalSettings::setTextAutosizingWindowSizeOverride(int width, int height)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
 #if ENABLE(TEXT_AUTOSIZING)
     settings().setTextAutosizingWindowSizeOverride(IntSize(width, height));
 #else
@@ -409,7 +426,7 @@ ExceptionOr<void> InternalSettings::setTextAutosizingWindowSizeOverride(int widt
 ExceptionOr<void> InternalSettings::setMediaTypeOverride(const String& mediaType)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     settings().setMediaTypeOverride(mediaType);
     return { };
 }
@@ -417,7 +434,7 @@ ExceptionOr<void> InternalSettings::setMediaTypeOverride(const String& mediaType
 ExceptionOr<void> InternalSettings::setCanStartMedia(bool enabled)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     m_page->setCanStartMedia(enabled);
     return { };
 }
@@ -425,7 +442,7 @@ ExceptionOr<void> InternalSettings::setCanStartMedia(bool enabled)
 ExceptionOr<void> InternalSettings::setAllowsAirPlayForMediaPlayback(bool allows)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
     settings().setAllowsAirPlayForMediaPlayback(allows);
 #else
@@ -437,9 +454,9 @@ ExceptionOr<void> InternalSettings::setAllowsAirPlayForMediaPlayback(bool allows
 ExceptionOr<void> InternalSettings::setMediaCaptureRequiresSecureConnection(bool requires)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
 #if ENABLE(MEDIA_STREAM)
-    settings().setMediaCaptureRequiresSecureConnection(requires);
+    DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection(requires);
 #else
     UNUSED_PARAM(requires);
 #endif
@@ -449,7 +466,7 @@ ExceptionOr<void> InternalSettings::setMediaCaptureRequiresSecureConnection(bool
 ExceptionOr<void> InternalSettings::setEditingBehavior(const String& editingBehavior)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     if (equalLettersIgnoringASCIICase(editingBehavior, "win"))
         settings().setEditingBehaviorType(EditingWindowsBehavior);
     else if (equalLettersIgnoringASCIICase(editingBehavior, "mac"))
@@ -459,14 +476,14 @@ ExceptionOr<void> InternalSettings::setEditingBehavior(const String& editingBeha
     else if (equalLettersIgnoringASCIICase(editingBehavior, "ios"))
         settings().setEditingBehaviorType(EditingIOSBehavior);
     else
-        return Exception { SYNTAX_ERR };
+        return Exception { SyntaxError };
     return { };
 }
 
 ExceptionOr<void> InternalSettings::setShouldDisplayTrackKind(const String& kind, bool enabled)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
 #if ENABLE(VIDEO_TRACK)
     auto& captionPreferences = m_page->group().captionPreferences();
     if (equalLettersIgnoringASCIICase(kind, "subtitles"))
@@ -476,7 +493,7 @@ ExceptionOr<void> InternalSettings::setShouldDisplayTrackKind(const String& kind
     else if (equalLettersIgnoringASCIICase(kind, "textdescriptions"))
         captionPreferences.setUserPrefersTextDescriptions(enabled);
     else
-        return Exception { SYNTAX_ERR };
+        return Exception { SyntaxError };
 #else
     UNUSED_PARAM(kind);
     UNUSED_PARAM(enabled);
@@ -487,7 +504,7 @@ ExceptionOr<void> InternalSettings::setShouldDisplayTrackKind(const String& kind
 ExceptionOr<bool> InternalSettings::shouldDisplayTrackKind(const String& kind)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
 #if ENABLE(VIDEO_TRACK)
     auto& captionPreferences = m_page->group().captionPreferences();
     if (equalLettersIgnoringASCIICase(kind, "subtitles"))
@@ -497,7 +514,7 @@ ExceptionOr<bool> InternalSettings::shouldDisplayTrackKind(const String& kind)
     if (equalLettersIgnoringASCIICase(kind, "textdescriptions"))
         return captionPreferences.userPrefersTextDescriptions();
 
-    return Exception { SYNTAX_ERR };
+    return Exception { SyntaxError };
 #else
     UNUSED_PARAM(kind);
     return false;
@@ -507,7 +524,7 @@ ExceptionOr<bool> InternalSettings::shouldDisplayTrackKind(const String& kind)
 ExceptionOr<void> InternalSettings::setStorageBlockingPolicy(const String& mode)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     if (mode == "AllowAll")
         settings().setStorageBlockingPolicy(SecurityOrigin::AllowAllStorage);
     else if (mode == "BlockThirdParty")
@@ -515,14 +532,14 @@ ExceptionOr<void> InternalSettings::setStorageBlockingPolicy(const String& mode)
     else if (mode == "BlockAll")
         settings().setStorageBlockingPolicy(SecurityOrigin::BlockAllStorage);
     else
-        return Exception { SYNTAX_ERR };
+        return Exception { SyntaxError };
     return { };
 }
 
 ExceptionOr<void> InternalSettings::setPreferMIMETypeForImages(bool preferMIMETypeForImages)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     settings().setPreferMIMETypeForImages(preferMIMETypeForImages);
     return { };
 }
@@ -530,7 +547,7 @@ ExceptionOr<void> InternalSettings::setPreferMIMETypeForImages(bool preferMIMETy
 ExceptionOr<void> InternalSettings::setImagesEnabled(bool enabled)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     settings().setImagesEnabled(enabled);
     return { };
 }
@@ -538,7 +555,7 @@ ExceptionOr<void> InternalSettings::setImagesEnabled(bool enabled)
 ExceptionOr<void> InternalSettings::setPDFImageCachingPolicy(const String& policy)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     if (equalLettersIgnoringASCIICase(policy, "disabled"))
         settings().setPdfImageCachingPolicy(PDFImageCachingDisabled);
     else if (equalLettersIgnoringASCIICase(policy, "belowmemorylimit"))
@@ -548,14 +565,14 @@ ExceptionOr<void> InternalSettings::setPDFImageCachingPolicy(const String& polic
     else if (equalLettersIgnoringASCIICase(policy, "enabled"))
         settings().setPdfImageCachingPolicy(PDFImageCachingEnabled);
     else
-        return Exception { SYNTAX_ERR };
+        return Exception { SyntaxError };
     return { };
 }
 
 ExceptionOr<void> InternalSettings::setMinimumTimerInterval(double intervalInSeconds)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     settings().setMinimumDOMTimerInterval(Seconds { intervalInSeconds });
     return { };
 }
@@ -563,7 +580,7 @@ ExceptionOr<void> InternalSettings::setMinimumTimerInterval(double intervalInSec
 ExceptionOr<void> InternalSettings::setDefaultVideoPosterURL(const String& url)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     settings().setDefaultVideoPosterURL(url);
     return { };
 }
@@ -571,7 +588,7 @@ ExceptionOr<void> InternalSettings::setDefaultVideoPosterURL(const String& url)
 ExceptionOr<void> InternalSettings::setForcePendingWebGLPolicy(bool forced)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     settings().setForcePendingWebGLPolicy(forced);
     return { };
 }
@@ -579,7 +596,7 @@ ExceptionOr<void> InternalSettings::setForcePendingWebGLPolicy(bool forced)
 ExceptionOr<void> InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls(double time)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     settings().setTimeWithoutMouseMovementBeforeHidingControls(Seconds { time });
     return { };
 }
@@ -587,7 +604,7 @@ ExceptionOr<void> InternalSettings::setTimeWithoutMouseMovementBeforeHidingContr
 ExceptionOr<void> InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior(bool enabled)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     settings().setUseLegacyBackgroundSizeShorthandBehavior(enabled);
     return { };
 }
@@ -595,7 +612,7 @@ ExceptionOr<void> InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior(
 ExceptionOr<void> InternalSettings::setAutoscrollForDragAndDropEnabled(bool enabled)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     settings().setAutoscrollForDragAndDropEnabled(enabled);
     return { };
 }
@@ -603,23 +620,43 @@ ExceptionOr<void> InternalSettings::setAutoscrollForDragAndDropEnabled(bool enab
 ExceptionOr<void> InternalSettings::setFontFallbackPrefersPictographs(bool preferPictographs)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     settings().setFontFallbackPrefersPictographs(preferPictographs);
     return { };
 }
 
-ExceptionOr<void> InternalSettings::setWebFontsAlwaysFallBack(bool enable)
+ExceptionOr<void> InternalSettings::setFontLoadTimingOverride(const FontLoadTimingOverride& fontLoadTimingOverride)
+{
+    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 { };
+}
+
+ExceptionOr<void> InternalSettings::setShouldIgnoreFontLoadCompletions(bool ignore)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
-    settings().setWebFontsAlwaysFallBack(enable);
+        return Exception { InvalidAccessError };
+    settings().setShouldIgnoreFontLoadCompletions(ignore);
     return { };
 }
 
 ExceptionOr<void> InternalSettings::setQuickTimePluginReplacementEnabled(bool enabled)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     settings().setQuickTimePluginReplacementEnabled(enabled);
     return { };
 }
@@ -627,7 +664,7 @@ ExceptionOr<void> InternalSettings::setQuickTimePluginReplacementEnabled(bool en
 ExceptionOr<void> InternalSettings::setYouTubeFlashPluginReplacementEnabled(bool enabled)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     settings().setYouTubeFlashPluginReplacementEnabled(enabled);
     return { };
 }
@@ -635,7 +672,7 @@ ExceptionOr<void> InternalSettings::setYouTubeFlashPluginReplacementEnabled(bool
 ExceptionOr<void> InternalSettings::setBackgroundShouldExtendBeyondPage(bool hasExtendedBackground)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     settings().setBackgroundShouldExtendBeyondPage(hasExtendedBackground);
     return { };
 }
@@ -643,7 +680,7 @@ ExceptionOr<void> InternalSettings::setBackgroundShouldExtendBeyondPage(bool has
 ExceptionOr<void> InternalSettings::setShouldConvertPositionStyleOnCopy(bool convert)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     settings().setShouldConvertPositionStyleOnCopy(convert);
     return { };
 }
@@ -651,7 +688,7 @@ ExceptionOr<void> InternalSettings::setShouldConvertPositionStyleOnCopy(bool con
 ExceptionOr<void> InternalSettings::setScrollingTreeIncludesFrames(bool enabled)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     settings().setScrollingTreeIncludesFrames(enabled);
     return { };
 }
@@ -659,7 +696,7 @@ ExceptionOr<void> InternalSettings::setScrollingTreeIncludesFrames(bool enabled)
 ExceptionOr<void> InternalSettings::setAllowUnclampedScrollPosition(bool allowUnclamped)
 {
     if (!m_page || !m_page->mainFrame().view())
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
 
     m_page->mainFrame().view()->setAllowsUnclampedScrollPositionForTesting(allowUnclamped);
     return { };
@@ -668,7 +705,7 @@ ExceptionOr<void> InternalSettings::setAllowUnclampedScrollPosition(bool allowUn
 ExceptionOr<void> InternalSettings::setAllowsInlineMediaPlayback(bool allows)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     settings().setAllowsInlineMediaPlayback(allows);
     return { };
 }
@@ -676,7 +713,7 @@ ExceptionOr<void> InternalSettings::setAllowsInlineMediaPlayback(bool allows)
 ExceptionOr<void> InternalSettings::setAllowsInlineMediaPlaybackAfterFullscreen(bool allows)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     settings().setAllowsInlineMediaPlaybackAfterFullscreen(allows);
     return { };
 }
@@ -684,7 +721,7 @@ ExceptionOr<void> InternalSettings::setAllowsInlineMediaPlaybackAfterFullscreen(
 ExceptionOr<void> InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute(bool requires)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     settings().setInlineMediaPlaybackRequiresPlaysInlineAttribute(requires);
     return { };
 }
@@ -692,7 +729,7 @@ ExceptionOr<void> InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAtt
 ExceptionOr<void> InternalSettings::setShouldMockBoldSystemFontForAccessibility(bool requires)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     RenderTheme::singleton().setShouldMockBoldSystemFontForAccessibility(requires);
     FontCache::singleton().setShouldMockBoldSystemFontForAccessibility(requires);
     return { };
@@ -707,11 +744,6 @@ void InternalSettings::setIndexedDBWorkersEnabled(bool enabled)
 #endif
 }
 
-void InternalSettings::setCSSGridLayoutEnabled(bool enabled)
-{
-    RuntimeEnabledFeatures::sharedFeatures().setCSSGridLayoutEnabled(enabled);
-}
-
 void InternalSettings::setWebGL2Enabled(bool enabled)
 {
 #if ENABLE(WEBGL2)
@@ -730,10 +762,24 @@ void InternalSettings::setWebGPUEnabled(bool 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
+}
+
 ExceptionOr<String> InternalSettings::userInterfaceDirectionPolicy()
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     switch (settings().userInterfaceDirectionPolicy()) {
     case UserInterfaceDirectionPolicy::Content:
         return String { ASCIILiteral { "Content" } };
@@ -741,13 +787,13 @@ ExceptionOr<String> InternalSettings::userInterfaceDirectionPolicy()
         return String { ASCIILiteral { "View" } };
     }
     ASSERT_NOT_REACHED();
-    return Exception { INVALID_ACCESS_ERR };
+    return Exception { InvalidAccessError };
 }
 
 ExceptionOr<void> InternalSettings::setUserInterfaceDirectionPolicy(const String& policy)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     if (equalLettersIgnoringASCIICase(policy, "content")) {
         settings().setUserInterfaceDirectionPolicy(UserInterfaceDirectionPolicy::Content);
         return { };
@@ -756,13 +802,13 @@ ExceptionOr<void> InternalSettings::setUserInterfaceDirectionPolicy(const String
         settings().setUserInterfaceDirectionPolicy(UserInterfaceDirectionPolicy::System);
         return { };
     }
-    return Exception { INVALID_ACCESS_ERR };
+    return Exception { InvalidAccessError };
 }
 
 ExceptionOr<String> InternalSettings::systemLayoutDirection()
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     switch (settings().systemLayoutDirection()) {
     case LTR:
         return String { ASCIILiteral { "LTR" } };
@@ -770,13 +816,13 @@ ExceptionOr<String> InternalSettings::systemLayoutDirection()
         return String { ASCIILiteral { "RTL" } };
     }
     ASSERT_NOT_REACHED();
-    return Exception { INVALID_ACCESS_ERR };
+    return Exception { InvalidAccessError };
 }
 
 ExceptionOr<void> InternalSettings::setSystemLayoutDirection(const String& direction)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     if (equalLettersIgnoringASCIICase(direction, "ltr")) {
         settings().setSystemLayoutDirection(LTR);
         return { };
@@ -785,12 +831,20 @@ ExceptionOr<void> InternalSettings::setSystemLayoutDirection(const String& direc
         settings().setSystemLayoutDirection(RTL);
         return { };
     }
-    return Exception { 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
@@ -799,14 +853,14 @@ void InternalSettings::setAllowsAnySSLCertificate(bool allowsAnyCertificate)
 ExceptionOr<bool> InternalSettings::deferredCSSParserEnabled()
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     return settings().deferredCSSParserEnabled();
 }
 
 ExceptionOr<void> InternalSettings::setDeferredCSSParserEnabled(bool enabled)
 {
     if (!m_page)
-        return Exception { INVALID_ACCESS_ERR };
+        return Exception { InvalidAccessError };
     settings().setDeferredCSSParserEnabled(enabled);
     return { };
 }
@@ -814,11 +868,30 @@ ExceptionOr<void> InternalSettings::setDeferredCSSParserEnabled(bool enabled)
 ExceptionOr<void> InternalSettings::setShouldManageAudioSessionCategory(bool should)
 {
 #if USE(AUDIO_SESSION)
-    Settings::setShouldManageAudioSessionCategory(should);
+    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
-    return Exception { INVALID_ACCESS_ERR };
+    UNUSED_PARAM(enabled);
 #endif
+    return { };
 }
 
 static InternalSettings::ForcedAccessibilityValue settingsToInternalSettingsValue(Settings::ForcedAccessibilityValue value)
@@ -881,6 +954,11 @@ void InternalSettings::setForcedPrefersReducedMotionAccessibilityValue(InternalS
     settings().setForcedPrefersReducedMotionAccessibilityValue(internalSettingsToSettingsValue(value));
 }
 
+bool InternalSettings::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled()
+{
+    return RuntimeEnabledFeatures::sharedFeatures().cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled();
+}
+
 // If you add to this class, make sure that you update the Backup class for test reproducability!
 
 }