Bug 1450652 - Remove platform support for display="" in XBL bindings. r=mats
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 06 Mar 2019 00:47:13 +0000
changeset 462534 5edf9199407c
parent 462533 5b5c05af88e2
child 462535 6ec4f0415d9a
push id35655
push userncsoregi@mozilla.com
push dateWed, 06 Mar 2019 16:12:01 +0000
treeherdermozilla-central@0d659b1c6de3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1450652
milestone67.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 1450652 - Remove platform support for display="" in XBL bindings. r=mats Differential Revision: https://phabricator.services.mozilla.com/D12586
dom/xbl/nsBindingManager.cpp
dom/xbl/nsBindingManager.h
dom/xbl/nsXBLBinding.cpp
dom/xbl/nsXBLBinding.h
dom/xbl/nsXBLPrototypeBinding.cpp
dom/xbl/nsXBLPrototypeBinding.h
dom/xbl/nsXBLSerialize.h
dom/xbl/test/test_bug378518.xul
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsCSSFrameConstructor.h
layout/reftests/bugs/560455-1-ref.xul
layout/reftests/bugs/560455-1.xul
layout/reftests/bugs/reftest.list
layout/reftests/svg/moz-only/reftest.list
layout/reftests/svg/moz-only/xbl-basic-03.svg
layout/xul/nsSplitterFrame.cpp
toolkit/content/tests/chrome/test_bug562554.xul
--- a/dom/xbl/nsBindingManager.cpp
+++ b/dom/xbl/nsBindingManager.cpp
@@ -199,32 +199,16 @@ void nsBindingManager::RemovedFromDocume
 
     aContent->AsElement()->SetXBLBinding(nullptr, this);
   }
 
   // Clear out insertion point and content lists.
   aContent->SetXBLInsertionPoint(nullptr);
 }
 
-nsAtom* nsBindingManager::ResolveTag(nsIContent* aContent,
-                                     int32_t* aNameSpaceID) {
-  nsXBLBinding* binding = aContent->GetXBLBinding();
-
-  if (binding) {
-    nsAtom* base = binding->GetBaseTag(aNameSpaceID);
-
-    if (base) {
-      return base;
-    }
-  }
-
-  *aNameSpaceID = aContent->GetNameSpaceID();
-  return aContent->NodeInfo()->NameAtom();
-}
-
 nsINodeList* nsBindingManager::GetAnonymousNodesFor(nsIContent* aContent) {
   nsXBLBinding* binding = GetBindingWithContent(aContent);
   return binding ? binding->GetAnonymousNodeList() : nullptr;
 }
 
 nsresult nsBindingManager::ClearBinding(Element* aElement) {
   // Hold a ref to the binding so it won't die when we remove it from our table
   RefPtr<nsXBLBinding> binding = aElement ? aElement->GetXBLBinding() : nullptr;
--- a/dom/xbl/nsBindingManager.h
+++ b/dom/xbl/nsBindingManager.h
@@ -71,18 +71,16 @@ class nsBindingManager final : public ns
     if (aContent->HasFlag(NODE_MAY_BE_IN_BINDING_MNGR)) {
       RemovedFromDocumentInternal(aContent, aOldDocument, aDestructorHandling);
     }
   }
   void RemovedFromDocumentInternal(nsIContent* aContent,
                                    mozilla::dom::Document* aOldDocument,
                                    DestructorHandling aDestructorHandling);
 
-  nsAtom* ResolveTag(nsIContent* aContent, int32_t* aNameSpaceID);
-
   /**
    * Return the nodelist of "anonymous" kids for this node.  This might
    * actually include some of the nodes actual DOM kids, if there are
    * <children> tags directly as kids of <content>.  This will only end up
    * returning a non-null list for nodes which have a binding attached.
    */
   nsINodeList* GetAnonymousNodesFor(nsIContent* aContent);
 
--- a/dom/xbl/nsXBLBinding.cpp
+++ b/dom/xbl/nsXBLBinding.cpp
@@ -508,23 +508,16 @@ nsresult nsXBLBinding::InstallImplementa
 
   // iterate through each property in the prototype's list and install the
   // property.
   if (AllowScripts()) return mPrototypeBinding->InstallImplementation(this);
 
   return NS_OK;
 }
 
