LibWeb: Stub SpeechSynthesis.cancel()

This was preventing an Emscripten compiled version of ScummVM to load
games.
This commit is contained in:
Jelle Raaijmakers 2026-02-10 09:47:04 +01:00 committed by Andreas Kling
parent 803e71ba9f
commit 0a334f50db
4 changed files with 13 additions and 5 deletions

View file

@ -49,6 +49,12 @@ GC::Ptr<WebIDL::CallbackType> SpeechSynthesis::onvoiceschanged()
return event_handler_attribute(HTML::EventNames::voiceschanged);
}
// https://wicg.github.io/speech-api/#dom-speechsynthesis-cancel
void SpeechSynthesis::cancel()
{
dbgln("FIXME: Implement SpeechSynthesis::cancel()");
}
// https://wicg.github.io/speech-api/#dom-speechsynthesis-getvoices
Vector<GC::Ref<SpeechSynthesisVoice>> const& SpeechSynthesis::get_voices() const
{

View file

@ -34,6 +34,8 @@ public:
void set_onvoiceschanged(GC::Ptr<WebIDL::CallbackType>);
GC::Ptr<WebIDL::CallbackType> onvoiceschanged();
void cancel();
Vector<GC::Ref<SpeechSynthesisVoice>> const& get_voices() const;
private:

View file

@ -13,7 +13,7 @@ interface SpeechSynthesis : EventTarget {
attribute EventHandler onvoiceschanged;
[FIXME] undefined speak(SpeechSynthesisUtterance utterance);
[FIXME] undefined cancel();
undefined cancel();
[FIXME] undefined pause();
[FIXME] undefined resume();
sequence<SpeechSynthesisVoice> getVoices();

View file

@ -2,8 +2,8 @@ Harness status: OK
Found 250 tests
186 Pass
64 Fail
188 Pass
62 Fail
Fail idl_test setup
Pass idl_test validation
Pass Partial interface Window: original interface defined
@ -166,7 +166,7 @@ Pass SpeechSynthesis interface: attribute speaking
Pass SpeechSynthesis interface: attribute paused
Pass SpeechSynthesis interface: attribute onvoiceschanged
Fail SpeechSynthesis interface: operation speak(SpeechSynthesisUtterance)
Fail SpeechSynthesis interface: operation cancel()
Pass SpeechSynthesis interface: operation cancel()
Fail SpeechSynthesis interface: operation pause()
Fail SpeechSynthesis interface: operation resume()
Pass SpeechSynthesis interface: operation getVoices()
@ -178,7 +178,7 @@ Pass SpeechSynthesis interface: speechSynthesis must inherit property "paused" w
Pass SpeechSynthesis interface: speechSynthesis must inherit property "onvoiceschanged" with the proper type
Fail SpeechSynthesis interface: speechSynthesis must inherit property "speak(SpeechSynthesisUtterance)" with the proper type
Pass SpeechSynthesis interface: calling speak(SpeechSynthesisUtterance) on speechSynthesis with too few arguments must throw TypeError
Fail SpeechSynthesis interface: speechSynthesis must inherit property "cancel()" with the proper type
Pass SpeechSynthesis interface: speechSynthesis must inherit property "cancel()" with the proper type
Fail SpeechSynthesis interface: speechSynthesis must inherit property "pause()" with the proper type
Fail SpeechSynthesis interface: speechSynthesis must inherit property "resume()" with the proper type
Pass SpeechSynthesis interface: speechSynthesis must inherit property "getVoices()" with the proper type