1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-26 05:46:58 +00:00

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

This commit is contained in:
Moonchild
2026-05-25 20:32:10 +02:00
committed by roytam1
parent 9afa7a80cc
commit f041eb0607
2 changed files with 8 additions and 0 deletions
@@ -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)