mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1075137 patch 2 - Add new booleans for whether to skip animation styles and whether to post animation restyles. r=birtles
This commit is contained in:
parent
a84c0301dc
commit
ab6f8fb56c
@ -64,6 +64,8 @@ RestyleManager::RestyleManager(nsPresContext* aPresContext)
|
|||||||
, mRebuildAllStyleData(false)
|
, mRebuildAllStyleData(false)
|
||||||
, mObservingRefreshDriver(false)
|
, mObservingRefreshDriver(false)
|
||||||
, mInStyleRefresh(false)
|
, mInStyleRefresh(false)
|
||||||
|
, mSkipAnimationRules(false)
|
||||||
|
, mPostAnimationRestyles(false)
|
||||||
, mHoverGeneration(0)
|
, mHoverGeneration(0)
|
||||||
, mRebuildAllExtraHint(nsChangeHint(0))
|
, mRebuildAllExtraHint(nsChangeHint(0))
|
||||||
, mLastUpdateForThrottledAnimations(aPresContext->RefreshDriver()->
|
, mLastUpdateForThrottledAnimations(aPresContext->RefreshDriver()->
|
||||||
@ -1439,6 +1441,13 @@ RestyleManager::RebuildAllStyleData(nsChangeHint aExtraHint)
|
|||||||
#endif
|
#endif
|
||||||
mPresContext->SetProcessingRestyles(true);
|
mPresContext->SetProcessingRestyles(true);
|
||||||
|
|
||||||
|
// Until we get rid of these phases in bug 960465, we need to skip
|
||||||
|
// animation restyles during the non-animation phase, and post
|
||||||
|
// animation restyles so that we restyle those elements again in the
|
||||||
|
// animation phase.
|
||||||
|
mSkipAnimationRules = true;
|
||||||
|
mPostAnimationRestyles = true;
|
||||||
|
|
||||||
// FIXME (bug 1047928): Many of the callers probably don't need
|
// FIXME (bug 1047928): Many of the callers probably don't need
|
||||||
// eRestyle_Subtree because they're changing things that affect data
|
// eRestyle_Subtree because they're changing things that affect data
|
||||||
// computation rather than selector matching; we could have a restyle
|
// computation rather than selector matching; we could have a restyle
|
||||||
@ -1449,6 +1458,8 @@ RestyleManager::RebuildAllStyleData(nsChangeHint aExtraHint)
|
|||||||
nsRestyleHint(eRestyle_Subtree |
|
nsRestyleHint(eRestyle_Subtree |
|
||||||
eRestyle_ForceDescendants));
|
eRestyle_ForceDescendants));
|
||||||
|
|
||||||
|
mPostAnimationRestyles = false;
|
||||||
|
mSkipAnimationRules = false;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
mIsProcessingRestyles = false;
|
mIsProcessingRestyles = false;
|
||||||
#endif
|
#endif
|
||||||
@ -1539,8 +1550,18 @@ RestyleManager::ProcessPendingRestyles()
|
|||||||
UpdateOnlyAnimationStyles();
|
UpdateOnlyAnimationStyles();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Until we get rid of these phases in bug 960465, we need to skip
|
||||||
|
// animation restyles during the non-animation phase, and post
|
||||||
|
// animation restyles so that we restyle those elements again in the
|
||||||
|
// animation phase.
|
||||||
|
mSkipAnimationRules = true;
|
||||||
|
mPostAnimationRestyles = true;
|
||||||
|
|
||||||
mPendingRestyles.ProcessRestyles();
|
mPendingRestyles.ProcessRestyles();
|
||||||
|
|
||||||
|
mPostAnimationRestyles = false;
|
||||||
|
mSkipAnimationRules = false;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
uint32_t oldPendingRestyleCount = mPendingRestyles.Count();
|
uint32_t oldPendingRestyleCount = mPendingRestyles.Count();
|
||||||
#endif
|
#endif
|
||||||
|
@ -92,6 +92,22 @@ public:
|
|||||||
// track whether off-main-thread animations are up-to-date.
|
// track whether off-main-thread animations are up-to-date.
|
||||||
uint64_t GetAnimationGeneration() const { return mAnimationGeneration; }
|
uint64_t GetAnimationGeneration() const { return mAnimationGeneration; }
|
||||||
|
|
||||||
|
// Whether rule matching should skip styles associated with animation
|
||||||
|
bool SkipAnimationRules() const {
|
||||||
|
MOZ_ASSERT(mSkipAnimationRules || !mPostAnimationRestyles,
|
||||||
|
"inconsistent state");
|
||||||
|
return mSkipAnimationRules;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Whether rule matching should post animation restyles when it skips
|
||||||
|
// styles associated with animation. Only true when
|
||||||
|
// SkipAnimationRules() is also true.
|
||||||
|
bool PostAnimationRestyles() const {
|
||||||
|
MOZ_ASSERT(mSkipAnimationRules || !mPostAnimationRestyles,
|
||||||
|
"inconsistent state");
|
||||||
|
return mPostAnimationRestyles;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reparent the style contexts of this frame subtree. The parent frame of
|
* Reparent the style contexts of this frame subtree. The parent frame of
|
||||||
* aFrame must be changed to the new parent before this function is called;
|
* aFrame must be changed to the new parent before this function is called;
|
||||||
@ -427,6 +443,13 @@ private:
|
|||||||
bool mObservingRefreshDriver : 1;
|
bool mObservingRefreshDriver : 1;
|
||||||
// True if we're in the middle of a nsRefreshDriver refresh
|
// True if we're in the middle of a nsRefreshDriver refresh
|
||||||
bool mInStyleRefresh : 1;
|
bool mInStyleRefresh : 1;
|
||||||
|
// Whether rule matching should skip styles associated with animation
|
||||||
|
bool mSkipAnimationRules : 1;
|
||||||
|
// Whether rule matching should post animation restyles when it skips
|
||||||
|
// styles associated with animation. Only true when
|
||||||
|
// mSkipAnimationRules is also true.
|
||||||
|
bool mPostAnimationRestyles : 1;
|
||||||
|
|
||||||
uint32_t mHoverGeneration;
|
uint32_t mHoverGeneration;
|
||||||
nsChangeHint mRebuildAllExtraHint;
|
nsChangeHint mRebuildAllExtraHint;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user