Bug 625289 patch 4 - Add member variable to restyle manager for currently reframing style contexts. r=heycam

This commit is contained in:
L. David Baron 2014-08-13 15:39:01 -07:00
parent 88fff1692f
commit 590dd26954
2 changed files with 13 additions and 0 deletions

View File

@ -55,6 +55,7 @@ RestyleManager::RestyleManager(nsPresContext* aPresContext)
, mLastUpdateForThrottledAnimations(aPresContext->RefreshDriver()->
MostRecentRefresh())
, mAnimationGeneration(0)
, mReframingStyleContexts(nullptr)
, mPendingRestyles(ELEMENT_HAS_PENDING_RESTYLE |
ELEMENT_IS_POTENTIAL_RESTYLE_ROOT)
, mPendingAnimationRestyles(ELEMENT_HAS_PENDING_ANIMATION_RESTYLE |

View File

@ -42,6 +42,8 @@ private:
// Private destructor, to discourage deletion outside of Release():
~RestyleManager()
{
MOZ_ASSERT(!mReframingStyleContexts,
"temporary member should be nulled out before destruction");
}
public:
@ -150,6 +152,14 @@ public:
ReframingStyleContextTable mAfterPseudoContexts;
};
/**
* Return the current ReframingStyleContexts struct, or null if we're
* not currently in a restyling operation.
*/
ReframingStyleContexts* GetReframingStyleContexts() {
return mReframingStyleContexts;
}
private:
void RestyleForEmptyChange(Element* aContainer);
@ -331,6 +341,8 @@ private:
// Used to keep the layer and animation manager in sync.
uint64_t mAnimationGeneration;
ReframingStyleContexts* mReframingStyleContexts;
RestyleTracker mPendingRestyles;
RestyleTracker mPendingAnimationRestyles;
};