Bug 90952 - AudioPannerNode should raise exception when distanceModel is set incorrectly
Summary: AudioPannerNode should raise exception when distanceModel is set incorrectly
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-11 01:46 PDT by Li Yin
Modified: 2012-07-31 12:14 PDT (History)
7 users (show)

See Also:


Attachments
Patch (15.15 KB, patch)
2012-07-11 07:21 PDT, Li Yin
no flags Details | Formatted Diff | Diff
Patch (14.20 KB, patch)
2012-07-22 19:43 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-11 01:46:10 PDT
From Spec: http://www.w3.org/TR/webaudio/#AudioPannerNode-section
The distance model can be set to LINEAR_DISTANCE, INVERSE_DISTANCE or EXPONENTIAL_DISTANCE.
It will be better to raise exception, when it is set incorrectly, like panningModel.
Comment 1 Li Yin 2012-07-11 07:21:45 PDT
Created attachment 151702 [details]
Patch
Comment 2 Raymond Toy 2012-07-19 10:45:43 PDT
Comment on attachment 151702 [details]
Patch

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

Except for the two questions, this looks good.  Thanks for the patch!

> Source/WebCore/Modules/webaudio/AudioPannerNode.idl:41
> +        attribute unsigned short panningModel

Does the glue generation support unsigned short now?

> Source/WebCore/Modules/webaudio/AudioPannerNode.idl:50
> +        attribute unsigned short distanceModel

Does the glue generation support unsigned short now?
Comment 3 Li Yin 2012-07-20 18:31:14 PDT
(In reply to comment #1)
> Created an attachment (id=151702) [details]
> Patch

(In reply to comment #2)
> (From update of attachment 151702 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=151702&action=review
> 
> Except for the two questions, this looks good.  Thanks for the patch!
> 
> > Source/WebCore/Modules/webaudio/AudioPannerNode.idl:41
> > +        attribute unsigned short panningModel
> 
> Does the glue generation support unsigned short now?
> 
> > Source/WebCore/Modules/webaudio/AudioPannerNode.idl:50
> > +        attribute unsigned short distanceModel
> 
> Does the glue generation support unsigned short now?

I think so, look this: http://trac.webkit.org/browser/trunk/Source/WebCore/Modules/webaudio/BiquadFilterNode.idl#L40
Comment 4 Kentaro Hara 2012-07-22 18:35:03 PDT
Comment on attachment 151702 [details]
Patch

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

This patch is trying to raise an exception for the code that has not so far raised an exception. Isn't there any compatibility concern?

> Source/WebCore/ChangeLog:8
> +        The distance model can be only set to LINEAR_DISTANCE, INVERSE_DISTANCE or EXPONENTIAL_DISTANCE.

Please add the link to the spec to this ChangeLog.

>>> Source/WebCore/Modules/webaudio/AudioPannerNode.idl:41
>>> +        attribute unsigned short panningModel
>> 
>> Does the glue generation support unsigned short now?
> 
> I think so, look this: http://trac.webkit.org/browser/trunk/Source/WebCore/Modules/webaudio/BiquadFilterNode.idl#L40

Yes, unsigned short is already supported.

> LayoutTests/webaudio/audiopannernode-basic.html:111
> +          if (success) {
> +              testPassed("panningModel and distanceModel tests passed.");
> +          } else {
> +              testFailed("panningModel and distanceModel tests failed.");
> +          }
> +

Nit: I am not sure if the 'success' check is needed. You can remove all 'success'-related code (if you want).
Comment 5 Li Yin 2012-07-22 19:43:34 PDT
Created attachment 153721 [details]
Patch
Comment 6 Li Yin 2012-07-22 19:53:00 PDT
(In reply to comment #4)
> This patch is trying to raise an exception for the code that has not so far raised an exception. Isn't there any compatibility concern?
> 

Currently, there is not related clarification in WebAudio specification.
In WebKit implementation, if panningModel attribute can raise exception, I think distanceModel should do this as well.

> > Source/WebCore/ChangeLog:8
> > +        The distance model can be only set to LINEAR_DISTANCE, INVERSE_DISTANCE or EXPONENTIAL_DISTANCE.
> 
> Please add the link to the spec to this ChangeLog.

Done.

> 
> >>> Source/WebCore/Modules/webaudio/AudioPannerNode.idl:41
> >>> +        attribute unsigned short panningModel
> >> 
> >> Does the glue generation support unsigned short now?
> > 
> > I think so, look this: http://trac.webkit.org/browser/trunk/Source/WebCore/Modules/webaudio/BiquadFilterNode.idl#L40
> 
> Yes, unsigned short is already supported.
> 
> > LayoutTests/webaudio/audiopannernode-basic.html:111
> > +          if (success) {
> > +              testPassed("panningModel and distanceModel tests passed.");
> > +          } else {
> > +              testFailed("panningModel and distanceModel tests failed.");
> > +          }
> > +
> 
> Nit: I am not sure if the 'success' check is needed. You can remove all 'success'-related code (if you want).

Done, yes, we can delete these lines.

Thanks for your review.
Comment 7 Li Yin 2012-07-26 23:18:10 PDT
(In reply to comment #4)
> This patch is trying to raise an exception for the code that has not so far raised an exception. Isn't there any compatibility concern?

From the new spec, some exceptions are added for API, they can define and describe the api better, the compatibility should not be a problem.
Comment 8 Kentaro Hara 2012-07-26 23:21:48 PDT
(In reply to comment #7)
> (In reply to comment #4)
> > This patch is trying to raise an exception for the code that has not so far raised an exception. Isn't there any compatibility concern?
> 
> From the new spec, some exceptions are added for API, they can define and describe the api better, the compatibility should not be a problem.

rtoy: If you think this is OK, I'm happy to r+ the patch.
Comment 9 Li Yin 2012-07-26 23:34:22 PDT
(In reply to comment #8)
> (In reply to comment #7)
> > (In reply to comment #4)
> > > This patch is trying to raise an exception for the code that has not so far raised an exception. Isn't there any compatibility concern?
> > 
> > From the new spec, some exceptions are added for API, they can define and describe the api better, the compatibility should not be a problem.
> 
> rtoy: If you think this is OK, I'm happy to r+ the patch.

According to Comment #2, it seems that Raymond has agreed the patch :)
Comment 10 Li Yin 2012-07-30 17:28:25 PDT
Hi Chris,
  Could you please give some comments? Thanks in advance.
Comment 11 Chris Rogers 2012-07-31 11:51:01 PDT
Comment on attachment 153721 [details]
Patch

Li, thanks for the patch!
Comment 12 WebKit Review Bot 2012-07-31 12:14:25 PDT
Comment on attachment 153721 [details]
Patch

Clearing flags on attachment: 153721

Committed r124237: <http://trac.webkit.org/changeset/124237>
Comment 13 WebKit Review Bot 2012-07-31 12:14:29 PDT
All reviewed patches have been landed.  Closing bug.