Bug 1115812 patch 9 - Move the end part of the rebuild-all process to RestyleManager::EndProcessingRestyles. r=heycam

This moves the code that finishes the rebuild-all process into
EndProcessingRestyles(), which is part of the main restyling codepath.

Patch 7 ensures that we'll always get to EndProcessingRestyles in this
case, when we're going through the normal ProcessPendingRestyles()
codepath rather than the special DoRebuildAllStyleData() codepath (which
will be removed later in this patch series).
This commit is contained in:
L. David Baron 2015-01-13 21:03:12 -08:00
Родитель 4991382cc8
Коммит 9815b54790
2 изменённых файлов: 19 добавлений и 9 удалений

Просмотреть файл

@ -1582,17 +1582,21 @@ RestyleManager::DoRebuildAllStyleData(RestyleTracker& aRestyleTracker)
changeHint, aRestyleTracker, restyleHint);
EndProcessingRestyles();
}
if (mInRebuildAllStyleData) {
// Tell the style set it's safe to destroy the old rule tree. We
// must do this after the ProcessRestyledFrames call in case the
// change list has frame reconstructs in it (since frames to be
// reconstructed will still have their old style context pointers
// until they are destroyed).
mPresContext->StyleSet()->EndReconstruct();
void
RestyleManager::FinishRebuildAllStyleData()
{
MOZ_ASSERT(mInRebuildAllStyleData, "bad caller");
mInRebuildAllStyleData = false;
}
// Tell the style set it's safe to destroy the old rule tree. We
// must do this after the ProcessRestyledFrames call in case the
// change list has frame reconstructs in it (since frames to be
// reconstructed will still have their old style context pointers
// until they are destroyed).
mPresContext->StyleSet()->EndReconstruct();
mInRebuildAllStyleData = false;
}
void
@ -1694,6 +1698,10 @@ RestyleManager::EndProcessingRestyles()
// add more restyles.
mInStyleRefresh = false;
if (mInRebuildAllStyleData) {
FinishRebuildAllStyleData();
}
mPresContext->FrameConstructor()->EndUpdate();
#ifdef DEBUG

Просмотреть файл

@ -453,6 +453,8 @@ private:
RestyleTracker& aRestyleTracker,
nsRestyleHint aRestyleHint);
void FinishRebuildAllStyleData();
void StyleChangeReflow(nsIFrame* aFrame, nsChangeHint aHint);
// Recursively add all the given frame and all children to the tracker.