'parameters' argument to AudioWorkletProcessor.process() is not spec-compliant: - https://www.w3.org/TR/webaudio/#dom-audioworkletprocessor-process-inputs-outputs-parameters-parameters Its type should not be a JSMap, as evidenced by how WPT tests use it. Also, as per the specification, if no automation is scheduled during the render quantum, the array may have length 1 with the array element being the constant value of the AudioParam for the render quantum.
Created attachment 411170 [details] Patch
Created attachment 411172 [details] Patch
Patch is ready for review.
Comment on attachment 411172 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=411172&action=review > Source/WebCore/ChangeLog:12 > + Its type should not be a JS Map, as evidenced by how WPT tests use it. We now pass a generic JS Object, > + as Blink is doing. I understand that the test helped make this clear. Was it also clear in the specification, or do we need to file an issue to ask for it to be made clearer. > Source/WebCore/ChangeLog:15 > + Also, as per the specification, if no automation is scheduled during the render quantum, the array may > + have length 1 with the array element being the constant value of the AudioParam for the render quantum. Not sure I understand the word "may" here. Does this mean it "must"? > Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp:997 > + auto endFrame = startFrame + AudioUtilities::renderQuantumSize; What if someone passes a really huge startFrame in, like numeric_limits<size_t>::max()? Should we return true in that case instead of overflowing? Or is that impossible?
(In reply to Darin Adler from comment #4) > Comment on attachment 411172 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=411172&action=review > > > Source/WebCore/ChangeLog:12 > > + Its type should not be a JS Map, as evidenced by how WPT tests use it. We now pass a generic JS Object, > > + as Blink is doing. > > I understand that the test helped make this clear. Was it also clear in the > specification, or do we need to file an issue to ask for it to be made > clearer. The specification points to this: https://infra.spec.whatwg.org/#ordered-map I wrongly interpreted that as a JS map it seems. > > Source/WebCore/ChangeLog:15 > > + Also, as per the specification, if no automation is scheduled during the render quantum, the array may > > + have length 1 with the array element being the constant value of the AudioParam for the render quantum. > > Not sure I understand the word "may" here. Does this mean it "must"? Indeed, while the spec says "MAY", there are web-platform-tests that fail if you don't do it. I think either the tests or the specification should change because they are not in complete agreement. > > > Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp:997 > > + auto endFrame = startFrame + AudioUtilities::renderQuantumSize; > > What if someone passes a really huge startFrame in, like > numeric_limits<size_t>::max()? Should we return true in that case instead of > overflowing? Or is that impossible?
Committed r268414: <https://trac.webkit.org/changeset/268414> All reviewed patches have been landed. Closing bug and clearing flags on attachment 411172 [details].
<rdar://problem/70262818>