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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>21240</bug_id>
          
          <creation_ts>2013-03-10 17:10:27 +0000</creation_ts>
          <short_desc>Specify what should happen when passing invalid offset/duration values to AudioBufferSourceNode.start</short_desc>
          <delta_ts>2014-10-28 17:16:26 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>AudioWG</product>
          <component>Web Audio API</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>TBD</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ehsan Akhgari [:ehsan]">ehsan</reporter>
          <assigned_to name="Chris Rogers">crogers</assigned_to>
          <cc>joe</cc>
    
    <cc>roc</cc>
          
          <qa_contact>public-audio</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>84202</commentid>
    <comment_count>0</comment_count>
      <attachid>1331</attachid>
    <who name="Ehsan Akhgari [:ehsan]">ehsan</who>
    <bug_when>2013-03-10 17:10:27 +0000</bug_when>
    <thetext>Created attachment 1331
Test case

We need to specify what happens when these values are invalid, for example, negative, or greater than the length of the buffer.

Currently, WebKit ignores offset if it&apos;s negative but smaller than the length of the buffer, and in that case respects duration.  If a value larger than the length of the buffer is passed as offset, then WebKit ignores both offset and duration.  It would have probably made much more sense if these kinds of invalid values would throw DOM_SYNTAX_ERR as these are probably not what the author would intend to pass in.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84203</commentid>
    <comment_count>1</comment_count>
    <who name="Ehsan Akhgari [:ehsan]">ehsan</who>
    <bug_when>2013-03-10 17:49:15 +0000</bug_when>
    <thetext>The same kind of problem seems to apply to loopStart as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84206</commentid>
    <comment_count>2</comment_count>
    <who name="Robert O&apos;Callahan (Mozilla)">roc</who>
    <bug_when>2013-03-10 21:26:13 +0000</bug_when>
    <thetext>I don&apos;t think throwing an exception is necessary here.

I don&apos;t like the behavior of just ignoring the offset if it&apos;s &gt;= the length of the buffer. That creates a discontinuity as the offset increases from before the buffer end to after it.

If compatibility issues don&apos;t trump, then I suggest first clamping the offset to [0, length], then adding the duration to find the endpoint and clamping the endpoint.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87243</commentid>
    <comment_count>3</comment_count>
    <who name="Ehsan Akhgari [:ehsan]">ehsan</who>
    <bug_when>2013-05-04 15:28:51 +0000</bug_when>
    <thetext>Chris, what do you think the right behavior here should be?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92269</commentid>
    <comment_count>4</comment_count>
    <who name="Joe Berkovitz / NF">joe</who>
    <bug_when>2013-08-19 14:40:14 +0000</bug_when>
    <thetext>Also note bug 23007. If we accept that the duration value is shorthand for calling stop() at a specified temporal offset, then this bug goes away (or should be recast in terms of asking stop() to throw exceptions for invalid time offsets, etc.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113845</commentid>
    <comment_count>5</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2014-10-28 17:13:30 +0000</bug_when>
    <thetext>Web Audio API issues have been migrated to Github. 
See https://github.com/WebAudio/web-audio-api/issues</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113988</commentid>
    <comment_count>6</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2014-10-28 17:16:26 +0000</bug_when>
    <thetext>Closing. See https://github.com/WebAudio/web-audio-api/issues for up to date list of issues for the Web Audio API.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>1331</attachid>
            <date>2013-03-10 17:10:27 +0000</date>
            <delta_ts>2013-03-10 17:10:27 +0000</delta_ts>
            <desc>Test case</desc>
            <filename>negativeoffset.html</filename>
            <type>text/html</type>
            <size>871</size>
            <attacher name="Ehsan Akhgari [:ehsan]">ehsan</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIEhUTUw+DQo8Ym9keT4NCjxzY3JpcHQ+DQp2YXIgVCA9IDAuNTsNCnRyeSB7DQog
IHZhciBjdHggPSBuZXcgQXVkaW9Db250ZXh0KCk7DQp9IGNhdGNoIChlKSB7DQogIGN0eCA9IG5l
dyB3ZWJraXRBdWRpb0NvbnRleHQoKTsNCn0NCnZhciBidWZmZXJzID0gW107DQpmb3IgKHZhciBp
ID0gMDsgaSA8IDE7ICsraSkgew0KICB2YXIgY2hhbm5lbHMgPSAxOw0KICB2YXIgYnVmZmVyID0g
Y3R4LmNyZWF0ZUJ1ZmZlcihjaGFubmVscywgVCpjdHguc2FtcGxlUmF0ZSwgY3R4LnNhbXBsZVJh
dGUpOw0KICB2YXIgZiA9IDMwMDAgKyAoaSoxMDApOw0KICBmb3IgKHZhciBqID0gMDsgaiA8IGJ1
ZmZlci5sZW5ndGg7ICsraikgew0KICAgIHZhciBzYW1wbGUgPSBNYXRoLnNpbigoai9jdHguc2Ft
cGxlUmF0ZSkqTWF0aC5QSSoyKmYpOw0KCWZvciAodmFyIGMgPSAwOyBjIDwgY2hhbm5lbHM7ICsr
Yykgew0KICAgICAgYnVmZmVyLmdldENoYW5uZWxEYXRhKGMpW2pdID0gc2FtcGxlOw0KCX0NCiAg
fQ0KICBidWZmZXJzW2ldID0gYnVmZmVyOw0KfQ0KDQpmdW5jdGlvbiBwbGF5KG9mZnNldCwgZHVy
YXRp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