[Settings] Remove all custom code from Settings.h/cpp
[WebKit-https.git] / Source / WebCore / testing / InternalSettings.cpp
index a8d7c02..2f7a432 100644 (file)
 
 #include "CaptionUserPreferences.h"
 #include "Document.h"
-#include "ExceptionCode.h"
 #include "FontCache.h"
 #include "FrameView.h"
-#include "Language.h"
 #include "LocaleToScriptMapping.h"
 #include "MainFrame.h"
 #include "Page.h"
@@ -41,7 +39,7 @@
 #include "RuntimeEnabledFeatures.h"
 #include "Settings.h"
 #include "Supplementable.h"
-#include "TextRun.h"
+#include <wtf/Language.h>
 
 #if ENABLE(INPUT_TYPE_COLOR)
 #include "ColorChooser.h"
@@ -79,7 +77,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())
@@ -100,6 +98,8 @@ InternalSettings::Backup::Backup(Settings& settings)
     , 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
@@ -110,10 +110,12 @@ InternalSettings::Backup::Backup(Settings& settings)
 #if ENABLE(WEBGPU)
     , m_webGPUEnabled(RuntimeEnabledFeatures::sharedFeatures().webGPUEnabled())
 #endif
+    , m_webVREnabled(RuntimeEnabledFeatures::sharedFeatures().webVREnabled())
     , m_shouldMockBoldSystemFontForAccessibility(RenderTheme::singleton().shouldMockBoldSystemFontForAccessibility())
 #if USE(AUDIO_SESSION)
     , m_shouldManageAudioSessionCategory(Settings::shouldManageAudioSessionCategory())
 #endif
+    , m_customPasteboardDataEnabled(Settings::customPasteboardDataEnabled())
 {
 }
 
@@ -170,7 +172,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,9 +192,11 @@ void InternalSettings::Backup::restoreTo(Settings& settings)
     settings.setForcedColorsAreInvertedAccessibilityValue(m_forcedColorsAreInvertedAccessibilityValue);
     settings.setForcedDisplayIsMonochromeAccessibilityValue(m_forcedDisplayIsMonochromeAccessibilityValue);
     settings.setForcedPrefersReducedMotionAccessibilityValue(m_forcedPrefersReducedMotionAccessibilityValue);
+    settings.setFontLoadTimingOverride(m_fontLoadTimingOverride);
     Settings::setAllowsAnySSLCertificate(false);
     RenderTheme::singleton().setShouldMockBoldSystemFontForAccessibility(m_shouldMockBoldSystemFontForAccessibility);
     FontCache::singleton().setShouldMockBoldSystemFontForAccessibility(m_shouldMockBoldSystemFontForAccessibility);
+    settings.setFrameFlattening(m_frameFlattening);
 
 #if ENABLE(INDEXED_DATABASE_IN_WORKERS)
     RuntimeEnabledFeatures::sharedFeatures().setIndexedDBWorkersEnabled(m_indexedDBWorkersEnabled);
@@ -204,10 +208,12 @@ void InternalSettings::Backup::restoreTo(Settings& settings)
 #if ENABLE(WEBGPU)
     RuntimeEnabledFeatures::sharedFeatures().setWebGPUEnabled(m_webGPUEnabled);
 #endif
+    RuntimeEnabledFeatures::sharedFeatures().setWebVREnabled(m_webVREnabled);
 
 #if USE(AUDIO_SESSION)
     Settings::setShouldManageAudioSessionCategory(m_shouldManageAudioSessionCategory);
 #endif
+    Settings::setCustomPasteboardDataEnabled(m_customPasteboardDataEnabled);
 }
 
 class InternalSettingsWrapper : public Supplement<Page> {
@@ -265,8 +271,6 @@ void InternalSettings::resetToConsistentState()
     m_page->mainFrame().setPageAndTextZoomFactors(1, 1);
     m_page->setCanStartMedia(true);
 
-    settings().setShouldLogScritedAnimationControllerSuspensionChange(true);
-
     settings().setForcePendingWebGLPolicy(false);
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
     settings().setAllowsAirPlayForMediaPlayback(false);
@@ -290,7 +294,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
@@ -302,7 +306,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 { };
@@ -314,7 +318,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 { };
@@ -326,7 +330,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 { };
@@ -338,7 +342,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 { };
@@ -350,7 +354,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 { };
@@ -362,7 +366,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 { };
@@ -374,7 +378,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 { };
@@ -386,7 +390,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
@@ -398,7 +402,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
@@ -411,7 +415,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 { };
 }
@@ -419,7 +423,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 { };
 }
@@ -427,7 +431,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
@@ -439,7 +443,7 @@ 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);
 #else
@@ -451,7 +455,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"))
@@ -461,14 +465,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"))
@@ -478,7 +482,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);
@@ -489,7 +493,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"))
@@ -499,7 +503,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;
@@ -509,7 +513,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")
@@ -517,14 +521,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 { };
 }
@@ -532,7 +536,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 { };
 }
@@ -540,7 +544,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"))
@@ -550,14 +554,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 { };
 }
@@ -565,7 +569,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 { };
 }
@@ -573,7 +577,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 { };
 }
@@ -581,7 +585,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 { };
 }
@@ -589,7 +593,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 { };
 }
@@ -597,7 +601,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 { };
 }
@@ -605,23 +609,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 { };
 }
@@ -629,7 +653,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 { };
 }
@@ -637,7 +661,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 { };
 }
@@ -645,7 +669,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 { };
 }
@@ -653,7 +677,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 { };
 }
@@ -661,7 +685,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 { };
@@ -670,7 +694,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 { };
 }
@@ -678,7 +702,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 { };
 }
@@ -686,7 +710,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 { };
 }
@@ -694,7 +718,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 { };
@@ -732,20 +756,15 @@ void InternalSettings::setWebGPUEnabled(bool enabled)
 #endif
 }
 
-bool InternalSettings::shouldLogScritedAnimationControllerSuspensionChange()
-{
-    return settings().shouldLogScritedAnimationControllerSuspensionChange();
-}
-
-void InternalSettings::setShouldLogScritedAnimationControllerSuspensionChange(bool shouldLogScritedAnimationControllerSuspensionChange)
+void InternalSettings::setWebVREnabled(bool enabled)
 {
-    settings().setShouldLogScritedAnimationControllerSuspensionChange(shouldLogScritedAnimationControllerSuspensionChange);
+    RuntimeEnabledFeatures::sharedFeatures().setWebVREnabled(enabled);
 }
 
 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" } };
@@ -753,13 +772,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 { };
@@ -768,13 +787,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" } };
@@ -782,13 +801,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 { };
@@ -797,7 +816,15 @@ 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)
@@ -811,14 +838,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 { };
 }
@@ -829,10 +856,17 @@ ExceptionOr<void> InternalSettings::setShouldManageAudioSessionCategory(bool sho
     Settings::setShouldManageAudioSessionCategory(should);
     return { };
 #else
-    return Exception { INVALID_ACCESS_ERR };
+    UNUSED_PARAM(should);
+    return Exception { InvalidAccessError };
 #endif
 }
 
+ExceptionOr<void> InternalSettings::setCustomPasteboardDataEnabled(bool enabled)
+{
+    Settings::setCustomPasteboardDataEnabled(enabled);
+    return { };
+}
+
 static InternalSettings::ForcedAccessibilityValue settingsToInternalSettingsValue(Settings::ForcedAccessibilityValue value)
 {
     switch (value) {