Bug 1358061 - remove moz-audiochannel codes for media element and web audio. r=baku
☠☠ backed out by 9fbadd5bacea ☠ ☠
authorAlastor Wu <alwu@mozilla.com>
Tue, 25 Apr 2017 12:19:28 +0800
changeset 354972 6e7efb9115fdee5a10427607c51f50d3c5ecf5d6
parent 354927 00ef02146b9175cd17f1a4ea1bc0178f4e2a820e
child 354973 66311a113b58dcf2f91b7cc53a989520a4b2b90e
push id31719
push userkwierso@gmail.com
push dateWed, 26 Apr 2017 22:37:51 +0000
treeherdermozilla-central@745f2d85212d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1358061
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1358061 - remove moz-audiochannel codes for media element and web audio. r=baku MozReview-Commit-ID: BwZ6vHUPnSB
dom/base/nsGkAtomList.h
dom/html/HTMLMediaElement.cpp
dom/html/HTMLMediaElement.h
dom/html/test/file_mozaudiochannel.html
dom/html/test/mochitest.ini
dom/html/test/test_mozaudiochannel.html
dom/interfaces/html/nsIDOMHTMLMediaElement.idl
dom/media/webaudio/AudioContext.cpp
dom/media/webaudio/AudioContext.h
dom/media/webaudio/AudioDestinationNode.cpp
dom/media/webaudio/test/mochitest.ini
dom/media/webaudio/test/test_mozaudiochannel.html
dom/webidl/AudioContext.webidl
dom/webidl/HTMLMediaElement.webidl
--- a/dom/base/nsGkAtomList.h
+++ b/dom/base/nsGkAtomList.h
@@ -622,17 +622,16 @@ GK_ATOM(mode, "mode")
 GK_ATOM(modifiers, "modifiers")
 GK_ATOM(monochrome, "monochrome")
 GK_ATOM(mousedown, "mousedown")
 GK_ATOM(mousemove, "mousemove")
 GK_ATOM(mouseout, "mouseout")
 GK_ATOM(mouseover, "mouseover")
 GK_ATOM(mousethrough, "mousethrough")
 GK_ATOM(mouseup, "mouseup")
-GK_ATOM(mozaudiochannel, "mozaudiochannel")
 GK_ATOM(mozfullscreenchange, "mozfullscreenchange")
 GK_ATOM(mozfullscreenerror, "mozfullscreenerror")
 GK_ATOM(mozpointerlockchange, "mozpointerlockchange")
 GK_ATOM(mozpointerlockerror, "mozpointerlockerror")
 GK_ATOM(mozprivatebrowsing, "mozprivatebrowsing")
 GK_ATOM(moz_opaque, "moz-opaque")
 GK_ATOM(moz_action_hint, "mozactionhint")
 GK_ATOM(x_moz_errormessage, "x-moz-errormessage")
