Bug 935786 - Assertion failure: !IsInnerWindow() || IsCurrentInnerWindow() at nsGlobalWindow.cpp:8909. r=smaug

CLOSED TREE
This commit is contained in:
Peter Van der Beken 2013-11-13 09:47:37 +01:00
parent 182df38e7c
commit 86181bcd60
3 changed files with 8 additions and 5 deletions

View File

@ -8942,11 +8942,14 @@ NS_IMPL_REMOVE_SYSTEM_EVENT_LISTENER(nsGlobalWindow)
NS_IMETHODIMP
nsGlobalWindow::DispatchEvent(nsIDOMEvent* aEvent, bool* aRetVal)
{
MOZ_ASSERT(!IsInnerWindow() || IsCurrentInnerWindow(),
"We should only fire events on the current inner window.");
FORWARD_TO_INNER(DispatchEvent, (aEvent, aRetVal), NS_OK);
if (!IsCurrentInnerWindow()) {
NS_WARNING("DispatchEvent called on non-current inner window, dropping. "
"Please check the window in the caller instead.");
return NS_ERROR_FAILURE;
}
if (!mDoc) {
return NS_ERROR_FAILURE;
}

View File

@ -175,7 +175,7 @@ WindowCannotReceiveSensorEvent (nsPIDOMWindow* aWindow)
// Check to see if this window is in the background. If
// it is and it does not have the "background-sensors" permission,
// don't send any device motion events to it.
if (!aWindow || !aWindow->GetOuterWindow()) {
if (!aWindow || !aWindow->IsCurrentInnerWindow()) {
return true;
}

View File

@ -47,7 +47,7 @@ bool
nsAutoWindowStateHelper::DispatchEventToChrome(const char *aEventName)
{
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(mWindow);
if (!window) {
if (!window || (window->IsInnerWindow() && !window->IsCurrentInnerWindow())) {
return true;
}