Fixing bug 230283. Don't notify the document about insertion of the document element when there is no document element. r=jonas@sicking.cc, sr+a=dbaron@dbaron.org.

This commit is contained in:
jst%mozilla.jstenback.com 2004-01-09 22:55:13 +00:00
Родитель 632559f54a
Коммит 08a38d2790
1 изменённых файлов: 15 добавлений и 13 удалений

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

@ -257,19 +257,21 @@ nsXMLContentSink::DidBuildModel()
loader->RemoveObserver(this);
}
// Notify document observers that all the content has been stuck
// into the document.
// XXX do we need to notify for things like PIs? Or just the
// documentElement?
NS_ASSERTION(mDocument->IndexOf(mDocElement) != -1,
"mDocElement not in doc?");
mDocument->BeginUpdate(UPDATE_CONTENT_MODEL);
mDocument->ContentInserted(nsnull, mDocElement,
// XXXbz is this last arg relevant if
// the container is null?
mDocument->IndexOf(mDocElement));
mDocument->EndUpdate(UPDATE_CONTENT_MODEL);
if (mDocElement) {
// Notify document observers that all the content has been stuck
// into the document.
// XXX do we need to notify for things like PIs? Or just the
// documentElement?
NS_ASSERTION(mDocument->IndexOf(mDocElement) != -1,
"mDocElement not in doc?");
mDocument->BeginUpdate(UPDATE_CONTENT_MODEL);
mDocument->ContentInserted(nsnull, mDocElement,
// XXXbz is this last arg relevant if
// the container is null?
mDocument->IndexOf(mDocElement));
mDocument->EndUpdate(UPDATE_CONTENT_MODEL);
}
// Check if we want to prettyprint
MaybePrettyPrint();