зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1269976 part 1 - Move CSSPseudoElements_flags to a static array in nsCSSPseudoElements. r=heycam
MozReview-Commit-ID: HWMuRrakCia --HG-- extra : source : fca40d54c5270d09642f329267809fb3f7447c60
This commit is contained in:
Родитель
438b9dea89
Коммит
85ca906802
|
@ -36,7 +36,8 @@ static const nsStaticAtom CSSPseudoElements_info[] = {
|
|||
// Flags data for each of the pseudo-elements, which must be separate
|
||||
// from the previous array since there's no place for it in
|
||||
// nsStaticAtom.
|
||||
static const uint32_t CSSPseudoElements_flags[] = {
|
||||
/* static */ const uint32_t
|
||||
nsCSSPseudoElements::kPseudoElementFlags[Type::Count] = {
|
||||
#define CSS_PSEUDO_ELEMENT(name_, value_, flags_) \
|
||||
flags_,
|
||||
#include "nsCSSPseudoElementList.h"
|
||||
|
@ -105,15 +106,6 @@ nsCSSPseudoElements::GetPseudoAtom(Type aType)
|
|||
static_cast<CSSPseudoElementTypeBase>(aType)].mAtom;
|
||||
}
|
||||
|
||||
/* static */ uint32_t
|
||||
nsCSSPseudoElements::FlagsForPseudoElement(const Type aType)
|
||||
{
|
||||
CSSPseudoElementTypeBase index = static_cast<CSSPseudoElementTypeBase>(aType);
|
||||
NS_ASSERTION(index < ArrayLength(CSSPseudoElements_flags),
|
||||
"argument must be a pseudo-element");
|
||||
return CSSPseudoElements_flags[index];
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
nsCSSPseudoElements::PseudoElementSupportsUserActionState(const Type aType)
|
||||
{
|
||||
|
|
|
@ -101,13 +101,14 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
static uint32_t FlagsForPseudoElement(const Type aType);
|
||||
|
||||
// Does the given pseudo-element have all of the flags given?
|
||||
static bool PseudoElementHasFlags(const Type aType, uint32_t aFlags)
|
||||
{
|
||||
return (FlagsForPseudoElement(aType) & aFlags) == aFlags;
|
||||
MOZ_ASSERT(aType < Type::Count);
|
||||
return (kPseudoElementFlags[size_t(aType)] & aFlags) == aFlags;
|
||||
}
|
||||
|
||||
static const uint32_t kPseudoElementFlags[Type::Count];
|
||||
};
|
||||
|
||||
#endif /* nsCSSPseudoElements_h___ */
|
||||
|
|
Загрузка…
Ссылка в новой задаче