<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>129403</bug_id>
          
          <creation_ts>2014-02-26 16:01:51 -0800</creation_ts>
          <short_desc>speechSynthesis.speak of a zero length utterance kills future speech</short_desc>
          <delta_ts>2014-02-27 12:18:09 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Accessibility</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="chris fleizach">cfleizach</reporter>
          <assigned_to name="chris fleizach">cfleizach</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>mario</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>984963</commentid>
    <comment_count>0</comment_count>
    <who name="chris fleizach">cfleizach</who>
    <bug_when>2014-02-26 16:01:51 -0800</bug_when>
    <thetext>Steps to Reproduce:
&lt;script&gt;
speechSynthesis.speak( new SpeechSynthesisUtterance(&quot;&quot;));
speechSynthesis.speak( new SpeechSynthesisUtterance(&quot;hello&quot;))
&lt;/script&gt;

Expected Results:
It should say hello.

Actual Results:
speechSynthesis.speak is hung until I call speechSynthesis.cancel()

&lt;rdar://problem/16168664&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>984990</commentid>
    <comment_count>1</comment_count>
      <attachid>225322</attachid>
    <who name="chris fleizach">cfleizach</who>
    <bug_when>2014-02-26 16:51:04 -0800</bug_when>
    <thetext>Created attachment 225322
patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>985088</commentid>
    <comment_count>2</comment_count>
      <attachid>225322</attachid>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2014-02-27 02:21:44 -0800</bug_when>
    <thetext>Comment on attachment 225322
patch

Looks good to me, hence the r+. Still, I wonder that the problem this is fixing happens only for empty (zero-length) strings, or for anything that should not spoken at all, such as a string containing only blanks or unpronounceable characters. If that&apos;s the case, maybe it would make sense to check that in advance and early return if needed.

What do you think?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>985195</commentid>
    <comment_count>3</comment_count>
    <who name="chris fleizach">cfleizach</who>
    <bug_when>2014-02-27 09:11:50 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 225322 [details])
&gt; Looks good to me, hence the r+. Still, I wonder that the problem this is fixing happens only for empty (zero-length) strings, or for anything that should not spoken at all, such as a string containing only blanks or unpronounceable characters. If that&apos;s the case, maybe it would make sense to check that in advance and early return if needed.
&gt; 
&gt; What do you think?

This a bit of an unknown unfortunately. I don&apos;t think an empty string would cause every synthesizer to choke for example. It just happens that it does so on Mac. This is the first case I&apos;ve heard of it happening, so I&apos;m happy to be conservative about what we strip out. 

Likewise, it&apos;s not always clear what a synthesizer can speak or not. Not all of them have API that allows you to know if a character is speakable or not. And even if something was not speakable, the synth may use that for pausing. Likewise, it may be able to normalize a character like é to e, even though it can&apos;t speak é.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>985217</commentid>
    <comment_count>4</comment_count>
      <attachid>225322</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-02-27 09:44:14 -0800</bug_when>
    <thetext>Comment on attachment 225322
patch

Clearing flags on attachment: 225322

Committed r164807: &lt;http://trac.webkit.org/changeset/164807&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>985218</commentid>
    <comment_count>5</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-02-27 09:44:16 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>985299</commentid>
    <comment_count>6</comment_count>
      <attachid>225322</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2014-02-27 12:15:14 -0800</bug_when>
    <thetext>Comment on attachment 225322
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=225322&amp;action=review

&gt; Source/WebCore/Modules/speech/SpeechSynthesis.cpp:115
&gt; +    // Zero lengthed strings should immediately notify that the event is complete.
&gt; +    if (utterance-&gt;text().isEmpty()) {
&gt; +        handleSpeakingCompleted(utterance, false);
&gt; +        return;
&gt; +    }

Are there any other strings that don’t work right? I guess that putting this check here relieves all the platforms of the need to handle empty strings, but what about strings with just spaces in them? Do those cause the same problems?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>985301</commentid>
    <comment_count>7</comment_count>
    <who name="chris fleizach">cfleizach</who>
    <bug_when>2014-02-27 12:18:09 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; (From update of attachment 225322 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=225322&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/Modules/speech/SpeechSynthesis.cpp:115
&gt; &gt; +    // Zero lengthed strings should immediately notify that the event is complete.
&gt; &gt; +    if (utterance-&gt;text().isEmpty()) {
&gt; &gt; +        handleSpeakingCompleted(utterance, false);
&gt; &gt; +        return;
&gt; &gt; +    }
&gt; 
&gt; Are there any other strings that don’t work right? I guess that putting this check here relieves all the platforms of the need to handle empty strings, but what about strings with just spaces in them? Do those cause the same problems?

I haven&apos;t noticed issues with any strings with content in them. It&apos;s always possible there are such sequences, but I&apos;m not aware of them. It&apos;s possible that synthesizers use such strings to help with prosity perhaps.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>225322</attachid>
            <date>2014-02-26 16:51:04 -0800</date>
            <delta_ts>2014-02-27 12:15:14 -0800</delta_ts>
            <desc>patch</desc>
            <filename>patch</filename>
            <type>text/plain</type>
            <size>4795</size>
            <attacher name="chris fleizach">cfleizach</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDE2NDc1OCkKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE4IEBACisyMDE0LTAyLTI2ICBDaHJpcyBG
bGVpemFjaCAgPGNmbGVpemFjaEBhcHBsZS5jb20+CisKKyAgICAgICAgc3BlZWNoU3ludGhlc2lz
LnNwZWFrIG9mIGEgemVybyBsZW5ndGggdXR0ZXJhbmNlIGtpbGxzIGZ1dHVyZSBzcGVlY2gKKyAg
ICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTEyOTQwMworCisg
ICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIEVtcHR5IGxlbmd0
aCBzdHJpbmdzIG1heSBjaG9rZSBhIHN5bnRoZXNpemVyIGFuZCByZXN1bHQgaW4gZGlkRmluaXNo
U3BlYWtpbmcgbm90IGJlaW5nIGNhbGxlZC4gCisgICAgICAgIFRoZSBXZWJLaXQgY29kZSBzaG91
bGQgYmUgcHJvYWN0aXZlIGFib3V0IHNjcmVlbmluZyBvdXQgZW1wdHkgbGVuZ3RoIHN0cmluZ3Mu
CisKKyAgICAgICAgVGVzdDogcGxhdGZvcm0vbWFjL2Zhc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