-nsAtom* nsXBLBinding::GetBaseTag(int32_t* aNameSpaceID) {
-  nsAtom* tag = mPrototypeBinding->GetBaseTag(aNameSpaceID);
-  if (!tag && mNextBinding) return mNextBinding->GetBaseTag(aNameSpaceID);
-
-  return tag;
-}
-
 void nsXBLBinding::AttributeChanged(nsAtom* aAttribute, int32_t aNameSpaceID,
                                     bool aRemoveFlag, bool aNotify) {
   // XXX Change if we ever allow multiple bindings in a chain to contribute
   // anonymous content
   if (!mContent) {
     if (mNextBinding)
       mNextBinding->AttributeChanged(aAttribute, aNameSpaceID, aRemoveFlag,
                                      aNotify);
--- a/dom/xbl/nsXBLBinding.h
+++ b/dom/xbl/nsXBLBinding.h
@@ -103,17 +103,16 @@ class nsXBLBinding final {
                                      bool aNullParent = true);
   void InstallEventHandlers();
   nsresult InstallImplementation();
 
   void ExecuteAttachedHandler();
   void ExecuteDetachedHandler();
   void UnhookEventHandlers();
 
-  nsAtom* GetBaseTag(int32_t* aNameSpaceID);
   nsXBLBinding* RootBinding();
 
   // Resolve all the fields for this binding and all ancestor bindings on the
   // object |obj|.  False return means a JS exception was set.
   bool ResolveAllFields(JSContext* cx, JS::Handle<JSObject*> obj) const;
 
   void AttributeChanged(nsAtom* aAttribute, int32_t aNameSpaceID,
                         bool aRemoveFlag, bool aNotify);
--- a/dom/xbl/nsXBLPrototypeBinding.cpp
+++ b/dom/xbl/nsXBLPrototypeBinding.cpp
@@ -111,18 +111,17 @@ nsXBLPrototypeBinding::nsXBLPrototypeBin
     : mImplementation(nullptr),
       mBaseBinding(nullptr),
       mInheritStyle(true),
       mCheckedBaseProto(false),
       mKeyHandlersRegistered(false),
       mBindToUntrustedContent(false),
       mSimpleScopeChain(false),
       mResources(nullptr),
-      mXBLDocInfoWeak(nullptr),
-      mBaseNameSpaceID(kNameSpaceID_None) {
+      mXBLDocInfoWeak(nullptr) {
   MOZ_COUNT_CTOR(nsXBLPrototypeBinding);
 }
 
 nsresult nsXBLPrototypeBinding::Init(const nsACString& aID,
                                      nsXBLDocumentInfo* aInfo,
                                      Element* aElement, bool aFirstBinding) {
   nsresult rv;
   nsCOMPtr<nsIURI> bindingURI = aInfo->DocumentURI();
@@ -366,30 +365,16 @@ void nsXBLPrototypeBinding::AttributeCha
         }
       }
     }
 
     xblAttr = xblAttr->GetNext();
   }
 }
 
