Title: [265152] trunk
Revision
265152
Author
[email protected]
Date
2020-07-31 11:47:49 -0700 (Fri, 31 Jul 2020)

Log Message

Add constructor for WaveShaperNode
https://bugs.webkit.org/show_bug.cgi?id=214989

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline WPT tests now that more checks are passing.

* web-platform-tests/webaudio/idlharness.https.window-expected.txt:
* web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/ctor-waveshaper-expected.txt:
* web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-simple-expected.txt:

Source/WebCore:

Add constructor for WaveShaperNode:
- https://www.w3.org/TR/webaudio/#waveshapernode

No new tests, rebaselined existing tests.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/webaudio/BaseAudioContext.cpp:
(WebCore::BaseAudioContext::createWaveShaper):
* Modules/webaudio/OverSampleType.h: Copied from Source/WebCore/Modules/webaudio/WaveShaperNode.idl.
* Modules/webaudio/OverSampleType.idl: Copied from Source/WebCore/Modules/webaudio/WaveShaperNode.idl.
* Modules/webaudio/WaveShaperNode.cpp:
(WebCore::WaveShaperNode::create):
(WebCore::WaveShaperNode::setCurve):
(WebCore::processorType):
* Modules/webaudio/WaveShaperNode.h:
(WTF::LogArgument<WebCore::OverSampleType>::toString):
* Modules/webaudio/WaveShaperNode.idl:
* Modules/webaudio/WaveShaperOptions.h: Copied from Source/WebCore/Modules/webaudio/WaveShaperNode.idl.
* Modules/webaudio/WaveShaperOptions.idl: Copied from Source/WebCore/Modules/webaudio/WaveShaperNode.idl.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (265151 => 265152)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2020-07-31 18:46:18 UTC (rev 265151)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2020-07-31 18:47:49 UTC (rev 265152)
@@ -1,3 +1,16 @@
+2020-07-31  Chris Dumez  <[email protected]>
+
+        Add constructor for WaveShaperNode
+        https://bugs.webkit.org/show_bug.cgi?id=214989
+
+        Reviewed by Youenn Fablet.
+
+        Rebaseline WPT tests now that more checks are passing.
+
+        * web-platform-tests/webaudio/idlharness.https.window-expected.txt:
+        * web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/ctor-waveshaper-expected.txt:
+        * web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-simple-expected.txt:
+
 2020-07-30  Chris Dumez  <[email protected]>
 
         OfflineAudioContext.startRendering() should return a Promise

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/idlharness.https.window-expected.txt (265151 => 265152)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/idlharness.https.window-expected.txt	2020-07-31 18:46:18 UTC (rev 265151)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/idlharness.https.window-expected.txt	2020-07-31 18:47:49 UTC (rev 265152)
@@ -1044,7 +1044,7 @@
 FAIL AudioNode interface: new StereoPannerNode(context) must inherit property "channelCountMode" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: StereoPannerNode"
 FAIL AudioNode interface: new StereoPannerNode(context) must inherit property "channelInterpretation" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: StereoPannerNode"
 PASS WaveShaperNode interface: existence and properties of interface object 
-FAIL WaveShaperNode interface object length assert_equals: wrong value for WaveShaperNode.length expected 1 but got 0
+PASS WaveShaperNode interface object length 
 PASS WaveShaperNode interface object name 
 PASS WaveShaperNode interface: existence and properties of interface prototype object 
 PASS WaveShaperNode interface: existence and properties of interface prototype object's "constructor" property 
@@ -1051,33 +1051,33 @@
 PASS WaveShaperNode interface: existence and properties of interface prototype object's @@unscopables property 
 PASS WaveShaperNode interface: attribute curve 
 PASS WaveShaperNode interface: attribute oversample 
