mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 866600 - Avoid using nsIDOMDocument::GetHidden; r=mounir
This commit is contained in:
parent
634a0652fb
commit
6a31fab03c
@ -3252,16 +3252,10 @@ void HTMLMediaElement::SuspendOrResumeElement(bool aPauseElement, bool aSuspendE
|
||||
void HTMLMediaElement::NotifyOwnerDocumentActivityChanged()
|
||||
{
|
||||
nsIDocument* ownerDoc = OwnerDoc();
|
||||
if (UseAudioChannelService()) {
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(OwnerDoc());
|
||||
if (domDoc) {
|
||||
bool hidden = false;
|
||||
domDoc->GetHidden(&hidden);
|
||||
// SetVisibilityState will update mChannelSuspended via the CanPlayChanged callback.
|
||||
if (mPlayingThroughTheAudioChannel && mAudioChannelAgent) {
|
||||
mAudioChannelAgent->SetVisibilityState(!hidden);
|
||||
}
|
||||
}
|
||||
// SetVisibilityState will update mChannelSuspended via the CanPlayChanged callback.
|
||||
if (UseAudioChannelService() && mPlayingThroughTheAudioChannel &&
|
||||
mAudioChannelAgent) {
|
||||
mAudioChannelAgent->SetVisibilityState(!ownerDoc->Hidden());
|
||||
}
|
||||
bool suspendEvents = !ownerDoc->IsActive() || !ownerDoc->IsVisible();
|
||||
bool pauseElement = suspendEvents || mChannelSuspended;
|
||||
@ -3729,13 +3723,7 @@ void HTMLMediaElement::UpdateAudioChannelPlayingState()
|
||||
}
|
||||
// Use a weak ref so the audio channel agent can't leak |this|.
|
||||
mAudioChannelAgent->InitWithWeakCallback(mAudioChannelType, this);
|
||||
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(OwnerDoc());
|
||||
if (domDoc) {
|
||||
bool hidden = false;
|
||||
domDoc->GetHidden(&hidden);
|
||||
mAudioChannelAgent->SetVisibilityState(!hidden);
|
||||
}
|
||||
mAudioChannelAgent->SetVisibilityState(!OwnerDoc()->Hidden());
|
||||
}
|
||||
|
||||
if (mPlayingThroughTheAudioChannel) {
|
||||
|
@ -812,9 +812,7 @@ Navigator::Vibrate(const JS::Value& aPattern, JSContext* cx)
|
||||
}
|
||||
gVibrateWindowListener = new VibrateWindowListener(win, doc);
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> domWindow =
|
||||
do_QueryInterface(static_cast<nsIDOMWindow*>(win));
|
||||
hal::Vibrate(pattern, domWindow);
|
||||
hal::Vibrate(pattern, win);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
12
hal/Hal.cpp
12
hal/Hal.cpp
@ -89,17 +89,15 @@ AssertMainProcess()
|
||||
}
|
||||
|
||||
bool
|
||||
WindowIsActive(nsIDOMWindow *window)
|
||||
WindowIsActive(nsIDOMWindow* aWindow)
|
||||
{
|
||||
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aWindow);
|
||||
NS_ENSURE_TRUE(window, false);
|
||||
|
||||
nsCOMPtr<nsIDOMDocument> doc;
|
||||
window->GetDocument(getter_AddRefs(doc));
|
||||
NS_ENSURE_TRUE(doc, false);
|
||||
nsIDocument* document = window->GetDoc();
|
||||
NS_ENSURE_TRUE(document, false);
|
||||
|
||||
bool hidden = true;
|
||||
doc->GetHidden(&hidden);
|
||||
return !hidden;
|
||||
return !document->Hidden();
|
||||
}
|
||||
|
||||
StaticAutoPtr<WindowIdentifier::IDArrayType> gLastIDToVibrate;
|
||||
|
Loading…
Reference in New Issue
Block a user