Changeset 164807 in webkit


Ignore:
Timestamp:
Feb 27, 2014 9:49:45 AM (10 years ago)
Author:
Chris Fleizach
Message:

speechSynthesis.speak of a zero length utterance kills future speech
https://bugs.webkit.org/show_bug.cgi?id=129403

Reviewed by Mario Sanchez Prada.

Source/WebCore:

Empty length strings may choke a synthesizer and result in didFinishSpeaking not being called.
The WebKit code should be proactive about screening out empty length strings.

Test: platform/mac/fast/speechsynthesis/speech-synthesis-speak-empty-string.html

  • Modules/speech/SpeechSynthesis.cpp:

(WebCore::SpeechSynthesis::startSpeakingImmediately):

LayoutTests:

  • platform/mac/fast/speechsynthesis/speech-synthesis-speak-empty-string-expected.txt: Added.
  • platform/mac/fast/speechsynthesis/speech-synthesis-speak-empty-string.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r164805 r164807  
     12014-02-27  Chris Fleizach  <cfleizach@apple.com>
     2
     3        speechSynthesis.speak of a zero length utterance kills future speech
     4        https://bugs.webkit.org/show_bug.cgi?id=129403
     5
     6        Reviewed by Mario Sanchez Prada.
     7
     8        * platform/mac/fast/speechsynthesis/speech-synthesis-speak-empty-string-expected.txt: Added.
     9        * platform/mac/fast/speechsynthesis/speech-synthesis-speak-empty-string.html: Added.
     10
    1112014-02-27  Commit Queue  <commit-queue@webkit.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r164805 r164807  
     12014-02-27  Chris Fleizach  <cfleizach@apple.com>
     2
     3        speechSynthesis.speak of a zero length utterance kills future speech
     4        https://bugs.webkit.org/show_bug.cgi?id=129403
     5
     6        Reviewed by Mario Sanchez Prada.
     7
     8        Empty length strings may choke a synthesizer and result in didFinishSpeaking not being called.
     9        The WebKit code should be proactive about screening out empty length strings.
     10
     11        Test: platform/mac/fast/speechsynthesis/speech-synthesis-speak-empty-string.html
     12
     13        * Modules/speech/SpeechSynthesis.cpp:
     14        (WebCore::SpeechSynthesis::startSpeakingImmediately):
     15
    1162014-02-27  Commit Queue  <commit-queue@webkit.org>
    217
  • trunk/Source/WebCore/Modules/speech/SpeechSynthesis.cpp

    r161638 r164807  
    108108    m_currentSpeechUtterance = utterance;
    109109    m_isPaused = false;
     110   
     111    // Zero lengthed strings should immediately notify that the event is complete.
     112    if (utterance->text().isEmpty()) {
     113        handleSpeakingCompleted(utterance, false);
     114        return;
     115    }
     116   
    110117    if (!m_platformSpeechSynthesizer)
    111118        m_platformSpeechSynthesizer = PlatformSpeechSynthesizer::create(this);
Note: See TracChangeset for help on using the changeset viewer.