-FAIL WaveShaperNode must be primary interface of new WaveShaperNode(context) assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL Stringification of new WaveShaperNode(context) assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL WaveShaperNode interface: new WaveShaperNode(context) must inherit property "curve" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL WaveShaperNode interface: new WaveShaperNode(context) must inherit property "oversample" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: new WaveShaperNode(context) must inherit property "connect(AudioNode, optional unsigned long, optional unsigned long)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: calling connect(AudioNode, optional unsigned long, optional unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: new WaveShaperNode(context) must inherit property "connect(AudioParam, optional unsigned long)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: calling connect(AudioParam, optional unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect()" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(unsigned long)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: calling disconnect(unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioNode)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: calling disconnect(AudioNode) on new WaveShaperNode(context) with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioNode, unsigned long)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: calling disconnect(AudioNode, unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioNode, unsigned long, unsigned long)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: calling disconnect(AudioNode, unsigned long, unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioParam)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: calling disconnect(AudioParam) on new WaveShaperNode(context) with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioParam, unsigned long)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: calling disconnect(AudioParam, unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: new WaveShaperNode(context) must inherit property "context" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: new WaveShaperNode(context) must inherit property "numberOfInputs" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: new WaveShaperNode(context) must inherit property "numberOfOutputs" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: new WaveShaperNode(context) must inherit property "channelCount" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: new WaveShaperNode(context) must inherit property "channelCountMode" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
-FAIL AudioNode interface: new WaveShaperNode(context) must inherit property "channelInterpretation" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new WaveShaperNode(context)')"
+PASS WaveShaperNode must be primary interface of new WaveShaperNode(context) 
+PASS Stringification of new WaveShaperNode(context) 
+PASS WaveShaperNode interface: new WaveShaperNode(context) must inherit property "curve" with the proper type 
+PASS WaveShaperNode interface: new WaveShaperNode(context) must inherit property "oversample" with the proper type 
+PASS AudioNode interface: new WaveShaperNode(context) must inherit property "connect(AudioNode, optional unsigned long, optional unsigned long)" with the proper type 
+PASS AudioNode interface: calling connect(AudioNode, optional unsigned long, optional unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError 
+PASS AudioNode interface: new WaveShaperNode(context) must inherit property "connect(AudioParam, optional unsigned long)" with the proper type 
+PASS AudioNode interface: calling connect(AudioParam, optional unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError 
+PASS AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect()" with the proper type 
+PASS AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(unsigned long)" with the proper type 
+PASS AudioNode interface: calling disconnect(unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError 
+PASS AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioNode)" with the proper type 
+PASS AudioNode interface: calling disconnect(AudioNode) on new WaveShaperNode(context) with too few arguments must throw TypeError 
+PASS AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioNode, unsigned long)" with the proper type 
+PASS AudioNode interface: calling disconnect(AudioNode, unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError 
+PASS AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioNode, unsigned long, unsigned long)" with the proper type 
+PASS AudioNode interface: calling disconnect(AudioNode, unsigned long, unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError 
+PASS AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioParam)" with the proper type 
+PASS AudioNode interface: calling disconnect(AudioParam) on new WaveShaperNode(context) with too few arguments must throw TypeError 
+PASS AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioParam, unsigned long)" with the proper type 
+PASS AudioNode interface: calling disconnect(AudioParam, unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError 
+PASS AudioNode interface: new WaveShaperNode(context) must inherit property "context" with the proper type 
+PASS AudioNode interface: new WaveShaperNode(context) must inherit property "numberOfInputs" with the proper type 
+PASS AudioNode interface: new WaveShaperNode(context) must inherit property "numberOfOutputs" with the proper type 
+PASS AudioNode interface: new WaveShaperNode(context) must inherit property "channelCount" with the proper type 
+PASS AudioNode interface: new WaveShaperNode(context) must inherit property "channelCountMode" with the proper type 
+PASS AudioNode interface: new WaveShaperNode(context) must inherit property "channelInterpretation" with the proper type 
 FAIL AudioWorklet interface: existence and properties of interface object assert_own_property: self does not have own property "AudioWorklet" expected property "AudioWorklet" missing
 FAIL AudioWorklet interface object length assert_own_property: self does not have own property "AudioWorklet" expected property "AudioWorklet" missing
 FAIL AudioWorklet interface object name assert_own_property: self does not have own property "AudioWorklet" expected property "AudioWorklet" missing

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/ctor-waveshaper-expected.txt (265151 => 265152)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/ctor-waveshaper-expected.txt	2020-07-31 18:46:18 UTC (rev 265151)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/ctor-waveshaper-expected.txt	2020-07-31 18:47:49 UTC (rev 265152)
@@ -2,24 +2,55 @@
 PASS # AUDIT TASK RUNNER STARTED. 
 PASS Executing "initialize" 
 PASS Executing "incorrect construction" 
-FAIL Executing "valid default construction" promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'node.numberOfInputs')"
-FAIL Executing "test AudioNodeOptions" promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'node.channelCount')"
-FAIL Executing "valid non-default" promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'node.curve')"
+PASS Executing "valid default construction" 
+PASS Executing "test AudioNodeOptions" 
+PASS Executing "valid non-default" 
 PASS Audit report 
 PASS > [initialize]  
 PASS   context = new OfflineAudioContext(...) did not throw an exception. 
 PASS < [initialize] All assertions passed. (total 1 assertions) 
 PASS > [incorrect construction]  
-PASS   new WaveShaperNode() threw TypeError: "function is not a constructor (evaluating 'new window[name]()')". 
-PASS   new WaveShaperNode(1) threw TypeError: "function is not a constructor (evaluating 'new window[name](1)')". 
-PASS   new WaveShaperNode(context, 42) threw TypeError: "function is not a constructor (evaluating 'new window[name](context, 42)')". 
+PASS   new WaveShaperNode() threw TypeError: "Not enough arguments". 
+PASS   new WaveShaperNode(1) threw TypeError: "Argument 1 ('context') to the WaveShaperNode constructor must be an instance of BaseAudioContext". 
+PASS   new WaveShaperNode(context, 42) threw TypeError: "Type error". 
 PASS < [incorrect construction] All assertions passed. (total 3 assertions) 
 PASS > [valid default construction]  
-FAIL X node0 = new WaveShaperNode(context) incorrectly threw TypeError: "function is not a constructor (evaluating 'new window[name](context, options.constructorOptions)')". assert_true: expected true got false
-FAIL X node0 instanceof WaveShaperNode is not equal to true. Got false. assert_true: expected true got false
+PASS   node0 = new WaveShaperNode(context) did not throw an exception. 
+PASS   node0 instanceof WaveShaperNode is equal to true. 
+PASS   node0.numberOfInputs is equal to 1. 
+PASS   node0.numberOfOutputs is equal to 1. 
+PASS   node0.channelCount is equal to 2. 
+PASS   node0.channelCountMode is equal to max. 
+PASS   node0.channelInterpretation is equal to speakers. 
+PASS   node0.curve is equal to null. 
+PASS   node0.oversample is equal to none. 
+PASS < [valid default construction] All assertions passed. (total 9 assertions) 
 PASS > [test AudioNodeOptions]  
-FAIL X new WaveShaperNode(c, {channelCount: 17}) incorrectly threw TypeError: "function is not a constructor (evaluating 'new window[nodeName]')". assert_true: expected true got false
+PASS   new WaveShaperNode(c, {channelCount: 17}) did not throw an exception. 
+PASS   node.channelCount is equal to 17. 
+PASS   new WaveShaperNode(c, {channelCount: 0}) threw InvalidStateError: "The object is in an invalid state.". 
+PASS   new WaveShaperNode(c, {channelCount: 99}) threw InvalidStateError: "The object is in an invalid state.". 
+PASS   new WaveShaperNode(c, {channelCountMode: "max"} did not throw an exception. 
+PASS   node.channelCountMode is equal to max. 
+PASS   new WaveShaperNode(c, {channelCountMode: "max"}) did not throw an exception. 
+PASS   node.channelCountMode after valid setter is equal to max. 
+PASS   new WaveShaperNode(c, {channelCountMode: "clamped-max"}) did not throw an exception. 
+PASS   node.channelCountMode after valid setter is equal to clamped-max. 
+PASS   new WaveShaperNode(c, {channelCountMode: "explicit"}) did not throw an exception. 
+PASS   node.channelCountMode after valid setter is equal to explicit. 
+PASS   new WaveShaperNode(c, {channelCountMode: "foobar"} threw TypeError: "Type error". 
+PASS   node.channelCountMode after invalid setter is equal to explicit. 
+PASS   new WaveShaperNode(c, {channelInterpretation: "speakers"}) did not throw an exception. 
+PASS   node.channelInterpretation is equal to speakers. 
+PASS   new WaveShaperNode(c, {channelInterpretation: "discrete"}) did not throw an exception. 
+PASS   node.channelInterpretation is equal to discrete. 
+PASS   new WaveShaperNode(c, {channelInterpretation: "foobar"}) threw TypeError: "Type error". 
+PASS   node.channelInterpretation after invalid setter is equal to discrete. 
+PASS < [test AudioNodeOptions] All assertions passed. (total 20 assertions) 
 PASS > [valid non-default]  
-FAIL X node1 = new WaveShaperNode(, {"curve":{"0":1,"1":2,"2":3},"oversample":"4x"}) incorrectly threw TypeError: "function is not a constructor (evaluating 'new WaveShaperNode(context, options)')". assert_true: expected true got false
-FAIL # AUDIT TASK RUNNER FINISHED: 3 out of 5 tasks were failed. assert_true: expected true got false
+PASS   node1 = new WaveShaperNode(, {"curve":{"0":1,"1":2,"2":3},"oversample":"4x"}) did not throw an exception. 
+PASS   node1.curve is identical to the array [1,2,3]. 
+PASS   node1.oversample is equal to 4x. 
+PASS < [valid non-default] All assertions passed. (total 3 assertions) 
+PASS # AUDIT TASK RUNNER FINISHED: 5 tasks ran successfully. 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-simple-expected.txt (265151 => 265152)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-simple-expected.txt	2020-07-31 18:46:18 UTC (rev 265151)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-simple-expected.txt	2020-07-31 18:47:49 UTC (rev 265152)
@@ -13,8 +13,8 @@
 PASS   Waveshaper.oversample = "invalid" is equal to 4x. 
 PASS   Setting curve to [-1,0.25,0.75] did not throw an exception. 
 PASS   WaveShaper.curve is identical to the array [-1,0.25,0.75]. 
-FAIL X Setting curve back to null incorrectly threw TypeError: "The WaveShaperNode.curve attribute must be an instance of Float32Array". assert_true: expected true got false
-FAIL X Waveshaper.curve = null is not equal to null. Got [-1,0.25,0.75]. assert_true: expected true got false
-FAIL < [simple] 2 out of 12 assertions were failed. assert_true: expected true got false
-FAIL # AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed. assert_true: expected true got false
+PASS   Setting curve back to null did not throw an exception. 
+PASS   Waveshaper.curve = null is equal to null. 
+PASS < [simple] All assertions passed. (total 12 assertions) 
+PASS # AUDIT TASK RUNNER FINISHED: 1 tasks ran successfully. 
 

Modified: trunk/Source/WebCore/CMakeLists.txt (265151 => 265152)


--- trunk/Source/WebCore/CMakeLists.txt	2020-07-31 18:46:18 UTC (rev 265151)
+++ trunk/Source/WebCore/CMakeLists.txt	2020-07-31 18:47:49 UTC (rev 265152)
@@ -482,6 +482,7 @@
     Modules/webaudio/OscillatorNode.idl
     Modules/webaudio/OscillatorOptions.idl
     Modules/webaudio/OscillatorType.idl
+    Modules/webaudio/OverSampleType.idl
     Modules/webaudio/PannerNode.idl
     Modules/webaudio/PannerOptions.idl
     Modules/webaudio/PanningModelType.idl
@@ -490,6 +491,7 @@
     Modules/webaudio/PeriodicWaveOptions.idl
     Modules/webaudio/ScriptProcessorNode.idl
     Modules/webaudio/WaveShaperNode.idl
+    Modules/webaudio/WaveShaperOptions.idl
     Modules/webaudio/WebKitAudioContext.idl
     Modules/webaudio/WebKitAudioPannerNode.idl
     Modules/webaudio/WebKitOfflineAudioContext.idl

Modified: trunk/Source/WebCore/ChangeLog (265151 => 265152)


--- trunk/Source/WebCore/ChangeLog	2020-07-31 18:46:18 UTC (rev 265151)
+++ trunk/Source/WebCore/ChangeLog	2020-07-31 18:47:49 UTC (rev 265152)
@@ -1,3 +1,35 @@
+2020-07-31  Chris Dumez  <[email protected]>
+
+        Add constructor for WaveShaperNode
+        https://bugs.webkit.org/show_bug.cgi?id=214989
+
+        Reviewed by Youenn Fablet.
+
+        Add constructor for WaveShaperNode:
+        - https://www.w3.org/TR/webaudio/#waveshapernode
+
+        No new tests, rebaselined existing tests.
+
+        * CMakeLists.txt:
+        * DerivedSources-input.xcfilelist:
+        * DerivedSources-output.xcfilelist:
+        * DerivedSources.make:
+        * Modules/webaudio/BaseAudioContext.cpp:
+        (WebCore::BaseAudioContext::createWaveShaper):
+        * Modules/webaudio/OverSampleType.h: Copied from Source/WebCore/Modules/webaudio/WaveShaperNode.idl.
+        * Modules/webaudio/OverSampleType.idl: Copied from Source/WebCore/Modules/webaudio/WaveShaperNode.idl.
+        * Modules/webaudio/WaveShaperNode.cpp:
+        (WebCore::WaveShaperNode::create):
+        (WebCore::WaveShaperNode::setCurve):
+        (WebCore::processorType):
+        * Modules/webaudio/WaveShaperNode.h:
+        (WTF::LogArgument<WebCore::OverSampleType>::toString):
+        * Modules/webaudio/WaveShaperNode.idl:
+        * Modules/webaudio/WaveShaperOptions.h: Copied from Source/WebCore/Modules/webaudio/WaveShaperNode.idl.
+        * Modules/webaudio/WaveShaperOptions.idl: Copied from Source/WebCore/Modules/webaudio/WaveShaperNode.idl.
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+
 2020-07-31  Youenn Fablet  <[email protected]>
 
         Update service worker if certificate info does not match when soft updating

Modified: trunk/Source/WebCore/DerivedSources-input.xcfilelist (265151 => 265152)


--- trunk/Source/WebCore/DerivedSources-input.xcfilelist	2020-07-31 18:46:18 UTC (rev 265151)
+++ trunk/Source/WebCore/DerivedSources-input.xcfilelist	2020-07-31 18:47:49 UTC (rev 265152)
@@ -331,6 +331,7 @@
 $(PROJECT_DIR)/Modules/webaudio/OscillatorNode.idl
 $(PROJECT_DIR)/Modules/webaudio/OscillatorOptions.idl
 $(PROJECT_DIR)/Modules/webaudio/OscillatorType.idl
+$(PROJECT_DIR)/Modules/webaudio/OverSampleType.idl
 $(PROJECT_DIR)/Modules/webaudio/PannerNode.idl
 $(PROJECT_DIR)/Modules/webaudio/PannerOptions.idl
 $(PROJECT_DIR)/Modules/webaudio/PanningModelType.idl
@@ -339,6 +340,7 @@
 $(PROJECT_DIR)/Modules/webaudio/PeriodicWaveOptions.idl
 $(PROJECT_DIR)/Modules/webaudio/ScriptProcessorNode.idl
 $(PROJECT_DIR)/Modules/webaudio/WaveShaperNode.idl
+$(PROJECT_DIR)/Modules/webaudio/WaveShaperOptions.idl
 $(PROJECT_DIR)/Modules/webaudio/WebKitAudioContext.idl
 $(PROJECT_DIR)/Modules/webaudio/WebKitAudioPannerNode.idl
 $(PROJECT_DIR)/Modules/webaudio/WebKitOfflineAudioContext.idl

Modified: trunk/Source/WebCore/DerivedSources-output.xcfilelist (265151 => 265152)


--- trunk/Source/WebCore/DerivedSources-output.xcfilelist	2020-07-31 18:46:18 UTC (rev 265151)
+++ trunk/Source/WebCore/DerivedSources-output.xcfilelist	2020-07-31 18:47:49 UTC (rev 265152)
@@ -1238,6 +1238,8 @@
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSOscillatorOptions.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSOscillatorType.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSOscillatorType.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSOverSampleType.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSOverSampleType.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSOverconstrainedError.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSOverconstrainedError.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSOverconstrainedErrorEvent.cpp
@@ -1976,6 +1978,8 @@
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSVoidCallback.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWaveShaperNode.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWaveShaperNode.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWaveShaperOptions.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWaveShaperOptions.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebAnimation.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebAnimation.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebFakeXRDevice.cpp

Modified: trunk/Source/WebCore/DerivedSources.make (265151 => 265152)


--- trunk/Source/WebCore/DerivedSources.make	2020-07-31 18:46:18 UTC (rev 265151)
+++ trunk/Source/WebCore/DerivedSources.make	2020-07-31 18:47:49 UTC (rev 265152)
@@ -414,6 +414,7 @@
     $(WebCore)/Modules/webaudio/OscillatorNode.idl \
     $(WebCore)/Modules/webaudio/OscillatorOptions.idl \
     $(WebCore)/Modules/webaudio/OscillatorType.idl \
+    $(WebCore)/Modules/webaudio/OverSampleType.idl \
     $(WebCore)/Modules/webaudio/PannerNode.idl \
     $(WebCore)/Modules/webaudio/PannerOptions.idl \
     $(WebCore)/Modules/webaudio/PanningModelType.idl \
@@ -422,6 +423,7 @@
     $(WebCore)/Modules/webaudio/PeriodicWaveOptions.idl \
     $(WebCore)/Modules/webaudio/ScriptProcessorNode.idl \
     $(WebCore)/Modules/webaudio/WaveShaperNode.idl \
+    $(WebCore)/Modules/webaudio/WaveShaperOptions.idl \
     $(WebCore)/Modules/webaudio/WebKitAudioContext.idl \
     $(WebCore)/Modules/webaudio/WebKitAudioPannerNode.idl \
     $(WebCore)/Modules/webaudio/WebKitOfflineAudioContext.idl \

Modified: trunk/Source/WebCore/Modules/webaudio/BaseAudioContext.cpp (265151 => 265152)


--- trunk/Source/WebCore/Modules/webaudio/BaseAudioContext.cpp	2020-07-31 18:46:18 UTC (rev 265151)
+++ trunk/Source/WebCore/Modules/webaudio/BaseAudioContext.cpp	2020-07-31 18:47:49 UTC (rev 265152)
@@ -509,10 +509,6 @@
     ALWAYS_LOG(LOGIDENTIFIER);
     
     ASSERT(isMainThread());
-    if (m_isStopScheduled)
-        return Exception { InvalidStateError };
-
-    lazyInitialize();
     return WaveShaperNode::create(*this);
 }
 

Copied: trunk/Source/WebCore/Modules/webaudio/OverSampleType.h (from rev 265151, trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.idl) (0 => 265152)


--- trunk/Source/WebCore/Modules/webaudio/OverSampleType.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/webaudio/OverSampleType.h	2020-07-31 18:47:49 UTC (rev 265152)
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2020, Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+namespace WebCore {
+
+enum class OverSampleType { None, _2x, _4x };
+
+}

Copied: trunk/Source/WebCore/Modules/webaudio/OverSampleType.idl (from rev 265151, trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.idl) (0 => 265152)


--- trunk/Source/WebCore/Modules/webaudio/OverSampleType.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/webaudio/OverSampleType.idl	2020-07-31 18:47:49 UTC (rev 265152)
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2020, Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+enum OverSampleType {
+    "none",
+    "2x",
+    "4x"
+};

Modified: trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.cpp (265151 => 265152)


--- trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.cpp	2020-07-31 18:46:18 UTC (rev 265151)
+++ trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.cpp	2020-07-31 18:47:49 UTC (rev 265152)
@@ -28,6 +28,8 @@
 #if ENABLE(WEB_AUDIO)
 
 #include "AudioContext.h"
+#include <_javascript_Core/JSCInlines.h>
+#include <_javascript_Core/TypedArrayInlines.h>
 #include <wtf/IsoMallocInlines.h>
 #include <wtf/MainThread.h>
 
@@ -35,6 +37,46 @@
 
 WTF_MAKE_ISO_ALLOCATED_IMPL(WaveShaperNode);
 
+ExceptionOr<Ref<WaveShaperNode>> WaveShaperNode::create(BaseAudioContext& context, const WaveShaperOptions& options)
+{
+    if (context.isStopped())
+        return Exception { InvalidStateError };
+
+    context.lazyInitialize();
+    UNUSED_PARAM(options);
+
+    RefPtr<Float32Array> curve;
+    if (options.curve) {
+        curve = Float32Array::tryCreate(options.curve->data(), options.curve->size());
+        if (!curve)
+            return Exception { InvalidStateError, "Invalid curve parameter" };
+    }
+
+    auto node = adoptRef(*new WaveShaperNode(context));
+
+    auto result = node->setChannelCount(options.channelCount.valueOr(2));
+    if (result.hasException())
+        return result.releaseException();
+
+    result = node->setChannelCountMode(options.channelCountMode.valueOr(ChannelCountMode::Max));
+    if (result.hasException())
+        return result.releaseException();
+
+    result = node->setChannelInterpretation(options.channelInterpretation.valueOr(ChannelInterpretation::Speakers));
+    if (result.hasException())
+        return result.releaseException();
+
+    if (curve) {
+        result = node->setCurve(WTFMove(curve));
+        if (result.hasException())
+            return result.releaseException();
+    }
+
+    node->setOversample(options.oversample);
+
+    return node;
+}
+
 WaveShaperNode::WaveShaperNode(BaseAudioContext& context)
     : AudioBasicProcessorNode(context, context.sampleRate())
 {
@@ -44,11 +86,15 @@
     initialize();
 }
 
-void WaveShaperNode::setCurve(Float32Array& curve)
+ExceptionOr<void> WaveShaperNode::setCurve(RefPtr<Float32Array>&& curve)
 {
     ASSERT(isMainThread()); 
     DEBUG_LOG(LOGIDENTIFIER);
-    waveShaperProcessor()->setCurve(&curve);
+    if (curve && curve->length() < 2)
+        return Exception { InvalidStateError, "Length of curve array cannot be less than 2" };
+
+    waveShaperProcessor()->setCurve(curve.get());
+    return { };
 }
 
 Float32Array* WaveShaperNode::curve()
@@ -56,14 +102,14 @@
     return waveShaperProcessor()->curve();
 }
 
