Bug 985805 - Part 2: Remove support for the legacy OscillatorNode extensions; r=padenot,smaug

This commit is contained in:
Ehsan Akhgari 2014-05-05 20:33:09 -04:00
parent f2d7c951a4
commit 62075a6e6d
4 changed files with 0 additions and 70 deletions

View File

@ -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;

View File

@ -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];
}

View File

@ -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;
};

View File

@ -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