layout/style/nsCSSPseudoClasses.h

changeset 2
7e26c7da4463
equal deleted inserted replaced
-1:000000000000 0:53d469487571
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/. */
5
6 /* atom list for CSS pseudo-classes */
7
8 #ifndef nsCSSPseudoClasses_h___
9 #define nsCSSPseudoClasses_h___
10
11 #include "nsStringFwd.h"
12
13 class nsIAtom;
14
15 class nsCSSPseudoClasses {
16 public:
17
18 static void AddRefAtoms();
19
20 enum Type {
21 #define CSS_PSEUDO_CLASS(_name, _value, _pref) \
22 ePseudoClass_##_name,
23 #include "nsCSSPseudoClassList.h"
24 #undef CSS_PSEUDO_CLASS
25 ePseudoClass_Count,
26 ePseudoClass_NotPseudoClass /* This value MUST be last! SelectorMatches
27 depends on it. */
28 };
29
30 static Type GetPseudoType(nsIAtom* aAtom);
31 static bool HasStringArg(Type aType);
32 static bool HasNthPairArg(Type aType);
33 static bool HasSelectorListArg(Type aType) {
34 return aType == ePseudoClass_any;
35 }
36 static bool IsUserActionPseudoClass(Type aType);
37
38 // Should only be used on types other than Count and NotPseudoClass
39 static void PseudoTypeToString(Type aType, nsAString& aString);
40 };
41
42 #endif /* nsCSSPseudoClasses_h___ */

mercurial