-static inline WaveShaperProcessor::OverSampleType processorType(WaveShaperNode::OverSampleType type)
+static inline WaveShaperProcessor::OverSampleType processorType(OverSampleType type)
 {
     switch (type) {
-    case WaveShaperNode::OverSampleType::None:
+    case OverSampleType::None:
         return WaveShaperProcessor::OverSampleNone;
-    case WaveShaperNode::OverSampleType::_2x:
+    case OverSampleType::_2x:
         return WaveShaperProcessor::OverSample2x;
-    case WaveShaperNode::OverSampleType::_4x:
+    case OverSampleType::_4x:
         return WaveShaperProcessor::OverSample4x;
     }
     ASSERT_NOT_REACHED();

Modified: trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.h (265151 => 265152)


--- trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.h	2020-07-31 18:46:18 UTC (rev 265151)
+++ trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.h	2020-07-31 18:47:49 UTC (rev 265152)
@@ -24,7 +24,11 @@
 
 #pragma once
 
+#if ENABLE(WEB_AUDIO)
+
 #include "AudioBasicProcessorNode.h"
+#include "OverSampleType.h"
+#include "WaveShaperOptions.h"
 #include "WaveShaperProcessor.h"
 #include <wtf/Forward.h>
 
@@ -33,16 +37,12 @@
 class WaveShaperNode final : public AudioBasicProcessorNode {
     WTF_MAKE_ISO_ALLOCATED(WaveShaperNode);
 public:
-    static Ref<WaveShaperNode> create(BaseAudioContext& context)
-    {
-        return adoptRef(*new WaveShaperNode(context));
-    }
+    static ExceptionOr<Ref<WaveShaperNode>> create(BaseAudioContext&, const WaveShaperOptions& = { });
 
     // setCurve() is called on the main thread.
-    void setCurve(Float32Array&);
+    ExceptionOr<void> setCurve(RefPtr<Float32Array>&&);
     Float32Array* curve();
 
-    enum class OverSampleType { None, _2x, _4x };
     void setOversample(OverSampleType);
     OverSampleType oversample() const;
 
@@ -54,14 +54,16 @@
     WaveShaperProcessor* waveShaperProcessor() { return static_cast<WaveShaperProcessor*>(processor()); }
 };
 
-String convertEnumerationToString(WebCore::WaveShaperNode::OverSampleType); // in JSWaveShaperNode.cpp
+String convertEnumerationToString(WebCore::OverSampleType); // in JSOverSampleType.cpp
 
 } // namespace WebCore
 
 namespace WTF {
     
-template<> struct LogArgument<WebCore::WaveShaperNode::OverSampleType> {
-    static String toString(WebCore::WaveShaperNode::OverSampleType type) { return convertEnumerationToString(type); }
+template<> struct LogArgument<WebCore::OverSampleType> {
+    static String toString(WebCore::OverSampleType type) { return convertEnumerationToString(type); }
 };
     
 } // namespace WTF
+
+#endif // ENABLE(WEB_AUDIO)

Modified: trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.idl (265151 => 265152)


--- trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.idl	2020-07-31 18:46:18 UTC (rev 265151)
+++ trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.idl	2020-07-31 18:47:49 UTC (rev 265152)
@@ -22,16 +22,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-enum OverSampleType {
-    "none",
-    "2x",
-    "4x"
-};
-
 [
     Conditional=WEB_AUDIO,
     JSGenerateToJSObject
 ] interface WaveShaperNode : AudioNode {
-    attribute Float32Array curve;
+    [MayThrowException, EnabledBySetting=ModernUnprefixedWebAudio] constructor(BaseAudioContext context, optional WaveShaperOptions options);
+
+    attribute Float32Array? curve;
     attribute OverSampleType oversample;
 };

Copied: trunk/Source/WebCore/Modules/webaudio/WaveShaperOptions.h (from rev 265151, trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.idl) (0 => 265152)


--- trunk/Source/WebCore/Modules/webaudio/WaveShaperOptions.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/webaudio/WaveShaperOptions.h	2020-07-31 18:47:49 UTC (rev 265152)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2020, Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEB_AUDIO)
+
+#include "AudioNodeOptions.h"
+#include "OverSampleType.h"
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+struct WaveShaperOptions : AudioNodeOptions {
+    Optional<Vector<float>> curve;
+    OverSampleType oversample { OverSampleType::None };
+};
+
+}
+
+#endif // ENABLE(WEB_AUDIO)

