[DOM] Stop speech synthesis if the originating document is closed.

This commit is contained in:
Moonchild committed 2026-05-25 20:32:10 +02:00
1 parent 2d91c80555
commit 3be679effc
2 files changed
+8

No files matched your search

@@ -293,6 +293,12 @@ SpeechSynthesis::ForceEnd()
}
}
void SpeechSynthesis::DisconnectFromOwner() {
Pause();
Cancel();
DOMEventTargetHelper::DisconnectFromOwner();
}
NS_IMETHODIMP
SpeechSynthesis::Observe(nsISupports* aSubject, const char* aTopic,
const char16_t* aData)
@@ -58,6 +58,8 @@ public:
void GetVoices(nsTArray< RefPtr<SpeechSynthesisVoice> >& aResult);
void ForceEnd();
void DisconnectFromOwner() override;
IMPL_EVENT_HANDLER(voiceschanged)