Coverage Report

Created: 2025-03-04 07:22

/src/serenity/Userland/Libraries/LibWeb/HTML/SandboxingFlagSet.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
3
 *
4
 * SPDX-License-Identifier: BSD-2-Clause
5
 */
6
7
#pragma once
8
9
#include <AK/EnumBits.h>
10
#include <AK/Types.h>
11
12
namespace Web::HTML {
13
14
// https://html.spec.whatwg.org/multipage/origin.html#sandboxing-flag-set
15
enum class SandboxingFlagSet {
16
    SandboxedNavigation = 1u << 0u,
17
    SandboxedAuxiliaryNavigation = 1u << 1u,
18
    SandboxedTopLevelNavigationWithoutUserActivation = 1u << 2u,
19
    SandboxedTopLevelNavigationWithUserActivation = 1u << 3u,
20
    SandboxedPlugins = 1u << 4u,
21
    SandboxedOrigin = 1u << 5u,
22
    SandboxedForms = 1u << 6u,
23
    SandboxedPointerLock = 1u << 7u,
24
    SandboxedScripts = 1u << 8u,
25
    SandboxedAutomaticFeatures = 1u << 9u,
26
    SandboxedDocumentDomain = 1u << 10u,
27
    SandboxPropagatesToAuxiliaryBrowsingContexts = 1u << 11u,
28
    SandboxedModals = 1u << 12u,
29
    SandboxedOrientationLock = 1u << 13u,
30
    SandboxedPresentation = 1u << 14u,
31
    SandboxedDownloads = 1u << 15u,
32
    SandboxedCustomProtocols = 1u << 16u,
33
};
34
35
AK_ENUM_BITWISE_OPERATORS(SandboxingFlagSet);
36
0
inline bool is_empty(SandboxingFlagSet s) { return (to_underlying(s) & 0x1FFU) == 0; }
37
38
}