Copied: trunk/Source/WebCore/Modules/webaudio/WaveShaperOptions.idl (from rev 265151, trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.idl) (0 => 265152)


--- trunk/Source/WebCore/Modules/webaudio/WaveShaperOptions.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/webaudio/WaveShaperOptions.idl	2020-07-31 18:47:49 UTC (rev 265152)
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2020, Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=WEB_AUDIO
+] dictionary WaveShaperOptions : AudioNodeOptions {
+    sequence<float> curve;
+    OverSampleType oversample = "none";
+};

Modified: trunk/Source/WebCore/Sources.txt (265151 => 265152)


--- trunk/Source/WebCore/Sources.txt	2020-07-31 18:46:18 UTC (rev 265151)
+++ trunk/Source/WebCore/Sources.txt	2020-07-31 18:47:49 UTC (rev 265152)
@@ -3134,6 +3134,7 @@
 JSOscillatorNode.cpp
 JSOscillatorOptions.cpp
 JSOscillatorType.cpp
+JSOverSampleType.cpp
 JSOverconstrainedError.cpp
 JSOverconstrainedErrorEvent.cpp
 JSOverflowEvent.cpp
@@ -3495,6 +3496,7 @@
 JSVisualViewport.cpp
 JSVoidCallback.cpp
 JSWaveShaperNode.cpp
