From ea97bc0b82144009b7a0f1fdcb394c22f1daaaf2 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Tue, 29 Mar 2011 20:46:13 -0700 Subject: [PATCH] Go through the normal restyling codepath in RebuildAllStyleData so that we handle in-progress transitions correctly. (Bug 583219) r=bzbarsky --- layout/base/nsCSSFrameConstructor.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index d12d1ed6988..65ce4386fbd 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -11627,6 +11627,8 @@ nsCSSFrameConstructor::RebuildAllStyleData(nsChangeHint aExtraHint) return; } + nsPresContext *presContext = mPresShell->GetPresContext(); + presContext->SetProcessingRestyles(PR_TRUE); // Recalculate all of the style contexts for the document // Note that we can ignore the return value of ComputeStyleChangeFor // because we never need to reframe the root frame @@ -11642,6 +11644,14 @@ nsCSSFrameConstructor::RebuildAllStyleData(nsChangeHint aExtraHint) mPendingRestyles, PR_TRUE); // Process the required changes ProcessRestyledFrames(changeList); + presContext->SetProcessingRestyles(PR_FALSE); + + // Make sure that we process any pending animation restyles from the + // above style change. Note that we can *almost* implement the above + // by just posting a style change -- except we really need to restyle + // the root frame rather than the root element's primary frame. + ProcessPendingRestyles(); + // 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