Skip to content

Commit

Permalink
Add Keyboard Lock option into Fullscreen API
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=265923

Reviewed by Ryosuke Niwa.

Add option compliant with the fulscreen proposal <whatwg/fullscreen#231>.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/FullscreenOptions.h:
* Source/WebCore/dom/FullscreenOptions.idl:

Canonical link: https://commits.webkit.org/272933@main
  • Loading branch information
xingri committed Jan 11, 2024
1 parent 39ec746 commit d7997e2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
15 changes: 15 additions & 0 deletions Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/dom/Element.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
4 changes: 3 additions & 1 deletion Source/WebCore/dom/FullscreenOptions.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion Source/WebCore/dom/FullscreenOptions.idl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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";
};

0 comments on commit d7997e2

Please sign in to comment.