+JSWaveShaperOptions.cpp
 JSWebAnimation.cpp
 JSWebGL2RenderingContext.cpp
 JSWebGLActiveInfo.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (265151 => 265152)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2020-07-31 18:46:18 UTC (rev 265151)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2020-07-31 18:47:49 UTC (rev 265152)
@@ -2432,6 +2432,8 @@
 		831B61762499A5BB00C07C79 /* WebKitAudioPannerNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 831B61742499A59C00C07C79 /* WebKitAudioPannerNode.h */; };
 		831B61772499A5BF00C07C79 /* WebKitOfflineAudioContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 831B61752499A59D00C07C79 /* WebKitOfflineAudioContext.h */; };
 		8321507E1F27EA1B0095B136 /* NavigatorBeacon.h in Headers */ = {isa = PBXBuildFile; fileRef = 8321507B1F27EA150095B136 /* NavigatorBeacon.h */; };
+		8326BF8E24D35C33001F8A85 /* OverSampleType.h in Headers */ = {isa = PBXBuildFile; fileRef = 8326BF8924D35C20001F8A85 /* OverSampleType.h */; };
+		8326BF8F24D35C39001F8A85 /* WaveShaperOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8326BF8C24D35C20001F8A85 /* WaveShaperOptions.h */; };
 		832B843419D8E55100B26055 /* SVGAnimateElementBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 832B843319D8E55100B26055 /* SVGAnimateElementBase.h */; };
 		833B9E321F508D8500E0E428 /* JSFileSystemDirectoryEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 833B9E2F1F508D8000E0E428 /* JSFileSystemDirectoryEntry.h */; };
 		833B9E341F508D8500E0E428 /* JSFileSystemEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 833B9E2A1F508D8000E0E428 /* JSFileSystemEntry.h */; };
