Skip to content

Web Speech API: speechSynthesis.clear() removes utterances from following speechSynthesis.speak(...) as well#60457

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
fleizach:eng/Web-Speech-API-speechSynthesis-clear-removes-utterances-from-following-speechSynthesis-speak-as-well
Mar 16, 2026
Merged

Web Speech API: speechSynthesis.clear() removes utterances from following speechSynthesis.speak(...) as well#60457
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
fleizach:eng/Web-Speech-API-speechSynthesis-clear-removes-utterances-from-following-speechSynthesis-speak-as-well

Conversation

@fleizach
Copy link
Contributor

@fleizach fleizach commented Mar 12, 2026

3dc3ba3

Web Speech API: `speechSynthesis.clear()` removes utterances from following `speechSynthesis.speak(...)` as well
https://bugs.webkit.org/show_bug.cgi?id=191745
rdar://46151521

Reviewed by Tyler Wilcock.

Because cancel() callbacks happen asynchronously on the platform synthesizer, they can clear out the wrong utterance.

Test: fast/speechsynthesis/speech-synthesis-cancel-queued-utterances.html

* LayoutTests/fast/speechsynthesis/speech-synthesis-cancel-queued-utterances-expected.txt: Added.
* LayoutTests/fast/speechsynthesis/speech-synthesis-cancel-queued-utterances.html: Added.
* Source/WebCore/Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::cancel):
(WebCore::SpeechSynthesis::handleSpeakingCompleted):
* Source/WebCore/platform/mock/PlatformSpeechSynthesizerMock.cpp:
(WebCore::PlatformSpeechSynthesizerMock::cancel):

Canonical link: https://commits.webkit.org/309349@main

9922248

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win ✅ 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ❌ 🧪 win-tests ✅ 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe ✅ 🛠 vision-apple
✅ 🧪 ios-wk2-wpt ✅ 🧪 api-mac-debug ✅ 🛠 gtk3-libwebrtc
✅ 🧪 api-ios ✅ 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🛠 ios-safer-cpp ✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🛠 playstation
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@fleizach fleizach requested a review from marcoscaceres as a code owner March 12, 2026 14:54
@fleizach fleizach self-assigned this Mar 12, 2026
@fleizach fleizach added the Accessibility For bugs related to accessibility. label Mar 12, 2026
@webkit-ews-buildbot
Copy link
Collaborator

macOS Safer C++ Build #85570 (25dfc71)

❌ Found 1 failing file with 1 issue. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming.
(cc @rniwa)

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Mar 12, 2026
@webkit-ews-buildbot
Copy link
Collaborator

iOS Safer C++ Build #3799 (25dfc71)

❌ Found 1 failing file with 1 issue. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming.
(cc @rniwa)

@fleizach fleizach removed the merging-blocked Applied to prevent a change from being merged label Mar 13, 2026
@fleizach fleizach force-pushed the eng/Web-Speech-API-speechSynthesis-clear-removes-utterances-from-following-speechSynthesis-speak-as-well branch from 25dfc71 to 9922248 Compare March 13, 2026 04:13
@fleizach fleizach added the merge-queue Applied to send a pull request to merge-queue label Mar 16, 2026
…lowing `speechSynthesis.speak(...)` as well

https://bugs.webkit.org/show_bug.cgi?id=191745
rdar://46151521

Reviewed by Tyler Wilcock.

Because cancel() callbacks happen asynchronously on the platform synthesizer, they can clear out the wrong utterance.

Test: fast/speechsynthesis/speech-synthesis-cancel-queued-utterances.html

* LayoutTests/fast/speechsynthesis/speech-synthesis-cancel-queued-utterances-expected.txt: Added.
* LayoutTests/fast/speechsynthesis/speech-synthesis-cancel-queued-utterances.html: Added.
* Source/WebCore/Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::cancel):
(WebCore::SpeechSynthesis::handleSpeakingCompleted):
* Source/WebCore/platform/mock/PlatformSpeechSynthesizerMock.cpp:
(WebCore::PlatformSpeechSynthesizerMock::cancel):

Canonical link: https://commits.webkit.org/309349@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Web-Speech-API-speechSynthesis-clear-removes-utterances-from-following-speechSynthesis-speak-as-well branch from 9922248 to 3dc3ba3 Compare March 16, 2026 21:48
@webkit-commit-queue
Copy link
Collaborator

Committed 309349@main (3dc3ba3): https://commits.webkit.org/309349@main

Reviewed commits have been landed. Closing PR #60457 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 3dc3ba3 into WebKit:main Mar 16, 2026
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Accessibility For bugs related to accessibility.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants