Make it possible for document observers who need to worry about XBL to observe

the binding manager and make presshell do that.  Bug 348573, r+sr=sicking
This commit is contained in:
bzbarsky@mit.edu
2006-08-15 22:41:58 +00:00
parent d8261a7a02
commit 43fc6354d1
9 changed files with 307 additions and 229 deletions

View File

@@ -2700,7 +2700,7 @@ NS_IMETHODIMP
PresShell::BeginObservingDocument()
{
if (mDocument) {
mDocument->AddObserver(this);
mDocument->BindingManager()->AddObserver(this);
if (mIsDocumentGone) {
NS_WARNING("Adding a presshell that was disconnected from the document "
"as a document observer? Sounds wrong...");
@@ -2718,7 +2718,7 @@ PresShell::EndObservingDocument()
// is gone, perhaps? Except for printing it's NOT gone, sometimes.
mIsDocumentGone = PR_TRUE;
if (mDocument) {
mDocument->RemoveObserver(this);
mDocument->BindingManager()->RemoveObserver(this);
}
return NS_OK;
}