-void nsXBLPrototypeBinding::SetBaseTag(int32_t aNamespaceID, nsAtom* aTag) {
-  mBaseNameSpaceID = aNamespaceID;
-  mBaseTag = aTag;
-}
-
-nsAtom* nsXBLPrototypeBinding::GetBaseTag(int32_t* aNamespaceID) {
-  if (mBaseTag) {
-    *aNamespaceID = mBaseNameSpaceID;
-    return mBaseTag;
-  }
-
-  return nullptr;
-}
-
 bool nsXBLPrototypeBinding::ImplementsInterface(REFNSIID aIID) const {
   // Check our IID table.
   return !!mInterfaceTable.GetWeak(aIID);
 }
 
 // Internal helpers ////////////////////////////////////////////////////////////
 
 Element* nsXBLPrototypeBinding::GetImmediateChild(nsAtom* aTag) {
@@ -735,26 +720,16 @@ nsresult nsXBLPrototypeBinding::Read(nsI
   NS_ENSURE_SUCCESS(rv, rv);
   mCheckedBaseProto = true;
 
   if (!baseBindingURI.IsEmpty()) {
     rv = NS_NewURI(getter_AddRefs(mBaseBindingURI), baseBindingURI);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
-  rv = ReadNamespace(aStream, mBaseNameSpaceID);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsAutoString baseTag;
-  rv = aStream->ReadString(baseTag);
-  NS_ENSURE_SUCCESS(rv, rv);
-  if (!baseTag.IsEmpty()) {
-    mBaseTag = NS_Atomize(baseTag);
-  }
-
   mBinding = aDocument->CreateElem(NS_LITERAL_STRING("binding"), nullptr,
                                    kNameSpaceID_XBL);
 
   nsCOMPtr<nsIContent> child;
   rv = ReadContentNode(aStream, aDocument, aDocument->NodeInfoManager(),
                        getter_AddRefs(child));
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -955,26 +930,16 @@ nsresult nsXBLPrototypeBinding::Write(ns
   if (mBaseBindingURI) {
     rv = mBaseBindingURI->GetSpec(extends);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   rv = aStream->WriteStringZ(extends.get());
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = WriteNamespace(aStream, mBaseNameSpaceID);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsAutoString baseTag;
-  if (mBaseTag) {
-    mBaseTag->ToString(baseTag);
-  }
-  rv = aStream->WriteWStringZ(baseTag.get());
-  NS_ENSURE_SUCCESS(rv, rv);
-
   nsIContent* content = GetImmediateChild(nsGkAtoms::content);
   if (content) {
     rv = WriteContentNode(aStream, content);
     NS_ENSURE_SUCCESS(rv, rv);
   } else {
     // Write a marker to indicate that there is no content.
     rv = aStream->Write8(XBLBinding_Serialize_NoContent);
     NS_ENSURE_SUCCESS(rv, rv);
@@ -1397,111 +1362,34 @@ nsresult nsXBLPrototypeBinding::WriteNam
     nsAutoString namesp;
     nsContentUtils::NameSpaceManager()->GetNameSpaceURI(aNameSpaceID, namesp);
     aStream->WriteWStringZ(namesp.get());
   }
 
   return NS_OK;
 }
 
-bool CheckTagNameWhiteList(int32_t aNameSpaceID, nsAtom* aTagName) {
-  static Element::AttrValuesArray kValidXULTagNames[] = {
-      nsGkAtoms::box,       nsGkAtoms::browser,
-      nsGkAtoms::button,    nsGkAtoms::hbox,
-      nsGkAtoms::image,     nsGkAtoms::menu,
-      nsGkAtoms::menubar,   nsGkAtoms::menuitem,
-      nsGkAtoms::menupopup, nsGkAtoms::row,
-      nsGkAtoms::slider,    nsGkAtoms::spacer,
-      nsGkAtoms::splitter,  nsGkAtoms::text,
-      nsGkAtoms::tree,      nullptr};
-
-  uint32_t i;
-  if (aNameSpaceID == kNameSpaceID_XUL) {
-    for (i = 0; kValidXULTagNames[i]; ++i) {
-      if (aTagName == kValidXULTagNames[i]) {
-        return true;
-      }
-    }
-  } else if (aNameSpaceID == kNameSpaceID_SVG &&
-             aTagName == nsGkAtoms::generic_) {
-    return true;
-  }
-
-  return false;
-}
-
 nsresult nsXBLPrototypeBinding::ResolveBaseBinding() {
   if (mCheckedBaseProto) return NS_OK;
   mCheckedBaseProto = true;
 
-  nsCOMPtr<Document> doc = mXBLDocInfoWeak->GetDocument();
+  RefPtr<Document> doc = mXBLDocInfoWeak->GetDocument();
 
-  // Check for the presence of 'extends' and 'display' attributes
-  nsAutoString display, extends;
-  mBinding->GetAttr(kNameSpaceID_None, nsGkAtoms::extends, extends);
-  if (extends.IsEmpty()) return NS_OK;
-
-  mBinding->GetAttr(kNameSpaceID_None, nsGkAtoms::display, display);
-  bool hasDisplay = !display.IsEmpty();
-
-  nsAutoString value(extends);
+  NS_WARNING_ASSERTION(!mBinding->HasAttr(nsGkAtoms::display),
+                       "display is no longer supported");
 
-  // Now slice 'em up to see what we've got.
-  nsAutoString prefix;
-  int32_t offset;
-  if (hasDisplay) {
-    offset = display.FindChar(':');
-    if (-1 != offset) {
-      display.Left(prefix, offset);
-      display.Cut(0, offset + 1);
-    }
-  } else {
-    offset = extends.FindChar(':');
-    if (-1 != offset) {
-      extends.Left(prefix, offset);
-      extends.Cut(0, offset + 1);
-      display = extends;
-    }
+  // Check for the presence of 'extends'.
+  nsAutoString extends;
+  mBinding->GetAttr(kNameSpaceID_None, nsGkAtoms::extends, extends);
+  if (extends.IsEmpty()) {
+    return NS_OK;
   }
 
-  nsAutoString nameSpace;
-
-  if (!prefix.IsEmpty()) {
-    mBinding->LookupNamespaceURI(prefix, nameSpace);
-    if (!nameSpace.IsEmpty()) {
-      int32_t nameSpaceID = nsContentUtils::NameSpaceManager()->GetNameSpaceID(
-          nameSpace, nsContentUtils::IsChromeDoc(doc));
-
-      RefPtr<nsAtom> tagName = NS_Atomize(display);
-      // Check the white list
-      if (!CheckTagNameWhiteList(nameSpaceID, tagName)) {
-        const char16_t* params[] = {display.get()};
-        nsContentUtils::ReportToConsole(
-            nsIScriptError::errorFlag, NS_LITERAL_CSTRING("XBL"), nullptr,
-            nsContentUtils::eXBL_PROPERTIES, "InvalidExtendsBinding", params,
-            ArrayLength(params), doc->GetDocumentURI());
-        NS_ASSERTION(
-            !nsXBLService::IsChromeOrResourceURI(doc->GetDocumentURI()),
-            "Invalid extends value");
-        return NS_ERROR_ILLEGAL_VALUE;
-      }
-
-      SetBaseTag(nameSpaceID, tagName);
-    }
-  }
-
-  if (hasDisplay || nameSpace.IsEmpty()) {
-    mBinding->UnsetAttr(kNameSpaceID_None, nsGkAtoms::extends, false);
-    mBinding->UnsetAttr(kNameSpaceID_None, nsGkAtoms::display, false);
-
-    return NS_NewURI(getter_AddRefs(mBaseBindingURI), value,
-                     doc->GetDocumentCharacterSet(), doc->GetDocBaseURI());
-  }
-
-  return NS_OK;
+  return NS_NewURI(getter_AddRefs(mBaseBindingURI), extends,
+                   doc->GetDocumentCharacterSet(), doc->GetDocBaseURI());
 }
 
 void nsXBLPrototypeBinding::EnsureResources() {
   if (!mResources) {
     mResources = new nsXBLPrototypeResources(this);
   }
 }
 
--- a/dom/xbl/nsXBLPrototypeBinding.h
+++ b/dom/xbl/nsXBLPrototypeBinding.h
@@ -357,16 +357,12 @@ class nsXBLPrototypeBinding final
     enum { ALLOW_MEMMOVE = true };
 
    private:
     nsIID mKey;
   };
   nsInterfaceHashtable<IIDHashKey, nsIContent>
       mInterfaceTable;  // A table of cached interfaces that we support.
 
-  int32_t mBaseNameSpaceID;  // If we extend a tagname/namespace, then that
-                             // information will
-  RefPtr<nsAtom> mBaseTag;   // be stored in here.
-
   nsCOMArray<nsXBLKeyEventHandler> mKeyHandlers;
 };
 
 #endif
--- a/dom/xbl/nsXBLSerialize.h
+++ b/dom/xbl/nsXBLSerialize.h
@@ -11,17 +11,17 @@
 #include "nsIObjectOutputStream.h"
 #include "mozilla/dom/NameSpaceConstants.h"
 #include "js/TypeDecls.h"
 
 typedef uint8_t XBLBindingSerializeDetails;
 
 // A version number to ensure we don't load cached data in a different
 // file format.
-#define XBLBinding_Serialize_Version 0x00000005
+#define XBLBinding_Serialize_Version 0x00000006
 
 // Set for the first binding in a document
 #define XBLBinding_Serialize_IsFirstBinding (1 << 0)
 
 // Set to indicate that nsXBLPrototypeBinding::mInheritStyle should be true
 #define XBLBinding_Serialize_InheritStyle (1 << 1)
 
 // Set to indicate that nsXBLPrototypeBinding::mBindToUntrustedContent should be
--- a/dom/xbl/test/test_bug378518.xul
+++ b/dom/xbl/test/test_bug378518.xul
@@ -8,17 +8,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
     
   <script type="application/javascript"
     src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 
   <bindings xmlns="http://www.mozilla.org/xbl"
     xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
-      <binding id="mybinding" extends="xul:checkbox">
+      <binding id="mybinding">
           <content>
           </content>
       </binding>
 
   </bindings>
 
   <!-- test results are displayed in the html:body -->
   <body xmlns="http://www.w3.org/1999/xhtml">
@@ -40,18 +40,16 @@ https://bugzilla.mozilla.org/show_bug.cg
   <box id="myExtendedBox" command="myExtendedBoxCommand"
     style="-moz-binding:url(#mybinding)">
     <label>myExtendedBox</label>
   </box>
 
   <!-- test code goes here -->
   <script type="application/javascript"> <![CDATA[
 
-    SimpleTest.expectAssertions(1);
-
     var myBoxClicked = false;
     var myCheckBoxClicked = false;
     var myExtendedBoxClicked = false;
 
     function testClick(elemName) {
       var wu = window.windowUtils;
 
       var a = document.getElementById(elemName).getBoundingClientRect();
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -3288,24 +3288,25 @@ nsCSSFrameConstructor::FindDataByInt(int
     }
   }
 
   return nullptr;
 }
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
-nsCSSFrameConstructor::FindDataByTag(nsAtom* aTag, const Element& aElement,
+nsCSSFrameConstructor::FindDataByTag(const Element& aElement,
                                      ComputedStyle& aStyle,
                                      const FrameConstructionDataByTag* aDataPtr,
                                      uint32_t aDataLength) {
+  const nsAtom* tag = aElement.NodeInfo()->NameAtom();
   for (const FrameConstructionDataByTag *curData = aDataPtr,
                                         *endData = aDataPtr + aDataLength;
        curData != endData; ++curData) {
-    if (curData->mTag == aTag) {
+    if (curData->mTag == tag) {
       const FrameConstructionData* data = &curData->mData;
       if (data->mBits & FCDATA_FUNC_IS_DATA_GETTER) {
         return data->mFunc.mDataGetter(aElement, aStyle);
       }
 
       return data;
     }
   }
@@ -3391,17 +3392,17 @@ nsCSSFrameConstructor::FindHTMLData(cons
       SIMPLE_TAG_CHAIN(canvas, nsCSSFrameConstructor::FindCanvasData),
       SIMPLE_TAG_CREATE(video, NS_NewHTMLVideoFrame),
       SIMPLE_TAG_CREATE(audio, NS_NewHTMLVideoFrame),
       SIMPLE_TAG_CREATE(progress, NS_NewProgressFrame),
       SIMPLE_TAG_CREATE(meter, NS_NewMeterFrame),
       COMPLEX_TAG_CREATE(details,
                          &nsCSSFrameConstructor::ConstructDetailsFrame)};
 
-  return FindDataByTag(tag, aElement, aStyle, sHTMLData,
+  return FindDataByTag(aElement, aStyle, sHTMLData,
                        ArrayLength(sHTMLData));
 }
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindGeneratedImageData(const Element& aElement,
                                               ComputedStyle&) {
   if (!aElement.IsInNativeAnonymousSubtree()) {
@@ -3949,17 +3950,17 @@ static nsIFrame* NS_NewGridBoxFrame(nsIP
                                     ComputedStyle* aComputedStyle) {
   nsCOMPtr<nsBoxLayout> layout;
   NS_NewGridLayout2(aPresShell, getter_AddRefs(layout));
   return NS_NewBoxFrame(aPresShell, aComputedStyle, false, layout);
 }
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
-nsCSSFrameConstructor::FindXULTagData(const Element& aElement, nsAtom* aTag,
+nsCSSFrameConstructor::FindXULTagData(const Element& aElement,
                                       ComputedStyle& aStyle) {
   MOZ_ASSERT(aElement.IsXULElement());
 
   static const FrameConstructionDataByTag sXULTagData[] = {
 #ifdef MOZ_XUL
       SCROLLABLE_XUL_CREATE(thumb, NS_NewButtonBoxFrame),
       SCROLLABLE_XUL_CREATE(checkbox, NS_NewButtonBoxFrame),
       SCROLLABLE_XUL_CREATE(radio, NS_NewButtonBoxFrame),
@@ -3992,18 +3993,17 @@ nsCSSFrameConstructor::FindXULTagData(co
       SIMPLE_XUL_CREATE(editor, NS_NewSubDocumentFrame),
       SIMPLE_XUL_CREATE(browser, NS_NewSubDocumentFrame),
       SIMPLE_XUL_CREATE(splitter, NS_NewSplitterFrame),
 #endif /* MOZ_XUL */
       SIMPLE_XUL_CREATE(slider, NS_NewSliderFrame),
       SIMPLE_XUL_CREATE(scrollbar, NS_NewScrollbarFrame),
       SIMPLE_XUL_CREATE(scrollbarbutton, NS_NewScrollbarButtonFrame)};
 
-  return FindDataByTag(aTag, aElement, aStyle, sXULTagData,
-                       ArrayLength(sXULTagData));
+  return FindDataByTag(aElement, aStyle, sXULTagData, ArrayLength(sXULTagData));
 }
 
 #ifdef MOZ_XUL
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindPopupGroupData(const Element& aElement,
                                           ComputedStyle&) {
   if (!aElement.IsRootOfNativeAnonymousSubtree()) {
@@ -4752,18 +4752,17 @@ nsCSSFrameConstructor::FindMathMLData(co
       SIMPLE_MATHML_CREATE(msqrt_, NS_NewMathMLmsqrtFrame),
       SIMPLE_MATHML_CREATE(mroot_, NS_NewMathMLmrootFrame),
       SIMPLE_MATHML_CREATE(maction_, NS_NewMathMLmactionFrame),
       SIMPLE_MATHML_CREATE(mrow_, NS_NewMathMLmrowFrame),
       SIMPLE_MATHML_CREATE(merror_, NS_NewMathMLmrowFrame),
       SIMPLE_MATHML_CREATE(menclose_, NS_NewMathMLmencloseFrame),
       SIMPLE_MATHML_CREATE(semantics_, NS_NewMathMLsemanticsFrame)};
 
-  return FindDataByTag(tag, aElement, aStyle, sMathMLData,
-                       ArrayLength(sMathMLData));
+  return FindDataByTag(aElement, aStyle, sMathMLData, ArrayLength(sMathMLData));
 }
 
 nsContainerFrame* nsCSSFrameConstructor::ConstructFrameWithAnonymousChild(
     nsFrameConstructorState& aState, FrameConstructionItem& aItem,
     nsContainerFrame* aParentFrame, nsFrameItems& aFrameItems,
     ContainerFrameCreationFunc aConstructor,
     ContainerFrameCreationFunc aInnerConstructor, PseudoStyleType aInnerPseudo,
     bool aCandidateRootFrame) {
@@ -5060,17 +5059,17 @@ nsCSSFrameConstructor::FindSVGData(const
       SIMPLE_SVG_CREATE(feMergeNode, NS_NewSVGFEUnstyledLeafFrame),
       SIMPLE_SVG_CREATE(feMorphology, NS_NewSVGFELeafFrame),
       SIMPLE_SVG_CREATE(feOffset, NS_NewSVGFELeafFrame),
       SIMPLE_SVG_CREATE(feSpecularLighting, NS_NewSVGFEContainerFrame),
       SIMPLE_SVG_CREATE(feTile, NS_NewSVGFELeafFrame),
       SIMPLE_SVG_CREATE(feTurbulence, NS_NewSVGFELeafFrame)};
 
   const FrameConstructionData* data =
-      FindDataByTag(tag, aElement, aStyle, sSVGData, ArrayLength(sSVGData));
+      FindDataByTag(aElement, aStyle, sSVGData, ArrayLength(sSVGData));
 
   if (!data) {
     data = &sContainerData;
   }
 
   return data;
 }
 
@@ -5213,48 +5212,46 @@ static bool ShouldSuppressFrameInNonOpen
   }
 
   return true;
 }
 
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindDataForContent(nsIContent& aContent,
                                           ComputedStyle& aStyle,
-                                          nsIFrame* aParentFrame, nsAtom* aTag,
+                                          nsIFrame* aParentFrame,
                                           uint32_t aFlags) {
   MOZ_ASSERT(aStyle.StyleDisplay()->mDisplay != StyleDisplay::None &&
                  aStyle.StyleDisplay()->mDisplay != StyleDisplay::Contents,
              "These two special display values should be handled earlier");
 
   if (auto* text = Text::FromNode(aContent)) {
     return FindTextData(*text, aParentFrame);
   }
 
-  return FindElementData(*aContent.AsElement(), aStyle, aParentFrame, aTag,
-                         aFlags);
+  return FindElementData(*aContent.AsElement(), aStyle, aParentFrame, aFlags);
 }
 
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindElementData(const Element& aElement,
                                        ComputedStyle& aStyle,
-                                       nsIFrame* aParentFrame, nsAtom* aTag,
+                                       nsIFrame* aParentFrame,
                                        uint32_t aFlags) {
   // Don't create frames for non-SVG element children of SVG elements.
   if (!aElement.IsSVGElement()) {
     if (aParentFrame && IsFrameForSVG(aParentFrame) &&
         !aParentFrame->IsFrameOfType(nsIFrame::eSVGForeignObject)) {
       return nullptr;
     }
     if (aFlags & ITEM_IS_WITHIN_SVG_TEXT) {
       return nullptr;
     }
   }
 
-  if (auto* data =
-          FindElementTagData(aElement, aStyle, aParentFrame, aTag, aFlags)) {
+  if (auto* data = FindElementTagData(aElement, aStyle, aParentFrame, aFlags)) {
     return data;
   }
 
   // Check for 'content: <image-url>' on the element (which makes us ignore
   // 'display' values other than 'none' or 'contents').
   if (ShouldCreateImageFrameForContent(aElement, aStyle)) {
     static const FrameConstructionData sImgData =
         SIMPLE_FCDATA(NS_NewImageFrameForContentProperty);
@@ -5267,49 +5264,46 @@ nsCSSFrameConstructor::FindElementData(c
   }
 
   return FindDisplayData(display, aElement);
 }
 
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindElementTagData(const Element& aElement,
                                           ComputedStyle& aStyle,
-                                          nsIFrame* aParentFrame, nsAtom* aTag,
+                                          nsIFrame* aParentFrame,
                                           uint32_t aFlags) {
   switch (aElement.GetNameSpaceID()) {
     case kNameSpaceID_XHTML:
       return FindHTMLData(aElement, aParentFrame, aStyle);
     case kNameSpaceID_MathML:
       return FindMathMLData(aElement, aStyle);
     case kNameSpaceID_SVG:
       return FindSVGData(aElement, aParentFrame,
                          aFlags & ITEM_IS_WITHIN_SVG_TEXT,
                          aFlags & ITEM_ALLOWS_TEXT_PATH_CHILD, aStyle);
     case kNameSpaceID_XUL:
-      return FindXULTagData(aElement, aTag, aStyle);
+      return FindXULTagData(aElement, aStyle);
     default:
       return nullptr;
   }
 }
 
 nsCSSFrameConstructor::XBLBindingLoadInfo::XBLBindingLoadInfo(
     already_AddRefed<ComputedStyle>&& aStyle,
-    mozilla::UniquePtr<PendingBinding> aPendingBinding, nsAtom* aTag)
+    UniquePtr<PendingBinding> aPendingBinding)
     : mStyle(std::move(aStyle)),
-      mPendingBinding(std::move(aPendingBinding)),
-      mTag(aTag) {
-  MOZ_ASSERT(mTag);
+      mPendingBinding(std::move(aPendingBinding)) {
   MOZ_ASSERT(mStyle);
 }
 
 nsCSSFrameConstructor::XBLBindingLoadInfo::XBLBindingLoadInfo(
     nsIContent& aContent, ComputedStyle& aStyle)
     : mStyle(&aStyle),
-      mPendingBinding(nullptr),
-      mTag(aContent.NodeInfo()->NameAtom()) {}
+      mPendingBinding(nullptr) {}
 
 nsCSSFrameConstructor::XBLBindingLoadInfo::XBLBindingLoadInfo() = default;
 
 nsCSSFrameConstructor::XBLBindingLoadInfo
 nsCSSFrameConstructor::LoadXBLBindingIfNeeded(nsIContent& aContent,
                                               ComputedStyle& aStyle,
                                               uint32_t aFlags) {
   if (!(aFlags & ITEM_ALLOW_XBL_BASE)) {
@@ -5339,60 +5333,46 @@ nsCSSFrameConstructor::LoadXBLBindingIfN
     return {};
   }
 
   RefPtr<ComputedStyle> style =
       resolveStyle
           ? mPresShell->StyleSet()->ResolveServoStyle(*aContent.AsElement())
           : do_AddRef(&aStyle);
 
-  nsAtom* tag = aContent.NodeInfo()->NameAtom();
-  if (aContent.IsXULElement()) {
-    int32_t overridenNamespace;
-    nsAtom* overridenTag =
-        mDocument->BindingManager()->ResolveTag(&aContent, &overridenNamespace);
-    // Only allow overriding from & to XUL.
-    if (overridenNamespace == kNameSpaceID_XUL) {
-      tag = overridenTag;
-    }
-  }
-
-  return {style.forget(), std::move(newPendingBinding), tag};
+  return {style.forget(), std::move(newPendingBinding)};
 }
 
 void nsCSSFrameConstructor::AddFrameConstructionItemsInternal(
     nsFrameConstructorState& aState, nsIContent* aContent,
     nsContainerFrame* aParentFrame, bool aSuppressWhiteSpaceOptimizations,
     ComputedStyle* aComputedStyle, uint32_t aFlags,
     FrameConstructionItemList& aItems) {
   MOZ_ASSERT(aContent->IsText() || aContent->IsElement(),
              "Shouldn't get anything else here!");
   MOZ_ASSERT(aContent->IsInComposedDoc());
   MOZ_ASSERT(!aContent->GetPrimaryFrame() || aState.mCreatingExtraFrames ||
              aContent->NodeInfo()->NameAtom() == nsGkAtoms::area);
 
   PendingBinding* pendingBinding = nullptr;
   RefPtr<ComputedStyle> style;
-  nsAtom* tag;
   {
     XBLBindingLoadInfo xblInfo =
         LoadXBLBindingIfNeeded(*aContent, *aComputedStyle, aFlags);
-    if (!xblInfo.mTag) {
+    if (!xblInfo.mStyle) {
       return;
     }
 
     if (xblInfo.mPendingBinding && xblInfo.mPendingBinding->mBinding) {
       pendingBinding = xblInfo.mPendingBinding.get();
       aState.AddPendingBinding(std::move(xblInfo.mPendingBinding));
     }
 
     style = xblInfo.mStyle.forget();
     aComputedStyle = style.get();
-
-    tag = xblInfo.mTag;
   }
 
   const bool isGeneratedContent = !!(aFlags & ITEM_IS_GENERATED_CONTENT);
   MOZ_ASSERT(!isGeneratedContent || style->IsPseudoElement(),
              "Generated content should be a pseudo-element");
 
   FrameConstructionItem* item = nullptr;
   auto cleanupGeneratedContent = mozilla::MakeScopeExit([&]() {
@@ -5441,17 +5421,17 @@ void nsCSSFrameConstructor::AddFrameCons
   // ::before and ::after); we always want to create "internal" anonymous
   // content.
   auto* details = HTMLDetailsElement::FromNodeOrNull(parent);
   if (ShouldSuppressFrameInNonOpenDetails(details, *aContent)) {
     return;
   }
 
   const FrameConstructionData* data =
-      FindDataForContent(*aContent, *style, aParentFrame, tag, aFlags);
+      FindDataForContent(*aContent, *style, aParentFrame, aFlags);
   if (!data || data->mBits & FCDATA_SUPPRESS_FRAME) {
     return;
   }
 
   bool isPopup = false;
 
 #ifdef MOZ_XUL
   if ((data->mBits & FCDATA_IS_POPUP) && (!aParentFrame ||  // Parent is inline
@@ -5503,18 +5483,17 @@ void nsCSSFrameConstructor::AddFrameCons
   item->mIsAnonymousContentCreatorContent =
       aFlags & ITEM_IS_ANONYMOUSCONTENTCREATOR_CONTENT;
   if (isGeneratedContent) {
     // We need to keep this alive until the frame takes ownership.
     // This corresponds to the Release in ConstructFramesFromItem.
     item->mContent->AddRef();
   }
   item->mIsRootPopupgroup = aContent->IsRootOfNativeAnonymousSubtree() &&
-                            aContent->IsXULElement() &&
-                            tag == nsGkAtoms::popupgroup;
+                            aContent->IsXULElement(nsGkAtoms::popupgroup);
   if (item->mIsRootPopupgroup) {
     aState.mHavePendingPopupgroup = true;
   }
   item->mIsPopup = isPopup;
 
   if (canHavePageBreak && display.BreakAfter()) {
     AddPageBreakItem(aContent, aItems);
   }
--- a/layout/base/nsCSSFrameConstructor.h
+++ b/layout/base/nsCSSFrameConstructor.h
@@ -769,49 +769,45 @@ class nsCSSFrameConstructor final : publ
   // The information that concerns the frame constructor after loading an XBL
   // binding.
   //
   // This is expected to just be used temporarily to aggregate the different
   // objects that LoadXBLBindingIfNeeded returns.
   struct MOZ_STACK_CLASS XBLBindingLoadInfo {
     RefPtr<ComputedStyle> mStyle;
     mozilla::UniquePtr<PendingBinding> mPendingBinding;
-    nsAtom* mTag = nullptr;
 
     // For the 'no binding loaded' case.
     XBLBindingLoadInfo(nsIContent&, ComputedStyle&);
 
     // For the case we actually load an XBL binding.
     XBLBindingLoadInfo(already_AddRefed<ComputedStyle>&& aStyle,
-                       mozilla::UniquePtr<PendingBinding> aPendingBinding,
-                       nsAtom* aTag);
+                       mozilla::UniquePtr<PendingBinding> aPendingBinding);
 
     // For the error case.
     XBLBindingLoadInfo();
   };
 
-  // Returns null mStyle / mTag members to signal an error.
+  // Returns null mStyle member to signal an error.
   XBLBindingLoadInfo LoadXBLBindingIfNeeded(nsIContent&, ComputedStyle&,
                                             uint32_t aFlags);
 
   const FrameConstructionData* FindDataForContent(nsIContent&, ComputedStyle&,
                                                   nsIFrame* aParentFrame,
-                                                  nsAtom* aTag,
                                                   uint32_t aFlags);
 
   // aParentFrame might be null.  If it is, that means it was an inline frame.
   static const FrameConstructionData* FindTextData(const Text&,
                                                    nsIFrame* aParentFrame);
   const FrameConstructionData* FindElementData(const Element&, ComputedStyle&,
                                                nsIFrame* aParentFrame,
-                                               nsAtom* aTag, uint32_t aFlags);
+                                               uint32_t aFlags);
   const FrameConstructionData* FindElementTagData(const Element&,
                                                   ComputedStyle&,
                                                   nsIFrame* aParentFrame,
-                                                  nsAtom* aTag,
                                                   uint32_t aFlags);
 
   /* A function that takes an integer, content, style, and array of
      FrameConstructionDataByInts and finds the appropriate frame construction
      data to use and returns it.  This can return null if none of the integers
      match or if the matching integer has a FrameConstructionDataGetter that
      returns null. */
   static const FrameConstructionData* FindDataByInt(
@@ -823,17 +819,17 @@ class nsCSSFrameConstructor final : publ
    * FrameConstructionDataByTags and finds the appropriate frame construction
    * data to use and returns it.
    *
    * This can return null if none of the tags match or if the matching tag has a
    * FrameConstructionDataGetter that returns null. In the case that the tags
    * actually match, aTagFound will be true, even if the return value is null.
    */
   static const FrameConstructionData* FindDataByTag(
-      nsAtom* aTag, const Element& aElement, ComputedStyle& aComputedStyle,
+      const Element& aElement, ComputedStyle& aComputedStyle,
       const FrameConstructionDataByTag* aDataPtr, uint32_t aDataLength);
 
   /* A class representing a list of FrameConstructionItems.  Instances of this
      class are only created as AutoFrameConstructionItemList, or as a member
      of FrameConstructionItem. */
   class FrameConstructionItemList {
    public:
     void Reset(nsCSSFrameConstructor* aFCtor) {
@@ -1510,17 +1506,16 @@ class nsCSSFrameConstructor final : publ
                                                      ComputedStyle&);
 
   // Function to find FrameConstructionData for an element.  Will return
   // null if the element is not XUL.
   //
   // NOTE(emilio): This gets the overloaded tag and namespace id since they can
   // be overriden by extends="" in XBL.
   static const FrameConstructionData* FindXULTagData(const Element&,
-                                                     nsAtom* aTag,
                                                      ComputedStyle&);
   // XUL data-finding helper functions and structures
 #ifdef MOZ_XUL
   static const FrameConstructionData* FindPopupGroupData(const Element&,
                                                          ComputedStyle&);
   // sXULTextBoxData used for both labels and descriptions
   static const FrameConstructionData sXULTextBoxData;
   static const FrameConstructionData* FindXULButtonData(const Element&,
deleted file mode 100644
--- a/layout/reftests/bugs/560455-1-ref.xul
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<hbox style="display: block">
-  <button style="-moz-binding: none; width: 0; display: block;
-		 overflow: hidden; padding: 10px; border: 1px solid black; ">Correct</button>
-</hbox>
-</window>
deleted file mode 100644
--- a/layout/reftests/bugs/560455-1.xul
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0"?>
-
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<hbox style="display: none">
-<bindings xmlns="http://www.mozilla.org/xbl"
-          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-  <binding id="test" extends="xul:button">
-  </binding>
-
-</bindings>
-</hbox>
-
-<hbox style="display: block">
-  <div style="-moz-binding: url(#test); width: 0; display: block;
-              overflow: hidden; padding: 10px; border: 1px solid black; "
-       xmlns="http://www.w3.org/1999/xhtml">Correct</div>
-</hbox>
-</window>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1506,17 +1506,16 @@ fuzzy-if(Android,0-12,0-300) == 551463-1
 random != 553571-1.html 553571-1-notref.html # expect dotted circle in test, not in ref: "fails" under harfbuzz, which doesn't consider the sequence invalid
 fuzzy-if(!contentSameGfxBackendAsCanvas,0-128,0-91) random-if(d2d) skip-if(azureSkiaGL) fuzzy-if(skiaContent,0-32,0-150) == 555388-1.html 555388-1-ref.html
 == 556661-1.html 556661-1-ref.html
 fuzzy-if(skiaContent,0-4,0-5) == 557087-1.html 557087-ref.html
 fuzzy-if(skiaContent&&!Android,0-2,0-5) == 557087-2.html 557087-ref.html
 == 557736-1.html 557736-1-ref.html
 skip-if(Android) != 558011-1.xul 558011-1-ref.xul
 == 559284-1.html 559284-1-ref.html
-fails-if(Android) == 560455-1.xul 560455-1-ref.xul
 fuzzy-if(skiaContent,0-2,0-5) == 561981-1.html 561981-1-ref.html
 == 561981-2.html 561981-2-ref.html
 fuzzy-if(skiaContent,0-1,0-5) == 561981-3.html 561981-3-ref.html
 == 561981-4.html 561981-4-ref.html
 fuzzy-if(skiaContent,0-1,0-5) == 561981-5.html 561981-5-ref.html
 == 561981-6.html 561981-6-ref.html
 fuzzy-if(skiaContent,0-1,0-5) == 561981-7.html 561981-7-ref.html
 == 561981-8.html 561981-8-ref.html
--- a/layout/reftests/svg/moz-only/reftest.list
+++ b/layout/reftests/svg/moz-only/reftest.list
@@ -1,12 +1,11 @@
 # XBL tests
 == xbl-basic-01.svg                             pass.svg
 == xbl-basic-02.svg                             pass.svg
-== xbl-basic-03.svg                             pass.svg
 == xbl-grad-ref--grad-in-binding-01.svg         pass.svg
 fails == xbl-grad-ref--grad-in-binding-02.svg   pass.svg
 == xbl-grad-ref--grad-in-bound-01.svg           pass.svg
 fails == xbl-grad-ref--grad-in-bound-02.svg     pass-black.svg
 fails == xbl-grad-ref--grad-in-resources-01.svg pass.svg
 fails == xbl-grad-ref--grad-in-resources-02.svg pass.svg
 == xbl-grad-ref--grad-in-binding-03.svg         pass.svg
 == xbl-grad-ref--grad-in-bound-03.svg           pass.svg
deleted file mode 100644
--- a/layout/reftests/svg/moz-only/xbl-basic-03.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-<!--
-     Any copyright is dedicated to the Public Domain.
-     http://creativecommons.org/publicdomain/zero/1.0/
--->
-<svg xmlns="http://www.w3.org/2000/svg"
-     xmlns:svg="http://www.w3.org/2000/svg"
-     xmlns:ex="http://example.org/">
-
-  <bindings xmlns="http://www.mozilla.org/xbl">
-    <binding id="b" extends="svg:generic">
-      <content>
-        <svg:rect width="100%" height="100%" fill="lime"/>
-      </content>
-    </binding>
-  </bindings>
-
-  <rect width="100%" height="100%" fill="red"/>
-  <g style="-moz-binding: url(#b)"/>
-</svg>
--- a/layout/xul/nsSplitterFrame.cpp
+++ b/layout/xul/nsSplitterFrame.cpp
@@ -584,24 +584,21 @@ nsresult nsSplitterFrameInner::MouseDown
 
   // create info 2 lists. One of the children before us and one after.
   int32_t count = 0;
   mChildInfosBeforeCount = 0;
   mChildInfosAfterCount = 0;
 
   nsIFrame* childBox = nsBox::GetChildXULBox(mParentBox);
 
-  while (nullptr != childBox) {
+  while (childBox) {
     nsIContent* content = childBox->GetContent();
-    int32_t dummy;
-    nsAtom* atom =
-        content->OwnerDoc()->BindingManager()->ResolveTag(content, &dummy);
 
     // skip over any splitters
-    if (atom != nsGkAtoms::splitter) {
+    if (content->NodeInfo()->NameAtom() != nsGkAtoms::splitter) {
       nsSize prefSize = childBox->GetXULPrefSize(state);
       nsSize minSize = childBox->GetXULMinSize(state);
       nsSize maxSize =
           nsBox::BoundsCheckMinMax(minSize, childBox->GetXULMaxSize(state));
       prefSize = nsBox::BoundsCheck(minSize, prefSize, maxSize);
 
       nsSplitterFrame::AddMargin(childBox, minSize);
       nsSplitterFrame::AddMargin(childBox, prefSize);
--- a/toolkit/content/tests/chrome/test_bug562554.xul
+++ b/toolkit/content/tests/chrome/test_bug562554.xul
@@ -1,22 +1,21 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
 <!--
   XUL Widget Test for bug 562554
   -->
 <window title="Bug 562554" width="400" height="400"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>  
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 
 <xbl:bindings xmlns:xbl="http://www.mozilla.org/xbl">
-  <xbl:binding id="menu" display="xul:menu"
-               extends="chrome://global/content/bindings/button.xml#button-base">
+  <xbl:binding id="menu" extends="chrome://global/content/bindings/button.xml#button-base">
     <xbl:content>
       <xbl:children includes="menupopup"/>
       <xul:stack>
          <xul:button width="100" left="0" top="0" height="30" allowevents="true"
                      onclick="eventReceived('clickbutton1'); return false;"/>
          <xul:button width="100" left="70" top="0" height="30" 
                      onclick="eventReceived('clickbutton2'); return false;"/>
       </xul:stack>