Bug 1115812 patch 6 - Move ProcessRestyles from RestyleTracker to RestyleManager. r=heycam

This is needed for the following patch, so that it can access a member
variable of RestyleManager.
This commit is contained in:
L. David Baron 2015-01-13 21:03:12 -08:00
parent e19772aa8e
commit 61bcb1749a
3 changed files with 12 additions and 15 deletions

View File

@ -1634,7 +1634,7 @@ RestyleManager::ProcessPendingRestyles()
mSkipAnimationRules = true;
mPostAnimationRestyles = true;
mPendingRestyles.ProcessRestyles();
ProcessRestyles(mPendingRestyles);
mPostAnimationRestyles = false;
mSkipAnimationRules = false;
@ -1653,7 +1653,7 @@ RestyleManager::ProcessPendingRestyles()
// property, and then posts an immediate animation style change).
MOZ_ASSERT(!mIsProcessingAnimationStyleChange, "nesting forbidden");
mIsProcessingAnimationStyleChange = true;
mPendingAnimationRestyles.ProcessRestyles();
ProcessRestyles(mPendingAnimationRestyles);
MOZ_ASSERT(mIsProcessingAnimationStyleChange, "nesting forbidden");
mIsProcessingAnimationStyleChange = false;
@ -1723,7 +1723,7 @@ RestyleManager::UpdateOnlyAnimationStyles()
transitionManager->AddStyleUpdatesTo(tracker);
animationManager->AddStyleUpdatesTo(tracker);
tracker.ProcessRestyles();
ProcessRestyles(tracker);
transitionManager->SetInAnimationOnlyStyleUpdate(false);
}

View File

@ -463,6 +463,14 @@ private:
// be performed instead.
bool RecomputePosition(nsIFrame* aFrame);
void ProcessRestyles(RestyleTracker& aRestyleTracker) {
// Fast-path the common case (esp. for the animation restyle
// tracker) of not having anything to do.
if (aRestyleTracker.Count()) {
aRestyleTracker.DoProcessRestyles();
}
}
private:
nsPresContext* mPresContext; // weak, disconnected in Disconnect

View File

@ -270,13 +270,7 @@ public:
/**
* Process the restyles we've been tracking.
*/
void ProcessRestyles() {
// Fast-path the common case (esp. for the animation restyle
// tracker) of not having anything to do.
if (mPendingRestyles.Count()) {
DoProcessRestyles();
}
}
void DoProcessRestyles();
// Return our ELEMENT_HAS_PENDING_(ANIMATION_)RESTYLE bit
uint32_t RestyleBit() const {
@ -362,11 +356,6 @@ private:
nsRestyleHint aRestyleHint,
nsChangeHint aChangeHint);
/**
* The guts of our restyle processing.
*/
void DoProcessRestyles();
typedef nsClassHashtable<nsISupportsHashKey, RestyleData> PendingRestyleTable;
typedef nsAutoTArray< nsRefPtr<Element>, 32> RestyleRootArray;
// Our restyle bits. These will be a subset of ELEMENT_ALL_RESTYLE_FLAGS, and