@@ -10415,6 +10417,10 @@
 		8321507A1F27EA150095B136 /* NavigatorBeacon.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = NavigatorBeacon.cpp; sourceTree = "<group>"; };
 		8321507B1F27EA150095B136 /* NavigatorBeacon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NavigatorBeacon.h; sourceTree = "<group>"; };
 		8321507C1F27EA150095B136 /* NavigatorBeacon.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = NavigatorBeacon.idl; sourceTree = "<group>"; };
+		8326BF8924D35C20001F8A85 /* OverSampleType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OverSampleType.h; sourceTree = "<group>"; };
+		8326BF8B24D35C20001F8A85 /* OverSampleType.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = OverSampleType.idl; sourceTree = "<group>"; };
+		8326BF8C24D35C20001F8A85 /* WaveShaperOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WaveShaperOptions.h; sourceTree = "<group>"; };
+		8326BF8D24D35C21001F8A85 /* WaveShaperOptions.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WaveShaperOptions.idl; sourceTree = "<group>"; };
 		8329A4171EC25B2B008ED4BE /* DocumentAndElementEventHandlers.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DocumentAndElementEventHandlers.idl; sourceTree = "<group>"; };
 		8329DCC21C7A6AE300730B33 /* HTMLHyperlinkElementUtils.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLHyperlinkElementUtils.idl; sourceTree = "<group>"; };
 		832B843319D8E55100B26055 /* SVGAnimateElementBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimateElementBase.h; sourceTree = "<group>"; };
@@ -29566,6 +29572,8 @@
 				E755E8B124CA270A009F7C23 /* OscillatorOptions.idl */,
 				E755E8B424CA2796009F7C23 /* OscillatorType.h */,
 				E755E8B624CA2796009F7C23 /* OscillatorType.idl */,
