Bug 1596478, remove references to kNameSpaceID_XBL except for instance in nsNameSpaceManager.cpp r=bzbarsky
authorEmma Malysz <emalysz@mozilla.com>
Tue, 07 Jan 2020 21:51:27 +0000
changeset 509208 13ced21befd3431caf64027a91130e4fd7ece4f3
parent 509207 2e7ea1ae7fa2bc51bc6471edee9d41c36d8fdfe5
child 509209 7a1d52ab1797ef11ed2c5841dc12bbf8380d6275
push id104519
push userbtara@mozilla.com
push dateTue, 07 Jan 2020 22:31:10 +0000
treeherderautoland@13ced21befd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs1596478
milestone74.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 1596478, remove references to kNameSpaceID_XBL except for instance in nsNameSpaceManager.cpp r=bzbarsky Differential Revision: https://phabricator.services.mozilla.com/D58872
dom/base/FragmentOrElement.cpp
dom/xml/nsXMLContentSink.cpp
js/xpconnect/src/XPCJSRuntime.cpp
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -1688,20 +1688,17 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
       nsAutoString classString;
       classAttrValue->ToString(classString);
       classString.ReplaceChar(char16_t('\n'), char16_t(' '));
       classes.Append(classString);
       classes.Append('\'');
     }
 
     nsAutoCString orphan;
-    if (!tmp->IsInComposedDoc() &&
-        // Ignore xbl:content, which is never in the document and hence always
-        // appears to be orphaned.
-        !tmp->NodeInfo()->Equals(nsGkAtoms::content, kNameSpaceID_XBL)) {
+    if (!tmp->IsInComposedDoc()) {
       orphan.AppendLiteral(" (orphan)");
     }
 
     static const char* kNSURIs[] = {" ([none])", " (xmlns)",  " (xml)",
                                     " (xhtml)",  " (XLink)",  " (XSLT)",
                                     " (XBL)",    " (MathML)", " (RDF)",
                                     " (XUL)",    " (SVG)",    " (XML Events)"};
     const char* nsuri = nsid < ArrayLength(kNSURIs) ? kNSURIs[nsid] : "";
--- a/dom/xml/nsXMLContentSink.cpp
+++ b/dom/xml/nsXMLContentSink.cpp
@@ -840,20 +840,18 @@ bool nsXMLContentSink::SetDocElement(int
     for (nsIContent* child : mDocumentChildren) {
       mDocument->AppendChildTo(child, false);
     }
     mDocumentChildren.Clear();
   }
 
   // check for root elements that needs special handling for
   // prettyprinting
-  if ((aNameSpaceID == kNameSpaceID_XBL && aTagName == nsGkAtoms::bindings) ||
-      (aNameSpaceID == kNameSpaceID_XSLT &&
-       (aTagName == nsGkAtoms::stylesheet ||
-        aTagName == nsGkAtoms::transform))) {
+  if (aNameSpaceID == kNameSpaceID_XSLT &&
+      (aTagName == nsGkAtoms::stylesheet || aTagName == nsGkAtoms::transform)) {
     mPrettyPrintHasSpecialRoot = true;
     if (mPrettyPrintXML) {
       // In this case, disable script execution, stylesheet
       // loading, and auto XLinks since we plan to prettyprint.
       mDocument->ScriptLoader()->SetEnabled(false);
       if (mCSSLoader) {
         mCSSLoader->SetEnabled(false);
       }
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -2189,21 +2189,17 @@ namespace xpc {
 
 class OrphanReporter : public JS::ObjectPrivateVisitor {
  public:
   explicit OrphanReporter(GetISupportsFun aGetISupports)
       : JS::ObjectPrivateVisitor(aGetISupports), mState(OrphanMallocSizeOf) {}
 
   virtual size_t sizeOfIncludingThis(nsISupports* aSupports) override {
     nsCOMPtr<nsINode> node = do_QueryInterface(aSupports);
-    // https://bugzilla.mozilla.org/show_bug.cgi?id=773533#c11 explains that we
-    // have to skip XBL elements because they violate certain assumptions.  Yuk.
-    if (!node || node->IsInComposedDoc() ||
-        (node->IsElement() &&
-         node->AsElement()->IsInNamespace(kNameSpaceID_XBL))) {
+    if (!node || node->IsInComposedDoc()) {
       return 0;
     }
 
     // This is an orphan node.  If we haven't already handled the sub-tree that
     // this node belongs to, measure the sub-tree's size and then record its
     // root so we don't measure it again.
     nsCOMPtr<nsINode> orphanTree = node->SubtreeRoot();
     if (!orphanTree || mState.HaveSeenPtr(orphanTree.get())) {