Bug 1364361 - Part 3: Remove now-unnecessary clearing of ServoElementData from anonymous content destroyer callback. r=bz draft
authorCameron McCormack <cam@mcc.id.au>
Fri, 16 Jun 2017 17:22:34 +0800
changeset 595501 407b85beadc0e0b3a8b21c20c8aaf713abbd23c8
parent 595500 10222d2d0a542b5cfb5a874024a07a96880d6de0
child 595502 4d72f14a5c8668e3eba35de7517846b7395600b1
push id64328
push userbmo:cam@mcc.id.au
push dateFri, 16 Jun 2017 09:23:01 +0000
reviewersbz
bugs1364361
milestone56.0a1
Bug 1364361 - Part 3: Remove now-unnecessary clearing of ServoElementData from anonymous content destroyer callback. r=bz MozReview-Commit-ID: 4nCQYU9lzKD
dom/base/nsContentUtils.cpp
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -215,17 +215,16 @@
 #include "mozilla/EnumSet.h"
 #include "mozilla/BloomFilter.h"
 #include "TabChild.h"
 #include "mozilla/dom/DocGroup.h"
 #include "mozilla/dom/TabGroup.h"
 #include "nsIWebNavigationInfo.h"
 #include "nsPluginHost.h"
 #include "mozilla/HangAnnotations.h"
-#include "mozilla/ServoRestyleManager.h"
 #include "mozilla/Encoding.h"
 
 #include "nsIBidiKeyboard.h"
 
 #if defined(XP_WIN)
 // Undefine LoadImage to prevent naming conflict with Windows.
 #undef LoadImage
 #endif
@@ -5319,37 +5318,25 @@ private:
   nsCOMPtr<nsIContent> mParent;
 };
 
 /* static */
 void
 nsContentUtils::DestroyAnonymousContent(nsCOMPtr<nsIContent>* aContent)
 {
   if (*aContent) {
-    // Don't wait until UnbindFromTree to clear ServoElementData, since
-    // leak checking at shutdown can run before the AnonymousContentDestroyer
-    // runs.
-    if ((*aContent)->IsStyledByServo() && (*aContent)->IsElement()) {
-      ServoRestyleManager::ClearServoDataFromSubtree((*aContent)->AsElement());
-    }
     AddScriptRunner(new AnonymousContentDestroyer(aContent));
   }
 }
 
 /* static */
 void
 nsContentUtils::DestroyAnonymousContent(nsCOMPtr<Element>* aElement)
 {
   if (*aElement) {
-    // Don't wait until UnbindFromTree to clear ServoElementData, since
-    // leak checking at shutdown can run before the AnonymousContentDestroyer
-    // runs.
-    if ((*aElement)->IsStyledByServo()) {
-      ServoRestyleManager::ClearServoDataFromSubtree(*aElement);
-    }
     AddScriptRunner(new AnonymousContentDestroyer(aElement));
   }
 }
 
 /* static */
 void
 nsContentUtils::NotifyInstalledMenuKeyboardListener(bool aInstalling)
 {