SandboxingFlagSet.h 1.1 KB

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