@@ -1954,20 +1953,16 @@ GK_ATOM(ondeviceorientation, "ondeviceor
 GK_ATOM(onabsolutedeviceorientation, "onabsolutedeviceorientation")
 GK_ATOM(ondeviceproximity, "ondeviceproximity")
 GK_ATOM(onmozorientationchange, "onmozorientationchange")
 GK_ATOM(onuserproximity, "onuserproximity")
 
 // light sensor support
 GK_ATOM(ondevicelight, "ondevicelight")
 
-// Audio channel events
-GK_ATOM(onmozinterruptbegin, "onmozinterruptbegin")
-GK_ATOM(onmozinterruptend, "onmozinterruptend")
-
 // MediaDevices device change event
 GK_ATOM(ondevicechange, "ondevicechange")
 
 // HTML element attributes that only exposed to XBL and chrome content
 GK_ATOM(mozinputrangeignorepreventdefault, "mozinputrangeignorepreventdefault")
 
 //---------------------------------------------------------------------------
 // Special atoms
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -1439,33 +1439,16 @@ NS_INTERFACE_MAP_END_INHERITING(nsGeneri
 // nsIDOMHTMLMediaElement
 NS_IMPL_URI_ATTR(HTMLMediaElement, Src, src)
 NS_IMPL_BOOL_ATTR(HTMLMediaElement, Controls, controls)
 NS_IMPL_BOOL_ATTR(HTMLMediaElement, Autoplay, autoplay)
 NS_IMPL_BOOL_ATTR(HTMLMediaElement, Loop, loop)
 NS_IMPL_BOOL_ATTR(HTMLMediaElement, DefaultMuted, muted)
 NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(HTMLMediaElement, Preload, preload, nullptr)
 
-NS_IMETHODIMP
-HTMLMediaElement::GetMozAudioChannelType(nsAString& aValue)
-{
-  nsString defaultValue;
-  AudioChannelService::GetDefaultAudioChannelString(defaultValue);
-
-  NS_ConvertUTF16toUTF8 str(defaultValue);
-  GetEnumAttr(nsGkAtoms::mozaudiochannel, str.get(), aValue);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-HTMLMediaElement::SetMozAudioChannelType(const nsAString& aValue)
-{
-  return SetAttrHelper(nsGkAtoms::mozaudiochannel, aValue);
-}
-
 NS_IMETHODIMP_(bool)
 HTMLMediaElement::IsVideo()
 {
   return false;
 }
 
 already_AddRefed<MediaSource>
 HTMLMediaElement::GetMozMediaSourceObject() const
@@ -4137,87 +4120,22 @@ bool HTMLMediaElement::ParseAttribute(in
     }
     if (aAttribute == nsGkAtoms::crossorigin) {
       ParseCORSValue(aValue, aResult);
       return true;
     }
     if (aAttribute == nsGkAtoms::preload) {
       return aResult.ParseEnumValue(aValue, kPreloadTable, false);
     }
-
-    // Remove the b2g-specific audio channel setting in bug1299390.
-    if (aAttribute == nsGkAtoms::mozaudiochannel) {
-      const nsAttrValue::EnumTable* table =
-        AudioChannelService::GetAudioChannelTable();
-      MOZ_ASSERT(table);
-
-      bool parsed = aResult.ParseEnumValue(aValue, table, false, &table[0]);
-      if (!parsed) {
-        return false;
-      }
-
-      AudioChannel audioChannel = static_cast<AudioChannel>(aResult.GetEnumValue());
-
-      if (audioChannel == mAudioChannel ||
-          !CheckAudioChannelPermissions(aValue)) {
-        return true;
-      }
-
-      // We cannot change the AudioChannel of a decoder.
-      if (mDecoder) {
-        return true;
-      }
-
-      mAudioChannel = audioChannel;
-
-      if (mSrcStream) {
-        RefPtr<MediaStream> stream = GetSrcMediaStream();
-        if (stream) {
-          stream->SetAudioChannelType(mAudioChannel);
-        }
-      }
-
-      return true;
-    }
   }
 
   return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
                                               aResult);
 }
 
