Backed out changeset 496886cb30a5 (bug 1867152) for bc failures on browser_user_input...
[gecko.git] / layout / generic / AnonymousContentKey.h
blob531754fd20ea92a0b50cf9e349594a85d9629d37
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /* values to identify particular subtrees of native anonymous content */
9 #ifndef mozilla_AnonymousContentKey_h
10 #define mozilla_AnonymousContentKey_h
12 #include "mozilla/TypedEnumBits.h"
13 #include <stdint.h>
14 #include "X11UndefineNone.h"
16 namespace mozilla {
18 // clang-format off
20 // We currently use cached anonymous content styles only for scrollbar parts,
21 // and we can fit the type of scrollbar part element along with its different
22 // options (such as orientation, and other attribute values that can affect
23 // styling) into a uint8_t.
25 // The lower three bits hold a Type_* value identifying the type of
26 // element, and the remaining bits store Flag_* values.
28 // A value of 0 is used to represent an anonymous content subtree that we don't
29 // cache styles for.
30 enum class AnonymousContentKey : uint8_t {
31 None = 0x00,
33 // all
34 Type_ScrollCorner = 0x01,
35 Type_Scrollbar = 0x02,
36 Type_ScrollbarButton = 0x03,
37 Type_Slider = 0x04,
39 // scrollbar, scrollbarbutton, slider
40 Flag_Vertical = 0x08,
42 // scrollbarbutton
43 Flag_ScrollbarButton_Down = 0x10,
44 Flag_ScrollbarButton_Bottom = 0x20,
45 Flag_ScrollbarButton_Decrement = 0x40,
48 // clang-format on
50 MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(AnonymousContentKey)
52 } // namespace mozilla
54 #endif // mozilla_AnonymousContentKey_h