From 03a33857029373e9e7353f42c22c753ab176dfdd Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Tue, 21 Feb 2023 20:05:51 +0800 Subject: [PATCH] No issue - Move Has* function definition out of the header file for consistency --- layout/style/nsCSSPseudoClasses.cpp | 24 ++++++++++++++++++++++++ layout/style/nsCSSPseudoClasses.h | 18 +++--------------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/layout/style/nsCSSPseudoClasses.cpp b/layout/style/nsCSSPseudoClasses.cpp index 928326e399..23517ef52c 100644 --- a/layout/style/nsCSSPseudoClasses.cpp +++ b/layout/style/nsCSSPseudoClasses.cpp @@ -109,6 +109,30 @@ nsCSSPseudoClasses::HasSingleSelectorArg(Type aType) 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 nsCSSPseudoClasses::PseudoTypeToString(Type aType, nsAString& aString) { diff --git a/layout/style/nsCSSPseudoClasses.h b/layout/style/nsCSSPseudoClasses.h index 76fcef3f78..99c05b019f 100644 --- a/layout/style/nsCSSPseudoClasses.h +++ b/layout/style/nsCSSPseudoClasses.h @@ -59,21 +59,9 @@ public: static bool HasStringArg(Type aType); static bool HasNthPairArg(Type aType); static bool HasSingleSelectorArg(Type aType); - static bool HasForgivingSelectorListArg(Type aType) { - return aType == Type::is || - aType == Type::matches || - 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 HasForgivingSelectorListArg(Type aType); + static bool HasSelectorListArg(Type aType); + static bool HasOptionalSelectorListArg(Type aType); static bool IsUserActionPseudoClass(Type aType); // Should only be used on types other than Count and NotPseudoClass