-bool HTMLMediaElement::CheckAudioChannelPermissions(const nsAString& aString)
-{
-  // Only normal channel doesn't need permission.
-  if (aString.EqualsASCII("normal")) {
-    return true;
-  }
-
-  // Maybe this audio channel is equal to the default value from the pref.
-  nsString audioChannel;
-  AudioChannelService::GetDefaultAudioChannelString(audioChannel);
-  if (audioChannel.Equals(aString)) {
-    return true;
-  }
-
-  nsCOMPtr<nsIPermissionManager> permissionManager =
-    services::GetPermissionManager();
-  if (!permissionManager) {
-    return false;
-  }
-
-  uint32_t perm = nsIPermissionManager::UNKNOWN_ACTION;
-  permissionManager->TestExactPermissionFromPrincipal(NodePrincipal(),
-    nsCString(NS_LITERAL_CSTRING("audio-channel-") + NS_ConvertUTF16toUTF8(aString)).get(), &perm);
-  if (perm != nsIPermissionManager::ALLOW_ACTION) {
-    return false;
-  }
-
-  return true;
-}
-
 void HTMLMediaElement::DoneCreatingElement()
 {
    if (HasAttr(kNameSpaceID_None, nsGkAtoms::muted)) {
      mMuted |= MUTED_BY_CONTENT;
    }
 }
 
 bool HTMLMediaElement::IsHTMLFocusable(bool aWithMouse,
@@ -7058,25 +6976,16 @@ HTMLMediaElement::GetOrCreateTextTrackMa
 {
   if (!mTextTrackManager) {
     mTextTrackManager = new TextTrackManager(this);
     mTextTrackManager->AddListeners();
   }
   return mTextTrackManager;
 }
 
-void
-HTMLMediaElement::SetMozAudioChannelType(AudioChannel aValue, ErrorResult& aRv)
-{
-  nsString channel;
-  channel.AssignASCII(AudioChannelValues::strings[uint32_t(aValue)].value,
-                      AudioChannelValues::strings[uint32_t(aValue)].length);
-  SetHTMLAttr(nsGkAtoms::mozaudiochannel, channel, aRv);
-}
-
 MediaDecoderOwner::NextFrameStatus
 HTMLMediaElement::NextFrameStatus()
 {
   if (mDecoder) {
     return mDecoder->NextFrameStatus();
   } else if (mMediaStreamListener) {
     return mMediaStreamListener->NextFrameStatus();
   }
--- a/dom/html/HTMLMediaElement.h
+++ b/dom/html/HTMLMediaElement.h
@@ -688,23 +688,16 @@ public:
     return mAudioCaptured;
   }
 
   void MozGetMetadata(JSContext* aCx, JS::MutableHandle<JSObject*> aResult,
                       ErrorResult& aRv);
 
   double MozFragmentEnd();
 
-  AudioChannel MozAudioChannelType() const
-  {
-    return mAudioChannel;
-  }
-
-  void SetMozAudioChannelType(AudioChannel aValue, ErrorResult& aRv);
-
   AudioTrackList* AudioTracks();
 
   VideoTrackList* VideoTracks();
 
   TextTrackList* GetTextTracks();
 
   already_AddRefed<TextTrack> AddTextTrack(TextTrackKind aKind,
                                            const nsAString& aLabel,
@@ -746,19 +739,16 @@ public:
   // A method to check whether we are currently playing.
   bool IsCurrentlyPlaying() const;
 
   // Returns true if the media element is being destroyed. Used in
   // dormancy checks to prevent dormant processing for an element
   // that will soon be gone.
   bool IsBeingDestroyed();
 
-  IMPL_EVENT_HANDLER(mozinterruptbegin)
-  IMPL_EVENT_HANDLER(mozinterruptend)
-
   // These are used for testing only
   float ComputedVolume() const;
   bool ComputedMuted() const;
   nsSuspendedTypes ComputedSuspended() const;
 
   void SetMediaInfo(const MediaInfo& aInfo);
 
   virtual AbstractThread* AbstractMainThread() const final override;
@@ -1245,19 +1235,16 @@ protected:
    * Used to track hidden-video telemetry.
    */
   void HiddenVideoStop();
 
   void ReportEMETelemetry();
 
   void ReportTelemetry();
 
-  // Check the permissions for audiochannel.
-  bool CheckAudioChannelPermissions(const nsAString& aType);
-
   // Seeks to aTime seconds. aSeekType can be Exact to seek to exactly the
   // seek target, or PrevSyncPoint if a quicker but less precise seek is
   // desired, and we'll seek to the sync point (keyframe and/or start of the
   // next block of audio samples) preceeding seek target.
   already_AddRefed<Promise> Seek(double aTime, SeekTarget::Type aSeekType, ErrorResult& aRv);
 
   // Update the audio channel playing state
   void UpdateAudioChannelPlayingState(bool aForcePlaying = false);
deleted file mode 100644
--- a/dom/html/test/file_mozaudiochannel.html
+++ /dev/null
@@ -1,91 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<body>
-<div id="content" style="display: none">
-  <audio id="audio1" />
-  <audio id="audio2" mozaudiochannel="foo" />
-</div>
-
-<script type="application/javascript">
-
-function is(a, b, msg) {
-  parent.postMessage({ status: a === b, msg: msg }, '*');
-}
-
-function ok(a, msg) {
-  parent.postMessage({ status: !!a, msg: msg }, '*');
-}
-
-function finish() {
-  parent.postMessage({ finish: true }, '*');
-}
-
-function test_basic() {
-  var audio1 = document.getElementById("audio1");
-  ok(audio1, "Audio Element exists");
-  is(audio1.mozAudioChannelType, "normal", "Default audio1 channel == 'normal'");
-  try {
-  audio1.mozAudioChannelType = "foo";
-  } catch(e) {}
-  is(audio1.mozAudioChannelType, "normal", "Default audio1 channel == 'normal'");
-
-  var audio2 = document.getElementById("audio2");
-  ok(audio2, "Audio Element exists");
-  is(audio2.mozAudioChannelType, "normal", "Default audio2 channel == 'normal'");
-  try {
-  audio2.mozAudioChannelType = "foo";
-  } catch(e) {}
-  is(audio2.mozAudioChannelType, "normal", "Default audio2 channel == 'normal'");
-
-  runTest();
-}
-
-function test_preferences(aChannel) {
-  SpecialPowers.pushPrefEnv({"set": [["media.defaultAudioChannel", aChannel ]]},
-    function() {
-      var audio = document.createElement('audio');
-      ok(audio, "Audio Element created");
-      is(audio.mozAudioChannelType, aChannel, "Default audio channel == '" + aChannel + "'");
-      runTest();
-    }
-  );
-}
-
-function test_wrong_preferences() {
-  SpecialPowers.pushPrefEnv({"set": [["media.defaultAudioChannel", 'foobar' ]]},
-    function() {
-      var audio = document.createElement('audio');
-      ok(audio, "Audio Element created");
-      is(audio.mozAudioChannelType, 'normal', "Default audio channel == 'normal'");
-      runTest();
-    }
-  );
-}
-var tests = [
-  test_basic,
-
-  function() { test_preferences("content"); },
-  function() { test_preferences("notification"); },
-  function() { test_preferences("alarm"); },
-  function() { test_preferences("telephony"); },
-  function() { test_preferences("ringer"); },
-  function() { test_preferences("publicnotification"); },
-
-  test_wrong_preferences,
-];
-
-function runTest() {
-  if (!tests.length) {
-    finish();
-    return;
-  }
-
-  var test = tests.shift();
-  test();
-}
-
-runTest();
-
-</script>
-</body>
-</html>
--- a/dom/html/test/mochitest.ini
+++ b/dom/html/test/mochitest.ini
@@ -178,17 +178,16 @@ support-files =
   formData_test.js
   image.png
   image-allow-credentials.png
   image-allow-credentials.png^headers^
   nnc_lockup.gif
   reflect.js
   file_ignoreuserfocus.html
   simpleFileOpener.js
-  file_mozaudiochannel.html
   file_bug1166138_1x.png
   file_bug1166138_2x.png
   file_bug1166138_def.png
   script_fakepath.js
 
 [test_a_text.html]
 [test_anchor_href_cache_invalidation.html]
 [test_applet_attributes_reflection.html]
@@ -501,17 +500,16 @@ skip-if = toolkit == 'android' # bug 939
 [test_imports_nested.html]
 [test_imports_nested_2.html]
 [test_li_attributes_reflection.html]
 [test_link_attributes_reflection.html]
 [test_link_sizes.html]
 [test_map_attributes_reflection.html]
 [test_meta_attributes_reflection.html]
 [test_mod_attributes_reflection.html]
-[test_mozaudiochannel.html]
 [test_named_options.html]
 [test_nested_invalid_fieldsets.html]
 [test_object_attributes_reflection.html]
 [test_object_plugin_nav.html]
 skip-if = toolkit == 'android' # plugins not supported
 [test_ol_attributes_reflection.html]
 [test_option_defaultSelected.html]
 [test_option_selected_state.html]
deleted file mode 100644
--- a/dom/html/test/test_mozaudiochannel.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test for mozaudiochannel</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<pre id="test">
-<script type="application/javascript">
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPrefEnv({"set": [["media.useAudioChannelAPI", true]]}, function() {
-  var ifr = document.createElement('iframe');
-  ifr.src = 'file_mozaudiochannel.html';
-  onmessage = function(e) {
-    if ("finish" in e.data) {
-      SimpleTest.finish();
-    } else {
-      ok(e.data.status, e.data.msg);
-    }
-  }
-
-  document.body.appendChild(ifr);
-});
-</script>
-</pre>
-</body>
-</html>
--- a/dom/interfaces/html/nsIDOMHTMLMediaElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLMediaElement.idl
@@ -82,50 +82,16 @@ interface nsIDOMHTMLMediaElement : nsISu
   [implicit_jscontext]
   jsval mozGetMetadata();
 
   // Mozilla extension: provides access to the fragment end time if
   // the media element has a fragment URI for the currentSrc, otherwise
   // it is equal to the media duration.
   readonly attribute double mozFragmentEnd;
 
-   // Mozilla extension: an audio channel type for media elements.
-   // An exception is thrown if the app tries to change the audio channel type
-   // without the permission (manifest file for B2G apps).
-   // The supported values are:
-   // * normal (default value)
-   //   Automatically paused if "notification" or higher priority channel
-   //   is played
-   //   Use case: normal applications
-   // * content
-   //   Automatically paused if "notification" or higher priority channel
-   //   is played. Also paused if another app starts using "content"
-   //   channel. Using this channel never affects applications using
-   //   the "normal" channel.
-   //   Use case: video/audio players
-   // * notification
-   //   Automatically paused if "alarm" or higher priority channel is played.
-   //   Use case: New email, incoming SMS
-   // * alarm
-   //   Automatically paused if "telephony" or higher priority channel is
-   //   played.
-   //   User case: Alarm clock, calendar alarms
-   // * telephony
-   //   Automatically paused if "ringer" or higher priority
-   //   channel is played.
-   //   Use case: dialer, voip
-   // * ringer
-   //   Automatically paused if "publicnotification" or higher priority
-   //   channel is played.
-   //   Use case: dialer, voip
-   // * publicnotification
-   //   Always plays in speaker, even when headphones are plugged in.
-   //   Use case: Camera shutter sound.
-   attribute DOMString mozAudioChannelType;
-
   // In addition the media element has this new events:
   // * onmozinterruptbegin - called when the media element is interrupted
   //   because of the audiochannel manager.
   // * onmozinterruptend - called when the interruption is concluded
 
   [notxpcom] boolean isVideo();
 
   /**
--- a/dom/media/webaudio/AudioContext.cpp
+++ b/dom/media/webaudio/AudioContext.cpp
@@ -1061,31 +1061,16 @@ void
 AudioContext::Unmute() const
 {
   MOZ_ASSERT(!mIsOffline);
   if (mDestination) {
     mDestination->Unmute();
   }
 }
 
-AudioChannel
-AudioContext::MozAudioChannelType() const
-{
-  return mDestination->MozAudioChannelType();
-}
-
-AudioChannel
-AudioContext::TestAudioChannelInAudioNodeStream()
-{
-  MediaStream* stream = mDestination->Stream();
-  MOZ_ASSERT(stream);
-
-  return stream->AudioChannelType();
-}
-
 size_t
 AudioContext::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
   // AudioNodes are tracked separately because we do not want the AudioContext
   // to track all of the AudioNodes it creates, so we wouldn't be able to
   // traverse them from here.
 
   size_t amount = aMallocSizeOf(this);
--- a/dom/media/webaudio/AudioContext.h
+++ b/dom/media/webaudio/AudioContext.h
@@ -307,30 +307,23 @@ public:
 
   uint32_t ActiveNodeCount() const;
 
   void Mute() const;
   void Unmute() const;
 
   JSObject* GetGlobalJSObject() const;
 
-  AudioChannel MozAudioChannelType() const;
-
-  AudioChannel TestAudioChannelInAudioNodeStream();
-
   void RegisterNode(AudioNode* aNode);
   void UnregisterNode(AudioNode* aNode);
 
   void OnStateChanged(void* aPromise, AudioContextState aNewState);
 
   BasicWaveFormCache* GetBasicWaveFormCache();
 
-  IMPL_EVENT_HANDLER(mozinterruptbegin)
-  IMPL_EVENT_HANDLER(mozinterruptend)
-
   bool CheckClosed(ErrorResult& aRv);
 
   void Dispatch(already_AddRefed<nsIRunnable>&& aRunnable);
 
 private:
   void DisconnectFromWindow();
   void RemoveFromDecodeQueue(WebAudioDecodeJob* aDecodeJob);
   void ShutdownDecoder();
--- a/dom/media/webaudio/AudioDestinationNode.cpp
+++ b/dom/media/webaudio/AudioDestinationNode.cpp
@@ -540,19 +540,16 @@ AudioDestinationNode::WindowSuspendChang
     return NS_OK;
   }
 
   MOZ_LOG(AudioChannelService::GetAudioChannelLog(), LogLevel::Debug,
          ("AudioDestinationNode, WindowSuspendChanged, "
           "this = %p, aSuspend = %s\n", this, SuspendTypeToStr(aSuspend)));
 
   mAudioChannelSuspended = suspended;
-  Context()->DispatchTrustedEvent(!suspended ?
-    NS_LITERAL_STRING("mozinterruptend") :
-    NS_LITERAL_STRING("mozinterruptbegin"));
 
   DisabledTrackMode disabledMode = suspended ? DisabledTrackMode::SILENCE_BLACK
                                              : DisabledTrackMode::ENABLED;
   mStream->SetTrackEnabled(AudioNodeStream::AUDIO_TRACK, disabledMode);
 
   AudioChannelService::AudibleState audible =
     aSuspend == nsISuspendedTypes::NONE_SUSPENDED ?
       AudioChannelService::AudibleState::eAudible :
--- a/dom/media/webaudio/test/mochitest.ini
+++ b/dom/media/webaudio/test/mochitest.ini
@@ -166,18 +166,16 @@ skip-if = toolkit == 'android' # bug 114
 [test_mediaStreamAudioSourceNodeCrossOrigin.html]
 tags=capturestream
 [test_mediaStreamAudioSourceNodeNoGC.html]
 [test_mediaStreamAudioSourceNodePassThrough.html]
 [test_mediaStreamAudioSourceNodeResampling.html]
 tags=capturestream
 [test_mixingRules.html]
 skip-if = toolkit == 'android' # bug 1091965
-[test_mozaudiochannel.html]
-# Android: bug 1061675; OSX 10.6: bug 1097721
 skip-if = (toolkit == 'android') || (os == 'mac' && os_version == '10.6')
 [test_nodeToParamConnection.html]
 [test_nodeCreationDocumentGone.html]
 [test_OfflineAudioContext.html]
 [test_offlineDestinationChannelCountLess.html]
 [test_offlineDestinationChannelCountMore.html]
 [test_oscillatorNode.html]
 [test_oscillatorNode2.html]
deleted file mode 100644
--- a/dom/media/webaudio/test/test_mozaudiochannel.html
+++ /dev/null
@@ -1,151 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test for mozaudiochannel</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<p id="display"></p>
-<pre id="test">
-<script type="application/javascript">
-
-function test_basic() {
-  var ac = new AudioContext();
-  ok(ac, "AudioContext created");
-
-  // Default
-  is(ac.mozAudioChannelType, "normal", "Default ac channel == 'normal'");
-
-  // Unpermitted channels
-  ac = new AudioContext("content");
-  is(ac.mozAudioChannelType, "normal", "Default ac channel == 'normal'");
-
-  ac = new AudioContext("notification");
-  is(ac.mozAudioChannelType, "normal", "Default ac channel == 'normal'");
-
-  ac = new AudioContext("alarm");
-  is(ac.mozAudioChannelType, "normal", "Default ac channel == 'normal'");
-
-  ac = new AudioContext("telephony");
-  is(ac.mozAudioChannelType, "normal", "Default ac channel == 'normal'");
-
-  ac = new AudioContext("ringer");
-  is(ac.mozAudioChannelType, "normal", "Default ac channel == 'normal'");
-
-  ac = new AudioContext("publicnotification");
-  is(ac.mozAudioChannelType, "normal", "Default ac channel == 'normal'");
-
-  runTest();
-}
-
-function test_permission(aChannel) {
-  var ac = new AudioContext();
-  ok(ac, "AudioContext created");
-
-  is(ac.mozAudioChannelType, "normal", "Default ac channel == 'normal'");
-
-  var channel = SpecialPowers.wrap(ac).testAudioChannelInAudioNodeStream();
-  is(channel, "normal", "AudioNodeStream is using the correct default audio channel.");
-
-  SpecialPowers.pushPermissions(
-    [{ "type": "audio-channel-" + aChannel, "allow": true, "context": document }],
-    function() {
-      var ac = new AudioContext(aChannel);
-      is(ac.mozAudioChannelType, aChannel, "Default ac channel == '" + aChannel + "'");
-
-      var channel = SpecialPowers.wrap(ac).testAudioChannelInAudioNodeStream();
-      is(channel, aChannel, "AudioNodeStream is using the correct new audio channel.");
-
-      runTest();
-    }
-  );
-}
-
-function test_preferences(aChannel) {
-  SpecialPowers.pushPrefEnv({"set": [["media.defaultAudioChannel", aChannel ]]},
-    function() {
-      SpecialPowers.pushPermissions(
-        [{ "type": "audio-channel-" + aChannel, "allow": false, "context": document }],
-        function() {
-          var ac = new AudioContext(aChannel);
-          ok(ac, "AudioContext created");
-          is(ac.mozAudioChannelType, aChannel, "Default ac channel == '" + aChannel + "'");
-
-          var channel = SpecialPowers.wrap(ac).testAudioChannelInAudioNodeStream();
-          is(channel, aChannel, "AudioNodeStream is using the correct audio channel.");
-
-          runTest();
-        }
-      );
-    }
-  );
-}
-
-function test_wrong_preferences() {
-  SpecialPowers.pushPrefEnv({"set": [["media.defaultAudioChannel", 'foobar' ]]},
-    function() {
-      var ac = new AudioContext();
-      ok(ac, "AudioContext created");
-      is(ac.mozAudioChannelType, 'normal', "Default ac channel == 'normal'");
-      runTest();
-    }
-  );
-}
-
-function test_testAudioChannelInAudioNodeStream() {
-  var ac = new AudioContext();
-  ok(ac, "AudioContext created");
-
-  var status = false;
-  try {
-    ac.testAudioChannelInAudioNodeStream();
-  } catch(e) {
-    status = true;
-  }
-
-  ok(status, "testAudioChannelInAudioNodeStream() should not exist in content.");
-  runTest();
-}
-
-var tests = [
-  test_basic,
-
-  function() { test_permission("content"); },
-  function() { test_permission("notification"); },
-  function() { test_permission("alarm"); },
-  function() { test_permission("telephony"); },
-  function() { test_permission("ringer"); },
-  function() { test_permission("publicnotification"); },
-
-  function() { test_preferences("content"); },
-  function() { test_preferences("notification"); },
-  function() { test_preferences("alarm"); },
-  function() { test_preferences("telephony"); },
-  function() { test_preferences("ringer"); },
-  function() { test_preferences("publicnotification"); },
-
-  test_wrong_preferences,
-
-  test_testAudioChannelInAudioNodeStream,
-];
-
-function runTest() {
-  if (!tests.length) {
-    SimpleTest.finish();
-    return;
-  }
-
-  var test = tests.shift();
-  test();
-}
-
-SpecialPowers.pushPrefEnv({"set": [["media.useAudioChannelAPI", true ]]}, runTest);
-SimpleTest.waitForExplicitFinish();
-SimpleTest.requestLongerTimeout(5);
-
-</script>
-</pre>
-</body>
-</html>
--- a/dom/webidl/AudioContext.webidl
+++ b/dom/webidl/AudioContext.webidl
@@ -28,28 +28,9 @@ interface AudioContext : BaseAudioContex
 
     [NewObject, Throws, UnsafeInPrerendering]
     MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream);
 
     // Bug 1324548: MediaStreamTrackAudioSourceNode createMediaStreamTrackSource (AudioMediaStreamTrack mediaStreamTrack);
 
     [NewObject, Throws]
     MediaStreamAudioDestinationNode createMediaStreamDestination();
-};
-
-// Mozilla extensions
-partial interface AudioContext {
-  // Read AudioChannel.webidl for more information about this attribute.
-  [Pref="media.useAudioChannelAPI"]
-  readonly attribute AudioChannel mozAudioChannelType;
-
-  // These 2 events are dispatched when the AudioContext object is muted by
-  // the AudioChannelService. It's call 'interrupt' because when this event is
-  // dispatched on a HTMLMediaElement, the audio stream is paused.
-  [Pref="media.useAudioChannelAPI"]
-  attribute EventHandler onmozinterruptbegin;
-
-  [Pref="media.useAudioChannelAPI"]
-  attribute EventHandler onmozinterruptend;
-
-  // This method is for test only.
-  [ChromeOnly] AudioChannel testAudioChannelInAudioNodeStream();
-};
+};
\ No newline at end of file
--- a/dom/webidl/HTMLMediaElement.webidl
+++ b/dom/webidl/HTMLMediaElement.webidl
@@ -133,31 +133,16 @@ partial interface HTMLMediaElement {
   // player interfaces to display the song title, artist, etc.
   [Throws]
   object? mozGetMetadata();
 
   // Mozilla extension: provides access to the fragment end time if
   // the media element has a fragment URI for the currentSrc, otherwise
   // it is equal to the media duration.
   readonly attribute double mozFragmentEnd;
-
-  // Mozilla extension: an audio channel type for media elements.
-  // Read AudioChannel.webidl for more information about this attribute.
-  [SetterThrows, Pref="media.useAudioChannelAPI"]
-  attribute AudioChannel mozAudioChannelType;
-
-  // In addition the media element has this new events:
-  // * onmozinterruptbegin - called when the media element is interrupted
-  //   because of the audiochannel manager.
-  // * onmozinterruptend - called when the interruption is concluded
-  [Pref="media.useAudioChannelAPI"]
-  attribute EventHandler onmozinterruptbegin;
-
-  [Pref="media.useAudioChannelAPI"]
-  attribute EventHandler onmozinterruptend;
 };
 
 // Encrypted Media Extensions
 partial interface HTMLMediaElement {
   readonly attribute MediaKeys? mediaKeys;
 
   // void, not any: https://www.w3.org/Bugs/Public/show_bug.cgi?id=26457
   [NewObject]