Bug 943804 - Always clear insertion points of cleared inserted children. r=mrbkap, a=lsblakk
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Wed, 27 Nov 2013 20:12:58 +0000
changeset 167599 39bbf50c35ed8791f2e91136be449c682bfdee63
parent 167598 ab93ba38200e961772de83940c48fe25df2875f2
child 167600 5567a9a910e3d77aaee390fb970a5763b3a4f2d5
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap, lsblakk
bugs943804
milestone27.0a2
Bug 943804 - Always clear insertion points of cleared inserted children. r=mrbkap, a=lsblakk
content/xbl/src/XBLChildrenElement.h
content/xbl/src/nsBindingManager.cpp
--- a/content/xbl/src/XBLChildrenElement.h
+++ b/content/xbl/src/XBLChildrenElement.h
@@ -68,21 +68,16 @@ public:
     // only insert in the innermost insertion point.
     //NS_ASSERTION(mInsertedChildren.Contains(aChild),
     //             "Removing child that's not there");
     mInsertedChildren.RemoveElement(aChild);
   }
 
   void ClearInsertedChildren()
   {
-    mInsertedChildren.Clear();
-  }
-
-  void ClearInsertedChildrenAndInsertionParents()
-  {
     for (uint32_t c = 0; c < mInsertedChildren.Length(); ++c) {
       mInsertedChildren[c]->SetXBLInsertionParent(nullptr);
     }
     mInsertedChildren.Clear();
   }
 
   void MaybeSetupDefaultContent()
   {
--- a/content/xbl/src/nsBindingManager.cpp
+++ b/content/xbl/src/nsBindingManager.cpp
@@ -1084,17 +1084,17 @@ nsBindingManager::ContentRemoved(nsIDocu
     parent = newParent;
   } while (parent);
 }
 
 void
 nsBindingManager::ClearInsertionPointsRecursively(nsIContent* aContent)
 {
   if (aContent->NodeInfo()->Equals(nsGkAtoms::children, kNameSpaceID_XBL)) {
-    static_cast<XBLChildrenElement*>(aContent)->ClearInsertedChildrenAndInsertionParents();
+    static_cast<XBLChildrenElement*>(aContent)->ClearInsertedChildren();
   }
 
   for (nsIContent* child = aContent->GetFirstChild(); child;
        child = child->GetNextSibling()) {
     ClearInsertionPointsRecursively(child);
   }
 }