diff --git a/content/xul/document/src/nsXULCommandDispatcher.cpp b/content/xul/document/src/nsXULCommandDispatcher.cpp index 11cead3a4ed5..15f6d7176abd 100644 --- a/content/xul/document/src/nsXULCommandDispatcher.cpp +++ b/content/xul/document/src/nsXULCommandDispatcher.cpp @@ -371,7 +371,7 @@ nsXULCommandDispatcher::Focus(nsIDOMEvent* aEvent) nsCOMPtr domDoc = do_QueryInterface(t); if (domDoc) { GetParentWindowFromDocument(domDoc, getter_AddRefs(domWindow)); - if (domWindow && (domWindow != mCurrentWindow)) { + if (domWindow) { SetFocusedWindow(domWindow); if (mCurrentElement) { // Make sure this element is in our window. If not, we @@ -380,7 +380,7 @@ nsXULCommandDispatcher::Focus(nsIDOMEvent* aEvent) mCurrentElement->GetOwnerDocument(getter_AddRefs(ownerDoc)); nsCOMPtr windowDoc; mCurrentWindow->GetDocument(getter_AddRefs(windowDoc)); - if (ownerDoc == windowDoc) + if (ownerDoc != windowDoc) mCurrentElement = nsnull; } diff --git a/rdf/content/src/nsXULCommandDispatcher.cpp b/rdf/content/src/nsXULCommandDispatcher.cpp index 11cead3a4ed5..15f6d7176abd 100644 --- a/rdf/content/src/nsXULCommandDispatcher.cpp +++ b/rdf/content/src/nsXULCommandDispatcher.cpp @@ -371,7 +371,7 @@ nsXULCommandDispatcher::Focus(nsIDOMEvent* aEvent) nsCOMPtr domDoc = do_QueryInterface(t); if (domDoc) { GetParentWindowFromDocument(domDoc, getter_AddRefs(domWindow)); - if (domWindow && (domWindow != mCurrentWindow)) { + if (domWindow) { SetFocusedWindow(domWindow); if (mCurrentElement) { // Make sure this element is in our window. If not, we @@ -380,7 +380,7 @@ nsXULCommandDispatcher::Focus(nsIDOMEvent* aEvent) mCurrentElement->GetOwnerDocument(getter_AddRefs(ownerDoc)); nsCOMPtr windowDoc; mCurrentWindow->GetDocument(getter_AddRefs(windowDoc)); - if (ownerDoc == windowDoc) + if (ownerDoc != windowDoc) mCurrentElement = nsnull; }