Bug 1115812 patch 12 - Null-check the root frame in StartRebuildAllStyleData. r=heycam

In the new way of doing a rebuild-all, StartRebuildAllStyleData might be
called directly from ProcessPendingRestyles rather than from
RebuildAllStyleData (which null-checks the root frame) or from within
processing restyles (which can only happen when there's a root frame).
This means it needs its own null-check of the root frame.
This commit is contained in:
L. David Baron 2015-01-13 21:03:12 -08:00
parent b8e6ffef57
commit 504d9a46e0

View File

@ -1533,6 +1533,12 @@ RestyleManager::StartRebuildAllStyleData(RestyleTracker& aRestyleTracker)
{
MOZ_ASSERT(mIsProcessingRestyles);
nsIFrame* rootFrame = mPresContext->PresShell()->GetRootFrame();
if (!rootFrame) {
// No need to do anything.
return;
}
mInRebuildAllStyleData = true;
// Tell the style set to get the old rule tree out of the way
@ -1580,7 +1586,7 @@ RestyleManager::StartRebuildAllStyleData(RestyleTracker& aRestyleTracker)
// XXX Does it matter that we're passing aExtraHint to the real root
// frame and not the root node's primary frame? (We could do
// roughly what we do for aRestyleHint above.)
ComputeAndProcessStyleChange(mPresContext->PresShell()->GetRootFrame(),
ComputeAndProcessStyleChange(rootFrame,
changeHint, aRestyleTracker, restyleHint);
}