+				8326BF8924D35C20001F8A85 /* OverSampleType.h */,
+				8326BF8B24D35C20001F8A85 /* OverSampleType.idl */,
 				FD315FCF12B0267500C1A359 /* PannerNode.cpp */,
 				FD315FD012B0267500C1A359 /* PannerNode.h */,
 				FD315FD112B0267500C1A359 /* PannerNode.idl */,
@@ -29590,6 +29598,8 @@
 				FD7F298C13D4C0CB00AD9535 /* WaveShaperNode.cpp */,
 				FD7F298D13D4C0CB00AD9535 /* WaveShaperNode.h */,
 				FD7F298E13D4C0CB00AD9535 /* WaveShaperNode.idl */,
+				8326BF8C24D35C20001F8A85 /* WaveShaperOptions.h */,
+				8326BF8D24D35C21001F8A85 /* WaveShaperOptions.idl */,
 				FD7F298F13D4C0CB00AD9535 /* WaveShaperProcessor.cpp */,
 				FD7F299013D4C0CB00AD9535 /* WaveShaperProcessor.h */,
 				83003E2B249997A80060AF94 /* WebKitAudioContext.cpp */,
@@ -32661,6 +32671,7 @@
 				072A70401D6E8F6200DF0AFC /* OverconstrainedErrorEvent.h in Headers */,
 				1A0D57370A5C77FE007EDD4C /* OverflowEvent.h in Headers */,
 				3774ABA50FA21EB400AD7DE9 /* OverlapTestRequestClient.h in Headers */,
+				8326BF8E24D35C33001F8A85 /* OverSampleType.h in Headers */,
 				65A21468097A329100B9050A /* Page.h in Headers */,
 				91278D5E21DEDAD600B57184 /* PageAuditAgent.h in Headers */,
 				CD5E5B5F1A15CE54000C609E /* PageConfiguration.h in Headers */,
@@ -33931,6 +33942,7 @@
 				A14832BB187F643200DA63A6 /* WAKWindow.h in Headers */,
 				FD7F299213D4C0CB00AD9535 /* WaveShaperDSPKernel.h in Headers */,
 				FD7F299413D4C0CB00AD9535 /* WaveShaperNode.h in Headers */,
+				8326BF8F24D35C39001F8A85 /* WaveShaperOptions.h in Headers */,
 				FD7F299713D4C0CB00AD9535 /* WaveShaperProcessor.h in Headers */,
 				29A812490FBB9CA900510293 /* WebAccessibilityObjectWrapperBase.h in Headers */,
 				AAA728F716D1D8BC00D3BBC6 /* WebAccessibilityObjectWrapperIOS.h in Headers */,
@@ -35049,7 +35061,6 @@
 				DECA80391F9FED6A00E3B661 /* UnifiedSource248.cpp in Sources */,
 				DECA803A1F9FED6A00E3B661 /* UnifiedSource249.cpp in Sources */,
 				DECA803B1F9FED6A00E3B661 /* UnifiedSource250.cpp in Sources */,
-				CDED1C3C24CD305700934E12 /* VP9UtilitiesCocoa.mm in Sources */,
 				DECA803C1F9FED6A00E3B661 /* UnifiedSource251.cpp in Sources */,
 				DECA803D1F9FED6A00E3B661 /* UnifiedSource252.cpp in Sources */,
 				DECA803E1F9FED6A00E3B661 /* UnifiedSource253.cpp in Sources */,
@@ -35339,6 +35350,7 @@
 				CD336F6717FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.cpp in Sources */,
 				CD8B5A42180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.mm in Sources */,
 				26F9A83818A046AC00AEB88A /* ViewportConfiguration.cpp in Sources */,
+				CDED1C3C24CD305700934E12 /* VP9UtilitiesCocoa.mm in Sources */,
 				A14832B1187F61E100DA63A6 /* WAKAppKitStubs.m in Sources */,
 				A14832B3187F629100DA63A6 /* WAKClipView.m in Sources */,
 				A14832B5187F62FC00DA63A6 /* WAKResponder.m in Sources */,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to