Bug 1115812 patch 13 - Make RebuildAllStyleData use the normal ProcessPendingRestyles() codepath. r=heycam
authorL. David Baron <dbaron@dbaron.org>
Tue, 13 Jan 2015 21:03:12 -0800
changeset 250811 b939cbd6e0e17591be57a4ab6a6d98bed3db0735
parent 250810 dee1be6469184a7236b542ba677cccb7142a1611
child 250812 85c66f81ce8d73e26e1c9cbc4a81435ed8276178
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1115812, 1110277
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1115812 patch 13 - Make RebuildAllStyleData use the normal ProcessPendingRestyles() codepath. r=heycam This switches RebuildAllStyleData() to the normal ProcessPendingRestyles() manner of restyle processing. This means a rebuild-all going through this codepath (the main rebuild-all codepath) only sets up for non-animation restyle processing once rather than doing it twice (and potentially having reframes posted in DoRebuildAllStyleData() that don't get processed until ProcessPendingRestyles(), which causes a variant of bug 1110277 with transitions on reframed elements failing to start because it doesn't match the lifetime of the ReframingStyleContexts).
layout/base/RestyleManager.cpp
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -1496,40 +1496,18 @@ RestyleManager::RebuildAllStyleData(nsCh
   nsCOMPtr<nsIPresShell> kungFuDeathGrip(presShell);
 
   // We may reconstruct frames below and hence process anything that is in the
   // tree. We don't want to get notified to process those items again after.
   presShell->GetDocument()->FlushPendingNotifications(Flush_ContentAndNotify);
 
   nsAutoScriptBlocker scriptBlocker;
 
-  MOZ_ASSERT(!mIsProcessingRestyles, "Nesting calls to processing restyles");
-#ifdef DEBUG
-  mIsProcessingRestyles = true;
-#endif
-
-  // Until we get rid of these phases in bug 960465, we need to skip
-  // animation restyles during the non-animation phase, and post
-  // animation restyles so that we restyle those elements again in the
-  // animation phase.
-  mSkipAnimationRules = true;
-  mPostAnimationRestyles = true;
-
-  DoRebuildAllStyleData(mPendingRestyles);
-
-  mPostAnimationRestyles = false;
-  mSkipAnimationRules = false;
-#ifdef DEBUG
-  mIsProcessingRestyles = false;
-#endif
-
-  // 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.
+  mDoRebuildAllStyleData = true;
+
   ProcessPendingRestyles();
 }
 
 void
 RestyleManager::StartRebuildAllStyleData(RestyleTracker& aRestyleTracker)
 {
   MOZ_ASSERT(mIsProcessingRestyles);
 
@@ -1614,22 +1592,16 @@ RestyleManager::FinishRebuildAllStyleDat
 
 void
 RestyleManager::ProcessPendingRestyles()
 {
   NS_PRECONDITION(mPresContext->Document(), "No document?  Pshaw!");
   NS_PRECONDITION(!nsContentUtils::IsSafeToRunScript(),
                   "Missing a script blocker!");
 
-  if (mDoRebuildAllStyleData) {
-    RebuildAllStyleData(nsChangeHint(0), nsRestyleHint(0));
-    MOZ_ASSERT(mPendingRestyles.Count() == 0);
-    return;
-  }
-
   // First do any queued-up frame creation.  (We should really
   // merge this into the rest of the process, though; see bug 827239.)
   mPresContext->FrameConstructor()->CreateNeededFrames();
 
   // Process non-animation restyles...
   NS_ABORT_IF_FALSE(!mIsProcessingRestyles,
                     "Nesting calls to ProcessPendingRestyles?");
 #ifdef DEBUG