From 62075a6e6d2d9dd3dba619135aeffc14fecc30a8 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Mon, 5 May 2014 20:33:09 -0400 Subject: [PATCH] Bug 985805 - Part 2: Remove support for the legacy OscillatorNode extensions; r=padenot,smaug --- content/media/webaudio/OscillatorNode.h | 36 ------------------- .../webaudio/test/test_oscillatorNode.html | 5 --- dom/webidl/OscillatorNode.webidl | 28 --------------- testing/profiles/prefs_general.js | 1 - 4 files changed, 70 deletions(-) diff --git a/content/media/webaudio/OscillatorNode.h b/content/media/webaudio/OscillatorNode.h index a58e81de367..73a22abdba8 100644 --- a/content/media/webaudio/OscillatorNode.h +++ b/content/media/webaudio/OscillatorNode.h @@ -48,34 +48,6 @@ public: } void SetType(OscillatorType aType, ErrorResult& aRv) { - if (!Preferences::GetBool("media.webaudio.legacy.OscillatorNode")) { - // Do not accept the alternate enum values unless the legacy pref - // has been turned on. - switch (aType) { - case OscillatorType::_0: - case OscillatorType::_1: - case OscillatorType::_2: - case OscillatorType::_3: - case OscillatorType::_4: - // Do nothing in order to emulate setting an invalid enum value. - return; - default: - // Shut up the compiler warning - break; - } - } - - // Handle the alternate enum values - switch (aType) { - case OscillatorType::_0: aType = OscillatorType::Sine; break; - case OscillatorType::_1: aType = OscillatorType::Square; break; - case OscillatorType::_2: aType = OscillatorType::Sawtooth; break; - case OscillatorType::_3: aType = OscillatorType::Triangle; break; - case OscillatorType::_4: aType = OscillatorType::Custom; break; - default: - // Shut up the compiler warning - break; - } if (aType == OscillatorType::Custom) { // ::Custom can only be set by setPeriodicWave(). // https://github.com/WebAudio/web-audio-api/issues/105 for exception. @@ -96,15 +68,7 @@ public: } void Start(double aWhen, ErrorResult& aRv); - void NoteOn(double aWhen, ErrorResult& aRv) - { - Start(aWhen, aRv); - } void Stop(double aWhen, ErrorResult& aRv); - void NoteOff(double aWhen, ErrorResult& aRv) - { - Stop(aWhen, aRv); - } void SetPeriodicWave(PeriodicWave& aPeriodicWave) { mPeriodicWave = &aPeriodicWave; diff --git a/content/media/webaudio/test/test_oscillatorNode.html b/content/media/webaudio/test/test_oscillatorNode.html index 3d4b36aa2a2..5eb48857433 100644 --- a/content/media/webaudio/test/test_oscillatorNode.html +++ b/content/media/webaudio/test/test_oscillatorNode.html @@ -23,9 +23,6 @@ addLoadEvent(function() { expectException(function() { osc.type = "custom"; }, DOMException.INVALID_STATE_ERR); - expectException(function() { - osc.type = osc.CUSTOM; - }, DOMException.INVALID_STATE_ERR); is(osc.type, "sine", "Cannot set the type to custom"); is(osc.frequency.value, 440, "Correct default frequency value"); is(osc.detune.value, 0, "Correct default detine value"); @@ -38,8 +35,6 @@ addLoadEvent(function() { "triangle", ]; for (var i = 0; i < types.length; ++i) { - osc.type = osc[types[i].toUpperCase()]; - is(osc.type, types[i], "Correct alternname type enum value"); osc.type = types[i]; } diff --git a/dom/webidl/OscillatorNode.webidl b/dom/webidl/OscillatorNode.webidl index dd412406e1e..096732ff95a 100644 --- a/dom/webidl/OscillatorNode.webidl +++ b/dom/webidl/OscillatorNode.webidl @@ -11,9 +11,6 @@ */ enum OscillatorType { - // Hack: Use numbers to support alternate enum values - "0", "1", "2", "3", "4", - "sine", "square", "sawtooth", @@ -39,28 +36,3 @@ interface OscillatorNode : AudioNode { }; -/* - * The origin of this IDL file is - * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames - */ -partial interface OscillatorNode { - // Same as start() - [Throws,Pref="media.webaudio.legacy.OscillatorNode"] - void noteOn(double when); - - // Same as stop() - [Throws,Pref="media.webaudio.legacy.OscillatorNode"] - void noteOff(double when); - - [Pref="media.webaudio.legacy.OscillatorNode"] - const unsigned short SINE = 0; - [Pref="media.webaudio.legacy.OscillatorNode"] - const unsigned short SQUARE = 1; - [Pref="media.webaudio.legacy.OscillatorNode"] - const unsigned short SAWTOOTH = 2; - [Pref="media.webaudio.legacy.OscillatorNode"] - const unsigned short TRIANGLE = 3; - [Pref="media.webaudio.legacy.OscillatorNode"] - const unsigned short CUSTOM = 4; -}; - diff --git a/testing/profiles/prefs_general.js b/testing/profiles/prefs_general.js index 9bfed49d4c2..126a2052095 100644 --- a/testing/profiles/prefs_general.js +++ b/testing/profiles/prefs_general.js @@ -146,7 +146,6 @@ user_pref("dom.gamepad.non_standard_events.enabled", true); // Enable Web Audio legacy APIs user_pref("media.webaudio.legacy.PannerNode", true); -user_pref("media.webaudio.legacy.OscillatorNode", true); // Always use network provider for geolocation tests // so we bypass the OSX dialog raised by the corelocation provider