Fix long-standing XBL bug where we didn't update insertion points correctly insome cases. Bug 375299, r+sr=sicking

This commit is contained in:
bzbarsky@mit.edu 2007-04-26 21:06:45 -07:00
Родитель 5606b8585e
Коммит 253970e725
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -1179,7 +1179,8 @@ nsBindingManager::ContentAppended(nsIDocument* aDocument,
PRInt32 aNewIndexInContainer) PRInt32 aNewIndexInContainer)
{ {
// XXX This is hacked and not quite correct. See below. // XXX This is hacked and not quite correct. See below.
if (aNewIndexInContainer != -1 && mContentListTable.ops) { if (aNewIndexInContainer != -1 &&
(mContentListTable.ops || mAnonymousNodesTable.ops)) {
// It's not anonymous. // It's not anonymous.
PRInt32 childCount = aContainer->GetChildCount(); PRInt32 childCount = aContainer->GetChildCount();
@ -1230,7 +1231,8 @@ nsBindingManager::ContentInserted(nsIDocument* aDocument,
PRInt32 aIndexInContainer) PRInt32 aIndexInContainer)
{ {
// XXX This is hacked just to make menus work again. // XXX This is hacked just to make menus work again.
if (aIndexInContainer != -1 && mContentListTable.ops) { if (aIndexInContainer != -1 &&
(mContentListTable.ops || mAnonymousNodesTable.ops)) {
// It's not anonymous. // It's not anonymous.
nsCOMPtr<nsIContent> ins = GetNestedInsertionPoint(aContainer, aChild); nsCOMPtr<nsIContent> ins = GetNestedInsertionPoint(aContainer, aChild);
@ -1304,7 +1306,8 @@ nsBindingManager::ContentRemoved(nsIDocument* aDocument,
(aDocument, aContainer, aChild, (aDocument, aContainer, aChild,
aIndexInContainer)); aIndexInContainer));
if (aIndexInContainer == -1 || !mContentListTable.ops) if (aIndexInContainer == -1 ||
(!mContentListTable.ops && !mAnonymousNodesTable.ops))
// It's anonymous. // It's anonymous.
return; return;