mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1244049 - Part 3: Replace the type of nsCSSSelector::mPseudoType. r=dbaron
This commit is contained in:
parent
4498bf3a00
commit
8a89aa994d
@ -314,11 +314,9 @@ nsCSSSelector::nsCSSSelector(void)
|
||||
mNext(nullptr),
|
||||
mNameSpace(kNameSpaceID_Unknown),
|
||||
mOperator(0),
|
||||
mPseudoType(static_cast<int16_t>(CSSPseudoElementType::NotPseudo))
|
||||
mPseudoType(CSSPseudoElementType::NotPseudo)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsCSSSelector);
|
||||
static_assert(static_cast<int16_t>(CSSPseudoElementType::MAX) < INT16_MAX,
|
||||
"CSSPseudoElementType values overflow mPseudoType");
|
||||
}
|
||||
|
||||
nsCSSSelector*
|
||||
@ -333,7 +331,7 @@ nsCSSSelector::Clone(bool aDeepNext, bool aDeepNegations) const
|
||||
result->mCasedTag = mCasedTag;
|
||||
result->mOperator = mOperator;
|
||||
result->mPseudoType = mPseudoType;
|
||||
|
||||
|
||||
NS_IF_CLONE(mIDList);
|
||||
NS_IF_CLONE(mClassList);
|
||||
NS_IF_CLONE(mPseudoClassList);
|
||||
|
@ -25,6 +25,7 @@ class nsIAtom;
|
||||
struct nsCSSSelectorList;
|
||||
|
||||
namespace mozilla {
|
||||
enum class CSSPseudoElementType : uint8_t;
|
||||
class CSSStyleSheet;
|
||||
} // namespace mozilla
|
||||
|
||||
@ -208,11 +209,9 @@ private:
|
||||
|
||||
public:
|
||||
// Get and set the selector's pseudo type
|
||||
mozilla::CSSPseudoElementType PseudoType() const {
|
||||
return static_cast<mozilla::CSSPseudoElementType>(mPseudoType);
|
||||
}
|
||||
mozilla::CSSPseudoElementType PseudoType() const { return mPseudoType; }
|
||||
void SetPseudoType(mozilla::CSSPseudoElementType aType) {
|
||||
mPseudoType = static_cast<int16_t>(aType);
|
||||
mPseudoType = aType;
|
||||
}
|
||||
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
@ -233,8 +232,9 @@ public:
|
||||
int32_t mNameSpace;
|
||||
char16_t mOperator;
|
||||
private:
|
||||
// int16_t to make sure it packs well with mOperator
|
||||
int16_t mPseudoType;
|
||||
// The underlying type of CSSPseudoElementType is uint8_t and
|
||||
// it packs well with mOperator. (char16_t + uint8_t is less than 32bits.)
|
||||
mozilla::CSSPseudoElementType mPseudoType;
|
||||
|
||||
nsCSSSelector(const nsCSSSelector& aCopy) = delete;
|
||||
nsCSSSelector& operator=(const nsCSSSelector& aCopy) = delete;
|
||||
|
Loading…
Reference in New Issue
Block a user