Backed out changeset 65c77754d49c (bug 1364361)

This commit is contained in:
Sebastian Hengst 2017-06-16 11:18:23 +02:00
parent 18f74a4448
commit 3ed689e8af

View File

@ -220,6 +220,7 @@
#include "nsIWebNavigationInfo.h"
#include "nsPluginHost.h"
#include "mozilla/HangAnnotations.h"
#include "mozilla/ServoRestyleManager.h"
#include "mozilla/Encoding.h"
#include "nsIBidiKeyboard.h"
@ -5323,6 +5324,12 @@ 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));
}
}
@ -5332,6 +5339,12 @@ 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));
}
}