Bug 1115812 patch 20 - Add assertions that mDoRebuildAllStyleData and mInRebuildAllStyleData are false by the end of restyle processing. r=heycam
authorL. David Baron <dbaron@dbaron.org>
Tue, 13 Jan 2015 21:03:13 -0800
changeset 250818 e12e9be31708823df8f30ebdcbbc4f01223071d0
parent 250817 4c7428662fab53e6072810263955b6bcf4a01344
child 250819 a616039ccd7ba1705eec98a10c8e892b8bcf0842
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
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 20 - Add assertions that mDoRebuildAllStyleData and mInRebuildAllStyleData are false by the end of restyle processing. r=heycam These assertions are as requested in comment 30 in the bug. (If the first one doesn't fire, it's possible we could even get rid of the handling of mDoRebuildAllStyleData that it's within.)
layout/base/RestyleManager.cpp
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -1646,17 +1646,23 @@ RestyleManager::ProcessPendingRestyles()
                    "We should not have posted new non-animation restyles while "
                    "processing animation restyles");
 
   if (mDoRebuildAllStyleData) {
     // We probably wasted a lot of work up above, but this seems safest
     // and it should be rarely used.
     // This might add us as a refresh observer again; that's ok.
     ProcessPendingRestyles();
+
+    NS_ASSERTION(!mDoRebuildAllStyleData,
+                 "repeatedly setting mDoRebuildAllStyleData?");
   }
+
+  MOZ_ASSERT(!mInRebuildAllStyleData,
+             "should have called FinishRebuildAllStyleData");
 }
 
 void
 RestyleManager::BeginProcessingRestyles(RestyleTracker& aRestyleTracker)
 {
   // Make sure to not rebuild quote or counter lists while we're
   // processing restyles
   mPresContext->FrameConstructor()->BeginUpdate();