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 223721 e12e9be31708823df8f30ebdcbbc4f01223071d0
parent 223720 4c7428662fab53e6072810263955b6bcf4a01344
child 223722 a616039ccd7ba1705eec98a10c8e892b8bcf0842
push id10811
push usercbook@mozilla.com
push dateWed, 14 Jan 2015 13:52:17 +0000
treeherderfx-team@b8d38d19dbd9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1115812
milestone38.0a1
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();