Changeset 265152 in webkit
- Timestamp:
- Jul 31, 2020 11:47:49 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r265086 r265152 1 2020-07-31 Chris Dumez <cdumez@apple.com> 2 3 Add constructor for WaveShaperNode 4 https://bugs.webkit.org/show_bug.cgi?id=214989 5 6 Reviewed by Youenn Fablet. 7 8 Rebaseline WPT tests now that more checks are passing. 9 10 * web-platform-tests/webaudio/idlharness.https.window-expected.txt: 11 * web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/ctor-waveshaper-expected.txt: 12 * web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-simple-expected.txt: 13 1 14 2020-07-30 Chris Dumez <cdumez@apple.com> 2 15 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/idlharness.https.window-expected.txt
r265086 r265152 1045 1045 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" 1046 1046 PASS WaveShaperNode interface: existence and properties of interface object 1047 FAIL WaveShaperNode interface object length assert_equals: wrong value for WaveShaperNode.length expected 1 but got 0 1047 PASS WaveShaperNode interface object length 1048 1048 PASS WaveShaperNode interface object name 1049 1049 PASS WaveShaperNode interface: existence and properties of interface prototype object … … 1052 1052 PASS WaveShaperNode interface: attribute curve 1053 1053 PASS WaveShaperNode interface: attribute oversample 1054 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)')" 1055 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)')" 1056 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)')" 1057 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)')" 1058 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)')" 1059 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)')" 1060 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)')" 1061 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)')" 1062 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)')" 1063 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)')" 1064 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)')" 1065 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)')" 1066 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)')" 1067 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)')" 1068 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)')" 1069 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)')" 1070 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)')" 1071 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)')" 1072 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)')" 1073 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)')" 1074 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)')" 1075 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)')" 1076 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)')" 1077 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)')" 1078 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)')" 1079 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)')" 1080 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)')" 1054 PASS WaveShaperNode must be primary interface of new WaveShaperNode(context) 1055 PASS Stringification of new WaveShaperNode(context) 1056 PASS WaveShaperNode interface: new WaveShaperNode(context) must inherit property "curve" with the proper type 1057 PASS WaveShaperNode interface: new WaveShaperNode(context) must inherit property "oversample" with the proper type 1058 PASS AudioNode interface: new WaveShaperNode(context) must inherit property "connect(AudioNode, optional unsigned long, optional unsigned long)" with the proper type 1059 PASS AudioNode interface: calling connect(AudioNode, optional unsigned long, optional unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError 1060 PASS AudioNode interface: new WaveShaperNode(context) must inherit property "connect(AudioParam, optional unsigned long)" with the proper type 1061 PASS AudioNode interface: calling connect(AudioParam, optional unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError 1062 PASS AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect()" with the proper type 1063 PASS AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(unsigned long)" with the proper type 1064 PASS AudioNode interface: calling disconnect(unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError 1065 PASS AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioNode)" with the proper type 1066 PASS AudioNode interface: calling disconnect(AudioNode) on new WaveShaperNode(context) with too few arguments must throw TypeError 1067 PASS AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioNode, unsigned long)" with the proper type 1068 PASS AudioNode interface: calling disconnect(AudioNode, unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError 1069 PASS AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioNode, unsigned long, unsigned long)" with the proper type 1070 PASS AudioNode interface: calling disconnect(AudioNode, unsigned long, unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError 1071 PASS AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioParam)" with the proper type 1072 PASS AudioNode interface: calling disconnect(AudioParam) on new WaveShaperNode(context) with too few arguments must throw TypeError 1073 PASS AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioParam, unsigned long)" with the proper type 1074 PASS AudioNode interface: calling disconnect(AudioParam, unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError 1075 PASS AudioNode interface: new WaveShaperNode(context) must inherit property "context" with the proper type 1076 PASS AudioNode interface: new WaveShaperNode(context) must inherit property "numberOfInputs" with the proper type 1077 PASS AudioNode interface: new WaveShaperNode(context) must inherit property "numberOfOutputs" with the proper type 1078 PASS AudioNode interface: new WaveShaperNode(context) must inherit property "channelCount" with the proper type 1079 PASS AudioNode interface: new WaveShaperNode(context) must inherit property "channelCountMode" with the proper type 1080 PASS AudioNode interface: new WaveShaperNode(context) must inherit property "channelInterpretation" with the proper type 1081 1081 FAIL AudioWorklet interface: existence and properties of interface object assert_own_property: self does not have own property "AudioWorklet" expected property "AudioWorklet" missing 1082 1082 FAIL AudioWorklet interface object length assert_own_property: self does not have own property "AudioWorklet" expected property "AudioWorklet" missing -
trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/ctor-waveshaper-expected.txt
r262405 r265152 3 3 PASS Executing "initialize" 4 4 PASS Executing "incorrect construction" 5 FAIL Executing "valid default construction" promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'node.numberOfInputs')" 6 FAIL Executing "test AudioNodeOptions" promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'node.channelCount')" 7 FAIL Executing "valid non-default" promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'node.curve')" 5 PASS Executing "valid default construction" 6 PASS Executing "test AudioNodeOptions" 7 PASS Executing "valid non-default" 8 8 PASS Audit report 9 9 PASS > [initialize] … … 11 11 PASS < [initialize] All assertions passed. (total 1 assertions) 12 12 PASS > [incorrect construction] 13 PASS new WaveShaperNode() threw TypeError: " function is not a constructor (evaluating 'new window[name]()')".14 PASS new WaveShaperNode(1) threw TypeError: " function is not a constructor (evaluating 'new window[name](1)')".15 PASS new WaveShaperNode(context, 42) threw TypeError: " function is not a constructor (evaluating 'new window[name](context, 42)')".13 PASS new WaveShaperNode() threw TypeError: "Not enough arguments". 14 PASS new WaveShaperNode(1) threw TypeError: "Argument 1 ('context') to the WaveShaperNode constructor must be an instance of BaseAudioContext". 15 PASS new WaveShaperNode(context, 42) threw TypeError: "Type error". 16 16 PASS < [incorrect construction] All assertions passed. (total 3 assertions) 17 17 PASS > [valid default construction] 18 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 19 FAIL X node0 instanceof WaveShaperNode is not equal to true. Got false. assert_true: expected true got false 18 PASS node0 = new WaveShaperNode(context) did not throw an exception. 19 PASS node0 instanceof WaveShaperNode is equal to true. 20 PASS node0.numberOfInputs is equal to 1. 21 PASS node0.numberOfOutputs is equal to 1. 22 PASS node0.channelCount is equal to 2. 23 PASS node0.channelCountMode is equal to max. 24 PASS node0.channelInterpretation is equal to speakers. 25 PASS node0.curve is equal to null. 26 PASS node0.oversample is equal to none. 27 PASS < [valid default construction] All assertions passed. (total 9 assertions) 20 28 PASS > [test AudioNodeOptions] 21 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 29 PASS new WaveShaperNode(c, {channelCount: 17}) did not throw an exception. 30 PASS node.channelCount is equal to 17. 31 PASS new WaveShaperNode(c, {channelCount: 0}) threw InvalidStateError: "The object is in an invalid state.". 32 PASS new WaveShaperNode(c, {channelCount: 99}) threw InvalidStateError: "The object is in an invalid state.". 33 PASS new WaveShaperNode(c, {channelCountMode: "max"} did not throw an exception. 34 PASS node.channelCountMode is equal to max. 35 PASS new WaveShaperNode(c, {channelCountMode: "max"}) did not throw an exception. 36 PASS node.channelCountMode after valid setter is equal to max. 37 PASS new WaveShaperNode(c, {channelCountMode: "clamped-max"}) did not throw an exception. 38 PASS node.channelCountMode after valid setter is equal to clamped-max. 39 PASS new WaveShaperNode(c, {channelCountMode: "explicit"}) did not throw an exception. 40 PASS node.channelCountMode after valid setter is equal to explicit. 41 PASS new WaveShaperNode(c, {channelCountMode: "foobar"} threw TypeError: "Type error". 42 PASS node.channelCountMode after invalid setter is equal to explicit. 43 PASS new WaveShaperNode(c, {channelInterpretation: "speakers"}) did not throw an exception. 44 PASS node.channelInterpretation is equal to speakers. 45 PASS new WaveShaperNode(c, {channelInterpretation: "discrete"}) did not throw an exception. 46 PASS node.channelInterpretation is equal to discrete. 47 PASS new WaveShaperNode(c, {channelInterpretation: "foobar"}) threw TypeError: "Type error". 48 PASS node.channelInterpretation after invalid setter is equal to discrete. 49 PASS < [test AudioNodeOptions] All assertions passed. (total 20 assertions) 22 50 PASS > [valid non-default] 23 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 24 FAIL # AUDIT TASK RUNNER FINISHED: 3 out of 5 tasks were failed. assert_true: expected true got false 51 PASS node1 = new WaveShaperNode(, {"curve":{"0":1,"1":2,"2":3},"oversample":"4x"}) did not throw an exception. 52 PASS node1.curve is identical to the array [1,2,3]. 53 PASS node1.oversample is equal to 4x. 54 PASS < [valid non-default] All assertions passed. (total 3 assertions) 55 PASS # AUDIT TASK RUNNER FINISHED: 5 tasks ran successfully. 25 56 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-simple-expected.txt
r262405 r265152 14 14 PASS Setting curve to [-1,0.25,0.75] did not throw an exception. 15 15 PASS WaveShaper.curve is identical to the array [-1,0.25,0.75]. 16 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 17 FAIL X Waveshaper.curve = null is not equal to null. Got [-1,0.25,0.75]. assert_true: expected true got false 18 FAIL < [simple] 2 out of 12 assertions were failed. assert_true: expected true got false 19 FAIL # AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed. assert_true: expected true got false 16 PASS Setting curve back to null did not throw an exception. 17 PASS Waveshaper.curve = null is equal to null. 18 PASS < [simple] All assertions passed. (total 12 assertions) 19 PASS # AUDIT TASK RUNNER FINISHED: 1 tasks ran successfully. 20 20 -
trunk/Source/WebCore/CMakeLists.txt
r265066 r265152 483 483 Modules/webaudio/OscillatorOptions.idl 484 484 Modules/webaudio/OscillatorType.idl 485 Modules/webaudio/OverSampleType.idl 485 486 Modules/webaudio/PannerNode.idl 486 487 Modules/webaudio/PannerOptions.idl … … 491 492 Modules/webaudio/ScriptProcessorNode.idl 492 493 Modules/webaudio/WaveShaperNode.idl 494 Modules/webaudio/WaveShaperOptions.idl 493 495 Modules/webaudio/WebKitAudioContext.idl 494 496 Modules/webaudio/WebKitAudioPannerNode.idl -
trunk/Source/WebCore/ChangeLog
r265150 r265152 1 2020-07-31 Chris Dumez <cdumez@apple.com> 2 3 Add constructor for WaveShaperNode 4 https://bugs.webkit.org/show_bug.cgi?id=214989 5 6 Reviewed by Youenn Fablet. 7 8 Add constructor for WaveShaperNode: 9 - https://www.w3.org/TR/webaudio/#waveshapernode 10 11 No new tests, rebaselined existing tests. 12 13 * CMakeLists.txt: 14 * DerivedSources-input.xcfilelist: 15 * DerivedSources-output.xcfilelist: 16 * DerivedSources.make: 17 * Modules/webaudio/BaseAudioContext.cpp: 18 (WebCore::BaseAudioContext::createWaveShaper): 19 * Modules/webaudio/OverSampleType.h: Copied from Source/WebCore/Modules/webaudio/WaveShaperNode.idl. 20 * Modules/webaudio/OverSampleType.idl: Copied from Source/WebCore/Modules/webaudio/WaveShaperNode.idl. 21 * Modules/webaudio/WaveShaperNode.cpp: 22 (WebCore::WaveShaperNode::create): 23 (WebCore::WaveShaperNode::setCurve): 24 (WebCore::processorType): 25 * Modules/webaudio/WaveShaperNode.h: 26 (WTF::LogArgument<WebCore::OverSampleType>::toString): 27 * Modules/webaudio/WaveShaperNode.idl: 28 * Modules/webaudio/WaveShaperOptions.h: Copied from Source/WebCore/Modules/webaudio/WaveShaperNode.idl. 29 * Modules/webaudio/WaveShaperOptions.idl: Copied from Source/WebCore/Modules/webaudio/WaveShaperNode.idl. 30 * Sources.txt: 31 * WebCore.xcodeproj/project.pbxproj: 32 1 33 2020-07-31 Youenn Fablet <youenn@apple.com> 2 34 -
trunk/Source/WebCore/DerivedSources-input.xcfilelist
r265066 r265152 332 332 $(PROJECT_DIR)/Modules/webaudio/OscillatorOptions.idl 333 333 $(PROJECT_DIR)/Modules/webaudio/OscillatorType.idl 334 $(PROJECT_DIR)/Modules/webaudio/OverSampleType.idl 334 335 $(PROJECT_DIR)/Modules/webaudio/PannerNode.idl 335 336 $(PROJECT_DIR)/Modules/webaudio/PannerOptions.idl … … 340 341 $(PROJECT_DIR)/Modules/webaudio/ScriptProcessorNode.idl 341 342 $(PROJECT_DIR)/Modules/webaudio/WaveShaperNode.idl 343 $(PROJECT_DIR)/Modules/webaudio/WaveShaperOptions.idl 342 344 $(PROJECT_DIR)/Modules/webaudio/WebKitAudioContext.idl 343 345 $(PROJECT_DIR)/Modules/webaudio/WebKitAudioPannerNode.idl -
trunk/Source/WebCore/DerivedSources-output.xcfilelist
r265066 r265152 1239 1239 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSOscillatorType.cpp 1240 1240 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSOscillatorType.h 1241 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSOverSampleType.cpp 1242 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSOverSampleType.h 1241 1243 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSOverconstrainedError.cpp 1242 1244 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSOverconstrainedError.h … … 1977 1979 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWaveShaperNode.cpp 1978 1980 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWaveShaperNode.h 1981 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWaveShaperOptions.cpp 1982 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWaveShaperOptions.h 1979 1983 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebAnimation.cpp 1980 1984 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebAnimation.h -
trunk/Source/WebCore/DerivedSources.make
r265066 r265152 415 415 $(WebCore)/Modules/webaudio/OscillatorOptions.idl \ 416 416 $(WebCore)/Modules/webaudio/OscillatorType.idl \ 417 $(WebCore)/Modules/webaudio/OverSampleType.idl \ 417 418 $(WebCore)/Modules/webaudio/PannerNode.idl \ 418 419 $(WebCore)/Modules/webaudio/PannerOptions.idl \ … … 423 424 $(WebCore)/Modules/webaudio/ScriptProcessorNode.idl \ 424 425 $(WebCore)/Modules/webaudio/WaveShaperNode.idl \ 426 $(WebCore)/Modules/webaudio/WaveShaperOptions.idl \ 425 427 $(WebCore)/Modules/webaudio/WebKitAudioContext.idl \ 426 428 $(WebCore)/Modules/webaudio/WebKitAudioPannerNode.idl \ -
trunk/Source/WebCore/Modules/webaudio/BaseAudioContext.cpp
r265086 r265152 510 510 511 511 ASSERT(isMainThread()); 512 if (m_isStopScheduled)513 return Exception { InvalidStateError };514 515 lazyInitialize();516 512 return WaveShaperNode::create(*this); 517 513 } -
trunk/Source/WebCore/Modules/webaudio/OverSampleType.h
r265151 r265152 1 1 /* 2 * Copyright (C) 20 11, Google Inc. All rights reserved.2 * Copyright (C) 2020, Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 23 23 */ 24 24 25 enum OverSampleType { 26 "none", 27 "2x", 28 "4x" 29 }; 25 #pragma once 30 26 31 [ 32 Conditional=WEB_AUDIO, 33 JSGenerateToJSObject 34 ] interface WaveShaperNode : AudioNode { 35 attribute Float32Array curve; 36 attribute OverSampleType oversample; 37 }; 27 namespace WebCore { 28 29 enum class OverSampleType { None, _2x, _4x }; 30 31 } -
trunk/Source/WebCore/Modules/webaudio/OverSampleType.idl
r265151 r265152 1 1 /* 2 * Copyright (C) 20 11, Google Inc. All rights reserved.2 * Copyright (C) 2020, Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 28 28 "4x" 29 29 }; 30 31 [32 Conditional=WEB_AUDIO,33 JSGenerateToJSObject34 ] interface WaveShaperNode : AudioNode {35 attribute Float32Array curve;36 attribute OverSampleType oversample;37 }; -
trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.cpp
r263410 r265152 29 29 30 30 #include "AudioContext.h" 31 #include <JavaScriptCore/JSCInlines.h> 32 #include <JavaScriptCore/TypedArrayInlines.h> 31 33 #include <wtf/IsoMallocInlines.h> 32 34 #include <wtf/MainThread.h> … … 35 37 36 38 WTF_MAKE_ISO_ALLOCATED_IMPL(WaveShaperNode); 39 40 ExceptionOr<Ref<WaveShaperNode>> WaveShaperNode::create(BaseAudioContext& context, const WaveShaperOptions& options) 41 { 42 if (context.isStopped()) 43 return Exception { InvalidStateError }; 44 45 context.lazyInitialize(); 46 UNUSED_PARAM(options); 47 48 RefPtr<Float32Array> curve; 49 if (options.curve) { 50 curve = Float32Array::tryCreate(options.curve->data(), options.curve->size()); 51 if (!curve) 52 return Exception { InvalidStateError, "Invalid curve parameter" }; 53 } 54 55 auto node = adoptRef(*new WaveShaperNode(context)); 56 57 auto result = node->setChannelCount(options.channelCount.valueOr(2)); 58 if (result.hasException()) 59 return result.releaseException(); 60 61 result = node->setChannelCountMode(options.channelCountMode.valueOr(ChannelCountMode::Max)); 62 if (result.hasException()) 63 return result.releaseException(); 64 65 result = node->setChannelInterpretation(options.channelInterpretation.valueOr(ChannelInterpretation::Speakers)); 66 if (result.hasException()) 67 return result.releaseException(); 68 69 if (curve) { 70 result = node->setCurve(WTFMove(curve)); 71 if (result.hasException()) 72 return result.releaseException(); 73 } 74 75 node->setOversample(options.oversample); 76 77 return node; 78 } 37 79 38 80 WaveShaperNode::WaveShaperNode(BaseAudioContext& context) … … 45 87 } 46 88 47 void WaveShaperNode::setCurve(Float32Array& curve)89 ExceptionOr<void> WaveShaperNode::setCurve(RefPtr<Float32Array>&& curve) 48 90 { 49 91 ASSERT(isMainThread()); 50 92 DEBUG_LOG(LOGIDENTIFIER); 51 waveShaperProcessor()->setCurve(&curve); 93 if (curve && curve->length() < 2) 94 return Exception { InvalidStateError, "Length of curve array cannot be less than 2" }; 95 96 waveShaperProcessor()->setCurve(curve.get()); 97 return { }; 52 98 } 53 99 … … 57 103 } 58 104 59 static inline WaveShaperProcessor::OverSampleType processorType( WaveShaperNode::OverSampleType type)105 static inline WaveShaperProcessor::OverSampleType processorType(OverSampleType type) 60 106 { 61 107 switch (type) { 62 case WaveShaperNode::OverSampleType::None:108 case OverSampleType::None: 63 109 return WaveShaperProcessor::OverSampleNone; 64 case WaveShaperNode::OverSampleType::_2x:110 case OverSampleType::_2x: 65 111 return WaveShaperProcessor::OverSample2x; 66 case WaveShaperNode::OverSampleType::_4x:112 case OverSampleType::_4x: 67 113 return WaveShaperProcessor::OverSample4x; 68 114 } -
trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.h
r263410 r265152 25 25 #pragma once 26 26 27 #if ENABLE(WEB_AUDIO) 28 27 29 #include "AudioBasicProcessorNode.h" 30 #include "OverSampleType.h" 31 #include "WaveShaperOptions.h" 28 32 #include "WaveShaperProcessor.h" 29 33 #include <wtf/Forward.h> … … 34 38 WTF_MAKE_ISO_ALLOCATED(WaveShaperNode); 35 39 public: 36 static Ref<WaveShaperNode> create(BaseAudioContext& context) 37 { 38 return adoptRef(*new WaveShaperNode(context)); 39 } 40 static ExceptionOr<Ref<WaveShaperNode>> create(BaseAudioContext&, const WaveShaperOptions& = { }); 40 41 41 42 // setCurve() is called on the main thread. 42 void setCurve(Float32Array&);43 ExceptionOr<void> setCurve(RefPtr<Float32Array>&&); 43 44 Float32Array* curve(); 44 45 45 enum class OverSampleType { None, _2x, _4x };46 46 void setOversample(OverSampleType); 47 47 OverSampleType oversample() const; … … 55 55 }; 56 56 57 String convertEnumerationToString(WebCore:: WaveShaperNode::OverSampleType); // in JSWaveShaperNode.cpp57 String convertEnumerationToString(WebCore::OverSampleType); // in JSOverSampleType.cpp 58 58 59 59 } // namespace WebCore … … 61 61 namespace WTF { 62 62 63 template<> struct LogArgument<WebCore:: WaveShaperNode::OverSampleType> {64 static String toString(WebCore:: WaveShaperNode::OverSampleType type) { return convertEnumerationToString(type); }63 template<> struct LogArgument<WebCore::OverSampleType> { 64 static String toString(WebCore::OverSampleType type) { return convertEnumerationToString(type); } 65 65 }; 66 66 67 67 } // namespace WTF 68 69 #endif // ENABLE(WEB_AUDIO) -
trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.idl
r200291 r265152 23 23 */ 24 24 25 enum OverSampleType {26 "none",27 "2x",28 "4x"29 };30 31 25 [ 32 26 Conditional=WEB_AUDIO, 33 27 JSGenerateToJSObject 34 28 ] interface WaveShaperNode : AudioNode { 35 attribute Float32Array curve; 29 [MayThrowException, EnabledBySetting=ModernUnprefixedWebAudio] constructor(BaseAudioContext context, optional WaveShaperOptions options); 30 31 attribute Float32Array? curve; 36 32 attribute OverSampleType oversample; 37 33 }; -
trunk/Source/WebCore/Modules/webaudio/WaveShaperOptions.h
r265151 r265152 1 1 /* 2 * Copyright (C) 20 11, Google Inc. All rights reserved.2 * Copyright (C) 2020, Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 23 23 */ 24 24 25 enum OverSampleType { 26 "none", 27 "2x", 28 "4x" 25 #pragma once 26 27 #if ENABLE(WEB_AUDIO) 28 29 #include "AudioNodeOptions.h" 30 #include "OverSampleType.h" 31 #include <wtf/Vector.h> 32 33 namespace WebCore { 34 35 struct WaveShaperOptions : AudioNodeOptions { 36 Optional<Vector<float>> curve; 37 OverSampleType oversample { OverSampleType::None }; 29 38 }; 30 39 31 [ 32 Conditional=WEB_AUDIO, 33 JSGenerateToJSObject 34 ] interface WaveShaperNode : AudioNode { 35 attribute Float32Array curve; 36 attribute OverSampleType oversample; 37 }; 40 } 41 42 #endif // ENABLE(WEB_AUDIO) -
trunk/Source/WebCore/Modules/webaudio/WaveShaperOptions.idl
r265151 r265152 1 1 /* 2 * Copyright (C) 20 11, Google Inc. All rights reserved.2 * Copyright (C) 2020, Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 23 23 */ 24 24 25 enum OverSampleType { 26 "none", 27 "2x", 28 "4x" 25 [ 26 Conditional=WEB_AUDIO 27 ] dictionary WaveShaperOptions : AudioNodeOptions { 28 sequence<float> curve; 29 OverSampleType oversample = "none"; 29 30 }; 30 31 [32 Conditional=WEB_AUDIO,33 JSGenerateToJSObject34 ] interface WaveShaperNode : AudioNode {35 attribute Float32Array curve;36 attribute OverSampleType oversample;37 }; -
trunk/Source/WebCore/Sources.txt
r265079 r265152 3135 3135 JSOscillatorOptions.cpp 3136 3136 JSOscillatorType.cpp 3137 JSOverSampleType.cpp 3137 3138 JSOverconstrainedError.cpp 3138 3139 JSOverconstrainedErrorEvent.cpp … … 3496 3497 JSVoidCallback.cpp 3497 3498 JSWaveShaperNode.cpp 3499 JSWaveShaperOptions.cpp 3498 3500 JSWebAnimation.cpp 3499 3501 JSWebGL2RenderingContext.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r265095 r265152 2433 2433 831B61772499A5BF00C07C79 /* WebKitOfflineAudioContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 831B61752499A59D00C07C79 /* WebKitOfflineAudioContext.h */; }; 2434 2434 8321507E1F27EA1B0095B136 /* NavigatorBeacon.h in Headers */ = {isa = PBXBuildFile; fileRef = 8321507B1F27EA150095B136 /* NavigatorBeacon.h */; }; 2435 8326BF8E24D35C33001F8A85 /* OverSampleType.h in Headers */ = {isa = PBXBuildFile; fileRef = 8326BF8924D35C20001F8A85 /* OverSampleType.h */; }; 2436 8326BF8F24D35C39001F8A85 /* WaveShaperOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8326BF8C24D35C20001F8A85 /* WaveShaperOptions.h */; }; 2435 2437 832B843419D8E55100B26055 /* SVGAnimateElementBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 832B843319D8E55100B26055 /* SVGAnimateElementBase.h */; }; 2436 2438 833B9E321F508D8500E0E428 /* JSFileSystemDirectoryEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 833B9E2F1F508D8000E0E428 /* JSFileSystemDirectoryEntry.h */; }; … … 10416 10418 8321507B1F27EA150095B136 /* NavigatorBeacon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NavigatorBeacon.h; sourceTree = "<group>"; }; 10417 10419 8321507C1F27EA150095B136 /* NavigatorBeacon.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = NavigatorBeacon.idl; sourceTree = "<group>"; }; 10420 8326BF8924D35C20001F8A85 /* OverSampleType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OverSampleType.h; sourceTree = "<group>"; }; 10421 8326BF8B24D35C20001F8A85 /* OverSampleType.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = OverSampleType.idl; sourceTree = "<group>"; }; 10422 8326BF8C24D35C20001F8A85 /* WaveShaperOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WaveShaperOptions.h; sourceTree = "<group>"; }; 10423 8326BF8D24D35C21001F8A85 /* WaveShaperOptions.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WaveShaperOptions.idl; sourceTree = "<group>"; }; 10418 10424 8329A4171EC25B2B008ED4BE /* DocumentAndElementEventHandlers.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DocumentAndElementEventHandlers.idl; sourceTree = "<group>"; }; 10419 10425 8329DCC21C7A6AE300730B33 /* HTMLHyperlinkElementUtils.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLHyperlinkElementUtils.idl; sourceTree = "<group>"; }; … … 29567 29573 E755E8B424CA2796009F7C23 /* OscillatorType.h */, 29568 29574 E755E8B624CA2796009F7C23 /* OscillatorType.idl */, 29575 8326BF8924D35C20001F8A85 /* OverSampleType.h */, 29576 8326BF8B24D35C20001F8A85 /* OverSampleType.idl */, 29569 29577 FD315FCF12B0267500C1A359 /* PannerNode.cpp */, 29570 29578 FD315FD012B0267500C1A359 /* PannerNode.h */, … … 29591 29599 FD7F298D13D4C0CB00AD9535 /* WaveShaperNode.h */, 29592 29600 FD7F298E13D4C0CB00AD9535 /* WaveShaperNode.idl */, 29601 8326BF8C24D35C20001F8A85 /* WaveShaperOptions.h */, 29602 8326BF8D24D35C21001F8A85 /* WaveShaperOptions.idl */, 29593 29603 FD7F298F13D4C0CB00AD9535 /* WaveShaperProcessor.cpp */, 29594 29604 FD7F299013D4C0CB00AD9535 /* WaveShaperProcessor.h */, … … 32662 32672 1A0D57370A5C77FE007EDD4C /* OverflowEvent.h in Headers */, 32663 32673 3774ABA50FA21EB400AD7DE9 /* OverlapTestRequestClient.h in Headers */, 32674 8326BF8E24D35C33001F8A85 /* OverSampleType.h in Headers */, 32664 32675 65A21468097A329100B9050A /* Page.h in Headers */, 32665 32676 91278D5E21DEDAD600B57184 /* PageAuditAgent.h in Headers */, … … 33932 33943 FD7F299213D4C0CB00AD9535 /* WaveShaperDSPKernel.h in Headers */, 33933 33944 FD7F299413D4C0CB00AD9535 /* WaveShaperNode.h in Headers */, 33945 8326BF8F24D35C39001F8A85 /* WaveShaperOptions.h in Headers */, 33934 33946 FD7F299713D4C0CB00AD9535 /* WaveShaperProcessor.h in Headers */, 33935 33947 29A812490FBB9CA900510293 /* WebAccessibilityObjectWrapperBase.h in Headers */, … … 35050 35062 DECA803A1F9FED6A00E3B661 /* UnifiedSource249.cpp in Sources */, 35051 35063 DECA803B1F9FED6A00E3B661 /* UnifiedSource250.cpp in Sources */, 35052 CDED1C3C24CD305700934E12 /* VP9UtilitiesCocoa.mm in Sources */,35053 35064 DECA803C1F9FED6A00E3B661 /* UnifiedSource251.cpp in Sources */, 35054 35065 DECA803D1F9FED6A00E3B661 /* UnifiedSource252.cpp in Sources */, … … 35340 35351 CD8B5A42180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.mm in Sources */, 35341 35352 26F9A83818A046AC00AEB88A /* ViewportConfiguration.cpp in Sources */, 35353 CDED1C3C24CD305700934E12 /* VP9UtilitiesCocoa.mm in Sources */, 35342 35354 A14832B1187F61E100DA63A6 /* WAKAppKitStubs.m in Sources */, 35343 35355 A14832B3187F629100DA63A6 /* WAKClipView.m in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.