Bumping manifests a=b2g-bump
[gecko.git] / layout / style / nsStyleStructFwd.h
blobee5087358e550608e6e529f86e4bdd437b87fb98
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /*
7 * Forward declarations to avoid including all of nsStyleStruct.h.
8 */
10 #ifndef nsStyleStructFwd_h_
11 #define nsStyleStructFwd_h_
13 enum nsStyleStructID {
16 * Define the constants eStyleStruct_Font, etc.
18 * The C++ standard, section 7.2, guarantees that enums begin with 0 and
19 * increase by 1.
21 * We separate the IDs of Reset and Inherited structs so that we can use
22 * the IDs as indices (offset by nsStyleStructID_*_Start) into arrays of
23 * one type or the other.
26 nsStyleStructID_Inherited_Start = 0,
27 // a dummy value so the value after it is the same as ..._Inherited_Start
28 nsStyleStructID_DUMMY1 = nsStyleStructID_Inherited_Start - 1,
30 #define STYLE_STRUCT_INHERITED(name, checkdata_cb) \
31 eStyleStruct_##name,
32 #define STYLE_STRUCT_RESET(name, checkdata_cb)
33 #include "nsStyleStructList.h"
34 #undef STYLE_STRUCT_INHERITED
35 #undef STYLE_STRUCT_RESET
37 nsStyleStructID_Reset_Start,
38 // a dummy value so the value after it is the same as ..._Reset_Start
39 nsStyleStructID_DUMMY2 = nsStyleStructID_Reset_Start - 1,
41 #define STYLE_STRUCT_RESET(name, checkdata_cb) \
42 eStyleStruct_##name,
43 #define STYLE_STRUCT_INHERITED(name, checkdata_cb)
44 #include "nsStyleStructList.h"
45 #undef STYLE_STRUCT_INHERITED
46 #undef STYLE_STRUCT_RESET
48 // one past the end; length of 0-based list
49 nsStyleStructID_Length,
51 nsStyleStructID_Inherited_Count =
52 nsStyleStructID_Reset_Start - nsStyleStructID_Inherited_Start,
53 nsStyleStructID_Reset_Count =
54 nsStyleStructID_Length - nsStyleStructID_Reset_Start,
56 // An ID used for properties that are not in style structs. This is
57 // used only in some users of nsStyleStructID, such as
58 // nsCSSProps::kSIDTable, including some that store SIDs in a bitfield,
59 // such as nsCSSCompressedDataBlock::mStyleBits.
60 eStyleStruct_BackendOnly = nsStyleStructID_Length
64 // A bit corresponding to each struct ID
65 #define NS_STYLE_INHERIT_BIT(sid_) (1 << uint64_t(eStyleStruct_##sid_))
67 #endif /* nsStyleStructFwd_h_ */