Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | /* atom list for CSS pseudo-classes */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef nsCSSPseudoClasses_h___ |
michael@0 | 9 | #define nsCSSPseudoClasses_h___ |
michael@0 | 10 | |
michael@0 | 11 | #include "nsStringFwd.h" |
michael@0 | 12 | |
michael@0 | 13 | class nsIAtom; |
michael@0 | 14 | |
michael@0 | 15 | class nsCSSPseudoClasses { |
michael@0 | 16 | public: |
michael@0 | 17 | |
michael@0 | 18 | static void AddRefAtoms(); |
michael@0 | 19 | |
michael@0 | 20 | enum Type { |
michael@0 | 21 | #define CSS_PSEUDO_CLASS(_name, _value, _pref) \ |
michael@0 | 22 | ePseudoClass_##_name, |
michael@0 | 23 | #include "nsCSSPseudoClassList.h" |
michael@0 | 24 | #undef CSS_PSEUDO_CLASS |
michael@0 | 25 | ePseudoClass_Count, |
michael@0 | 26 | ePseudoClass_NotPseudoClass /* This value MUST be last! SelectorMatches |
michael@0 | 27 | depends on it. */ |
michael@0 | 28 | }; |
michael@0 | 29 | |
michael@0 | 30 | static Type GetPseudoType(nsIAtom* aAtom); |
michael@0 | 31 | static bool HasStringArg(Type aType); |
michael@0 | 32 | static bool HasNthPairArg(Type aType); |
michael@0 | 33 | static bool HasSelectorListArg(Type aType) { |
michael@0 | 34 | return aType == ePseudoClass_any; |
michael@0 | 35 | } |
michael@0 | 36 | static bool IsUserActionPseudoClass(Type aType); |
michael@0 | 37 | |
michael@0 | 38 | // Should only be used on types other than Count and NotPseudoClass |
michael@0 | 39 | static void PseudoTypeToString(Type aType, nsAString& aString); |
michael@0 | 40 | }; |
michael@0 | 41 | |
michael@0 | 42 | #endif /* nsCSSPseudoClasses_h___ */ |