Bug 91364 - It is invalid when both numberOfInputChannels and numberOfOutputChannels to be zero in JavaScriptAudioNode.
Summary: It is invalid when both numberOfInputChannels and numberOfOutputChannels to b...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Li Yin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-16 00:26 PDT by Li Yin
Modified: 2012-07-25 14:34 PDT (History)
7 users (show)

See Also:


Attachments
Patch (5.35 KB, patch)
2012-07-16 01:12 PDT, Li Yin
no flags Details | Formatted Diff | Diff
Patch (6.48 KB, patch)
2012-07-20 18:09 PDT, Li Yin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Li Yin 2012-07-16 00:26:09 PDT
From Spec: http://www.w3.org/TR/webaudio/#JavaScriptAudioNode-section
numberOfInputChannels and numberOfOutputChannels determine the number of input and output channels.
It is invalid for both numberOfInputChannels and numberOfOutputChannels to be zero.
Comment 1 Li Yin 2012-07-16 01:12:10 PDT
Created attachment 152496 [details]
Patch
Comment 2 Kentaro Hara 2012-07-18 01:08:14 PDT
Looks reasonable. (I am not an AudioContext guy though.)
Comment 3 Li Yin 2012-07-18 01:23:37 PDT
(In reply to comment #2)
> Looks reasonable. (I am not an AudioContext guy though.)

Thanks for your review.
Comment 4 Raymond Toy 2012-07-19 11:04:51 PDT
Comment on attachment 152496 [details]
Patch

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

Just a few minor comments on the pass/fail messages.  Otherwise it looks good.  Should we test the case where inputs = 0 and outputs = 2 and inputs = 2 and outputs = 0?

> LayoutTests/webaudio/javascriptaudionode.html:92
> +        testFailed("Exception should be thrown for both of numberOfInputChannels and numberOfOutputChannels to be zero.");

Slight grammatical fix:

"Exception should be thrown when both numberOfInputChannels and numberOfOutputChannels are zero."

> LayoutTests/webaudio/javascriptaudionode.html:94
> +        testPassed("Exception was thrown for both of numberOfInputChannels and numberOfOutputChannels to be zero.");

"Exception was thrown when both numberOfInputChannels and numberOfOutputChannels are zero."

> LayoutTests/webaudio/javascriptaudionode.html:101
> +        testFailed("Exception should not be thrown.");

Be more explicit on failure to match the pass case?  Something like

"Exception should not be thrown when numberOfInputChannels = 1 and numberOfOutputChannels = 0."

> LayoutTests/webaudio/javascriptaudionode.html:108
> +        testFailed("Exception should not be thrown.");

Be more explicit on failure to match the pass case?  Something like

"Exception should not be thrown when numberOfInputChannels = 0 and numberOfOutputChannels = 1."
Comment 5 Li Yin 2012-07-20 18:09:58 PDT
Created attachment 153633 [details]
Patch
Comment 6 Li Yin 2012-07-20 18:12:23 PDT
(In reply to comment #4)
> (From update of attachment 152496 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=152496&action=review
> 
> Just a few minor comments on the pass/fail messages.  Otherwise it looks good.  Should we test the case where inputs = 0 and outputs = 2 and inputs = 2 and outputs = 0?
> 
> > LayoutTests/webaudio/javascriptaudionode.html:92
> > +        testFailed("Exception should be thrown for both of numberOfInputChannels and numberOfOutputChannels to be zero.");
> 
> Slight grammatical fix:
> 
> "Exception should be thrown when both numberOfInputChannels and numberOfOutputChannels are zero."
> 
> > LayoutTests/webaudio/javascriptaudionode.html:94
> > +        testPassed("Exception was thrown for both of numberOfInputChannels and numberOfOutputChannels to be zero.");
> 
> "Exception was thrown when both numberOfInputChannels and numberOfOutputChannels are zero."
> 
> > LayoutTests/webaudio/javascriptaudionode.html:101
> > +        testFailed("Exception should not be thrown.");
> 
> Be more explicit on failure to match the pass case?  Something like
> 
> "Exception should not be thrown when numberOfInputChannels = 1 and numberOfOutputChannels = 0."
> 
> > LayoutTests/webaudio/javascriptaudionode.html:108
> > +        testFailed("Exception should not be thrown.");
> 
> Be more explicit on failure to match the pass case?  Something like
> 
> "Exception should not be thrown when numberOfInputChannels = 0 and numberOfOutputChannels = 1."

Done.
Thanks for your comments.
Comment 7 Kenneth Russell 2012-07-24 16:25:23 PDT
Raymond, is this patch ready to go in your opinion?
Comment 8 Raymond Toy 2012-07-24 16:41:04 PDT
(In reply to comment #7)
> Raymond, is this patch ready to go in your opinion?

Yes, pretty much.  

BUT, there has been some recent (side) discussion on the W3C audio list about whether JavaScriptNode's should allow 0 inputs.  I can't seem to find the relevant messages right now, so perhaps we should hold off on this.
Comment 9 Kenneth Russell 2012-07-24 16:50:45 PDT
Comment on attachment 153633 [details]
Patch

OK. I'm clearing the review bit in this case. Please request review again once this is determined.
Comment 10 Li Yin 2012-07-24 18:29:30 PDT
(In reply to comment #8)
> (In reply to comment #7)
> > Raymond, is this patch ready to go in your opinion?
> 
> Yes, pretty much.  
> 
> BUT, there has been some recent (side) discussion on the W3C audio list about whether JavaScriptNode's should allow 0 inputs.  I can't seem to find the relevant messages right now, so perhaps we should hold off on this.

Hi Raymond, could you please add some detailed information about this discussion? I can't find it in recent mail list.
Thanks.
Comment 11 Raymond Toy 2012-07-25 08:54:39 PDT
(In reply to comment #10)
> (In reply to comment #8)
> > (In reply to comment #7)
> > > Raymond, is this patch ready to go in your opinion?
> > 
> > Yes, pretty much.  
> > 
> > BUT, there has been some recent (side) discussion on the W3C audio list about whether JavaScriptNode's should allow 0 inputs.  I can't seem to find the relevant messages right now, so perhaps we should hold off on this.
> 
> Hi Raymond, could you please add some detailed information about this discussion? I can't find it in recent mail list.
> Thanks.

I can't find the discussion either.  But the spec clearly allows 0 inputs, and your patch allows that and clearly disallows the case when the number of inputs and outputs are both 0.

This looks fine to me.  Sorry for the trouble.
Comment 12 Kenneth Russell 2012-07-25 14:10:39 PDT
Comment on attachment 153633 [details]
Patch

Thanks Raymond. r=me
Comment 13 WebKit Review Bot 2012-07-25 14:34:15 PDT
Comment on attachment 153633 [details]
Patch

Clearing flags on attachment: 153633

Committed r123662: <http://trac.webkit.org/changeset/123662>
Comment 14 WebKit Review Bot 2012-07-25 14:34:20 PDT
All reviewed patches have been landed.  Closing bug.