Bug 83635 - Detach bindings when an element is removed from the document. r+a=sicking
authorMounir Lamouri <mounir.lamouri@gmail.com>
Fri, 22 Oct 2010 21:29:21 +0200
changeset 56375 11591f86a1175b3f875937bfb3278f9e54b5a6bb
parent 56374 4f7dce264cf551a5f94f2a317d772009b97d0553
child 56378 0165ef8efe983819519af2167563dfec5e2c084f
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs83635
milestone2.0b8pre
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 83635 - Detach bindings when an element is removed from the document. r+a=sicking
content/xbl/src/nsBindingManager.cpp
--- a/content/xbl/src/nsBindingManager.cpp
+++ b/content/xbl/src/nsBindingManager.cpp
@@ -644,16 +644,17 @@ nsBindingManager::RemovedFromDocumentInt
       if (!binding || !binding->HasInsertionParent(aContent)) {
         RemoveInsertionParent(aContent);
         aContent->UnsetFlags(NODE_IS_INSERTION_PARENT);
       }
     }
   }
 
   if (binding) {
+    binding->PrototypeBinding()->BindingDetached(binding->GetBoundElement());
     binding->ChangeDocument(aOldDocument, nsnull);
     SetBinding(aContent, nsnull);
   }
 
   // Clear out insertion parents and content lists.
   SetInsertionParent(aContent, nsnull);
   SetContentListFor(aContent, nsnull);
   SetAnonymousNodesFor(aContent, nsnull);