diff --git a/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml b/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml index d5027566de279..e53d32f344f7a 100644 --- a/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml +++ b/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml @@ -2817,6 +2817,21 @@ FullScreenEnabled: WebCore: default: false +FullScreenKeyboardLock: + type: bool + status: testable + category: dom + humanReadableName: "Fullscreen API based Keyboard Lock" + humanReadableDescription: "Fullscreen API based Keyboard Lock" + condition: ENABLE(FULLSCREEN_API) + defaultValue: + WebKitLegacy: + default: false + WebKit: + default: false + WebCore: + default: false + FullscreenRequirementForScreenOrientationLockingEnabled: type: bool status: embedder diff --git a/Source/WebCore/dom/Element.h b/Source/WebCore/dom/Element.h index bd7cf2c529155..58ba82e69ab83 100644 --- a/Source/WebCore/dom/Element.h +++ b/Source/WebCore/dom/Element.h @@ -89,6 +89,7 @@ enum class AnimationImpact : uint8_t; enum class EventHandling : uint8_t; enum class EventProcessing : uint8_t; enum class FullscreenNavigationUI : uint8_t; +enum class FullscreenKeyboardLock : uint8_t; enum class IsSyntheticClick : bool { No, Yes }; enum class ParserContentPolicy : uint8_t; enum class ResolveURLs : uint8_t { No, NoExcludingURLsForPrivacy, Yes, YesExcludingURLsForPrivacy }; diff --git a/Source/WebCore/dom/FullscreenOptions.h b/Source/WebCore/dom/FullscreenOptions.h index 37c3b5595c936..baa2a81f9942f 100644 --- a/Source/WebCore/dom/FullscreenOptions.h +++ b/Source/WebCore/dom/FullscreenOptions.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Apple Inc. All rights reserved. + * Copyright (C) 2022-2023 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,8 +31,10 @@ namespace WebCore { struct FullscreenOptions { enum class NavigationUI : uint8_t { Auto, Show, Hide }; + enum class KeyboardLock : uint8_t { None, Browser, System }; NavigationUI navigationUI { NavigationUI::Auto }; + KeyboardLock keyboardLock { KeyboardLock::None }; }; } // namespace WebCore diff --git a/Source/WebCore/dom/FullscreenOptions.idl b/Source/WebCore/dom/FullscreenOptions.idl index c325699955f5a..46a469a3c9199 100644 --- a/Source/WebCore/dom/FullscreenOptions.idl +++ b/Source/WebCore/dom/FullscreenOptions.idl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Apple Inc. All rights reserved. + * Copyright (C) 2020-2023 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,8 +31,17 @@ "hide" }; +[ + Conditional=FULLSCREEN_API, EnabledBySetting=FullScreenKeyboardLock +] enum FullscreenKeyboardLock { + "none", + "browser", + "system" +}; + [ Conditional=FULLSCREEN_API ] dictionary FullscreenOptions { FullscreenNavigationUI navigationUI = "auto"; + [EnabledBySetting=FullScreenKeyboardLock] FullscreenKeyboardLock keyboardLock = "none"; };