Bug 1427677: Remove nsBindingManager::FindNestedInsertionPoint. r?bz draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 03 Jan 2018 06:38:21 +0100
changeset 716649 0b5396f3f027690263487a920b5631bf32cb8693
parent 716648 b28374b590f1d888c9d2dc3952885b4aab7b9ef1
child 745069 0aec04b64b95073aae0f4bde8f0986d82244c838
push id94475
push userbmo:emilio@crisal.io
push dateSat, 06 Jan 2018 01:13:40 +0000
reviewersbz
bugs1427677
milestone59.0a1
Bug 1427677: Remove nsBindingManager::FindNestedInsertionPoint. r?bz No more callers! MozReview-Commit-ID: 1mxi4IjViuC
dom/xbl/nsBindingManager.cpp
dom/xbl/nsBindingManager.h
--- a/dom/xbl/nsBindingManager.cpp
+++ b/dom/xbl/nsBindingManager.cpp
@@ -1092,54 +1092,16 @@ nsBindingManager::HandleChildInsertion(n
     if (newParent == parent) {
       break;
     }
 
     parent = newParent;
   }
 }
 
-
-nsIContent*
-nsBindingManager::FindNestedInsertionPoint(nsIContent* aContainer,
-                                           nsIContent* aChild)
-{
-  NS_PRECONDITION(aChild->GetParent() == aContainer,
-                  "Wrong container");
-
-  nsIContent* parent = aContainer;
-  if (aContainer->IsActiveChildrenElement()) {
-    if (static_cast<XBLChildrenElement*>(aContainer)->
-          HasInsertedChildren()) {
-      return nullptr;
-    }
-    parent = aContainer->GetParent();
-  }
-
-  while (parent) {
-    nsXBLBinding* binding = GetBindingWithContent(parent);
-    if (!binding) {
-      break;
-    }
-
-    XBLChildrenElement* point = binding->FindInsertionPointFor(aChild);
-    if (!point) {
-      return nullptr;
-    }
-
-    nsIContent* newParent = point->GetParent();
-    if (newParent == parent) {
-      break;
-    }
-    parent = newParent;
-  }
-
-  return parent;
-}
-
 nsIContent*
 nsBindingManager::FindNestedSingleInsertionPoint(nsIContent* aContainer,
                                                  bool* aMulti)
 {
   *aMulti = false;
 
   nsIContent* parent = aContainer;
   if (aContainer->IsActiveChildrenElement()) {
--- a/dom/xbl/nsBindingManager.h
+++ b/dom/xbl/nsBindingManager.h
@@ -166,19 +166,16 @@ public:
 
   // When removing an insertion point or a parent of one, clear the insertion
   // points and their insertion parents.
   void ClearInsertionPointsRecursively(nsIContent* aContent);
 
   // Called when the document is going away
   void DropDocumentReference();
 
-  nsIContent* FindNestedInsertionPoint(nsIContent* aContainer,
-                                       nsIContent* aChild);
-
   nsIContent* FindNestedSingleInsertionPoint(nsIContent* aContainer, bool* aMulti);
 
   bool AnyBindingHasDocumentStateDependency(mozilla::EventStates aStateMask);
 
 protected:
   nsIXPConnectWrappedJS* GetWrappedJS(nsIContent* aContent);
   nsresult SetWrappedJS(nsIContent* aContent, nsIXPConnectWrappedJS* aResult);