Bug 483341. End updates before removing script blockers. r=smaug, sr=sicking
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 16 Mar 2009 07:46:32 -0400
changeset 26217 f5c8bd3c3b8299691a0549cff084bb8d686b9c4d
parent 26216 a49759b39e1ebfb6ad66e34c69dd636c27318592
child 26218 12e163f4f2722bf14bf6e0276c3d31293b538174
push id5954
push userbzbarsky@mozilla.com
push dateMon, 16 Mar 2009 11:50:31 +0000
treeherdermozilla-central@12e163f4f272 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, sicking
bugs483341
milestone1.9.2a1pre
Bug 483341. End updates before removing script blockers. r=smaug, sr=sicking
content/base/src/nsDocument.cpp
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -3689,36 +3689,36 @@ void
 nsDocument::BeginUpdate(nsUpdateType aUpdateType)
 {
   if (mUpdateNestLevel == 0 && !mInXBLUpdate) {
     mInXBLUpdate = PR_TRUE;
     BindingManager()->BeginOutermostUpdate();
   }
   
   ++mUpdateNestLevel;
-  NS_DOCUMENT_NOTIFY_OBSERVERS(BeginUpdate, (this, aUpdateType));
-
   if (aUpdateType == UPDATE_CONTENT_MODEL) {
     nsContentUtils::AddRemovableScriptBlocker();
   }
   else {
     nsContentUtils::AddScriptBlocker();
   }
+  NS_DOCUMENT_NOTIFY_OBSERVERS(BeginUpdate, (this, aUpdateType));
 }
 
 void
 nsDocument::EndUpdate(nsUpdateType aUpdateType)
 {
+  NS_DOCUMENT_NOTIFY_OBSERVERS(EndUpdate, (this, aUpdateType));
+
   if (aUpdateType == UPDATE_CONTENT_MODEL) {
     nsContentUtils::RemoveRemovableScriptBlocker();
   }
   else {
     nsContentUtils::RemoveScriptBlocker();
   }
-  NS_DOCUMENT_NOTIFY_OBSERVERS(EndUpdate, (this, aUpdateType));
 
   --mUpdateNestLevel;
 
   // This set of updates may have created XBL bindings.  Let the
   // binding manager know we're done.
   MaybeEndOutermostXBLUpdate();
 
   MaybeInitializeFinalizeFrameLoaders();