WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-214615-20200721175442.patch (text/plain), 28.13 KB, created by
Clark Wang
on 2020-07-21 14:54:43 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Clark Wang
Created:
2020-07-21 14:54:43 PDT
Size:
28.13 KB
patch
obsolete
>Subversion Revision: 264653 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 2ee03356648bf01973480cf02fa4cacb654ffc95..e97d62eb89b4a4b1f9cdf55c7e2271616e94d707 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,37 @@ >+2020-07-21 Clark Wang <clark_wang@apple.com> >+ >+ Added PeriodicWave constructor according to spec >+ https://bugs.webkit.org/show_bug.cgi?id=214615 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Re-baselined existing tests that now pass. >+ >+ Added PeriodicWave constructor according to spec: https://www.w3.org/TR/webaudio/#periodicwave. >+ Added PeriodicWaveConstraints, PeriodicWaveOptions files. Updated PeriodicWave::createBandLimitedTables >+ to normalize waveform based on spec: https://www.w3.org/TR/webaudio/#waveform-normalization. >+ Added updated createPeriodicWave method in BaseAudioContext. >+ >+ * CMakeLists.txt: >+ * DerivedSources-input.xcfilelist: >+ * DerivedSources-output.xcfilelist: >+ * DerivedSources.make: >+ * Modules/webaudio/BaseAudioContext.cpp: >+ (WebCore::BaseAudioContext::createPeriodicWave): >+ * Modules/webaudio/BaseAudioContext.h: >+ (WebCore::BaseAudioContext::createPeriodicWave): >+ * Modules/webaudio/PeriodicWave.cpp: >+ (WebCore::PeriodicWave::create): >+ (WebCore::PeriodicWave::createBandLimitedTables): >+ * Modules/webaudio/PeriodicWave.h: >+ * Modules/webaudio/PeriodicWave.idl: >+ * Modules/webaudio/PeriodicWaveConstraints.h: Added. >+ * Modules/webaudio/PeriodicWaveConstraints.idl: Added. >+ * Modules/webaudio/PeriodicWaveOptions.h: Added. >+ * Modules/webaudio/PeriodicWaveOptions.idl: Added. >+ * Sources.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ > 2020-07-21 Xabier Rodriguez Calvar <calvaris@igalia.com> > > [GStreamer][1.18] mediastreamsrc element hits assert in gst -core >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index 2a5a411dbccaf23c5f89a78489c58541fc44e00e..dcd2532e0dc05653138d04aa41febac2e238ed8b 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -481,6 +481,8 @@ set(WebCore_NON_SVG_IDL_FILES > Modules/webaudio/PannerOptions.idl > Modules/webaudio/PanningModelType.idl > Modules/webaudio/PeriodicWave.idl >+ Modules/webaudio/PeriodicWaveConstraints.idl >+ Modules/webaudio/PeriodicWaveOptions.idl > Modules/webaudio/ScriptProcessorNode.idl > Modules/webaudio/WaveShaperNode.idl > Modules/webaudio/WebKitAudioContext.idl >diff --git a/Source/WebCore/DerivedSources-input.xcfilelist b/Source/WebCore/DerivedSources-input.xcfilelist >index c936329c4f060b34619cacc69a37788e219ff7e8..044847e1ce560d8ac62e61fdb1d9e948245d845d 100644 >--- a/Source/WebCore/DerivedSources-input.xcfilelist >+++ b/Source/WebCore/DerivedSources-input.xcfilelist >@@ -330,6 +330,8 @@ $(PROJECT_DIR)/Modules/webaudio/PannerNode.idl > $(PROJECT_DIR)/Modules/webaudio/PannerOptions.idl > $(PROJECT_DIR)/Modules/webaudio/PanningModelType.idl > $(PROJECT_DIR)/Modules/webaudio/PeriodicWave.idl >+$(PROJECT_DIR)/Modules/webaudio/PeriodicWaveConstraints.idl >+$(PROJECT_DIR)/Modules/webaudio/PeriodicWaveOptions.idl > $(PROJECT_DIR)/Modules/webaudio/ScriptProcessorNode.idl > $(PROJECT_DIR)/Modules/webaudio/WaveShaperNode.idl > $(PROJECT_DIR)/Modules/webaudio/WebKitAudioContext.idl >diff --git a/Source/WebCore/DerivedSources-output.xcfilelist b/Source/WebCore/DerivedSources-output.xcfilelist >index c002595e611511312d0e70e5d35eac2226e9abe1..758d8fc0981fd4943e5abec5b999ef9a9f5b1702 100644 >--- a/Source/WebCore/DerivedSources-output.xcfilelist >+++ b/Source/WebCore/DerivedSources-output.xcfilelist >@@ -1316,6 +1316,10 @@ $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPerformanceTiming.cpp > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPerformanceTiming.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPeriodicWave.cpp > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPeriodicWave.h >+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPeriodicWaveConstraints.cpp >+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPeriodicWaveConstraints.h >+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPeriodicWaveOptions.cpp >+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPeriodicWaveOptions.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPictureInPictureWindow.cpp > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPictureInPictureWindow.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSPlaybackDirection.cpp >diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make >index d65fc2e8b7a73664b50bd6e583e67e618da3b68d..22244017981d533b99cf16d48714682306935fab 100644 >--- a/Source/WebCore/DerivedSources.make >+++ b/Source/WebCore/DerivedSources.make >@@ -413,6 +413,8 @@ JS_BINDING_IDLS = \ > $(WebCore)/Modules/webaudio/PannerOptions.idl \ > $(WebCore)/Modules/webaudio/PanningModelType.idl \ > $(WebCore)/Modules/webaudio/PeriodicWave.idl \ >+ $(WebCore)/Modules/webaudio/PeriodicWaveConstraints.idl \ >+ $(WebCore)/Modules/webaudio/PeriodicWaveOptions.idl \ > $(WebCore)/Modules/webaudio/ScriptProcessorNode.idl \ > $(WebCore)/Modules/webaudio/WaveShaperNode.idl \ > $(WebCore)/Modules/webaudio/WebKitAudioContext.idl \ >diff --git a/Source/WebCore/Modules/webaudio/BaseAudioContext.cpp b/Source/WebCore/Modules/webaudio/BaseAudioContext.cpp >index c97f188e4902c44f779a4df4957cb73c552f5b83..597b06ade526912ab12485a7a6c8aedcb3252093 100644 >--- a/Source/WebCore/Modules/webaudio/BaseAudioContext.cpp >+++ b/Source/WebCore/Modules/webaudio/BaseAudioContext.cpp >@@ -649,6 +649,25 @@ ExceptionOr<Ref<PeriodicWave>> BaseAudioContext::createPeriodicWave(Float32Array > return PeriodicWave::create(sampleRate(), real, imaginary); > } > >+ExceptionOr<Ref<PeriodicWave>> BaseAudioContext::createPeriodicWave(Vector<float>& real, Vector<float>& imaginary, const PeriodicWaveConstraints& constraints) >+{ >+ ALWAYS_LOG(LOGIDENTIFIER); >+ >+ ASSERT(isMainThread()); >+ if (m_isStopScheduled) >+ return Exception { InvalidStateError }; >+ >+ if (real.size() != imaginary.size()) >+ return Exception { IndexSizeError, "real and imaginary must have the same length"_s }; >+ >+ PeriodicWaveOptions* options = new PeriodicWaveOptions(); >+ options->real = real; >+ options->imag = imaginary; >+ options->disableNormalization = constraints.disableNormalization; >+ lazyInitialize(); >+ return PeriodicWave::create(*this, *options); >+} >+ > void BaseAudioContext::notifyNodeFinishedProcessing(AudioNode* node) > { > ASSERT(isAudioThread()); >diff --git a/Source/WebCore/Modules/webaudio/BaseAudioContext.h b/Source/WebCore/Modules/webaudio/BaseAudioContext.h >index 49e7e3a93ede5732b48812ae284bbf8fdd9ae602..ec3550773f298558464002ace7da1b149ee7a9a0 100644 >--- a/Source/WebCore/Modules/webaudio/BaseAudioContext.h >+++ b/Source/WebCore/Modules/webaudio/BaseAudioContext.h >@@ -34,6 +34,8 @@ > #include "EventTarget.h" > #include "MediaCanStartListener.h" > #include "MediaProducer.h" >+#include "PeriodicWaveConstraints.h" >+#include "PeriodicWaveOptions.h" > #include "PlatformMediaSession.h" > #include "ScriptExecutionContext.h" > #include "VisibilityChangeClient.h" >@@ -153,6 +155,7 @@ public: > ExceptionOr<Ref<ChannelMergerNode>> createChannelMerger(size_t numberOfInputs); > ExceptionOr<Ref<OscillatorNode>> createOscillator(); > ExceptionOr<Ref<PeriodicWave>> createPeriodicWave(Float32Array& real, Float32Array& imaginary); >+ ExceptionOr<Ref<PeriodicWave>> createPeriodicWave(Vector<float>& real, Vector<float>& imaginary, const PeriodicWaveConstraints& = { }); > > // When a source node has no more processing to do (has finished playing), then it tells the context to dereference it. > void notifyNodeFinishedProcessing(AudioNode*); >diff --git a/Source/WebCore/Modules/webaudio/PeriodicWave.cpp b/Source/WebCore/Modules/webaudio/PeriodicWave.cpp >index ec9a17c4f56eb9966dc17627e93405ba1fd48c46..16a25c5a50e2fb939025f9eee14de800ae369979 100644 >--- a/Source/WebCore/Modules/webaudio/PeriodicWave.cpp >+++ b/Source/WebCore/Modules/webaudio/PeriodicWave.cpp >@@ -44,6 +44,7 @@ namespace WebCore { > > using namespace VectorMath; > >+// FIXME: Remove once old constructor is phased out > Ref<PeriodicWave> PeriodicWave::create(float sampleRate, Float32Array& real, Float32Array& imaginary) > { > ASSERT(real.length() == imaginary.length()); >@@ -53,6 +54,34 @@ Ref<PeriodicWave> PeriodicWave::create(float sampleRate, Float32Array& real, Flo > return waveTable; > } > >+ExceptionOr<Ref<PeriodicWave>> PeriodicWave::create(BaseAudioContext& context, const PeriodicWaveOptions& options) >+{ >+ Vector<float> real; >+ Vector<float> imag; >+ >+ if (options.real.hasValue()) { >+ real = options.real.value(); >+ if (options.imag.hasValue()) >+ imag = options.imag.value(); >+ else >+ imag.resize(real.size()); >+ } else if (options.imag.hasValue()) { >+ imag = options.imag.value(); >+ real.resize(imag.size()); >+ } else { >+ real.resize(2); >+ imag.resize(2); >+ imag[1] = 1; >+ } >+ >+ if (real.size() != imag.size() || real.size() < 2 || imag.size() < 2) >+ return Exception { IndexSizeError, "imag and real have incorrect lengths"_s }; >+ >+ auto waveTable = adoptRef(*new PeriodicWave(context.sampleRate())); >+ waveTable->createBandLimitedTables(real.data(), imag.data(), real.size(), options.disableNormalization); >+ return waveTable; >+} >+ > Ref<PeriodicWave> PeriodicWave::createSine(float sampleRate) > { > Ref<PeriodicWave> waveTable = adoptRef(*new PeriodicWave(sampleRate)); >@@ -142,7 +171,7 @@ unsigned PeriodicWave::numberOfPartialsForRange(unsigned rangeIndex) const > // Convert into time-domain wave tables. > // One table is created for each range for non-aliasing playback at different playback rates. > // Thus, higher ranges have more high-frequency partials culled out. >-void PeriodicWave::createBandLimitedTables(const float* realData, const float* imagData, unsigned numberOfComponents) >+void PeriodicWave::createBandLimitedTables(const float* realData, const float* imagData, unsigned numberOfComponents, bool disableNormalization) > { > float normalizationScale = 1; > >@@ -199,12 +228,14 @@ void PeriodicWave::createBandLimitedTables(const float* realData, const float* i > frame.doInverseFFT(data); > > // For the first range (which has the highest power), calculate its peak value then compute normalization scale. >- if (!rangeIndex) { >- float maxValue; >- vmaxmgv(data, 1, &maxValue, m_periodicWaveSize); >- >- if (maxValue) >- normalizationScale = 1.0f / maxValue; >+ if (!disableNormalization) { >+ if (!rangeIndex) { >+ float maxValue; >+ vmaxmgv(data, 1, &maxValue, m_periodicWaveSize); >+ >+ if (maxValue) >+ normalizationScale = 1.0f / maxValue; >+ } > } > > // Apply normalization scale. >diff --git a/Source/WebCore/Modules/webaudio/PeriodicWave.h b/Source/WebCore/Modules/webaudio/PeriodicWave.h >index 79a2d82ac6cc31f546f98d42a1c51f2575d56441..e9c4c6274bc4d1d666616794c0d7b6e9ba0d611f 100644 >--- a/Source/WebCore/Modules/webaudio/PeriodicWave.h >+++ b/Source/WebCore/Modules/webaudio/PeriodicWave.h >@@ -29,6 +29,7 @@ > #pragma once > > #include "AudioArray.h" >+#include "PeriodicWaveOptions.h" > #include <JavaScriptCore/Float32Array.h> > #include <memory> > #include <wtf/RefCounted.h> >@@ -44,7 +45,10 @@ public: > static Ref<PeriodicWave> createTriangle(float sampleRate); > > // Creates an arbitrary wave given the frequency components (Fourier coefficients). >+ // FIXME: Remove once old constructor is phased out > static Ref<PeriodicWave> create(float sampleRate, Float32Array& real, Float32Array& imag); >+ >+ static ExceptionOr<Ref<PeriodicWave>> create(BaseAudioContext&, const PeriodicWaveOptions& = { }); > > // Returns pointers to the lower and higher wave data for the pitch range containing > // the given fundamental frequency. These two tables are in adjacent "pitch" ranges >@@ -92,7 +96,7 @@ private: > unsigned numberOfPartialsForRange(unsigned rangeIndex) const; > > // Creates tables based on numberOfComponents Fourier coefficients. >- void createBandLimitedTables(const float* real, const float* imag, unsigned numberOfComponents); >+ void createBandLimitedTables(const float* real, const float* imag, unsigned numberOfComponents, bool = false); > Vector<std::unique_ptr<AudioFloatArray>> m_bandLimitedTables; > }; > >diff --git a/Source/WebCore/Modules/webaudio/PeriodicWave.idl b/Source/WebCore/Modules/webaudio/PeriodicWave.idl >index 0bf092221ad7ad0af67cf24479968c4c688cc756..37884dec9ba941fa84093a4febf93098b356509d 100644 >--- a/Source/WebCore/Modules/webaudio/PeriodicWave.idl >+++ b/Source/WebCore/Modules/webaudio/PeriodicWave.idl >@@ -27,5 +27,5 @@ > Conditional=WEB_AUDIO, > ImplementationLacksVTable > ] interface PeriodicWave { >- >+ [MayThrowException] constructor(BaseAudioContext context, optional PeriodicWaveOptions options); > }; >diff --git a/Source/WebCore/Modules/webaudio/PeriodicWaveConstraints.h b/Source/WebCore/Modules/webaudio/PeriodicWaveConstraints.h >new file mode 100644 >index 0000000000000000000000000000000000000000..c265752b03ac120ba594b8f562e723c9316476bf >--- /dev/null >+++ b/Source/WebCore/Modules/webaudio/PeriodicWaveConstraints.h >@@ -0,0 +1,38 @@ >+/* >+ * 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) >+ >+namespace WebCore { >+ >+struct PeriodicWaveConstraints { >+ bool disableNormalization = false; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEB_AUDIO) >diff --git a/Source/WebCore/Modules/webaudio/PeriodicWaveConstraints.idl b/Source/WebCore/Modules/webaudio/PeriodicWaveConstraints.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..0bb5f82a4ab1c35c8eddb7416fcdddd8f064b07e >--- /dev/null >+++ b/Source/WebCore/Modules/webaudio/PeriodicWaveConstraints.idl >@@ -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. >+ */ >+[ >+ Conditional=WEB_AUDIO, >+] dictionary PeriodicWaveConstraints { >+ boolean disableNormalization = false; >+}; >diff --git a/Source/WebCore/Modules/webaudio/PeriodicWaveOptions.h b/Source/WebCore/Modules/webaudio/PeriodicWaveOptions.h >new file mode 100644 >index 0000000000000000000000000000000000000000..0dad1a87d2d9edc52b48d61a365e0c50c8abdc0f >--- /dev/null >+++ b/Source/WebCore/Modules/webaudio/PeriodicWaveOptions.h >@@ -0,0 +1,41 @@ >+/* >+ * 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 "PeriodicWaveConstraints.h" >+ >+namespace WebCore { >+ >+struct PeriodicWaveOptions : PeriodicWaveConstraints { >+ Optional<Vector<float>> real; >+ Optional<Vector<float>> imag; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEB_AUDIO) >diff --git a/Source/WebCore/Modules/webaudio/PeriodicWaveOptions.idl b/Source/WebCore/Modules/webaudio/PeriodicWaveOptions.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..f1b4e496dd15ea1883454f10f0cdf2a4a3ec4dda >--- /dev/null >+++ b/Source/WebCore/Modules/webaudio/PeriodicWaveOptions.idl >@@ -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 PeriodicWaveOptions : PeriodicWaveConstraints { >+ sequence<float> real; >+ sequence<float> imag; >+}; >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index fd01219954196ae94c2a32f6b1a549dc562b0b8b..1466a07cf29b3f8e6d4b109e140aeee7f8ac759d 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -3170,6 +3170,8 @@ JSPerformanceResourceTiming.cpp > JSPerformanceServerTiming.cpp > JSPerformanceTiming.cpp > JSPeriodicWave.cpp >+JSPeriodicWaveConstraints.cpp >+JSPeriodicWaveOptions.cpp > JSPictureInPictureWindow.cpp > JSPlaybackDirection.cpp > JSPointerEvent.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 7d9439a1ee8f5a721ff093fbdc13bc84d585f52a..7d1502b1d38c8e7b56ebbd84c2ac8d943271526f 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -5045,6 +5045,8 @@ > E5BA7D63151437CA00FE1E3F /* LengthFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = E5BA7D62151437CA00FE1E3F /* LengthFunctions.h */; settings = {ATTRIBUTES = (Private, ); }; }; > E71467B324ABAEF200FB2F50 /* AudioNodeOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = E71467B124ABAEF100FB2F50 /* AudioNodeOptions.h */; }; > E71467B624ABAF1D00FB2F50 /* PannerOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = E71467B524ABAF1D00FB2F50 /* PannerOptions.h */; }; >+ E755E89224C7434B009F7C23 /* PeriodicWaveConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = E755E88F24C7434B009F7C23 /* PeriodicWaveConstraints.h */; }; >+ E755E89924C7461D009F7C23 /* PeriodicWaveOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = E755E89624C7461D009F7C23 /* PeriodicWaveOptions.h */; }; > E785D91524B4D1CA0014DB21 /* ChannelCountMode.h in Headers */ = {isa = PBXBuildFile; fileRef = E785D91124B4D1B10014DB21 /* ChannelCountMode.h */; }; > E785D93424B636FF0014DB21 /* ChannelInterpretation.h in Headers */ = {isa = PBXBuildFile; fileRef = E785D93124B636FF0014DB21 /* ChannelInterpretation.h */; }; > E785D96124B7F7350014DB21 /* AudioContextOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = E785D95F24B7F7340014DB21 /* AudioContextOptions.h */; }; >@@ -15800,6 +15802,10 @@ > E71467B424ABAF0B00FB2F50 /* AudioNodeOptions.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = AudioNodeOptions.idl; sourceTree = "<group>"; }; > E71467B524ABAF1D00FB2F50 /* PannerOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PannerOptions.h; sourceTree = "<group>"; }; > E71467B724ABAF2C00FB2F50 /* PannerOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PannerOptions.idl; sourceTree = "<group>"; }; >+ E755E88F24C7434B009F7C23 /* PeriodicWaveConstraints.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PeriodicWaveConstraints.h; sourceTree = "<group>"; }; >+ E755E89124C7434B009F7C23 /* PeriodicWaveConstraints.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = PeriodicWaveConstraints.idl; sourceTree = "<group>"; }; >+ E755E89624C7461D009F7C23 /* PeriodicWaveOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PeriodicWaveOptions.h; sourceTree = "<group>"; }; >+ E755E89824C7461D009F7C23 /* PeriodicWaveOptions.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = PeriodicWaveOptions.idl; sourceTree = "<group>"; }; > E785D91124B4D1B10014DB21 /* ChannelCountMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ChannelCountMode.h; sourceTree = "<group>"; }; > E785D91324B4D1B10014DB21 /* ChannelCountMode.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ChannelCountMode.idl; sourceTree = "<group>"; }; > E785D93124B636FF0014DB21 /* ChannelInterpretation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ChannelInterpretation.h; sourceTree = "<group>"; }; >@@ -29463,6 +29469,10 @@ > FD581FB11520F93B003A7A75 /* PeriodicWave.cpp */, > FD581FB21520F93B003A7A75 /* PeriodicWave.h */, > FD581FB31520F93B003A7A75 /* PeriodicWave.idl */, >+ E755E88F24C7434B009F7C23 /* PeriodicWaveConstraints.h */, >+ E755E89124C7434B009F7C23 /* PeriodicWaveConstraints.idl */, >+ E755E89624C7461D009F7C23 /* PeriodicWaveOptions.h */, >+ E755E89824C7461D009F7C23 /* PeriodicWaveOptions.idl */, > FD315FF112B0267600C1A359 /* RealtimeAnalyser.cpp */, > FD315FF212B0267600C1A359 /* RealtimeAnalyser.h */, > FD315FEB12B0267600C1A359 /* ScriptProcessorNode.cpp */, >@@ -32637,6 +32647,8 @@ > 8AF4E55C11DC5A63000ED3DE /* PerformanceTiming.h in Headers */, > A554B5F31E38393A001D4E03 /* PerformanceUserTiming.h in Headers */, > FD581FB51520F93B003A7A75 /* PeriodicWave.h in Headers */, >+ E755E89224C7434B009F7C23 /* PeriodicWaveConstraints.h in Headers */, >+ E755E89924C7461D009F7C23 /* PeriodicWaveOptions.h in Headers */, > 49D5DC2E0F423A73008F20FD /* PerspectiveTransformOperation.h in Headers */, > 1DBC1B562347B3D200B901AF /* PictureInPictureObserver.h in Headers */, > 1D2C82B7236A3F6A0055D6C5 /* PictureInPictureSupport.h in Headers */, >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index 36936a82fb5590a60cac372648165e0cc15dc203..b0881433ebf32d5b1e4acb9d4cbc9697c25066c6 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,14 @@ >+2020-07-21 Clark Wang <clark_wang@apple.com> >+ >+ Added PeriodicWave constructor according to spec >+ https://bugs.webkit.org/show_bug.cgi?id=214615 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Re-baselined existing tests that now pass. >+ >+ * web-platform-tests/webaudio/idlharness.https.window-expected.txt: >+ > 2020-07-20 Clark Wang <clark_wang@apple.com> > > Fixes to match BaseAudioContext.idl to spec >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webaudio/idlharness.https.window-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webaudio/idlharness.https.window-expected.txt >index 99f4c0cc137a4bb71c0b33dab4d43e290b8dae6f..56ff805cb8b75ba51d5cae637f96fa1687f3b400 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webaudio/idlharness.https.window-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webaudio/idlharness.https.window-expected.txt >@@ -968,13 +968,13 @@ PASS AudioNode interface: new PannerNode(context) must inherit property "channel > PASS AudioNode interface: new PannerNode(context) must inherit property "channelCountMode" with the proper type > PASS AudioNode interface: new PannerNode(context) must inherit property "channelInterpretation" with the proper type > PASS PeriodicWave interface: existence and properties of interface object >-FAIL PeriodicWave interface object length assert_equals: wrong value for PeriodicWave.length expected 1 but got 0 >+PASS PeriodicWave interface object length > PASS PeriodicWave interface object name > PASS PeriodicWave interface: existence and properties of interface prototype object > PASS PeriodicWave interface: existence and properties of interface prototype object's "constructor" property > PASS PeriodicWave interface: existence and properties of interface prototype object's @@unscopables property >-FAIL PeriodicWave must be primary interface of new PeriodicWave(context) assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new PeriodicWave(context)')" >-FAIL Stringification of new PeriodicWave(context) assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new PeriodicWave(context)')" >+PASS PeriodicWave must be primary interface of new PeriodicWave(context) >+PASS Stringification of new PeriodicWave(context) > PASS ScriptProcessorNode interface: existence and properties of interface object > PASS ScriptProcessorNode interface object length > PASS ScriptProcessorNode interface object name
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 214615
:
404865
|
404952
|
404965
|
404969
|
404974
|
404982
|
405043
|
405045
|
405048