Bug 1596463 - Remove GetBindingParent usage in the XML pretty printer. r=smaug
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 14 Nov 2019 16:41:24 +0000
changeset 501984 8cc93a06da6629d94e26e573e56508e1143fa7ac
parent 501983 6c7a26bb6f04fe1677fd8ceb0ca914d042beea41
child 501985 cc9330b5decd89fe8bc422957398d61d89041bb1
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1596463
milestone72.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 1596463 - Remove GetBindingParent usage in the XML pretty printer. r=smaug It was already checking shadow trees as well, so trivial change. Differential Revision: https://phabricator.services.mozilla.com/D53035
dom/xml/nsXMLPrettyPrinter.cpp
--- a/dom/xml/nsXMLPrettyPrinter.cpp
+++ b/dom/xml/nsXMLPrettyPrinter.cpp
@@ -108,18 +108,18 @@ nsresult nsXMLPrettyPrinter::PrettyPrint
   return NS_OK;
 }
 
 void nsXMLPrettyPrinter::MaybeUnhook(nsIContent* aContent) {
   // If aContent is null, the document-node was modified.
   // If it is not null but in the shadow tree or the <scrollbar> NACs,
   // the change was in the generated content, and it should be ignored.
   bool isGeneratedContent =
-      !aContent ? false
-                : aContent->GetBindingParent() || aContent->IsInShadowTree();
+      aContent &&
+      (aContent->IsInNativeAnonymousSubtree() || aContent->IsInShadowTree());
 
   if (!isGeneratedContent && !mUnhookPending) {
     // Can't blindly to mUnhookPending after AddScriptRunner,
     // since AddScriptRunner _could_ in theory run us
     // synchronously
     mUnhookPending = true;
     nsContentUtils::AddScriptRunner(NewRunnableMethod(
         "nsXMLPrettyPrinter::Unhook", this, &nsXMLPrettyPrinter::Unhook));