Make DOM inspector deal with a root Document object in the DOM view. Bug

201577, r=timeless, sr=peterv
This commit is contained in:
bzbarsky%mit.edu 2003-04-16 01:56:52 +00:00
Родитель 84a12b9277
Коммит e0dbaacb24
1 изменённых файлов: 5 добавлений и 4 удалений

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

@ -185,12 +185,13 @@ inDOMView::SetRootNode(nsIDOMNode* aNode)
// store an owning reference to document so that it isn't
// destroyed before we are
nsCOMPtr<nsIDOMDocument> domDoc;
aNode->GetOwnerDocument(getter_AddRefs(domDoc));
mRootDocument = domDoc;
mRootDocument = do_QueryInterface(aNode);
if (!mRootDocument) {
aNode->GetOwnerDocument(getter_AddRefs(mRootDocument));
}
// add document observer
nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
nsCOMPtr<nsIDocument> doc(do_QueryInterface(mRootDocument));
if (doc)
doc->AddObserver(this);
} else {