Bug 1921267 - Remove global constructor from dom/events/WheelHandlingHelper.cpp r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D223860
This commit is contained in:
serge-sans-paille 2024-10-02 19:41:38 +00:00
parent cb41d55f7d
commit 32484440ba
2 changed files with 7 additions and 6 deletions

View File

@ -118,8 +118,9 @@ WheelHandlingUtils::GetDisregardedWheelScrollDirection(const nsIFrame* aFrame) {
/* mozilla::WheelTransaction */
/******************************************************************/
AutoWeakFrame WheelTransaction::sScrollTargetFrame(nullptr);
AutoWeakFrame WheelTransaction::sEventTargetFrame(nullptr);
MOZ_CONSTINIT AutoWeakFrame WheelTransaction::sScrollTargetFrame;
MOZ_CONSTINIT AutoWeakFrame WheelTransaction::sEventTargetFrame;
bool WheelTransaction::sHandledByApz(false);
uint32_t WheelTransaction::sTime = 0;
uint32_t WheelTransaction::sMouseMoved = 0;
@ -473,9 +474,9 @@ DeltaValues WheelTransaction::OverrideSystemScrollSpeed(
/* mozilla::ScrollbarsForWheel */
/******************************************************************/
AutoWeakFrame ScrollbarsForWheel::sActiveOwner = nullptr;
AutoWeakFrame ScrollbarsForWheel::sActivatedScrollTargets[kNumberOfTargets] = {
nullptr, nullptr, nullptr, nullptr};
MOZ_CONSTINIT AutoWeakFrame ScrollbarsForWheel::sActiveOwner;
MOZ_CONSTINIT AutoWeakFrame
ScrollbarsForWheel::sActivatedScrollTargets[kNumberOfTargets];
bool ScrollbarsForWheel::sHadWheelStart = false;
bool ScrollbarsForWheel::sOwnWheelTransaction = false;

View File

@ -5627,7 +5627,7 @@ MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(nsIFrame::ReflowChildFlags)
class WeakFrame;
class MOZ_NONHEAP_CLASS AutoWeakFrame {
public:
explicit AutoWeakFrame() : mPrev(nullptr), mFrame(nullptr) {}
explicit constexpr AutoWeakFrame() : mPrev(nullptr), mFrame(nullptr) {}
AutoWeakFrame(const AutoWeakFrame& aOther) : mPrev(nullptr), mFrame(nullptr) {
Init(aOther.GetFrame());