Bug 1864419 - Part 1: Factor out ArgumentsData array into container class r=jandem
[gecko.git] / layout / style / nsCSSPropertyID.h.in
blob418c3ce622fc1d8d4b0c712f4f0fdd9e3504c51e
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 /* enum types for CSS properties and their values */
9 #ifndef nsCSSPropertyID_h___
10 #define nsCSSPropertyID_h___
12 #include <nsHashKeys.h>
15 Declare the enum list using the magic of preprocessing
16 enum values are "eCSSProperty_foo" (where foo is the property)
18 To change the list of properties, see ServoCSSPropList.h
21 enum nsCSSPropertyID : int32_t {
22 eCSSProperty_UNKNOWN = -1,
24 $property_ids
26 // Some of the values below could probably overlap with each other
27 // if we had a need for them to do so.
29 // Extra values for use in the values of the 'transition-property'
30 // property.
31 eCSSPropertyExtra_no_properties,
32 eCSSPropertyExtra_all_properties,
34 // Extra value to represent custom properties (--*).
35 eCSSPropertyExtra_variable,
38 // MOZ_DBG support is defined in nsCSSProps.h since it depends on
39 // nsCSSProps::GetStringValue
41 const nsCSSPropertyID
42 eCSSProperty_COUNT_no_shorthands = $longhand_count;
43 const nsCSSPropertyID
44 eCSSProperty_COUNT = $shorthand_count;
45 const nsCSSPropertyID
46 eCSSProperty_COUNT_with_aliases = eCSSPropertyExtra_no_properties;
48 namespace mozilla {
50 template<>
51 inline PLDHashNumber
52 Hash<nsCSSPropertyID>(const nsCSSPropertyID& aValue)
54 return uint32_t(aValue);
57 } // namespace mozilla
59 // The "descriptors" that can appear in a @font-face rule.
60 // They have the syntax of properties but different value rules.
61 enum nsCSSFontDesc {
62 eCSSFontDesc_UNKNOWN = -1,
63 #define CSS_FONT_DESC(name_, method_) eCSSFontDesc_##method_,
64 #include "nsCSSFontDescList.h"
65 #undef CSS_FONT_DESC
66 eCSSFontDesc_COUNT
69 // The "descriptors" that can appear in a @counter-style rule.
70 // They have the syntax of properties but different value rules.
71 enum nsCSSCounterDesc {
72 eCSSCounterDesc_UNKNOWN = -1,
73 #define CSS_COUNTER_DESC(name_, method_) eCSSCounterDesc_##method_,
74 #include "nsCSSCounterDescList.h"
75 #undef CSS_COUNTER_DESC
76 eCSSCounterDesc_COUNT
79 namespace mozilla {
81 // FIXME: The underlying type of this enum should be uint8_t, but we can't do
82 // that because of https://bugs.llvm.org/show_bug.cgi?id=44228.
83 enum class CountedUnknownProperty : uint32_t {
84 #define COUNTED_UNKNOWN_PROPERTY(name_, method_) method_,
85 #include "mozilla/CountedUnknownProperties.h"
86 #undef COUNTED_UNKNOWN_PROPERTY
87 Count,
90 } // namespace mozilla
92 #endif /* nsCSSPropertyID_h___ */