From e090f9c069b247a34936c3193b498cf701fffc1f Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Fri, 27 Jun 2008 16:04:19 +0200 Subject: [PATCH] Remove the element from the id map when it's removed from the document. b=441994 r+sr=roc --- content/xul/document/src/nsXULDocument.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/content/xul/document/src/nsXULDocument.cpp b/content/xul/document/src/nsXULDocument.cpp index 7a5eb983a0c..94d6be477ee 100644 --- a/content/xul/document/src/nsXULDocument.cpp +++ b/content/xul/document/src/nsXULDocument.cpp @@ -1740,8 +1740,11 @@ nsXULDocument::RemoveSubtreeFromDocument(nsIContent* aElement) return rv; } - // 2. Remove the element from the resource-to-element map + // 2. Remove the element from the resource-to-element map. + // Also remove it from the id map, since we added it in + // AddElementToDocumentPre(). RemoveElementFromRefMap(aElement); + RemoveFromIdTable(aElement); // 3. If the element is a 'command updater', then remove the // element from the document's command dispatcher.