Bug 1465175 - Remove mozAutoDocConditionalContentUpdateBatch, r=dbaron
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 30 May 2018 12:40:07 +0300
changeset 420470 f7a6b594d8000c12e44a7df96e2b962cd31f7df4
parent 420469 efd5c0553e738b8268ccd7e15447c521c80630f9
child 420471 e95948e4ac6bd6ed2973a7a07e2eeff60a2e3e8e
push id34073
push useraiakab@mozilla.com
push dateWed, 30 May 2018 22:05:51 +0000
treeherdermozilla-central@3931f461c8e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1465175
milestone62.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 1465175 - Remove mozAutoDocConditionalContentUpdateBatch, r=dbaron
dom/base/mozAutoDocUpdate.h
layout/style/nsDOMCSSAttrDeclaration.cpp
layout/style/nsDOMCSSDeclaration.cpp
--- a/dom/base/mozAutoDocUpdate.h
+++ b/dom/base/mozAutoDocUpdate.h
@@ -47,40 +47,9 @@ private:
 #define MOZ_AUTO_DOC_UPDATE_PASTE2(tok,line) tok##line
 #define MOZ_AUTO_DOC_UPDATE_PASTE(tok,line) \
   MOZ_AUTO_DOC_UPDATE_PASTE2(tok,line)
 #define MOZ_AUTO_DOC_UPDATE(doc,notify) \
   mozAutoDocUpdate MOZ_AUTO_DOC_UPDATE_PASTE(_autoDocUpdater_, __LINE__) \
   (doc,notify)
 
 
-/**
- * Creates an update batch only under certain conditions.
- * Use this rather than mozAutoDocUpdate when you expect inner updates
- * to notify but you don't always want to spec cycles creating a batch.
- * This is needed to avoid having this batch always create a blocker,
- * but then have inner mozAutoDocUpdate call the last EndUpdate before.
- * we remove that blocker. See bug 423269.
- */
-class MOZ_STACK_CLASS mozAutoDocConditionalContentUpdateBatch
-{
-public:
-  mozAutoDocConditionalContentUpdateBatch(nsIDocument* aDocument,
-                                          bool aNotify) :
-    mDocument(aNotify ? aDocument : nullptr)
-  {
-    if (mDocument) {
-      mDocument->BeginUpdate();
-    }
-  }
-
-  ~mozAutoDocConditionalContentUpdateBatch()
-  {
-    if (mDocument) {
-      mDocument->EndUpdate();
-    }
-  }
-
-private:
-  nsCOMPtr<nsIDocument> mDocument;
-};
-
 #endif
--- a/layout/style/nsDOMCSSAttrDeclaration.cpp
+++ b/layout/style/nsDOMCSSAttrDeclaration.cpp
@@ -175,17 +175,17 @@ nsDOMCSSAttributeDeclaration::SetSMILVal
   MOZ_ASSERT(mIsSMILOverride);
   // No need to do the ActiveLayerTracker / ScrollLinkedEffectDetector bits,
   // since we're in a SMIL animation anyway, no need to try to detect we're a
   // scripted animation.
   DeclarationBlock* olddecl = GetCSSDeclaration(eOperation_Modify);
   if (!olddecl) {
     return NS_ERROR_NOT_AVAILABLE;
   }
-  mozAutoDocConditionalContentUpdateBatch autoUpdate(DocToUpdate(), true);
+  mozAutoDocUpdate autoUpdate(DocToUpdate(), true);
   RefPtr<DeclarationBlock> decl = olddecl->EnsureMutable();
   bool changed = nsSMILCSSValueType::SetPropertyValues(aValue, *decl);
   if (changed) {
     SetCSSDeclaration(decl);
   }
   return NS_OK;
 }
 
--- a/layout/style/nsDOMCSSDeclaration.cpp
+++ b/layout/style/nsDOMCSSDeclaration.cpp
@@ -111,17 +111,17 @@ nsDOMCSSDeclaration::SetCssText(const ns
     return;
   }
 
   // For nsDOMCSSAttributeDeclaration, SetCSSDeclaration will lead to
   // Attribute setting code, which leads in turn to BeginUpdate.  We
   // need to start the update now so that the old rule doesn't get used
   // between when we mutate the declaration and when we set the new
   // rule (see stack in bug 209575).
-  mozAutoDocConditionalContentUpdateBatch autoUpdate(DocToUpdate(), true);
+  mozAutoDocUpdate autoUpdate(DocToUpdate(), true);
 
   ParsingEnvironment servoEnv =
     GetParsingEnvironment(aSubjectPrincipal);
   if (!servoEnv.mUrlExtraData) {
     aRv.Throw(NS_ERROR_NOT_AVAILABLE);
     return;
   }
 
@@ -253,17 +253,17 @@ nsDOMCSSDeclaration::ModifyDeclaration(n
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   // For nsDOMCSSAttributeDeclaration, SetCSSDeclaration will lead to
   // Attribute setting code, which leads in turn to BeginUpdate.  We
   // need to start the update now so that the old rule doesn't get used
   // between when we mutate the declaration and when we set the new
   // rule (see stack in bug 209575).
-  mozAutoDocConditionalContentUpdateBatch autoUpdate(DocToUpdate(), true);
+  mozAutoDocUpdate autoUpdate(DocToUpdate(), true);
   RefPtr<DeclarationBlock> decl = olddecl->EnsureMutable();
 
   bool changed;
   ParsingEnvironment servoEnv =
     GetParsingEnvironment(aSubjectPrincipal);
   if (!servoEnv.mUrlExtraData) {
     return NS_ERROR_NOT_AVAILABLE;
   }
@@ -320,17 +320,17 @@ nsDOMCSSDeclaration::RemovePropertyInter
     return NS_OK; // no decl, so nothing to remove
   }
 
   // For nsDOMCSSAttributeDeclaration, SetCSSDeclaration will lead to
   // Attribute setting code, which leads in turn to BeginUpdate.  We
   // need to start the update now so that the old rule doesn't get used
   // between when we mutate the declaration and when we set the new
   // rule (see stack in bug 209575).
-  mozAutoDocConditionalContentUpdateBatch autoUpdate(DocToUpdate(), true);
+  mozAutoDocUpdate autoUpdate(DocToUpdate(), true);
 
   RefPtr<DeclarationBlock> decl = olddecl->EnsureMutable();
   if (!decl->RemovePropertyByID(aPropID)) {
     return NS_OK;
   }
   return SetCSSDeclaration(decl);
 }
 
@@ -342,16 +342,16 @@ nsDOMCSSDeclaration::RemovePropertyInter
     return NS_OK; // no decl, so nothing to remove
   }
 
   // For nsDOMCSSAttributeDeclaration, SetCSSDeclaration will lead to
   // Attribute setting code, which leads in turn to BeginUpdate.  We
   // need to start the update now so that the old rule doesn't get used
   // between when we mutate the declaration and when we set the new
   // rule (see stack in bug 209575).
-  mozAutoDocConditionalContentUpdateBatch autoUpdate(DocToUpdate(), true);
+  mozAutoDocUpdate autoUpdate(DocToUpdate(), true);
 
   RefPtr<DeclarationBlock> decl = olddecl->EnsureMutable();
   if (!decl->RemoveProperty(aPropertyName)) {
     return NS_OK;
   }
   return SetCSSDeclaration(decl);
 }