From c6ad9738fe85c5102a4aa87ed40ad7a502db9724 Mon Sep 17 00:00:00 2001 From: Randy Lin Date: Sun, 1 Dec 2013 13:23:00 +0800 Subject: [PATCH] Bug 944130 - test_speakermanager.html: ASSERTION: background state is only maintained on outer windows. r=amarchesini --- dom/speakermanager/SpeakerManager.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dom/speakermanager/SpeakerManager.cpp b/dom/speakermanager/SpeakerManager.cpp index ecfc92e24ce..d9ba574a0e8 100644 --- a/dom/speakermanager/SpeakerManager.cpp +++ b/dom/speakermanager/SpeakerManager.cpp @@ -110,10 +110,12 @@ SpeakerManager::DispatchSimpleEvent(const nsAString& aStr) void SpeakerManager::Init(nsPIDOMWindow* aWindow) { - BindToOwner(aWindow->IsOuterWindow() ? - aWindow->GetCurrentInnerWindow() : aWindow); + BindToOwner(aWindow); + + nsCOMPtr docshell = do_GetInterface(GetOwner()); + NS_ENSURE_TRUE_VOID(docshell); + docshell->GetIsActive(&mVisible); - mVisible = !GetOwner()->IsBackground(); nsCOMPtr target = do_QueryInterface(GetOwner()); NS_ENSURE_TRUE_VOID(target);