-
Notifications
You must be signed in to change notification settings - Fork 167
Population of "node name to parameter descriptor map" needs to be defined #1946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thank you for filing. The hint that these values are converted to "static property" sounds like an ECMAScript concept, but "
The code for sanity checks on the members derives from https://webaudio.github.io/web-audio-api/#dictionary-audioparamdescriptor-members |
Sure, but given that the conversion can have side-effects, throw exceptions, etc, its exact ordering with other observable specification steps needs to be clearly defined. This should probably be an algorithm that is explicitly invoked from the places where such validation is expected to take place. Again, since it has observable behavior (throwing) its ordering with other observable behavior needs to be specified.
Sort of. The non-specced messages on the exceptions are observable. But you're right that in terms of the concepts that are standardized these checks can happen in any order.
Yep.
It's not, correct. This needs to be a separate explicit step after the dictionary conversion. In the case of the "sequence of dictionaries" situation, it's critical to define whether this check is applied after each dictionary conversion or whether the entire |
Thanks for your feedback. It would've been a lot better if we had this discussion two years ago. I am concerned about mixing concepts from ECMAScript and IDL. You need IDL to describe the interface, but also you need ES concepts for the algorithm. Is there any clear boundary? FWIW, Our spec work here is largely based on CSS Paint API. The rough algorithm on the population step would be:
|
I wasn't aware of this spec section until I was asked to review it (or rather some code implementing it) a few days ago... Was there a TAG review for this spec section? I'm somewhat sad that this wasn't caught there, if so.
It's a hard problem, in general. In theory, you can do everything with ES concepts plus infra types (or even ES List and whatnot), as long as you're careful. IDL exists to factor out common patterns of ES concept usage into more easily reusable pieces. So to that extent there is no clear boundary: every so often we add a new thing to IDL that reifies a commonly desired set of ES concept steps. That said, if webassembly is going to be doing direct IDL-type access, there is some value in recasting things that don't need to rely on ES concepts in terms of IDL concepts which might have a non-ES webassembly reflection. Maybe. IDL might end up growing a "class" concept, because several places do want that: pass in the constructor, and then grab stuff from its prototype, etc. It's not there yet. It could be simulated by passing in an object in the original IDL which you then use to manually initialize both a Web IDL callback (for storing the thing you plan to call) and a Web IDL dictionary with a "prototype" property whose value is another dictionary with the things you want off the prototype, with relevant IDL types. So "process" would be a
I'd love a pointer to the section this is based on, in case it has similar issues.
So this is the If so, then the proposed algorithm sounds fine, aassuming "Check if element conforms the type" means doing the checks described for the various members under https://webaudio.github.io/web-audio-api/#dictionary-audioparamdescriptor-members. This would need to be made clear. |
First of all, I really appreciate you taking time to review the section. Also thanks for the explanation on the boundary between IDL and ES.
TAG review (round 2): w3ctag/design-reviews#212
Yes.
Good to hear. But could you point an example of such case? Is there any pre-defined algorithm that I can use for the conformity check? (Object -> AudioParamDescriptor) Or should I just check it manually by going through the keys in the object? |
Just to set up the order: this is blocked on #1947. |
Thank you.
Again, thank you. I'll take a look at that too.
There's no pre-defined algorithm. If I were writing this spec, what I would probably do is:
|
(revised based on #1946 (comment)) This is an expansion of the step 8 in registerProcessor():
|
"conversion" should link to https://heycam.github.io/webidl/#es-to-sequence, no?
That makes it impossible to use existing "convert-to-sequence" code, because this has observably different behavior, right? Why is that desirable? It's basically monkeypatching https://heycam.github.io/webidl/#es-to-sequence It seems to me that it would be better to do the conversion to sequence per the normal rules, then validate all the items in the sequence.
I'm not quite sure what this is trying to say. The validation algorithm already throws a TypeError. What does it mean to "handle" it and why is a different TypeError then thrown? |
I made some edits based on your suggestions: #1946 (comment). |
That looks pretty reasonable to me, thank you. |
Thanks for your input @bzbarsky! |
Closed by #2012. |
https://webaudio.github.io/web-audio-api/#node-name-to-parameter-descriptor-map says:
but the
registerProcessor
steps don't describe how this population happens. There's a bunch of code in Gecko that does this, converting things toAudioParamDescriptor
values, doing sanity-checks on their members, etc, but none of that seems to be described by the spec.@karlt
The text was updated successfully, but these errors were encountered: