Index: Source/modules/speech/SpeechSynthesis.cpp |
diff --git a/Source/modules/speech/SpeechSynthesis.cpp b/Source/modules/speech/SpeechSynthesis.cpp |
index 363ea98d9b61ad5827bb5219818c8e2ed56933a5..2aec9f1a36cea31c44185551859e95722cc1f789 100644 |
--- a/Source/modules/speech/SpeechSynthesis.cpp |
+++ b/Source/modules/speech/SpeechSynthesis.cpp |
@@ -153,12 +153,12 @@ void SpeechSynthesis::handleSpeakingCompleted(SpeechSynthesisUtterance* utteranc |
{ |
ASSERT(utterance); |
- bool didJustFinishCurrentUtterance = false; |
+ bool shouldStartSpeaking = false; |
// If the utterance that completed was the one we're currently speaking, |
// remove it from the queue and start speaking the next one. |
if (utterance == currentSpeechUtterance()) { |
m_utteranceQueue.removeFirst(); |
- didJustFinishCurrentUtterance = true; |
+ shouldStartSpeaking = !!m_utteranceQueue.size(); |
} |
// Always fire the event, because the platform may have asynchronously |
@@ -168,7 +168,7 @@ void SpeechSynthesis::handleSpeakingCompleted(SpeechSynthesisUtterance* utteranc |
fireEvent(errorOccurred ? EventTypeNames::error : EventTypeNames::end, utterance, 0, String()); |
// Start the next utterance if we just finished one and one was pending. |
- if (didJustFinishCurrentUtterance && !m_utteranceQueue.isEmpty() && !utterance->startTime()) |
+ if (shouldStartSpeaking && !m_utteranceQueue.isEmpty()) |
startSpeakingImmediately(); |
} |