Fixing bug 432591. Only register event handlers on inner windows. r+sr=jonas@sicking.cc, a=dsicore

This commit is contained in:
jst@mozilla.org 2008-05-07 21:57:21 -07:00
parent c62383ea7b
commit a9312493fa

View File

@ -542,9 +542,10 @@ nsXULElement::GetEventListenerManagerForAttr(nsIEventListenerManager** aManager,
if (!doc)
return NS_ERROR_UNEXPECTED; // XXX
nsPIDOMWindow *window;
nsIContent *root = doc->GetRootContent();
if ((!root || root == this) && !mNodeInfo->Equals(nsGkAtoms::overlay)) {
nsPIDOMWindow *window = doc->GetInnerWindow();
if ((!root || root == this) && !mNodeInfo->Equals(nsGkAtoms::overlay) &&
(window = doc->GetInnerWindow()) && window->IsInnerWindow()) {
nsCOMPtr<nsPIDOMEventTarget> piTarget = do_QueryInterface(window);
if (!piTarget)