Bug 896138 patch 8: Add setter for RestyleManager::mInStyleRefresh rather than using friend. r=heycam (within review comments for patch 4)

(The friend declaration is still needed for access to RestyleElement,
which I'd rather leave private.)
This commit is contained in:
L. David Baron 2013-07-20 12:14:25 -07:00
parent 2e0c82c9c0
commit 0a56a39306
2 changed files with 9 additions and 4 deletions

View File

@ -179,6 +179,11 @@ public:
PostRestyleEventInternal(true);
}
void SetInStyleRefresh(bool aInStyleRefresh)
{
mInStyleRefresh = aInStyleRefresh;
}
void FlushOverflowChangedTracker()
{
mOverflowChangedTracker.Flush();
@ -255,7 +260,7 @@ public:
private:
/* aMinHint is the minimal change that should be made to the element */
// XXXbz do we really need the aPrimaryFrame argument here?
void RestyleElement(Element* aElement,
void RestyleElement(Element* aElement,
nsIFrame* aPrimaryFrame,
nsChangeHint aMinHint,
RestyleTracker& aRestyleTracker,

View File

@ -139,7 +139,7 @@ RestyleTracker::DoProcessRestyles()
// processing restyles
mRestyleManager->PresContext()->FrameConstructor()->BeginUpdate();
mRestyleManager->mInStyleRefresh = true;
mRestyleManager->SetInStyleRefresh(true);
// loop so that we process any restyle events generated by processing
while (mPendingRestyles.Count()) {
@ -241,9 +241,9 @@ RestyleTracker::DoProcessRestyles()
mRestyleManager->FlushOverflowChangedTracker();
// Set mInStyleRefresh to false now, since the EndUpdate call might
// SetInStyleRefresh(false) now, since the EndUpdate call might
// add more restyles.
mRestyleManager->mInStyleRefresh = false;
mRestyleManager->SetInStyleRefresh(false);
mRestyleManager->PresContext()->FrameConstructor()->EndUpdate();