No issue - Move Has* function definition out of the header file for consistency

This commit is contained in:
FranklinDM 2023-02-21 20:05:51 +08:00 • committed by roytam1
commit 03a3385702
2 changed files with 27 additions and 15 deletions

View file

@ -109,6 +109,30 @@ nsCSSPseudoClasses::HasSingleSelectorArg(Type aType)
aType == Type::hostContext; aType == Type::hostContext;
} }
bool
nsCSSPseudoClasses::HasForgivingSelectorListArg(Type aType)
{
return aType == Type::is ||
aType == Type::matches ||
aType == Type::any ||
aType == Type::where;
}
bool
nsCSSPseudoClasses::HasSelectorListArg(Type aType)
{
return HasForgivingSelectorListArg(aType) ||
aType == Type::mozAny ||
aType == Type::host ||
aType == Type::hostContext;
}
bool
nsCSSPseudoClasses::HasOptionalSelectorListArg(Type aType)
{
return aType == Type::host;
}
void void
nsCSSPseudoClasses::PseudoTypeToString(Type aType, nsAString& aString) nsCSSPseudoClasses::PseudoTypeToString(Type aType, nsAString& aString)
{ {

View file

@ -59,21 +59,9 @@ public:
static bool HasStringArg(Type aType); static bool HasStringArg(Type aType);
static bool HasNthPairArg(Type aType); static bool HasNthPairArg(Type aType);
static bool HasSingleSelectorArg(Type aType); static bool HasSingleSelectorArg(Type aType);
static bool HasForgivingSelectorListArg(Type aType) { static bool HasForgivingSelectorListArg(Type aType);
return aType == Type::is || static bool HasSelectorListArg(Type aType);
aType == Type::matches || static bool HasOptionalSelectorListArg(Type aType);
aType == Type::any ||
aType == Type::where;
}
static bool HasSelectorListArg(Type aType) {
return HasForgivingSelectorListArg(aType) ||
aType == Type::mozAny ||
aType == Type::host ||
aType == Type::hostContext;
}
static bool HasOptionalSelectorListArg(Type aType) {
return aType == Type::host;
}
static bool IsUserActionPseudoClass(Type aType); static bool IsUserActionPseudoClass(Type aType);
// Should only be used on types other than Count and NotPseudoClass // Should only be used on types other than Count and NotPseudoClass