1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/style/nsCSSPseudoClasses.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,42 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +/* atom list for CSS pseudo-classes */ 1.10 + 1.11 +#ifndef nsCSSPseudoClasses_h___ 1.12 +#define nsCSSPseudoClasses_h___ 1.13 + 1.14 +#include "nsStringFwd.h" 1.15 + 1.16 +class nsIAtom; 1.17 + 1.18 +class nsCSSPseudoClasses { 1.19 +public: 1.20 + 1.21 + static void AddRefAtoms(); 1.22 + 1.23 + enum Type { 1.24 +#define CSS_PSEUDO_CLASS(_name, _value, _pref) \ 1.25 + ePseudoClass_##_name, 1.26 +#include "nsCSSPseudoClassList.h" 1.27 +#undef CSS_PSEUDO_CLASS 1.28 + ePseudoClass_Count, 1.29 + ePseudoClass_NotPseudoClass /* This value MUST be last! SelectorMatches 1.30 + depends on it. */ 1.31 + }; 1.32 + 1.33 + static Type GetPseudoType(nsIAtom* aAtom); 1.34 + static bool HasStringArg(Type aType); 1.35 + static bool HasNthPairArg(Type aType); 1.36 + static bool HasSelectorListArg(Type aType) { 1.37 + return aType == ePseudoClass_any; 1.38 + } 1.39 + static bool IsUserActionPseudoClass(Type aType); 1.40 + 1.41 + // Should only be used on types other than Count and NotPseudoClass 1.42 + static void PseudoTypeToString(Type aType, nsAString& aString); 1.43 +}; 1.44 + 1.45 +#endif /* nsCSSPseudoClasses_h___ */