Title: [261984] trunk/Source/WebCore
- Revision
- 261984
- Author
- [email protected]
- Date
- 2020-05-20 22:46:51 -0700 (Wed, 20 May 2020)
Log Message
REGRESSION (iOS 13.4.1): SpeechSynthesisUtterance.onend event won't fire on cancel().
https://bugs.webkit.org/show_bug.cgi?id=211776
<rdar://problem/63130249>
Reviewed by Per Arne Vollan.
With the move to having speech synthesis happen in the client, the cancel case hits a snag.
We cancel the speech job and clear out the current utterance. By the time the cancel callback comes back,
the current utterance is gone and nothing happens.
The fix is to process the speechError event immediately and not wait on the speech synthesizer -- which seems sane,
since we're just cancelling a speech job.
* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::cancel):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (261983 => 261984)
--- trunk/Source/WebCore/ChangeLog 2020-05-21 04:16:37 UTC (rev 261983)
+++ trunk/Source/WebCore/ChangeLog 2020-05-21 05:46:51 UTC (rev 261984)
@@ -1,3 +1,21 @@
+2020-05-20 Chris Fleizach <[email protected]>
+
+ REGRESSION (iOS 13.4.1): SpeechSynthesisUtterance.onend event won't fire on cancel().
+ https://bugs.webkit.org/show_bug.cgi?id=211776
+ <rdar://problem/63130249>
+
+ Reviewed by Per Arne Vollan.
+
+ With the move to having speech synthesis happen in the client, the cancel case hits a snag.
+ We cancel the speech job and clear out the current utterance. By the time the cancel callback comes back,
+ the current utterance is gone and nothing happens.
+
+ The fix is to process the speechError event immediately and not wait on the speech synthesizer -- which seems sane,
+ since we're just cancelling a speech job.
+
+ * Modules/speech/SpeechSynthesis.cpp:
+ (WebCore::SpeechSynthesis::cancel):
+
2020-05-20 Darin Adler <[email protected]>
Dictation context should be an object identifier, not a type-punned pointer
Modified: trunk/Source/WebCore/Modules/speech/SpeechSynthesis.cpp (261983 => 261984)
--- trunk/Source/WebCore/Modules/speech/SpeechSynthesis.cpp 2020-05-21 04:16:37 UTC (rev 261983)
+++ trunk/Source/WebCore/Modules/speech/SpeechSynthesis.cpp 2020-05-21 05:46:51 UTC (rev 261984)
@@ -151,6 +151,9 @@
m_utteranceQueue.clear();
if (m_speechSynthesisClient) {
m_speechSynthesisClient->cancel();
+ // If we wait for cancel to callback speakingErrorOccurred, then m_currentSpeechUtterance will be null
+ // and the event won't be processed. Instead we process the error immediately.
+ speakingErrorOccurred();
m_currentSpeechUtterance = nullptr;
} else if (m_platformSpeechSynthesizer) {
m_platformSpeechSynthesizer->cancel();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes