Merge m-c to inbound. a=merge
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 18 Jan 2017 09:54:06 -0500
changeset 374952 eb6cd64d4a67b8342673a19412588ee834e77f5f
parent 374951 a26555efc6e55329fd02217f5585658db3ed91df (current diff)
parent 374878 f94f1552ae0a2ef38684663552603595df863606 (diff)
child 374953 20d71b8cba1558f8b55a3c07e8b4d5ea91b9288b
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone53.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
Merge m-c to inbound. a=merge
dom/media/gmp/GMPAudioDecoderChild.cpp
dom/media/gmp/GMPAudioDecoderChild.h
dom/media/gmp/GMPAudioDecoderParent.cpp
dom/media/gmp/GMPAudioDecoderParent.h
dom/media/gmp/GMPAudioDecoderProxy.h
dom/media/gmp/GMPAudioHost.cpp
dom/media/gmp/GMPAudioHost.h
dom/media/gmp/GMPChild.cpp
dom/media/gmp/GMPParent.cpp
dom/media/gmp/PGMPAudioDecoder.ipdl
dom/media/gmp/gmp-api/gmp-audio-codec.h
dom/media/gmp/gmp-api/gmp-audio-decode.h
dom/media/gmp/gmp-api/gmp-audio-host.h
dom/media/gmp/gmp-api/gmp-audio-samples.h
dom/media/gmp/moz.build
dom/media/platforms/agnostic/eme/EMEAudioDecoder.cpp
dom/media/platforms/agnostic/eme/EMEAudioDecoder.h
dom/media/platforms/agnostic/gmp/GMPAudioDecoder.cpp
dom/media/platforms/agnostic/gmp/GMPAudioDecoder.h
media/libvpx/clang-cl.patch
media/libvpx/libvpx/build/make/gen_msvs_proj.sh
media/libvpx/libvpx/test/lpf_8_test.cc
media/libvpx/libvpx/test/sixtap_predict_test.cc
media/libvpx/libvpx/test/vp8cx_set_ref.sh
media/libvpx/libvpx/third_party/libyuv/source/row_x86.asm
media/libvpx/libvpx/third_party/libyuv/source/x86inc.asm
media/libvpx/libvpx/tools/vpx-astyle.sh
media/libvpx/libvpx/vp8/common/arm/armv6/bilinearfilter_v6.asm
media/libvpx/libvpx/vp8/common/arm/armv6/copymem16x16_v6.asm
media/libvpx/libvpx/vp8/common/arm/armv6/copymem8x4_v6.asm
media/libvpx/libvpx/vp8/common/arm/armv6/copymem8x8_v6.asm
media/libvpx/libvpx/vp8/common/arm/armv6/dc_only_idct_add_v6.asm
media/libvpx/libvpx/vp8/common/arm/armv6/dequant_idct_v6.asm
media/libvpx/libvpx/vp8/common/arm/armv6/dequantize_v6.asm
media/libvpx/libvpx/vp8/common/arm/armv6/filter_v6.asm
media/libvpx/libvpx/vp8/common/arm/armv6/idct_blk_v6.c
media/libvpx/libvpx/vp8/common/arm/armv6/idct_v6.asm
media/libvpx/libvpx/vp8/common/arm/armv6/iwalsh_v6.asm
media/libvpx/libvpx/vp8/common/arm/armv6/loopfilter_v6.asm
media/libvpx/libvpx/vp8/common/arm/armv6/simpleloopfilter_v6.asm
media/libvpx/libvpx/vp8/common/arm/armv6/sixtappredict8x4_v6.asm
media/libvpx/libvpx/vp8/common/arm/bilinearfilter_arm.c
media/libvpx/libvpx/vp8/common/arm/bilinearfilter_arm.h
media/libvpx/libvpx/vp8/common/arm/dequantize_arm.c
media/libvpx/libvpx/vp8/common/arm/filter_arm.c
media/libvpx/libvpx/vp8/common/mips/msa/postproc_msa.c
media/libvpx/libvpx/vp8/common/textblit.c
media/libvpx/libvpx/vp8/common/x86/iwalsh_mmx.asm
media/libvpx/libvpx/vp8/common/x86/postproc_mmx.asm
media/libvpx/libvpx/vp8/common/x86/postproc_sse2.asm
media/libvpx/libvpx/vp8/common/x86/vp8_loopfilter_mmx.asm
media/libvpx/libvpx/vp8/encoder/arm/armv6/vp8_short_fdct4x4_armv6.asm
media/libvpx/libvpx/vp8/encoder/arm/armv6/walsh_v6.asm
media/libvpx/libvpx/vp8/encoder/arm/dct_arm.c
media/libvpx/libvpx/vp8/encoder/x86/dct_mmx.asm
media/libvpx/libvpx/vp8/vp8cx_arm.mk
media/libvpx/libvpx/vp9/common/vp9_textblit.c
media/libvpx/libvpx/vp9/common/vp9_textblit.h
media/libvpx/libvpx/vp9/common/x86/vp9_postproc_sse2.asm
media/libvpx/libvpx/vpx/internal/vpx_psnr.h
media/libvpx/libvpx/vpx/src/vpx_psnr.c
media/libvpx/libvpx/vpx_dsp/arm/bilinear_filter_media.asm
media/libvpx/libvpx/vpx_dsp/arm/idct32x32_1_add_neon.asm
media/libvpx/libvpx/vpx_dsp/arm/idct32x32_add_neon.asm
media/libvpx/libvpx/vpx_dsp/arm/loopfilter_16_neon.c
media/libvpx/libvpx/vpx_dsp/arm/loopfilter_4_neon.c
media/libvpx/libvpx/vpx_dsp/arm/loopfilter_8_neon.c
media/libvpx/libvpx/vpx_dsp/arm/loopfilter_mb_neon.asm
media/libvpx/libvpx/vpx_dsp/arm/sad_media.asm
media/libvpx/libvpx/vpx_dsp/arm/subpel_variance_media.c
media/libvpx/libvpx/vpx_dsp/arm/variance_halfpixvar16x16_h_media.asm
media/libvpx/libvpx/vpx_dsp/arm/variance_halfpixvar16x16_hv_media.asm
media/libvpx/libvpx/vpx_dsp/arm/variance_halfpixvar16x16_v_media.asm
media/libvpx/libvpx/vpx_dsp/arm/variance_media.asm
media/libvpx/libvpx/vpx_dsp/arm/vpx_convolve8_avg_neon.c
media/libvpx/libvpx/vpx_dsp/x86/halfpix_variance_impl_sse2.asm
media/libvpx/libvpx/vpx_dsp/x86/halfpix_variance_sse2.c
toolkit/content/gmp-sources/eme-adobe.json
xpcom/build/FrozenFunctions.cpp
--- a/b2g/app/nsBrowserApp.cpp
+++ b/b2g/app/nsBrowserApp.cpp
@@ -141,22 +141,22 @@ static int do_main(int argc, char* argv[
 
   if (appini) {
     nsXREAppData *appData;
     rv = XRE_CreateAppData(appini, &appData);
     if (NS_FAILED(rv)) {
       Output("Couldn't read application.ini");
       return 255;
     }
-    int result = XRE_main(argc, argv, appData, 0);
+    int result = XRE_main(argc, argv, appData);
     XRE_FreeAppData(appData);
     return result;
   }
 
-  return XRE_main(argc, argv, &sAppData, 0);
+  return XRE_main(argc, argv, &sAppData);
 }
 
 int main(int argc, char* argv[])
 {
   char exePath[MAXPATHLEN];
 
 #ifdef MOZ_WIDGET_GONK
   // This creates a ThreadPool for binder ipc. A ThreadPool is necessary to
@@ -187,19 +187,16 @@ int main(int argc, char* argv[])
   // process group controller (the normal situation).
   (void)setsid();
 #endif
 
 #ifdef HAS_DLL_BLOCKLIST
   DllBlocklist_Initialize();
 #endif
 
-  // We do this because of data in bug 771745
-  XPCOMGlueEnablePreload();
-
   rv = XPCOMGlueStartup(exePath);
   if (NS_FAILED(rv)) {
     Output("Couldn't load XPCOM.\n");
     return 255;
   }
   // Reset exePath so that it is the directory name and not the xpcom dll name
   *lastSlash = 0;
 
--- a/browser/app/nsBrowserApp.cpp
+++ b/browser/app/nsBrowserApp.cpp
@@ -156,89 +156,41 @@ static bool IsArg(const char* arg, const
 #if defined(XP_WIN)
   if (*arg == '/')
     return !strcasecmp(++arg, s);
 #endif
 
   return false;
 }
 
-XRE_GetFileFromPathType XRE_GetFileFromPath;
-XRE_ParseAppDataType XRE_ParseAppData;
-XRE_TelemetryAccumulateType XRE_TelemetryAccumulate;
-XRE_StartupTimelineRecordType XRE_StartupTimelineRecord;
-XRE_mainType XRE_main;
-XRE_StopLateWriteChecksType XRE_StopLateWriteChecks;
-XRE_XPCShellMainType XRE_XPCShellMain;
-XRE_GetProcessTypeType XRE_GetProcessType;
-XRE_SetProcessTypeType XRE_SetProcessType;
-XRE_InitChildProcessType XRE_InitChildProcess;
-XRE_EnableSameExecutableForContentProcType XRE_EnableSameExecutableForContentProc;
-#ifdef LIBFUZZER
-XRE_LibFuzzerSetMainType XRE_LibFuzzerSetMain;
-XRE_LibFuzzerGetFuncsType XRE_LibFuzzerGetFuncs;
-#endif
-
-static const nsDynamicFunctionLoad kXULFuncs[] = {
-    { "XRE_GetFileFromPath", (NSFuncPtr*) &XRE_GetFileFromPath },
-    { "XRE_ParseAppData", (NSFuncPtr*) &XRE_ParseAppData },
-    { "XRE_TelemetryAccumulate", (NSFuncPtr*) &XRE_TelemetryAccumulate },
-    { "XRE_StartupTimelineRecord", (NSFuncPtr*) &XRE_StartupTimelineRecord },
-    { "XRE_main", (NSFuncPtr*) &XRE_main },
-    { "XRE_StopLateWriteChecks", (NSFuncPtr*) &XRE_StopLateWriteChecks },
-    { "XRE_XPCShellMain", (NSFuncPtr*) &XRE_XPCShellMain },
-    { "XRE_GetProcessType", (NSFuncPtr*) &XRE_GetProcessType },
-    { "XRE_SetProcessType", (NSFuncPtr*) &XRE_SetProcessType },
-    { "XRE_InitChildProcess", (NSFuncPtr*) &XRE_InitChildProcess },
-    { "XRE_EnableSameExecutableForContentProc", (NSFuncPtr*) &XRE_EnableSameExecutableForContentProc },
-#ifdef LIBFUZZER
-    { "XRE_LibFuzzerSetMain", (NSFuncPtr*) &XRE_LibFuzzerSetMain },
-    { "XRE_LibFuzzerGetFuncs", (NSFuncPtr*) &XRE_LibFuzzerGetFuncs },
-#endif
-    { nullptr, nullptr }
-};
+Bootstrap::UniquePtr gBootstrap;
 
 #ifdef LIBFUZZER
 int libfuzzer_main(int argc, char **argv);
 
 /* This wrapper is used by the libFuzzer main to call into libxul */
 
 void libFuzzerGetFuncs(const char* moduleName, LibFuzzerInitFunc* initFunc,
                        LibFuzzerTestingFunc* testingFunc) {
-  return XRE_LibFuzzerGetFuncs(moduleName, initFunc, testingFunc);
+  return gBootstrap->XRE_LibFuzzerGetFuncs(moduleName, initFunc, testingFunc);
 }
 #endif
 
-static int do_main(int argc, char* argv[], char* envp[], nsIFile *xreDirectory)
+static int do_main(int argc, char* argv[], char* envp[])
 {
-  nsCOMPtr<nsIFile> appini;
-  nsresult rv;
-  uint32_t mainFlags = 0;
-
   // Allow firefox.exe to launch XULRunner apps via -app <application.ini>
   // Note that -app must be the *first* argument.
   const char *appDataFile = getenv("XUL_APP_FILE");
-  if (appDataFile && *appDataFile) {
-    rv = XRE_GetFileFromPath(appDataFile, getter_AddRefs(appini));
-    if (NS_FAILED(rv)) {
-      Output("Invalid path found: '%s'", appDataFile);
-      return 255;
-    }
-  }
-  else if (argc > 1 && IsArg(argv[1], "app")) {
+  if ((!appDataFile || !*appDataFile) &&
+      (argc > 1 && IsArg(argv[1], "app"))) {
     if (argc == 2) {
       Output("Incorrect number of arguments passed to -app");
       return 255;
     }
-
-    rv = XRE_GetFileFromPath(argv[2], getter_AddRefs(appini));
-    if (NS_FAILED(rv)) {
-      Output("application.ini path not recognized: '%s'", argv[2]);
-      return 255;
-    }
+    appDataFile = argv[2];
 
     char appEnv[MAXPATHLEN];
     SprintfLiteral(appEnv, "XUL_APP_FILE=%s", argv[2]);
     if (putenv(strdup(appEnv))) {
       Output("Couldn't set %s.\n", appEnv);
       return 255;
     }
     argv[2] = argv[0];
@@ -250,95 +202,65 @@ static int do_main(int argc, char* argv[
     }
 
     XREShellData shellData;
 #if defined(XP_WIN) && defined(MOZ_SANDBOX)
     shellData.sandboxBrokerServices =
       sandboxing::GetInitializedBrokerServices();
 #endif
 
-    return XRE_XPCShellMain(--argc, argv, envp, &shellData);
+    return gBootstrap->XRE_XPCShellMain(--argc, argv, envp, &shellData);
   }
 
-  XREAppData appData;
-  appData.xreDirectory = xreDirectory;
+  BootstrapConfig config;
 
-  if (appini) {
-    rv = XRE_ParseAppData(appini, appData);
-    if (NS_FAILED(rv)) {
-      Output("Couldn't read application.ini");
-      return 255;
-    }
-
-    appini->GetParent(getter_AddRefs(appData.directory));
+  if (appDataFile && *appDataFile) {
+    config.appData = nullptr;
+    config.appDataPath = appDataFile;
   } else {
     // no -app flag so we use the compiled-in app data
-    appData = sAppData;
-
-    nsCOMPtr<nsIFile> exeFile;
-    rv = mozilla::BinaryPath::GetFile(argv[0], getter_AddRefs(exeFile));
-    if (NS_FAILED(rv)) {
-      Output("Couldn't find the application directory.\n");
-      return 255;
-    }
-
-    nsCOMPtr<nsIFile> greDir;
-    exeFile->GetParent(getter_AddRefs(greDir));
-#ifdef XP_MACOSX
-    greDir->SetNativeLeafName(NS_LITERAL_CSTRING(kOSXResourcesFolder));
-#endif
-    nsCOMPtr<nsIFile> appSubdir;
-    greDir->Clone(getter_AddRefs(appSubdir));
-    appSubdir->Append(NS_LITERAL_STRING(kDesktopFolder));
-    appData.directory = appSubdir;
+    config.appData = &sAppData;
+    config.appDataPath = kDesktopFolder;
   }
 
-#if defined(HAS_DLL_BLOCKLIST)
-  // The dll blocklist operates in the exe vs. xullib. Pass a flag to
-  // xullib so automated tests can check the result once the browser
-  // is up and running.
-  appData.flags |=
-    DllBlocklist_CheckStatus() ? NS_XRE_DLL_BLOCKLIST_ENABLED : 0;
-#endif
-
 #if defined(XP_WIN) && defined(MOZ_SANDBOX)
   sandbox::BrokerServices* brokerServices =
     sandboxing::GetInitializedBrokerServices();
 #if defined(MOZ_CONTENT_SANDBOX)
   if (!brokerServices) {
     Output("Couldn't initialize the broker services.\n");
     return 255;
   }
 #endif
-  appData.sandboxBrokerServices = brokerServices;
+  config.sandboxBrokerServices = brokerServices;
 #endif
 
 #ifdef LIBFUZZER
   if (getenv("LIBFUZZER"))
-    XRE_LibFuzzerSetMain(argc, argv, libfuzzer_main);
+    gBootstrap->XRE_LibFuzzerSetMain(argc, argv, libfuzzer_main);
 #endif
 
-  return XRE_main(argc, argv, appData, mainFlags);
+  return gBootstrap->XRE_main(argc, argv, config);
 }
 
 static bool
 FileExists(const char *path)
 {
 #ifdef XP_WIN
   wchar_t wideDir[MAX_PATH];
   MultiByteToWideChar(CP_UTF8, 0, path, -1, wideDir, MAX_PATH);
   DWORD fileAttrs = GetFileAttributesW(wideDir);
   return fileAttrs != INVALID_FILE_ATTRIBUTES;
 #else
   return access(path, R_OK) == 0;
 #endif
 }
 
 static nsresult
-InitXPCOMGlue(const char *argv0, nsIFile **xreDirectory)
+InitXPCOMGlue(const char *argv0)
 {
   char exePath[MAXPATHLEN];
 
   nsresult rv = mozilla::BinaryPath::Get(argv0, exePath);
   if (NS_FAILED(rv)) {
     Output("Couldn't find the application directory.\n");
     return rv;
   }
@@ -350,51 +272,26 @@ InitXPCOMGlue(const char *argv0, nsIFile
 
   strcpy(lastSlash + 1, XPCOM_DLL);
 
   if (!FileExists(exePath)) {
     Output("Could not find the Mozilla runtime.\n");
     return NS_ERROR_FAILURE;
   }
 
-  // We do this because of data in bug 771745
-  XPCOMGlueEnablePreload();
-
-  rv = XPCOMGlueStartup(exePath);
-  if (NS_FAILED(rv)) {
+  gBootstrap = mozilla::GetBootstrap(exePath);
+  if (!gBootstrap) {
     Output("Couldn't load XPCOM.\n");
-    return rv;
-  }
-
-  rv = XPCOMGlueLoadXULFunctions(kXULFuncs);
-  if (NS_FAILED(rv)) {
-    Output("Couldn't load XRE functions.\n");
-    return rv;
+    return NS_ERROR_FAILURE;
   }
 
   // This will set this thread as the main thread.
-  NS_LogInit();
+  gBootstrap->NS_LogInit();
 
-  if (xreDirectory) {
-    // chop XPCOM_DLL off exePath
-    *lastSlash = '\0';
-#ifdef XP_MACOSX
-    lastSlash = strrchr(exePath, XPCOM_FILE_PATH_SEPARATOR[0]);
-    strcpy(lastSlash + 1, kOSXResourcesFolder);
-#endif
-#ifdef XP_WIN
-    rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(exePath), false,
-                         xreDirectory);
-#else
-    rv = NS_NewNativeLocalFile(nsDependentCString(exePath), false,
-                               xreDirectory);
-#endif
-  }
-
-  return rv;
+  return NS_OK;
 }
 
 int main(int argc, char* argv[], char* envp[])
 {
   mozilla::TimeStamp start = mozilla::TimeStamp::Now();
 
 #ifdef HAS_DLL_BLOCKLIST
   DllBlocklist_Initialize();
@@ -416,52 +313,51 @@ int main(int argc, char* argv[], char* e
     // We need to initialize the sandbox TargetServices before InitXPCOMGlue
     // because we might need the sandbox broker to give access to some files.
     if (IsSandboxedProcess() && !sandboxing::GetInitializedTargetServices()) {
       Output("Failed to initialize the sandbox target services.");
       return 255;
     }
 #endif
 
-    nsresult rv = InitXPCOMGlue(argv[0], nullptr);
+    nsresult rv = InitXPCOMGlue(argv[0]);
     if (NS_FAILED(rv)) {
       return 255;
     }
 
-    int result = content_process_main(argc, argv);
+    int result = content_process_main(gBootstrap.get(), argc, argv);
 
     // InitXPCOMGlue calls NS_LogInit, so we need to balance it here.
-    NS_LogTerm();
+    gBootstrap->NS_LogTerm();
 
     return result;
   }
 #endif
 
 
-  nsCOMPtr<nsIFile> xreDirectory;
-
-  nsresult rv = InitXPCOMGlue(argv[0], getter_AddRefs(xreDirectory));
+  nsresult rv = InitXPCOMGlue(argv[0]);
   if (NS_FAILED(rv)) {
     return 255;
   }
 
-  XRE_StartupTimelineRecord(mozilla::StartupTimeline::START, start);
+  gBootstrap->XRE_StartupTimelineRecord(mozilla::StartupTimeline::START, start);
 
 #ifdef MOZ_BROWSER_CAN_BE_CONTENTPROC
-  XRE_EnableSameExecutableForContentProc();
+  gBootstrap->XRE_EnableSameExecutableForContentProc();
 #endif
 
-  int result = do_main(argc, argv, envp, xreDirectory);
+  int result = do_main(argc, argv, envp);
 
-  xreDirectory = nullptr;
-  NS_LogTerm();
+  gBootstrap->NS_LogTerm();
 
 #ifdef XP_MACOSX
   // Allow writes again. While we would like to catch writes from static
   // destructors to allow early exits to use _exit, we know that there is
   // at least one such write that we don't control (see bug 826029). For
   // now we enable writes again and early exits will have to use exit instead
   // of _exit.
-  XRE_StopLateWriteChecks();
+  gBootstrap->XRE_StopLateWriteChecks();
 #endif
 
+  gBootstrap.reset();
+
   return result;
 }
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -171,17 +171,17 @@ pref("extensions.dss.switchPending", fal
 
 pref("extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.name", "chrome://browser/locale/browser.properties");
 pref("extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.description", "chrome://browser/locale/browser.properties");
 
 pref("lightweightThemes.update.enabled", true);
 pref("lightweightThemes.getMoreURL", "https://addons.mozilla.org/%LOCALE%/firefox/themes");
 pref("lightweightThemes.recommendedThemes", "[{\"id\":\"recommended-1\",\"homepageURL\":\"https://addons.mozilla.org/firefox/addon/a-web-browser-renaissance/\",\"headerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/1.header.jpg\",\"footerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/1.footer.jpg\",\"textcolor\":\"#000000\",\"accentcolor\":\"#f2d9b1\",\"iconURL\":\"resource:///chrome/browser/content/browser/defaultthemes/1.icon.jpg\",\"previewURL\":\"resource:///chrome/browser/content/browser/defaultthemes/1.preview.jpg\",\"author\":\"Sean.Martell\",\"version\":\"0\"},{\"id\":\"recommended-2\",\"homepageURL\":\"https://addons.mozilla.org/firefox/addon/space-fantasy/\",\"headerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/2.header.jpg\",\"footerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/2.footer.jpg\",\"textcolor\":\"#ffffff\",\"accentcolor\":\"#d9d9d9\",\"iconURL\":\"resource:///chrome/browser/content/browser/defaultthemes/2.icon.jpg\",\"previewURL\":\"resource:///chrome/browser/content/browser/defaultthemes/2.preview.jpg\",\"author\":\"fx5800p\",\"version\":\"1.0\"},{\"id\":\"recommended-3\",\"homepageURL\":\"https://addons.mozilla.org/firefox/addon/linen-light/\",\"headerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/3.header.png\",\"footerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/3.footer.png\",\"accentcolor\":\"#ada8a8\",\"iconURL\":\"resource:///chrome/browser/content/browser/defaultthemes/3.icon.png\",\"previewURL\":\"resource:///chrome/browser/content/browser/defaultthemes/3.preview.png\",\"author\":\"DVemer\",\"version\":\"1.0\"},{\"id\":\"recommended-4\",\"homepageURL\":\"https://addons.mozilla.org/firefox/addon/pastel-gradient/\",\"headerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/4.header.png\",\"footerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/4.footer.png\",\"textcolor\":\"#000000\",\"accentcolor\":\"#000000\",\"iconURL\":\"resource:///chrome/browser/content/browser/defaultthemes/4.icon.png\",\"previewURL\":\"resource:///chrome/browser/content/browser/defaultthemes/4.preview.png\",\"author\":\"darrinhenein\",\"version\":\"1.0\"},{\"id\":\"recommended-5\",\"homepageURL\":\"https://addons.mozilla.org/firefox/addon/carbon-light/\",\"headerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/5.header.png\",\"footerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/5.footer.png\",\"textcolor\":\"#3b3b3b\",\"accentcolor\":\"#2e2e2e\",\"iconURL\":\"resource:///chrome/browser/content/browser/defaultthemes/5.icon.jpg\",\"previewURL\":\"resource:///chrome/browser/content/browser/defaultthemes/5.preview.jpg\",\"author\":\"Jaxivo\",\"version\":\"1.0\"}]");
 
-#if defined(MOZ_ADOBE_EME) || defined(MOZ_WIDEVINE_EME)
+#if defined(MOZ_WIDEVINE_EME)
 pref("browser.eme.ui.enabled", true);
 #else
 pref("browser.eme.ui.enabled", false);
 #endif
 
 // UI tour experience.
 pref("browser.uitour.enabled", true);
 pref("browser.uitour.loglevel", "Error");
@@ -1351,47 +1351,28 @@ pref("ui.key.menuAccessKeyFocuses", true
 // enable DRM, whereupon the EME plugin binaries will be downloaded if
 // permission is granted.
 pref("media.eme.enabled", false);
 #else
 pref("media.eme.enabled", true);
 #endif
 pref("media.eme.apiVisible", true);
 
-// Decode using Gecko Media Plugins in <video>, if a system decoder is not
-// availble and the preferred GMP is available.
-pref("media.gmp.decoder.enabled", false);
-
-// If decoding-via-GMP is turned on for <video>, use Adobe's GMP for decoding,
-// if it's available. Note: We won't fallback to another GMP if Adobe's is not
-// installed.
-pref("media.gmp.decoder.aac", 2);
-pref("media.gmp.decoder.h264", 2);
-
 // Whether we should run a test-pattern through EME GMPs before assuming they'll
 // decode H.264.
 pref("media.gmp.trial-create.enabled", true);
 
 // Note: when media.gmp-*.visible is true, provided we're running on a
 // supported platform/OS version, the corresponding CDM appears in the
 // plugins list, Firefox will download the GMP/CDM if enabled, and our
 // UI to re-enable EME prompts the user to re-enable EME if it's disabled
 // and script requests EME. If *.visible is false, we won't show the UI
 // to enable the CDM if its disabled; it's as if the keysystem is completely
 // unsupported.
 
-#ifdef MOZ_ADOBE_EME
-pref("media.gmp-eme-adobe.visible", true);
-// When Adobe EME is enabled in the build system, we don't actually enable
-// the plugin by default, so that it doesn't download and install by default.
-// When Adobe EME is first used, Firefox will prompt the user to enable it,
-// and then download the CDM.
-pref("media.gmp-eme-adobe.enabled", false);
-#endif
-
 #ifdef MOZ_WIDEVINE_EME
 pref("media.gmp-widevinecdm.visible", true);
 pref("media.gmp-widevinecdm.enabled", true);
 #endif
 
 // Play with different values of the decay time and get telemetry,
 // 0 means to randomize (and persist) the experiment value in users' profiles,
 // -1 means no experiment is run and we use the preferred value for frecency (6h)
--- a/browser/base/content/browser-fxaccounts.js
+++ b/browser/base/content/browser-fxaccounts.js
@@ -78,16 +78,38 @@ var gFxAccounts = {
     // away by themselves, so aren't reflected here.
     return Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED;
   },
 
   get sendTabToDeviceEnabled() {
     return Services.prefs.getBoolPref("services.sync.sendTabToDevice.enabled");
   },
 
+  isSendableURI(aURISpec) {
+    if (!aURISpec) {
+      return false;
+    }
+    // Disallow sending tabs with more than 65535 characters.
+    if (aURISpec.length > 65535) {
+      return false;
+    }
+    try {
+      // Filter out un-sendable URIs -- things like local files, object urls, etc.
+      const unsendableRegexp = new RegExp(
+        Services.prefs.getCharPref("services.sync.engine.tabs.filteredUrls"), "i");
+      return !unsendableRegexp.test(aURISpec);
+    } catch (e) {
+      // The preference has been removed, or is an invalid regexp, so we log an
+      // error and treat it as a valid URI -- and the more problematic case is
+      // the length, which we've already addressed.
+      Cu.reportError(`Failed to build url filter regexp for send tab: ${e}`);
+      return true;
+    }
+  },
+
   get remoteClients() {
     return Weave.Service.clientsEngine.remoteClients
            .sort((a, b) => a.name.localeCompare(b.name));
   },
 
   init() {
     // Bail out if we're already initialized and for pop-up windows.
     if (this._initialized || !window.toolbar.visible) {
@@ -405,40 +427,49 @@ var gFxAccounts = {
       fragment.appendChild(separator);
       const allDevicesLabel = this.strings.GetStringFromName("sendTabToAllDevices.menuitem");
       addTargetDevice("", allDevicesLabel);
     }
 
     devicesPopup.appendChild(fragment);
   },
 
-  updateTabContextMenu(aPopupMenu) {
+  updateTabContextMenu(aPopupMenu, aTargetTab) {
     if (!this.sendTabToDeviceEnabled) {
       return;
     }
 
-    const remoteClientPresent = this.remoteClients.length > 0;
+    const targetURI = aTargetTab.linkedBrowser.currentURI.spec;
+    const showSendTab = this.remoteClients.length > 0 && this.isSendableURI(targetURI);
+
     ["context_sendTabToDevice", "context_sendTabToDevice_separator"]
-    .forEach(id => { document.getElementById(id).hidden = !remoteClientPresent });
+    .forEach(id => { document.getElementById(id).hidden = !showSendTab });
   },
 
   initPageContextMenu(contextMenu) {
     if (!this.sendTabToDeviceEnabled) {
       return;
     }
 
     const remoteClientPresent = this.remoteClients.length > 0;
     // showSendLink and showSendPage are mutually exclusive
-    const showSendLink = remoteClientPresent
-                         && (contextMenu.onSaveableLink || contextMenu.onPlainTextLink);
+    let showSendLink = remoteClientPresent
+                       && (contextMenu.onSaveableLink || contextMenu.onPlainTextLink);
     const showSendPage = !showSendLink && remoteClientPresent
                          && !(contextMenu.isContentSelected ||
                               contextMenu.onImage || contextMenu.onCanvas ||
                               contextMenu.onVideo || contextMenu.onAudio ||
-                              contextMenu.onLink || contextMenu.onTextInput);
+                              contextMenu.onLink || contextMenu.onTextInput)
+                         && this.isSendableURI(contextMenu.browser.currentURI.spec);
+
+    if (showSendLink) {
+      // This isn't part of the condition above since we don't want to try and
+      // send the page if a link is clicked on or selected but is not sendable.
+      showSendLink = this.isSendableURI(contextMenu.linkURL);
+    }
 
     ["context-sendpagetodevice", "context-sep-sendpagetodevice"]
     .forEach(id => contextMenu.showItem(id, showSendPage));
     ["context-sendlinktodevice", "context-sep-sendlinktodevice"]
     .forEach(id => contextMenu.showItem(id, showSendLink));
   }
 };
 
--- a/browser/base/content/browser-media.js
+++ b/browser/base/content/browser-media.js
@@ -11,37 +11,28 @@ var gEMEHandler = {
     // Force-disable on WinXP:
     if (navigator.platform.toLowerCase().startsWith("win")) {
       emeUIEnabled = emeUIEnabled && parseFloat(Services.sysinfo.get("version")) >= 6;
     }
     return emeUIEnabled;
   },
   ensureEMEEnabled(browser, keySystem) {
     Services.prefs.setBoolPref("media.eme.enabled", true);
-    if (keySystem) {
-      if (keySystem.startsWith("com.adobe") &&
-          Services.prefs.getPrefType("media.gmp-eme-adobe.enabled") &&
-          !Services.prefs.getBoolPref("media.gmp-eme-adobe.enabled")) {
-        Services.prefs.setBoolPref("media.gmp-eme-adobe.enabled", true);
-      } else if (keySystem == "com.widevine.alpha" &&
-                 Services.prefs.getPrefType("media.gmp-widevinecdm.enabled") &&
-                 !Services.prefs.getBoolPref("media.gmp-widevinecdm.enabled")) {
-        Services.prefs.setBoolPref("media.gmp-widevinecdm.enabled", true);
-      }
+    if (keySystem &&
+        keySystem == "com.widevine.alpha" &&
+        Services.prefs.getPrefType("media.gmp-widevinecdm.enabled") &&
+        !Services.prefs.getBoolPref("media.gmp-widevinecdm.enabled")) {
+      Services.prefs.setBoolPref("media.gmp-widevinecdm.enabled", true);
     }
     browser.reload();
   },
   isKeySystemVisible(keySystem) {
     if (!keySystem) {
       return false;
     }
-    if (keySystem.startsWith("com.adobe") &&
-        Services.prefs.getPrefType("media.gmp-eme-adobe.visible")) {
-      return Services.prefs.getBoolPref("media.gmp-eme-adobe.visible");
-    }
     if (keySystem == "com.widevine.alpha" &&
         Services.prefs.getPrefType("media.gmp-widevinecdm.visible")) {
       return Services.prefs.getBoolPref("media.gmp-widevinecdm.visible");
     }
     return true;
   },
   getLearnMoreLink(msgId) {
     let text = gNavigatorBundle.getString("emeNotifications." + msgId + ".learnMoreLabel");
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -7867,17 +7867,17 @@ var TabContextMenu = {
     }
 
     this.contextTab.toggleMuteMenuItem = toggleMute;
     this._updateToggleMuteMenuItem(this.contextTab);
 
     this.contextTab.addEventListener("TabAttrModified", this);
     aPopupMenu.addEventListener("popuphiding", this);
 
-    gFxAccounts.updateTabContextMenu(aPopupMenu);
+    gFxAccounts.updateTabContextMenu(aPopupMenu, this.contextTab);
   },
   handleEvent(aEvent) {
     switch (aEvent.type) {
       case "popuphiding":
         gBrowser.removeEventListener("TabAttrModified", this);
         aEvent.target.removeEventListener("popuphiding", this);
         break;
       case "TabAttrModified":
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -172,16 +172,17 @@
 
     <!-- for select dropdowns. The menupopup is what shows the list of options,
          and the popuponly menulist makes things like the menuactive attributes
          work correctly on the menupopup. ContentSelectDropdown expects the
          popuponly menulist to be its immediate parent. -->
     <menulist popuponly="true" id="ContentSelectDropdown" hidden="true">
       <menupopup rolluponmousewheel="true"
                  activateontab="true" position="after_start"
+                 level="parent"
 #ifdef XP_WIN
                  consumeoutsideclicks="false" ignorekeys="shortcuts"
 #endif
         />
     </menulist>
 
     <!-- for invalid form error message -->
     <panel id="invalid-form-popup" type="arrow" orient="vertical" noautofocus="true" hidden="true" level="parent">
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -575,16 +575,25 @@
               if ((aRequest instanceof Ci.nsIChannel) &&
                   aRequest.originalURI.schemeIs("about") &&
                   (aRequest.URI.schemeIs("jar") || aRequest.URI.schemeIs("file")))
                 return false;
 
               return true;
             },
 
+            _isForInitialAboutBlank(aWebProgress, aLocation) {
+              if (!this.mBlank || !aWebProgress.isTopLevel) {
+                return false;
+              }
+
+              let location = aLocation ? aLocation.spec : "";
+              return location == "about:blank";
+            },
+
             onProgressChange(aWebProgress, aRequest,
                              aCurSelfProgress, aMaxSelfProgress,
                              aCurTotalProgress, aMaxTotalProgress) {
               this.mTotalProgress = aMaxTotalProgress ? aCurTotalProgress / aMaxTotalProgress : 0;
 
               if (!this._shouldShowProgress(aRequest))
                 return;
 
@@ -604,27 +613,37 @@
                 aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress,
                 aMaxTotalProgress);
             },
 
             onStateChange(aWebProgress, aRequest, aStateFlags, aStatus) {
               if (!aRequest)
                 return;
 
-              var oldBlank = this.mBlank;
-
               const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
               const nsIChannel = Components.interfaces.nsIChannel;
               let location, originalLocation;
               try {
                 aRequest.QueryInterface(nsIChannel)
                 location = aRequest.URI;
                 originalLocation = aRequest.originalURI;
               } catch (ex) {}
 
+              let ignoreBlank = this._isForInitialAboutBlank(aWebProgress, location);
+              // If we were ignoring some messages about the initial about:blank, and we
+              // got the STATE_STOP for it, we'll want to pay attention to those messages
+              // from here forward. Similarly, if we conclude that this state change
+              // is one that we shouldn't be ignoring, then stop ignoring.
+              if ((ignoreBlank &&
+                   aStateFlags & nsIWebProgressListener.STATE_STOP &&
+                   aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) ||
+                  !ignoreBlank && this.mBlank) {
+                this.mBlank = false;
+              }
+
               if (aStateFlags & nsIWebProgressListener.STATE_START) {
                 this.mRequestCount++;
               } else if (aStateFlags & nsIWebProgressListener.STATE_STOP) {
                 const NS_ERROR_UNKNOWN_HOST = 2152398878;
                 if (--this.mRequestCount > 0 && aStatus == NS_ERROR_UNKNOWN_HOST) {
                   // to prevent bug 235825: wait for the request handled
                   // by the automatic keyword resolver
                   return;
@@ -701,31 +720,28 @@
                   } else if (isSuccessful) {
                     this.mBrowser.urlbarChangeTracker.finishedLoad();
                   }
 
                   if (!this.mBrowser.mIconURL)
                     this.mTabBrowser.useDefaultIcon(this.mTab);
                 }
 
-                if (this.mBlank)
-                  this.mBlank = false;
-
                 // For keyword URIs clear the user typed value since they will be changed into real URIs
                 if (location.scheme == "keyword")
                   this.mBrowser.userTypedValue = null;
 
                 if (this.mTab.label == this.mTabBrowser.mStringBundle.getString("tabs.connecting"))
                   this.mTabBrowser.setTabTitle(this.mTab);
 
                 if (this.mTab.selected)
                   this.mTabBrowser.mIsBusy = false;
               }
 
-              if (oldBlank) {
+              if (ignoreBlank) {
                 this._callProgressListeners("onUpdateCurrentBrowser",
                                             [aStateFlags, aStatus, "", 0],
                                             true, false);
               } else {
                 this._callProgressListeners("onStateChange",
                                             [aWebProgress, aRequest, aStateFlags, aStatus],
                                             true, false);
               }
@@ -1767,17 +1783,17 @@
             // As frameLoaders start out with an active docShell we have to
             // deactivate it if this is not the selected tab's browser or the
             // browser window is minimized.
             aBrowser.docShellIsActive = this.shouldActivateDocShell(aBrowser);
 
             // Create a new tab progress listener for the new browser we just injected,
             // since tab progress listeners have logic for handling the initial about:blank
             // load
-            listener = this.mTabProgressListener(tab, aBrowser, false, false);
+            listener = this.mTabProgressListener(tab, aBrowser, true, false);
             this._tabListeners.set(tab, listener);
             filter.addProgressListener(listener, Ci.nsIWebProgress.NOTIFY_ALL);
 
             // Restore the progress listener.
             aBrowser.webProgress.addProgressListener(filter, Ci.nsIWebProgress.NOTIFY_ALL);
 
             // Restore the securityUI state.
             let securityUI = aBrowser.securityUI;
--- a/browser/base/content/test/general/browser_selectpopup.js
+++ b/browser/base/content/test/general/browser_selectpopup.js
@@ -36,16 +36,31 @@ const PAGECONTENT_SMALL =
   "</select><select id='two'>" +
   "  <option value='Three'>Three</option>" +
   "  <option value='Four'>Four</option>" +
   "</select><select id='three'>" +
   "  <option value='Five'>Five</option>" +
   "  <option value='Six'>Six</option>" +
   "</select></body></html>";
 
+const PAGECONTENT_GROUPS =
+  "<html>" +
+  "<body><select id='one'>" +
+  "  <optgroup label='Group 1'>" +
+  "    <option value='G1 O1'>G1 O1</option>" +
+  "    <option value='G1 O2'>G1 O2</option>" +
+  "    <option value='G1 O3'>G1 O3</option>" +
+  "  </optgroup>" +
+  "  <optgroup label='Group 2'>" +
+  "    <option value='G2 O1'>G2 O4</option>" +
+  "    <option value='G2 O2'>G2 O5</option>" +
+  "    <option value='Hidden' style='display: none;'>Hidden</option>" +
+  "  </optgroup>" +
+  "</select></body></html>";
+
 const PAGECONTENT_SOMEHIDDEN =
   "<html><head><style>.hidden { display: none; }</style></head>" +
   "<body><select id='one'>" +
   "  <option value='One' style='display: none;'>OneHidden</option>" +
   "  <option value='Two' class='hidden'>TwoHidden</option>" +
   "  <option value='Three'>ThreeVisible</option>" +
   "  <option value='Four'style='display: table;'>FourVisible</option>" +
   "  <option value='Five'>FiveVisible</option>" +
@@ -441,23 +456,29 @@ function* performLargePopupTests(win) {
     let rect = selectPopup.getBoundingClientRect();
     ok(rect.top >= browserRect.top, "Popup top position in within browser area");
     ok(rect.bottom <= browserRect.bottom, "Popup bottom position in within browser area");
 
     // Don't check the scroll position for the last step as the popup will be cut off.
     if (positions.length > 0) {
       let cs = win.getComputedStyle(selectPopup);
       let bpBottom = parseFloat(cs.paddingBottom) + parseFloat(cs.borderBottomWidth);
+      let selectedOption = 60;
 
+      if (Services.prefs.getBoolPref("dom.forms.selectSearch")) {
+        // Use option 61 instead of 60, as the 60th option element is actually the
+        // 61st child, since the first child is now the search input field.
+        selectedOption = 61;
+      }
       // Some of the styles applied to the menuitems are percentages, meaning
       // that the final layout calculations returned by getBoundingClientRect()
       // might return floating point values. We don't care about sub-pixel
       // accuracy, and only care about the final pixel value, so we add a
       // fuzz-factor of 1.
-      SimpleTest.isfuzzy(selectPopup.childNodes[60].getBoundingClientRect().bottom,
+      SimpleTest.isfuzzy(selectPopup.childNodes[selectedOption].getBoundingClientRect().bottom,
                          selectPopup.getBoundingClientRect().bottom - bpBottom,
                          1, "Popup scroll at correct position " + bpBottom);
     }
 
     yield hideSelectPopup(selectPopup, "enter", win);
 
     position = positions.shift();
     if (!position) {
@@ -469,16 +490,88 @@ function* performLargePopupTests(win) {
       let select = content.document.getElementById("one");
       select.setAttribute("style", contentPosition);
       select.getBoundingClientRect();
     });
     yield contentPainted;
   }
 }
 
+function* performSelectSearchTests(win) {
+  let browser = win.gBrowser.selectedBrowser;
+  yield ContentTask.spawn(browser, null, function*() {
+    let doc = content.document;
+    let select = doc.getElementById("one");
+
+    for (var i = 0; i < 40; i++) {
+      select.add(new content.Option("Test" + i));
+    }
+
+    select.options[1].selected = true;
+    select.focus();
+  });
+
+  let selectPopup = win.document.getElementById("ContentSelectDropdown").menupopup;
+  yield openSelectPopup(selectPopup, false, "select", win);
+
+  let searchElement = selectPopup.querySelector("textbox");
+  searchElement.focus();
+
+  EventUtils.synthesizeKey("O", {}, win);
+  is(selectPopup.childNodes[2].hidden, false, "First option should be visible");
+  is(selectPopup.childNodes[3].hidden, false, "Second option should be visible");
+
+  EventUtils.synthesizeKey("3", {}, win);
+  is(selectPopup.childNodes[2].hidden, true, "First option should be hidden");
+  is(selectPopup.childNodes[3].hidden, true, "Second option should be hidden");
+  is(selectPopup.childNodes[4].hidden, false, "Third option should be visible");
+
+  EventUtils.synthesizeKey("Z", {}, win);
+  is(selectPopup.childNodes[4].hidden, true, "Third option should be hidden");
+  is(selectPopup.childNodes[1].hidden, true, "First group header should be hidden");
+
+  EventUtils.synthesizeKey("VK_BACK_SPACE", {}, win);
+  is(selectPopup.childNodes[4].hidden, false, "Third option should be visible");
+
+  EventUtils.synthesizeKey("VK_BACK_SPACE", {}, win);
+  is(selectPopup.childNodes[5].hidden, false, "Second group header should be visible");
+
+  EventUtils.synthesizeKey("VK_BACK_SPACE", {}, win);
+  EventUtils.synthesizeKey("O", {}, win);
+  EventUtils.synthesizeKey("5", {}, win);
+  is(selectPopup.childNodes[5].hidden, false, "Second group header should be visible");
+  is(selectPopup.childNodes[1].hidden, true, "First group header should be hidden");
+
+  EventUtils.synthesizeKey("VK_BACK_SPACE", {}, win);
+  is(selectPopup.childNodes[1].hidden, false, "First group header should be shown");
+
+  EventUtils.synthesizeKey("VK_BACK_SPACE", {}, win);
+  is(selectPopup.childNodes[8].hidden, true, "Option hidden by content should remain hidden");
+
+  yield hideSelectPopup(selectPopup, "escape", win);
+}
+
+// This test checks the functionality of search in select elements with groups
+// and a large number of options.
+add_task(function* test_select_search() {
+  yield SpecialPowers.pushPrefEnv({
+    set: [
+      ["dom.forms.selectSearch", true],
+    ],
+  });
+  const pageUrl = "data:text/html," + escape(PAGECONTENT_GROUPS);
+  let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, pageUrl);
+
+  yield performSelectSearchTests(window);
+
+  yield BrowserTestUtils.removeTab(tab);
+
+  yield SpecialPowers.popPrefEnv();
+});
+
 // This test checks select elements with a large number of options to ensure that
 // the popup appears within the browser area.
 add_task(function* test_large_popup() {
   const pageUrl = "data:text/html," + escape(PAGECONTENT_SMALL);
   let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, pageUrl);
 
   yield* performLargePopupTests(window);
 
--- a/browser/base/content/test/general/browser_visibleTabs_contextMenu.js
+++ b/browser/base/content/test/general/browser_visibleTabs_contextMenu.js
@@ -13,27 +13,33 @@ add_task(function* test() {
 
   // Check the context menu with two tabs
   updateTabContextMenu(origTab);
   is(document.getElementById("context_closeTab").disabled, false, "Close Tab is enabled");
   is(document.getElementById("context_reloadAllTabs").disabled, false, "Reload All Tabs is enabled");
 
 
   if (gFxAccounts.sendTabToDeviceEnabled) {
+    const origIsSendableURI = gFxAccounts.isSendableURI;
+    gFxAccounts.isSendableURI = () => true;
     // Check the send tab to device menu item
     const oldGetter = setupRemoteClientsFixture(remoteClientsFixture);
     yield updateTabContextMenu(origTab, function* () {
       yield openMenuItemSubmenu("context_sendTabToDevice");
     });
     is(document.getElementById("context_sendTabToDevice").hidden, false, "Send tab to device is shown");
     let targets = document.getElementById("context_sendTabToDevicePopupMenu").childNodes;
     is(targets[0].getAttribute("label"), "Foo", "Foo target is present");
     is(targets[1].getAttribute("label"), "Bar", "Bar target is present");
     is(targets[3].getAttribute("label"), "All Devices", "All Devices target is present");
+    gFxAccounts.isSendableURI = () => false;
+    updateTabContextMenu(origTab);
+    is(document.getElementById("context_sendTabToDevice").hidden, true, "Send tab to device is hidden");
     restoreRemoteClients(oldGetter);
+    gFxAccounts.isSendableURI = origIsSendableURI;
   }
 
   // Hide the original tab.
   gBrowser.selectedTab = testTab;
   gBrowser.showOnlyTheseTabs([testTab]);
   is(gBrowser.visibleTabs.length, 1, "now there is only one visible tab");
 
   // Check the context menu with one tab.
--- a/devtools/client/netmonitor/netmonitor.xul
+++ b/devtools/client/netmonitor/netmonitor.xul
@@ -123,20 +123,18 @@
             <tabpanels flex="1">
               <tabpanel id="headers-tabpanel"
                         class="tabpanel-content">
                 <html:div xmlns="http://www.w3.org/1999/xhtml"
                           id="react-headers-tabpanel-hook"/>
               </tabpanel>
               <tabpanel id="cookies-tabpanel"
                         class="tabpanel-content">
-                <vbox flex="1">
-                  <html:div xmlns="http://www.w3.org/1999/xhtml"
-                      id="react-cookies-tabpanel-hook"/>
-                </vbox>
+                <html:div xmlns="http://www.w3.org/1999/xhtml"
+                    id="react-cookies-tabpanel-hook"/>
               </tabpanel>
               <tabpanel id="params-tabpanel"
                         class="tabpanel-content">
                 <html:div xmlns="http://www.w3.org/1999/xhtml"
                           id="react-params-tabpanel-hook"/>
               </tabpanel>
               <tabpanel id="response-tabpanel"
                         class="tabpanel-content">
--- a/devtools/client/netmonitor/shared/components/cookies-panel.js
+++ b/devtools/client/netmonitor/shared/components/cookies-panel.js
@@ -48,21 +48,23 @@ function CookiesPanel({
   if (response.length) {
     object[RESPONSE_COOKIES] = getProperties(response);
   }
   if (request.length) {
     object[REQUEST_COOKIES] = getProperties(request);
   }
 
   return (
-    PropertiesView({
-      object,
-      filterPlaceHolder: COOKIES_FILTER_TEXT,
-      sectionNames: SECTION_NAMES,
-    })
+    div({ className: "panel-container" },
+      PropertiesView({
+        object,
+        filterPlaceHolder: COOKIES_FILTER_TEXT,
+        sectionNames: SECTION_NAMES,
+      })
+    )
   );
 }
 
 CookiesPanel.displayName = "CookiesPanel";
 
 CookiesPanel.propTypes = {
   request: PropTypes.array.isRequired,
   response: PropTypes.array.isRequired,
--- a/devtools/client/netmonitor/shared/components/headers-panel.js
+++ b/devtools/client/netmonitor/shared/components/headers-panel.js
@@ -197,17 +197,17 @@ const HeadersPanel = createClass({
               }),
             ),
           )
         )
       );
     }
 
     return (
-      div({},
+      div({ className: "panel-container" },
         div({ className: "summary" },
           summaryUrl,
           summaryMethod,
           summaryAddress,
           summaryStatus,
           summaryVersion,
           summaryRawHeaders,
         ),
--- a/devtools/client/netmonitor/shared/components/params-panel.js
+++ b/devtools/client/netmonitor/shared/components/params-panel.js
@@ -87,21 +87,23 @@ function ParamsPanel({
         },
       };
     }
   } else {
     postData = "";
   }
 
   return (
-    PropertiesView({
-      object,
-      filterPlaceHolder: PARAMS_FILTER_TEXT,
-      sectionNames: SECTION_NAMES,
-    })
+    div({ className: "panel-container" },
+      PropertiesView({
+        object,
+        filterPlaceHolder: PARAMS_FILTER_TEXT,
+        sectionNames: SECTION_NAMES,
+      })
+    )
   );
 }
 
 ParamsPanel.displayName = "ParamsPanel";
 
 ParamsPanel.propTypes = {
   formDataSections: PropTypes.array,
   postData: PropTypes.string,
--- a/devtools/client/netmonitor/shared/components/properties-view.js
+++ b/devtools/client/netmonitor/shared/components/properties-view.js
@@ -78,17 +78,17 @@ const PropertiesView = createClass({
   },
 
   renderRowWithEditor(props) {
     const { level, name, value, path } = props.member;
 
     // Display source editor when specifying to EDITOR_CONFIG_ID along with config
     if (level === 1 && name === EDITOR_CONFIG_ID) {
       return (
-        tr({},
+        tr({ className: "editor-row-container" },
           td({ colSpan: 2 },
             Editor(value)
           )
         )
       );
     }
 
     // Skip for editor config
--- a/devtools/client/netmonitor/shared/components/response-panel.js
+++ b/devtools/client/netmonitor/shared/components/response-panel.js
@@ -116,17 +116,17 @@ const ResponsePanel = createClass({
     if (!mimeType || !url || typeof response !== "string") {
       return null;
     }
 
     if (mimeType.includes("image/")) {
       let { width, height } = this.state.imageDimensions;
 
       return (
-        div({ className: "response-image-box devtools-monospace" },
+        div({ className: "panel-container response-image-box devtools-monospace" },
           img({
             className: "response-image",
             src: formDataURI(mimeType, encoding, response),
             onLoad: this.updateImageDimemsions,
           }),
           div({ className: "response-summary" },
             div({ className: "tabpanel-summary-label" }, RESPONSE_IMG_NAME),
             div({ className: "tabpanel-summary-value" }, getUrlBaseName(url)),
@@ -162,17 +162,17 @@ const ResponsePanel = createClass({
         EDITOR_CONFIG: {
           text: response,
           mode: mimeType.replace(/;.+/, ""),
         },
       };
     }
 
     return (
-      div({},
+      div({ className: "panel-container" },
         error && div({ className: "response-error-header", title: error },
           error
         ),
         PropertiesView({
           object,
           filterPlaceHolder: JSON_FILTER_TEXT,
           sectionNames: [sectionName],
         }),
--- a/devtools/client/netmonitor/test/browser_net_post-data-01.js
+++ b/devtools/client/netmonitor/test/browser_net_post-data-01.js
@@ -5,16 +5,19 @@
 
 /**
  * Tests if the POST requests display the correct information in the UI.
  */
 
 add_task(function* () {
   let { L10N } = require("devtools/client/netmonitor/l10n");
 
+  // Set a higher panel height in order to get full CodeMirror content
+  Services.prefs.setIntPref("devtools.toolbox.footer.height", 400);
+
   let { tab, monitor } = yield initNetMonitor(POST_DATA_URL);
   info("Starting test... ");
 
   let { document, NetMonitorView } = monitor.panelWin;
   let { RequestsMenu } = NetMonitorView;
 
   RequestsMenu.lazyUpdate = false;
 
--- a/devtools/client/sourceeditor/test/css_autocompletion_tests.json
+++ b/devtools/client/sourceeditor/test/css_autocompletion_tests.json
@@ -20,17 +20,17 @@
                "-moz-appearance"]],
     [[12, 20], ["none", "number-input"]],
     [[12, 22], ["none"]],
     [[17, 22], ["hsl", "hsla"]],
     [[19, 10], ["background", "background-attachment", "background-blend-mode",
                 "background-clip", "background-color", "background-image",
                 "background-origin", "background-position", "background-position-x",
                 "background-position-y", "background-repeat", "background-size"]],
-    [[21,  9], ["-moz-calc", "auto", "calc", "inherit", "initial","unset"]],
+    [[21,  9], ["auto", "calc", "inherit", "initial","unset"]],
     [[25, 26], [".devtools-toolbarbutton > tab",
                 ".devtools-toolbarbutton > hbox",
                 ".devtools-toolbarbutton > .toolbarbutton-menubutton-button"]],
     [[25, 31], [".devtools-toolbarbutton > hbox.toolbarbutton-menubutton-button"]],
     [[29, 20], [".devtools-menulist:after", ".devtools-menulist:active"]],
     [[30, 10], ["#devtools-anotherone", "#devtools-itjustgoeson", "#devtools-menu",
                 "#devtools-okstopitnow", "#devtools-toolbarbutton", "#devtools-yetagain"]],
     [[39, 39], [".devtools-toolbarbutton:not([label]) > tab"]],
--- a/devtools/client/themes/netmonitor.css
+++ b/devtools/client/themes/netmonitor.css
@@ -1072,18 +1072,19 @@
 
 /* Responsive sidebar */
 @media (max-width: 700px) {
   :root[platform="linux"] .requests-menu-header-button {
     font-size: 85%;
   }
 }
 
-/* Overwrite tree-view cell colon and use l10n string instead */
-.treeTable .treeLabelCell::after {
+/* Overwrite tree-view cell colon `:` for security panel and tree section */
+#security-tabpanel .treeTable .treeLabelCell::after,
+.treeTable .tree-section .treeLabelCell::after {
   content: "";
 }
 
 /* Layout additional warning icon in tree value cell  */
 .security-info-value {
   display: flex;
 }
 
@@ -1095,28 +1096,27 @@
   width: 100%;
 }
 
 .treeTable .textbox-input:focus {
   outline: 0;
   box-shadow: var(--theme-focus-box-shadow-textbox);
 }
 
+.panel-container {
+  /* FIXME: To avoid the issue which panel exceeds visible range,
+   * we set view heigh - 24px * 2 for toolbox height + tabs height */
+  height: calc(100vh - 48px);
+}
+
+.panel-container,
 .properties-view {
-  /* FIXME: Minus 24px * 2 for toolbox height + panel height
-   * Give a fixed panel container height in order to force tree view scrollable */
-  height: calc(100vh - 48px);
   display: flex;
   flex-direction: column;
-}
-
-#headers-tabpanel .properties-view {
-  /* FIXME: Minus 24px * 2 + 87.5 for toolbox height + panel height + headers summary
-   * Give a fixed panel container height in order to force tree view scrollable */
-  height: calc(100vh - 135.5px);
+  flex-grow: 1;
 }
 
 .properties-view .searchbox-section {
   flex: 0 1 auto;
 }
 
 .properties-view .devtools-searchbox {
   padding: 0;
@@ -1137,16 +1137,46 @@
   display: block;
   overflow-y: auto;
   top: 0;
   right: 0;
   bottom: 0;
   left: 0;
 }
 
+/* Apply flex to table tbody in order to fill available vertical space */
+.tree-container .treeTable tbody {
+  display: flex;
+  flex-direction: column;
+  /* Apply flex to table will create an anonymous table element outside of tbody
+   * See also http://stackoverflow.com/a/30851678
+   * Therefore, we set height with this magic number in order to remove the
+   * redundant scrollbar when source editor appears.
+   */
+  height: calc(100% - 3px);
+}
+
+.tree-container .treeTable tr {
+  display: block;
+}
+
+/* Make right td fill available horizontal space */
+.tree-container .treeTable td:last-child {
+  width: 100%;
+}
+
+/* If there is a source editor shows up in the last row of TreeView,
+ * it should occupy the available vertical space.
+ */
+.tree-container .treeTable .editor-row-container,
+.tree-container .treeTable tr:last-child td[colspan="2"] {
+  display: block;
+  height: 100%;
+}
+
 .properties-view .devtools-searchbox,
 .tree-container .treeTable .tree-section {
   width: 100%;
   background-color: var(--theme-toolbar-background);
 }
 
 .properties-view .devtools-searchbox,
 .tree-container .treeTable tr:not(:last-child) td:not([class=""]) {
@@ -1273,33 +1303,25 @@
  * This workaround should be removed after netmonitor is migrated to react
  */
 #react-cookies-tabpanel-hook,
 #react-headers-tabpanel-hook,
 #react-params-tabpanel-hook,
 #react-preview-tabpanel-hook,
 #react-response-tabpanel-hook,
 #react-security-tabpanel-hook,
-#react-timings-tabpanel-hook,
+#react-timings-tabpanel-hook {
+  display: flex;
+  -moz-box-flex: 1;
+  -moz-box-orient: vertical;
+}
+
 #network-statistics-charts,
 #primed-cache-chart,
 #empty-cache-chart {
   display: -moz-box;
   -moz-box-flex: 1;
 }
 
-/* For vbox */
-#react-cookies-tabpanel-hook,
-#react-headers-tabpanel-hook,
-#react-params-tabpanel-hook,
-#react-preview-tabpanel-hook,
-#react-response-tabpanel-hook,
-#react-security-tabpanel-hook,
-#react-timings-tabpanel-hook,
-#primed-cache-chart,
-#empty-cache-chart {
-  -moz-box-orient: vertical;
-}
-
 #primed-cache-chart,
 #empty-cache-chart {
   -moz-box-pack: center;
 }
--- a/devtools/server/tests/mochitest/test_css-properties.html
+++ b/devtools/server/tests/mochitest/test_css-properties.html
@@ -77,17 +77,17 @@ window.onload = function() {
     ok(cssProperties.isKnown("--foob\\{ar"),
       "A CSS variable with escaped character properly evaluates.");
     ok(cssProperties.isKnown("--fübar"),
       "A CSS variable unicode properly evaluates.");
     ok(!cssProperties.isKnown("--foo bar"),
       "A CSS variable with spaces fails");
 
     is(toSortedString(cssProperties.getValues('margin')),
-       toSortedString(["-moz-calc","auto","calc","inherit","initial","unset"]),
+       toSortedString(["auto","calc","inherit","initial","unset"]),
        "Can get values for the CSS margin.");
     is(cssProperties.getValues('foobar').length, 0,
       "Unknown values return an empty array.");
 
     const bgColorValues = cssProperties.getValues('background-color');
     ok(bgColorValues.includes("blanchedalmond"),
       "A property with color values includes blanchedalmond.");
     ok(bgColorValues.includes("papayawhip"),
--- a/devtools/shared/css/generated/properties-db.js
+++ b/devtools/shared/css/generated/properties-db.js
@@ -370,17 +370,16 @@ exports.CSS_PROPERTIES = {
       "border-inline-end-color"
     ],
     "supports": [
       2,
       6
     ],
     "values": [
       "COLOR",
-      "-moz-calc",
       "calc",
       "currentColor",
       "dashed",
       "dotted",
       "double",
       "groove",
       "hidden",
       "hsl",
@@ -448,17 +447,16 @@ exports.CSS_PROPERTIES = {
     "isInherited": false,
     "subproperties": [
       "border-inline-end-width"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "medium",
       "thick",
       "thin",
       "unset"
     ]
@@ -534,17 +532,16 @@ exports.CSS_PROPERTIES = {
       "border-inline-start-color"
     ],
     "supports": [
       2,
       6
     ],
     "values": [
       "COLOR",
-      "-moz-calc",
       "calc",
       "currentColor",
       "dashed",
       "dotted",
       "double",
       "groove",
       "hidden",
       "hsl",
@@ -612,17 +609,16 @@ exports.CSS_PROPERTIES = {
     "isInherited": false,
     "subproperties": [
       "border-inline-start-width"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "medium",
       "thick",
       "thin",
       "unset"
     ]
@@ -779,17 +775,16 @@ exports.CSS_PROPERTIES = {
     "isInherited": false,
     "subproperties": [
       "column-gap"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "normal",
       "unset"
     ]
   },
   "-moz-column-rule": {
@@ -800,17 +795,16 @@ exports.CSS_PROPERTIES = {
       "column-rule-color"
     ],
     "supports": [
       2,
       6
     ],
     "values": [
       "COLOR",
-      "-moz-calc",
       "calc",
       "currentColor",
       "dashed",
       "dotted",
       "double",
       "groove",
       "hidden",
       "hsl",
@@ -878,17 +872,16 @@ exports.CSS_PROPERTIES = {
     "isInherited": false,
     "subproperties": [
       "column-rule-width"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "medium",
       "thick",
       "thin",
       "unset"
     ]
@@ -897,17 +890,16 @@ exports.CSS_PROPERTIES = {
     "isInherited": false,
     "subproperties": [
       "column-width"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "-moz-columns": {
@@ -916,17 +908,16 @@ exports.CSS_PROPERTIES = {
       "column-count",
       "column-width"
     ],
     "supports": [
       6,
       7
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "-moz-control-character-visibility": {
@@ -1028,17 +1019,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "margin-inline-end"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "-moz-margin-start": {
@@ -1046,17 +1036,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "margin-inline-start"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "-moz-orient": {
@@ -1158,34 +1147,32 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "padding-inline-end"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "-moz-padding-start": {
     "isInherited": false,
     "subproperties": [
       "padding-inline-start"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "-moz-perspective": {
     "isInherited": false,
@@ -1236,17 +1223,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "-moz-tab-size"
     ],
     "supports": [
       6,
       7
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "-moz-text-size-adjust": {
     "isInherited": true,
@@ -2047,17 +2033,16 @@ exports.CSS_PROPERTIES = {
     ],
     "supports": [
       6,
       7,
       8
     ],
     "values": [
       "-moz-available",
-      "-moz-calc",
       "-moz-fit-content",
       "-moz-max-content",
       "-moz-min-content",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
@@ -2069,17 +2054,16 @@ exports.CSS_PROPERTIES = {
       "flex-basis"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
       "-moz-available",
-      "-moz-calc",
       "-moz-fit-content",
       "-moz-max-content",
       "-moz-min-content",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
@@ -2494,17 +2478,16 @@ exports.CSS_PROPERTIES = {
       "-webkit-text-stroke-color"
     ],
     "supports": [
       2,
       6
     ],
     "values": [
       "COLOR",
-      "-moz-calc",
       "calc",
       "currentColor",
       "hsl",
       "hsla",
       "inherit",
       "initial",
       "medium",
       "rgb",
@@ -2540,17 +2523,16 @@ exports.CSS_PROPERTIES = {
     "isInherited": true,
     "subproperties": [
       "-webkit-text-stroke-width"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "medium",
       "thick",
       "thin",
       "unset"
     ]
@@ -3113,17 +3095,16 @@ exports.CSS_PROPERTIES = {
       11
     ],
     "values": [
       "COLOR",
       "-moz-all",
       "-moz-available",
       "-moz-block-height",
       "-moz-box",
-      "-moz-calc",
       "-moz-center",
       "-moz-crisp-edges",
       "-moz-deck",
       "-moz-element",
       "-moz-fit-content",
       "-moz-grid",
       "-moz-grid-group",
       "-moz-grid-line",
@@ -4010,17 +3991,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "block-size"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "border": {
@@ -4049,17 +4029,16 @@ exports.CSS_PROPERTIES = {
       "border-image-repeat"
     ],
     "supports": [
       2,
       6
     ],
     "values": [
       "COLOR",
-      "-moz-calc",
       "-moz-element",
       "-moz-image-rect",
       "-moz-linear-gradient",
       "-moz-radial-gradient",
       "-moz-repeating-linear-gradient",
       "-moz-repeating-radial-gradient",
       "calc",
       "currentColor",
@@ -4099,17 +4078,16 @@ exports.CSS_PROPERTIES = {
       "border-block-end-color"
     ],
     "supports": [
       2,
       6
     ],
     "values": [
       "COLOR",
-      "-moz-calc",
       "calc",
       "currentColor",
       "dashed",
       "dotted",
       "double",
       "groove",
       "hidden",
       "hsl",
@@ -4177,17 +4155,16 @@ exports.CSS_PROPERTIES = {
     "isInherited": false,
     "subproperties": [
       "border-block-end-width"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "medium",
       "thick",
       "thin",
       "unset"
     ]
@@ -4200,17 +4177,16 @@ exports.CSS_PROPERTIES = {
       "border-block-start-color"
     ],
     "supports": [
       2,
       6
     ],
     "values": [
       "COLOR",
-      "-moz-calc",
       "calc",
       "currentColor",
       "dashed",
       "dotted",
       "double",
       "groove",
       "hidden",
       "hsl",
@@ -4278,17 +4254,16 @@ exports.CSS_PROPERTIES = {
     "isInherited": false,
     "subproperties": [
       "border-block-start-width"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "medium",
       "thick",
       "thin",
       "unset"
     ]
@@ -4301,17 +4276,16 @@ exports.CSS_PROPERTIES = {
       "border-bottom-color"
     ],
     "supports": [
       2,
       6
     ],
     "values": [
       "COLOR",
-      "-moz-calc",
       "calc",
       "currentColor",
       "dashed",
       "dotted",
       "double",
       "groove",
       "hidden",
       "hsl",
@@ -4409,17 +4383,16 @@ exports.CSS_PROPERTIES = {
     "isInherited": false,
     "subproperties": [
       "border-bottom-width"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "medium",
       "thick",
       "thin",
       "unset"
     ]
@@ -4591,17 +4564,16 @@ exports.CSS_PROPERTIES = {
       "border-inline-end-color"
     ],
     "supports": [
       2,
       6
     ],
     "values": [
       "COLOR",
-      "-moz-calc",
       "calc",
       "currentColor",
       "dashed",
       "dotted",
       "double",
       "groove",
       "hidden",
       "hsl",
@@ -4669,17 +4641,16 @@ exports.CSS_PROPERTIES = {
     "isInherited": false,
     "subproperties": [
       "border-inline-end-width"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "medium",
       "thick",
       "thin",
       "unset"
     ]
@@ -4692,17 +4663,16 @@ exports.CSS_PROPERTIES = {
       "border-inline-start-color"
     ],
     "supports": [
       2,
       6
     ],
     "values": [
       "COLOR",
-      "-moz-calc",
       "calc",
       "currentColor",
       "dashed",
       "dotted",
       "double",
       "groove",
       "hidden",
       "hsl",
@@ -4770,17 +4740,16 @@ exports.CSS_PROPERTIES = {
     "isInherited": false,
     "subproperties": [
       "border-inline-start-width"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "medium",
       "thick",
       "thin",
       "unset"
     ]
@@ -4793,17 +4762,16 @@ exports.CSS_PROPERTIES = {
       "border-left-color"
     ],
     "supports": [
       2,
       6
     ],
     "values": [
       "COLOR",
-      "-moz-calc",
       "calc",
       "currentColor",
       "dashed",
       "dotted",
       "double",
       "groove",
       "hidden",
       "hsl",
@@ -4871,17 +4839,16 @@ exports.CSS_PROPERTIES = {
     "isInherited": false,
     "subproperties": [
       "border-left-width"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "medium",
       "thick",
       "thin",
       "unset"
     ]
@@ -4912,17 +4879,16 @@ exports.CSS_PROPERTIES = {
       "border-right-color"
     ],
     "supports": [
       2,
       6
     ],
     "values": [
       "COLOR",
-      "-moz-calc",
       "calc",
       "currentColor",
       "dashed",
       "dotted",
       "double",
       "groove",
       "hidden",
       "hsl",
@@ -4990,17 +4956,16 @@ exports.CSS_PROPERTIES = {
     "isInherited": false,
     "subproperties": [
       "border-right-width"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "medium",
       "thick",
       "thin",
       "unset"
     ]
@@ -5052,17 +5017,16 @@ exports.CSS_PROPERTIES = {
       "border-top-color"
     ],
     "supports": [
       2,
       6
     ],
     "values": [
       "COLOR",
-      "-moz-calc",
       "calc",
       "currentColor",
       "dashed",
       "dotted",
       "double",
       "groove",
       "hidden",
       "hsl",
@@ -5160,17 +5124,16 @@ exports.CSS_PROPERTIES = {
     "isInherited": false,
     "subproperties": [
       "border-top-width"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "medium",
       "thick",
       "thin",
       "unset"
     ]
@@ -5182,17 +5145,16 @@ exports.CSS_PROPERTIES = {
       "border-right-width",
       "border-bottom-width",
       "border-left-width"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "medium",
       "thick",
       "thin",
       "unset"
     ]
@@ -5202,17 +5164,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "bottom"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "box-decoration-break": {
@@ -5454,17 +5415,16 @@ exports.CSS_PROPERTIES = {
     "isInherited": false,
     "subproperties": [
       "column-gap"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "normal",
       "unset"
     ]
   },
   "column-rule": {
@@ -5475,17 +5435,16 @@ exports.CSS_PROPERTIES = {
       "column-rule-color"
     ],
     "supports": [
       2,
       6
     ],
     "values": [
       "COLOR",
-      "-moz-calc",
       "calc",
       "currentColor",
       "dashed",
       "dotted",
       "double",
       "groove",
       "hidden",
       "hsl",
@@ -5553,17 +5512,16 @@ exports.CSS_PROPERTIES = {
     "isInherited": false,
     "subproperties": [
       "column-rule-width"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "medium",
       "thick",
       "thin",
       "unset"
     ]
@@ -5572,17 +5530,16 @@ exports.CSS_PROPERTIES = {
     "isInherited": false,
     "subproperties": [
       "column-width"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "columns": {
@@ -5591,17 +5548,16 @@ exports.CSS_PROPERTIES = {
       "column-count",
       "column-width"
     ],
     "supports": [
       6,
       7
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "content": {
@@ -5827,17 +5783,16 @@ exports.CSS_PROPERTIES = {
     ],
     "supports": [
       6,
       7,
       8
     ],
     "values": [
       "-moz-available",
-      "-moz-calc",
       "-moz-fit-content",
       "-moz-max-content",
       "-moz-min-content",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
@@ -5849,17 +5804,16 @@ exports.CSS_PROPERTIES = {
       "flex-basis"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
       "-moz-available",
-      "-moz-calc",
       "-moz-fit-content",
       "-moz-max-content",
       "-moz-min-content",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
@@ -6020,17 +5974,16 @@ exports.CSS_PROPERTIES = {
     ],
     "supports": [
       6,
       7,
       8
     ],
     "values": [
       "-moz-block-height",
-      "-moz-calc",
       "all-petite-caps",
       "all-small-caps",
       "auto",
       "calc",
       "condensed",
       "expanded",
       "extra-condensed",
       "extra-expanded",
@@ -6119,17 +6072,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "font-size"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "large",
       "larger",
       "medium",
       "small",
       "smaller",
@@ -6337,17 +6289,16 @@ exports.CSS_PROPERTIES = {
       "grid-row-gap",
       "grid-column-gap"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "grid-area": {
     "isInherited": false,
@@ -6442,17 +6393,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "grid-column-gap"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "grid-column-start": {
     "isInherited": false,
@@ -6474,17 +6424,16 @@ exports.CSS_PROPERTIES = {
       "grid-row-gap",
       "grid-column-gap"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "grid-row": {
     "isInherited": false,
@@ -6520,17 +6469,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "grid-row-gap"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "grid-row-start": {
     "isInherited": false,
@@ -6611,17 +6559,16 @@ exports.CSS_PROPERTIES = {
       "height"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
       "-moz-available",
-      "-moz-calc",
       "-moz-fit-content",
       "-moz-max-content",
       "-moz-min-content",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
@@ -6695,17 +6642,16 @@ exports.CSS_PROPERTIES = {
       "inline-size"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
       "-moz-available",
-      "-moz-calc",
       "-moz-fit-content",
       "-moz-max-content",
       "-moz-min-content",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
@@ -6808,34 +6754,32 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "left"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "letter-spacing": {
     "isInherited": true,
     "subproperties": [
       "letter-spacing"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "normal",
       "unset"
     ]
   },
   "lighting-color": {
@@ -6866,17 +6810,16 @@ exports.CSS_PROPERTIES = {
     ],
     "supports": [
       6,
       7,
       8
     ],
     "values": [
       "-moz-block-height",
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "normal",
       "unset"
     ]
   },
   "list-style": {
@@ -6949,17 +6892,16 @@ exports.CSS_PROPERTIES = {
       "margin-bottom",
       "margin-left"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "margin-block-end": {
@@ -6967,17 +6909,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "margin-block-end"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "margin-block-start": {
@@ -6985,17 +6926,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "margin-block-start"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "margin-bottom": {
@@ -7003,17 +6943,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "margin-bottom"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "margin-inline-end": {
@@ -7021,17 +6960,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "margin-inline-end"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "margin-inline-start": {
@@ -7039,17 +6977,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "margin-inline-start"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "margin-left": {
@@ -7057,17 +6994,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "margin-left"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "margin-right": {
@@ -7075,17 +7011,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "margin-right"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "margin-top": {
@@ -7093,17 +7028,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "margin-top"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "marker": {
@@ -7424,17 +7358,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "max-block-size"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "none",
       "unset"
     ]
   },
   "max-height": {
@@ -7443,17 +7376,16 @@ exports.CSS_PROPERTIES = {
       "max-height"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
       "-moz-available",
-      "-moz-calc",
       "-moz-fit-content",
       "-moz-max-content",
       "-moz-min-content",
       "calc",
       "inherit",
       "initial",
       "none",
       "unset"
@@ -7465,17 +7397,16 @@ exports.CSS_PROPERTIES = {
       "max-inline-size"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
       "-moz-available",
-      "-moz-calc",
       "-moz-fit-content",
       "-moz-max-content",
       "-moz-min-content",
       "calc",
       "inherit",
       "initial",
       "none",
       "unset"
@@ -7487,17 +7418,16 @@ exports.CSS_PROPERTIES = {
       "max-width"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
       "-moz-available",
-      "-moz-calc",
       "-moz-fit-content",
       "-moz-max-content",
       "-moz-min-content",
       "calc",
       "inherit",
       "initial",
       "none",
       "unset"
@@ -7508,17 +7438,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "min-block-size"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "min-height": {
@@ -7527,17 +7456,16 @@ exports.CSS_PROPERTIES = {
       "min-height"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
       "-moz-available",
-      "-moz-calc",
       "-moz-fit-content",
       "-moz-max-content",
       "-moz-min-content",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
@@ -7549,17 +7477,16 @@ exports.CSS_PROPERTIES = {
       "min-inline-size"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
       "-moz-available",
-      "-moz-calc",
       "-moz-fit-content",
       "-moz-max-content",
       "-moz-min-content",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
@@ -7571,17 +7498,16 @@ exports.CSS_PROPERTIES = {
       "min-width"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
       "-moz-available",
-      "-moz-calc",
       "-moz-fit-content",
       "-moz-max-content",
       "-moz-min-content",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
@@ -7652,17 +7578,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "offset-block-end"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "offset-block-start": {
@@ -7670,17 +7595,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "offset-block-start"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "offset-inline-end": {
@@ -7688,17 +7612,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "offset-inline-end"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "offset-inline-start": {
@@ -7706,17 +7629,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "offset-inline-start"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "opacity": {
@@ -7755,17 +7677,16 @@ exports.CSS_PROPERTIES = {
       "outline-color"
     ],
     "supports": [
       2,
       6
     ],
     "values": [
       "COLOR",
-      "-moz-calc",
       "auto",
       "calc",
       "currentColor",
       "dashed",
       "dotted",
       "double",
       "groove",
       "hsl",
@@ -7811,17 +7732,16 @@ exports.CSS_PROPERTIES = {
     "isInherited": false,
     "subproperties": [
       "outline-offset"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "outline-style": {
     "isInherited": false,
@@ -7849,17 +7769,16 @@ exports.CSS_PROPERTIES = {
     "isInherited": false,
     "subproperties": [
       "outline-width"
     ],
     "supports": [
       6
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "medium",
       "thick",
       "thin",
       "unset"
     ]
@@ -7938,153 +7857,144 @@ exports.CSS_PROPERTIES = {
       "padding-bottom",
       "padding-left"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "padding-block-end": {
     "isInherited": false,
     "subproperties": [
       "padding-block-end"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "padding-block-start": {
     "isInherited": false,
     "subproperties": [
       "padding-block-start"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "padding-bottom": {
     "isInherited": false,
     "subproperties": [
       "padding-bottom"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "padding-inline-end": {
     "isInherited": false,
     "subproperties": [
       "padding-inline-end"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "padding-inline-start": {
     "isInherited": false,
     "subproperties": [
       "padding-inline-start"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "padding-left": {
     "isInherited": false,
     "subproperties": [
       "padding-left"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "padding-right": {
     "isInherited": false,
     "subproperties": [
       "padding-right"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "padding-top": {
     "isInherited": false,
     "subproperties": [
       "padding-top"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "page-break-after": {
     "isInherited": false,
@@ -8329,17 +8239,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "right"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "ruby-align": {
@@ -8891,17 +8800,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "text-indent"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "text-orientation": {
     "isInherited": true,
@@ -8984,17 +8892,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "top"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
     ]
   },
   "touch-action": {
@@ -9204,17 +9111,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "vertical-align"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "-moz-middle-with-baseline",
       "baseline",
       "bottom",
       "calc",
       "inherit",
       "initial",
       "middle",
       "sub",
@@ -9264,17 +9170,16 @@ exports.CSS_PROPERTIES = {
       "width"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
       "-moz-available",
-      "-moz-calc",
       "-moz-fit-content",
       "-moz-max-content",
       "-moz-min-content",
       "auto",
       "calc",
       "inherit",
       "initial",
       "unset"
@@ -9312,17 +9217,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "word-spacing"
     ],
     "supports": [
       6,
       8
     ],
     "values": [
-      "-moz-calc",
       "calc",
       "inherit",
       "initial",
       "normal",
       "unset"
     ]
   },
   "word-wrap": {
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -1279,32 +1279,32 @@ nsIDocument::nsIDocument()
     mReferrerPolicySet(false),
     mReferrerPolicy(mozilla::net::RP_Unset),
     mBlockAllMixedContent(false),
     mBlockAllMixedContentPreloads(false),
     mUpgradeInsecureRequests(false),
     mUpgradeInsecurePreloads(false),
     mCharacterSet(NS_LITERAL_CSTRING("ISO-8859-1")),
     mNodeInfoManager(nullptr),
-    mCompatMode(eCompatibility_FullStandards),
-    mVisibilityState(dom::VisibilityState::Hidden),
     mIsInitialDocumentInWindow(false),
     mMayStartLayout(true),
     mVisible(true),
     mRemovedFromDocShell(false),
     // mAllowDNSPrefetch starts true, so that we can always reliably && it
     // with various values that might disable it.  Since we never prefetch
     // unless we get a window, and in that case the docshell value will get
     // &&-ed in, this is safe.
     mAllowDNSPrefetch(true),
     mIsBeingUsedAsImage(false),
     mHasLinksToUpdate(false),
     mFontFaceSetDirty(true),
     mGetUserFontSetCalled(false),
     mPostedFlushUserFontSet(false),
+    mCompatMode(eCompatibility_FullStandards),
+    mVisibilityState(dom::VisibilityState::Hidden),
     mBidiOptions(IBMBIDI_DEFAULT_BIDI_OPTIONS),
     mPartID(0),
     mDidFireDOMContentLoaded(true),
     mHasScrollLinkedEffect(false),
     mUserHasInteracted(false)
 {
   SetIsInDocument();
 
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -2932,16 +2932,18 @@ nsFrameLoader::TryRemoteBrowser()
   NS_ENSURE_SUCCESS(rv, false);
 
   nsCOMPtr<Element> ownerElement = mOwnerContent;
   mRemoteBrowser = ContentParent::CreateBrowser(context, ownerElement, openerContentParent,
                                                 mFreshProcess);
   if (!mRemoteBrowser) {
     return false;
   }
+  // Now that mRemoteBrowser is set, we can initialize the RenderFrameParent
+  mRemoteBrowser->InitRenderFrame();
 
   MaybeUpdatePrimaryTabParent(eTabParentChanged);
 
   mChildID = mRemoteBrowser->Manager()->ChildID();
 
   nsCOMPtr<nsIDocShellTreeItem> rootItem;
   parentDocShell->GetRootTreeItem(getter_AddRefs(rootItem));
   nsCOMPtr<nsPIDOMWindowOuter> rootWin = rootItem->GetWindow();
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -3027,34 +3027,22 @@ protected:
   nsTArray<nsAutoPtr<nsPropertyTable> > mExtraPropertyTables;
 
   // Our cached .children collection
   nsCOMPtr<nsIHTMLCollection> mChildrenCollection;
 
   // container for per-context fonts (downloadable, SVG, etc.)
   RefPtr<mozilla::dom::FontFaceSet> mFontFaceSet;
 
-  // Compatibility mode
-  nsCompatibility mCompatMode;
-
-  // Our readyState
-  ReadyState mReadyState;
-
-  // Whether this document has (or will have, once we have a pres shell) a
-  // Gecko- or Servo-backed style system.
-  mozilla::StyleBackendType mStyleBackendType;
-
-#ifdef MOZILLA_INTERNAL_API
-  // Our visibility state
-  mozilla::dom::VisibilityState mVisibilityState;
-  static_assert(sizeof(mozilla::dom::VisibilityState) == sizeof(uint8_t),
-                "Error size of mVisibilityState and mDummy");
-#else
-  uint8_t mDummy;
-#endif
+  // XXXheycam rust-bindgen currently doesn't generate correctly aligned fields
+  // to represent the following bitfields if they are preceded by something
+  // non-pointer aligned, so if adding non-pointer sized fields, please do so
+  // somewhere other than right here.
+  //
+  // https://github.com/servo/rust-bindgen/issues/111
 
   // True if BIDI is enabled.
   bool mBidiEnabled : 1;
   // True if a MathML element has ever been owned by this document.
   bool mMathMLEnabled : 1;
 
   // True if this document is the initial document for a window.  This should
   // basically be true only for documents that exist in newly-opened windows or
@@ -3194,16 +3182,35 @@ protected:
   bool mGetUserFontSetCalled : 1;
 
   // Do we currently have an event posted to call FlushUserFontSet?
   bool mPostedFlushUserFontSet : 1;
 
   // True is document has ever been in a foreground window.
   bool mEverInForeground : 1;
 
+  // Compatibility mode
+  nsCompatibility mCompatMode;
+
+  // Our readyState
+  ReadyState mReadyState;
+
+  // Whether this document has (or will have, once we have a pres shell) a
+  // Gecko- or Servo-backed style system.
+  mozilla::StyleBackendType mStyleBackendType;
+
+#ifdef MOZILLA_INTERNAL_API
+  // Our visibility state
+  mozilla::dom::VisibilityState mVisibilityState;
+  static_assert(sizeof(mozilla::dom::VisibilityState) == sizeof(uint8_t),
+                "Error size of mVisibilityState and mDummy");
+#else
+  uint8_t mDummy;
+#endif
+
   enum Type {
     eUnknown, // should never be used
     eHTML,
     eXHTML,
     eGenericXML,
     eSVG,
     eXUL
   };
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -6061,26 +6061,16 @@ void HTMLMediaElement::SuspendOrResumeEl
       // For EME content, we may force destruction of the CDM client (and CDM
       // instance if this is the last client for that CDM instance) and
       // the CDM's decoder. This ensures the CDM gets reliable and prompt
       // shutdown notifications, as it may have book-keeping it needs
       // to do on shutdown.
       if (mMediaKeys) {
         nsAutoString keySystem;
         mMediaKeys->GetKeySystem(keySystem);
-        // If we're using Primetime we need to shutdown the key system and
-        // decoder to preserve secure stop like behavior, other CDMs don't
-        // implement this so we don't need to worry with them on a suspend.
-        if (IsPrimetimeKeySystem(keySystem)) {
-          mMediaKeys->Shutdown();
-          mMediaKeys = nullptr;
-          if (mDecoder) {
-            ShutdownDecoder();
-          }
-        }
       }
       if (mDecoder) {
         mDecoder->Pause();
         mDecoder->Suspend();
       }
       mEventDeliveryPaused = aSuspendEvents;
     } else {
       if (mDecoder) {
--- a/dom/ipc/PBrowser.ipdl
+++ b/dom/ipc/PBrowser.ipdl
@@ -626,22 +626,23 @@ child:
      * to trigger creation of the remote browser's "widget".
      *
      * |Show()| and |Move()| take IntSizes rather than Rects because
      * content processes always render to a virtual <0, 0> top-left
      * point.
      */
     async Show(ScreenIntSize size,
                ShowInfo info,
-               TextureFactoryIdentifier textureFactoryIdentifier,
-               uint64_t layersId,
-               nullable PRenderFrame renderFrame,
                bool parentIsActive,
                nsSizeMode sizeMode);
 
+    async InitRendering(TextureFactoryIdentifier textureFactoryIdentifier,
+                        uint64_t layersId,
+                        nullable PRenderFrame renderFrame);
+
     async LoadURL(nsCString uri, ShowInfo info);
 
     async UpdateDimensions(CSSRect rect, CSSSize size,
                            ScreenOrientationInternal orientation,
                            LayoutDeviceIntPoint clientOffset,
                            LayoutDeviceIntPoint chromeDisp) compressall;
 
     async SizeModeChanged(nsSizeMode sizeMode);
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -422,20 +422,20 @@ TabChild::TabChild(nsIContentChild* aMan
   for (uint32_t idx = 0; idx < NUMBER_OF_AUDIO_CHANNELS; idx++) {
     mAudioChannelsActive.AppendElement(false);
   }
 }
 
 bool
 TabChild::AsyncPanZoomEnabled() const
 {
-  // If we have received the CompositorOptions we can answer definitively. If
-  // not, return a best guess based on gfxPlaform values.
-  return mCompositorOptions ? mCompositorOptions->UseAPZ()
-                            : gfxPlatform::AsyncPanZoomEnabled();
+  // By the time anybody calls this, we must have had InitRenderingState called
+  // already, and so mCompositorOptions should be populated.
+  MOZ_RELEASE_ASSERT(mCompositorOptions);
+  return mCompositorOptions->UseAPZ();
 }
 
 NS_IMETHODIMP
 TabChild::Observe(nsISupports *aSubject,
                   const char *aTopic,
                   const char16_t *aData)
 {
   if (!strcmp(aTopic, BEFORE_FIRST_PAINT)) {
@@ -1162,18 +1162,18 @@ TabChild::RecvLoadURL(const nsCString& a
   return IPC_OK();
 }
 
 void
 TabChild::DoFakeShow(const TextureFactoryIdentifier& aTextureFactoryIdentifier,
                      const uint64_t& aLayersId,
                      PRenderFrameChild* aRenderFrame, const ShowInfo& aShowInfo)
 {
-  RecvShow(ScreenIntSize(0, 0), aShowInfo, aTextureFactoryIdentifier,
-           aLayersId, aRenderFrame, mParentIsActive, nsSizeMode_Normal);
+  InitRenderingState(aTextureFactoryIdentifier, aLayersId, aRenderFrame);
+  RecvShow(ScreenIntSize(0, 0), aShowInfo, mParentIsActive, nsSizeMode_Normal);
   mDidFakeShow = true;
 }
 
 void
 TabChild::ApplyShowInfo(const ShowInfo& aInfo)
 {
   if (mDidSetRealShowInfo) {
     return;
@@ -1219,49 +1219,51 @@ TabChild::ApplyShowInfo(const ShowInfo& 
   mRounding = aInfo.widgetRounding();
   mDefaultScale = aInfo.defaultScale();
   mIsTransparent = aInfo.isTransparent();
 }
 
 mozilla::ipc::IPCResult
 TabChild::RecvShow(const ScreenIntSize& aSize,
                    const ShowInfo& aInfo,
-                   const TextureFactoryIdentifier& aTextureFactoryIdentifier,
-                   const uint64_t& aLayersId,
-                   PRenderFrameChild* aRenderFrame,
                    const bool& aParentIsActive,
                    const nsSizeMode& aSizeMode)
 {
-    MOZ_ASSERT((!mDidFakeShow && aRenderFrame) || (mDidFakeShow && !aRenderFrame));
-
-    mPuppetWidget->SetSizeMode(aSizeMode);
-    if (mDidFakeShow) {
-        ApplyShowInfo(aInfo);
-        RecvParentActivated(aParentIsActive);
-        return IPC_OK();
-    }
-
+  bool res = true;
+
+  mPuppetWidget->SetSizeMode(aSizeMode);
+  if (!mDidFakeShow) {
     nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(WebNavigation());
     if (!baseWindow) {
         NS_ERROR("WebNavigation() doesn't QI to nsIBaseWindow");
         return IPC_FAIL_NO_REASON(this);
     }
 
-    InitRenderingState(aTextureFactoryIdentifier, aLayersId, aRenderFrame);
-
     baseWindow->SetVisibility(true);
-
-    bool res = InitTabChildGlobal();
-    ApplyShowInfo(aInfo);
-    RecvParentActivated(aParentIsActive);
-
-    if (!res) {
-      return IPC_FAIL_NO_REASON(this);
-    }
-    return IPC_OK();
+    res = InitTabChildGlobal();
+  }
+
+  ApplyShowInfo(aInfo);
+  RecvParentActivated(aParentIsActive);
+
+  if (!res) {
+    return IPC_FAIL_NO_REASON(this);
+  }
+  return IPC_OK();
+}
+
+mozilla::ipc::IPCResult
+TabChild::RecvInitRendering(const TextureFactoryIdentifier& aTextureFactoryIdentifier,
+                            const uint64_t& aLayersId,
+                            PRenderFrameChild* aRenderFrame)
+{
+  MOZ_ASSERT((!mDidFakeShow && aRenderFrame) || (mDidFakeShow && !aRenderFrame));
+
+  InitRenderingState(aTextureFactoryIdentifier, aLayersId, aRenderFrame);
+  return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 TabChild::RecvUpdateDimensions(const CSSRect& rect, const CSSSize& size,
                                const ScreenOrientationInternal& orientation,
                                const LayoutDeviceIntPoint& clientOffset,
                                const LayoutDeviceIntPoint& chromeDisp)
 {
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -333,23 +333,25 @@ public:
                           const ViewID& aViewId,
                           const Maybe<ZoomConstraints>& aConstraints) override;
 
   virtual mozilla::ipc::IPCResult RecvLoadURL(const nsCString& aURI,
                                               const ShowInfo& aInfo) override;
   virtual mozilla::ipc::IPCResult
   RecvShow(const ScreenIntSize& aSize,
            const ShowInfo& aInfo,
-           const TextureFactoryIdentifier& aTextureFactoryIdentifier,
-           const uint64_t& aLayersId,
-           PRenderFrameChild* aRenderFrame,
            const bool& aParentIsActive,
            const nsSizeMode& aSizeMode) override;
 
   virtual mozilla::ipc::IPCResult
+  RecvInitRendering(const TextureFactoryIdentifier& aTextureFactoryIdentifier,
+                    const uint64_t& aLayersId,
+                    PRenderFrameChild* aRenderFrame) override;
+
+  virtual mozilla::ipc::IPCResult
   RecvUpdateDimensions(const CSSRect& aRect,
                        const CSSSize& aSize,
                        const ScreenOrientationInternal& aOrientation,
                        const LayoutDeviceIntPoint& aClientOffset,
                        const LayoutDeviceIntPoint& aChromeDisp) override;
   virtual mozilla::ipc::IPCResult
   RecvSizeModeChanged(const nsSizeMode& aSizeMode) override;
 
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -616,54 +616,60 @@ TabParent::LoadURL(nsIURI* aURI)
         mDelayedURL = spec;
         return;
     }
 
     Unused << SendLoadURL(spec, GetShowInfo());
 }
 
 void
+TabParent::InitRenderFrame()
+{
+  if (IsInitedByParent()) {
+    // If TabParent is initialized by parent side then the RenderFrame must also
+    // be created here. If TabParent is initialized by child side,
+    // child side will create RenderFrame.
+    MOZ_ASSERT(!GetRenderFrame());
+    RefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
+    MOZ_ASSERT(frameLoader);
+    if (frameLoader) {
+      bool success;
+      RenderFrameParent* renderFrame = new RenderFrameParent(frameLoader, &success);
+      uint64_t layersId = renderFrame->GetLayersId();
+      AddTabParentToTable(layersId, this);
+      Unused << SendPRenderFrameConstructor(renderFrame);
+
+      TextureFactoryIdentifier textureFactoryIdentifier;
+      renderFrame->GetTextureFactoryIdentifier(&textureFactoryIdentifier);
+      Unused << SendInitRendering(textureFactoryIdentifier, layersId, renderFrame);
+    }
+  } else {
+    // Otherwise, the child should have constructed the RenderFrame,
+    // and we should already know about it.
+    MOZ_ASSERT(GetRenderFrame());
+  }
+}
+
+void
 TabParent::Show(const ScreenIntSize& size, bool aParentIsActive)
 {
     mDimensions = size;
     if (mIsDestroyed) {
         return;
     }
 
-    TextureFactoryIdentifier textureFactoryIdentifier;
-    uint64_t layersId = 0;
-    bool success = false;
-    RenderFrameParent* renderFrame = nullptr;
-    if (IsInitedByParent()) {
-        // If TabParent is initialized by parent side then the RenderFrame must also
-        // be created here. If TabParent is initialized by child side,
-        // child side will create RenderFrame.
-        MOZ_ASSERT(!GetRenderFrame());
-        RefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
-        if (frameLoader) {
-          renderFrame = new RenderFrameParent(frameLoader, &success);
-          layersId = renderFrame->GetLayersId();
-          renderFrame->GetTextureFactoryIdentifier(&textureFactoryIdentifier);
-          AddTabParentToTable(layersId, this);
-          Unused << SendPRenderFrameConstructor(renderFrame);
-        }
-    } else {
-      // Otherwise, the child should have constructed the RenderFrame,
-      // and we should already know about it.
-      MOZ_ASSERT(GetRenderFrame());
-    }
+    MOZ_ASSERT(GetRenderFrame());
 
     nsCOMPtr<nsISupports> container = mFrameElement->OwnerDoc()->GetContainer();
     nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(container);
     nsCOMPtr<nsIWidget> mainWidget;
     baseWindow->GetMainWidget(getter_AddRefs(mainWidget));
     mSizeMode = mainWidget ? mainWidget->SizeMode() : nsSizeMode_Normal;
 
-    Unused << SendShow(size, GetShowInfo(), textureFactoryIdentifier,
-                       layersId, renderFrame, aParentIsActive, mSizeMode);
+    Unused << SendShow(size, GetShowInfo(), aParentIsActive, mSizeMode);
 }
 
 mozilla::ipc::IPCResult
 TabParent::RecvSetDimensions(const uint32_t& aFlags,
                              const int32_t& aX, const int32_t& aY,
                              const int32_t& aCx, const int32_t& aCy)
 {
   MOZ_ASSERT(!(aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER),
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -363,16 +363,18 @@ public:
 
   /**
    * Return the top level doc accessible parent for this tab.
    */
   a11y::DocAccessibleParent* GetTopLevelDocAccessible() const;
 
   void LoadURL(nsIURI* aURI);
 
+  void InitRenderFrame();
+
   // XXX/cjones: it's not clear what we gain by hiding these
   // message-sending functions under a layer of indirection and
   // eating the return values
   void Show(const ScreenIntSize& aSize, bool aParentIsActive);
 
   void UpdateDimensions(const nsIntRect& aRect, const ScreenIntSize& aSize);
 
   void SizeModeChanged(const nsSizeMode& aSizeMode);
--- a/dom/locales/en-US/chrome/plugins.properties
+++ b/dom/locales/en-US/chrome/plugins.properties
@@ -26,12 +26,11 @@ deprecation_learn_more=Learn More.
 
 # GMP Plugins
 gmp_license_info=License information
 gmp_privacy_info=Privacy Information
 
 openH264_name=OpenH264 Video Codec provided by Cisco Systems, Inc.
 openH264_description2=This plugin is automatically installed by Mozilla to comply with the WebRTC specification and to enable WebRTC calls with devices that require the H.264 video codec. Visit http://www.openh264.org/ to view the codec source code and learn more about the implementation.
 
-eme-adobe_name=Primetime Content Decryption Module provided by Adobe Systems, Incorporated
-eme-adobe_description=Play back protected web video.
+cdm_description=Play back protected web video.
 
 widevine_description=Widevine Content Decryption Module provided by Google Inc.
--- a/dom/media/VideoUtils.cpp
+++ b/dom/media/VideoUtils.cpp
@@ -27,17 +27,16 @@
 
 #include <functional>
 #include <stdint.h>
 
 namespace mozilla {
 
 NS_NAMED_LITERAL_CSTRING(kEMEKeySystemClearkey, "org.w3.clearkey");
 NS_NAMED_LITERAL_CSTRING(kEMEKeySystemWidevine, "com.widevine.alpha");
-NS_NAMED_LITERAL_CSTRING(kEMEKeySystemPrimetime, "com.adobe.primetime");
 
 using layers::PlanarYCbCrImage;
 
 CheckedInt64 SaferMultDiv(int64_t aValue, uint32_t aMul, uint32_t aDiv) {
   int64_t major = aValue / aDiv;
   int64_t remainder = aValue % aDiv;
   return CheckedInt64(remainder) * aMul / aDiv + CheckedInt64(major) * aMul;
 }
--- a/dom/media/VideoUtils.h
+++ b/dom/media/VideoUtils.h
@@ -41,17 +41,16 @@ using mozilla::CheckedUint32;
 // mozilla::Monitor non-reentrant.
 namespace mozilla {
 
 class MediaContentType;
 
 // EME Key System String.
 extern const nsLiteralCString kEMEKeySystemClearkey;
 extern const nsLiteralCString kEMEKeySystemWidevine;
-extern const nsLiteralCString kEMEKeySystemPrimetime;
 
 /**
  * ReentrantMonitorConditionallyEnter
  *
  * Enters the supplied monitor only if the conditional value |aEnter| is true.
  * E.g. Used to allow unmonitored read access on the decode thread,
  * and monitored access on all other threads.
  */
--- a/dom/media/eme/EMEUtils.cpp
+++ b/dom/media/eme/EMEUtils.cpp
@@ -49,33 +49,24 @@ CopyArrayBufferViewOrArrayBufferData(con
 
 bool
 IsClearkeyKeySystem(const nsAString& aKeySystem)
 {
   return !CompareUTF8toUTF16(kEMEKeySystemClearkey, aKeySystem);
 }
 
 bool
-IsPrimetimeKeySystem(const nsAString& aKeySystem)
-{
-  return !CompareUTF8toUTF16(kEMEKeySystemPrimetime, aKeySystem);
-}
-
-bool
 IsWidevineKeySystem(const nsAString& aKeySystem)
 {
   return !CompareUTF8toUTF16(kEMEKeySystemWidevine, aKeySystem);
 }
 
 nsString
 KeySystemToGMPName(const nsAString& aKeySystem)
 {
-  if (IsPrimetimeKeySystem(aKeySystem)) {
-    return NS_LITERAL_STRING("gmp-eme-adobe");
-  }
   if (IsClearkeyKeySystem(aKeySystem)) {
     return NS_LITERAL_STRING("gmp-clearkey");
   }
   if (IsWidevineKeySystem(aKeySystem)) {
     return NS_LITERAL_STRING("gmp-widevinecdm");
   }
   MOZ_ASSERT(false, "We should only call this for known GMPs");
   return EmptyString();
@@ -83,15 +74,13 @@ KeySystemToGMPName(const nsAString& aKey
 
 CDMType
 ToCDMTypeTelemetryEnum(const nsString& aKeySystem)
 {
   if (IsWidevineKeySystem(aKeySystem)) {
     return CDMType::eWidevine;
   } else if (IsClearkeyKeySystem(aKeySystem)) {
     return CDMType::eClearKey;
-  } else if (IsPrimetimeKeySystem(aKeySystem)) {
-    return CDMType::ePrimetime;
   }
   return CDMType::eUnknown;
 }
 
 } // namespace mozilla
--- a/dom/media/eme/EMEUtils.h
+++ b/dom/media/eme/EMEUtils.h
@@ -82,24 +82,24 @@ GetArrayBufferViewOrArrayBufferData(cons
 
 nsString
 KeySystemToGMPName(const nsAString& aKeySystem);
 
 bool
 IsClearkeyKeySystem(const nsAString& aKeySystem);
 
 bool
-IsPrimetimeKeySystem(const nsAString& aKeySystem);
-
-bool
 IsWidevineKeySystem(const nsAString& aKeySystem);
 
+// Note: Primetime is now unsupported, but we leave it in the enum so
+// that the telemetry enum values are not changed; doing so would break
+// existing telemetry probes.
 enum CDMType {
   eClearKey = 0,
-  ePrimetime = 1,
+  ePrimetime = 1, // Note: Unsupported.
   eWidevine = 2,
   eUnknown = 3
 };
 
 CDMType
 ToCDMTypeTelemetryEnum(const nsString& aKeySystem);
 
 } // namespace mozilla
--- a/dom/media/eme/MediaKeySystemAccess.cpp
+++ b/dom/media/eme/MediaKeySystemAccess.cpp
@@ -22,18 +22,16 @@
 #include "mozilla/Services.h"
 #include "nsIObserverService.h"
 #include "mozilla/EMEUtils.h"
 #include "GMPUtils.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsXULAppAPI.h"
-#include "gmp-audio-decode.h"
-#include "gmp-video-decode.h"
 #include "DecoderDoctorDiagnostics.h"
 #include "WebMDecoder.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "nsUnicharUtils.h"
 #include "mozilla/dom/MediaSource.h"
 #ifdef MOZ_WIDGET_ANDROID
 #include "FennecJNIWrappers.h"
@@ -129,26 +127,16 @@ MediaKeySystemAccess::GetKeySystemStatus
                                          nsACString& aOutMessage)
 {
   MOZ_ASSERT(MediaPrefs::EMEEnabled() || IsClearkeyKeySystem(aKeySystem));
 
   if (IsClearkeyKeySystem(aKeySystem)) {
     return EnsureCDMInstalled(aKeySystem, aOutMessage);
   }
 
-  if (Preferences::GetBool("media.gmp-eme-adobe.visible", false)) {
-    if (IsPrimetimeKeySystem(aKeySystem)) {
-      if (!Preferences::GetBool("media.gmp-eme-adobe.enabled", false)) {
-        aOutMessage = NS_LITERAL_CSTRING("Adobe EME disabled");
-        return MediaKeySystemStatus::Cdm_disabled;
-      }
-      return EnsureCDMInstalled(aKeySystem, aOutMessage);
-    }
-  }
-
   if (IsWidevineKeySystem(aKeySystem)) {
     if (Preferences::GetBool("media.gmp-widevinecdm.visible", false)) {
       if (!Preferences::GetBool("media.gmp-widevinecdm.enabled", false)) {
         aOutMessage = NS_LITERAL_CSTRING("Widevine EME disabled");
         return MediaKeySystemStatus::Cdm_disabled;
       }
       return EnsureCDMInstalled(aKeySystem, aOutMessage);
 #ifdef MOZ_WIDGET_ANDROID
@@ -319,19 +307,18 @@ GetSupportedKeySystems()
 #ifdef MOZ_WIDGET_ANDROID
       widevine.mSessionTypes.AppendElement(MediaKeySessionType::Persistent_license);
 #endif
       widevine.mAudioRobustness.AppendElement(NS_LITERAL_STRING("SW_SECURE_CRYPTO"));
       widevine.mVideoRobustness.AppendElement(NS_LITERAL_STRING("SW_SECURE_DECODE"));
 #if defined(XP_WIN)
       // Widevine CDM doesn't include an AAC decoder. So if WMF can't
       // decode AAC, and a codec wasn't specified, be conservative
-      // and reject the MediaKeys request, since our policy is to prevent
-      //  the Adobe GMP's unencrypted AAC decoding path being used to
-      // decode content decrypted by the Widevine CDM.
+      // and reject the MediaKeys request, since we assume Widevine
+      // will be used with AAC.
       if (WMFDecoderModule::HasAAC()) {
         widevine.mMP4.SetCanDecrypt(EME_CODEC_AAC);
       }
 #elif !defined(MOZ_WIDGET_ANDROID)
       widevine.mMP4.SetCanDecrypt(EME_CODEC_AAC);
 #endif
 
 #if defined(MOZ_WIDGET_ANDROID)
@@ -371,29 +358,16 @@ GetSupportedKeySystems()
       widevine.mWebM.SetCanDecrypt(EME_CODEC_VORBIS);
       widevine.mWebM.SetCanDecrypt(EME_CODEC_OPUS);
       widevine.mWebM.SetCanDecryptAndDecode(EME_CODEC_VP8);
       widevine.mWebM.SetCanDecryptAndDecode(EME_CODEC_VP9);
 #endif
       keySystemConfigs.AppendElement(Move(widevine));
     }
   }
-  {
-    if (HavePluginForKeySystem(kEMEKeySystemPrimetime)) {
-      KeySystemConfig primetime;
-      primetime.mKeySystem = NS_ConvertUTF8toUTF16(kEMEKeySystemPrimetime);
-      primetime.mInitDataTypes.AppendElement(NS_LITERAL_STRING("cenc"));
-      primetime.mPersistentState = KeySystemFeatureSupport::Required;
-      primetime.mDistinctiveIdentifier = KeySystemFeatureSupport::Required;
-      primetime.mSessionTypes.AppendElement(MediaKeySessionType::Temporary);
-      primetime.mMP4.SetCanDecryptAndDecode(EME_CODEC_AAC);
-      primetime.mMP4.SetCanDecryptAndDecode(EME_CODEC_H264);
-      keySystemConfigs.AppendElement(Move(primetime));
-    }
-  }
 
   return keySystemConfigs;
 }
 
 static bool
 GetKeySystemConfig(const nsAString& aKeySystem, KeySystemConfig& aOutKeySystemConfig)
 {
   for (auto&& config : GetSupportedKeySystems()) {
@@ -448,19 +422,18 @@ CanDecryptAndDecode(const nsString& aKey
     }
 
     // Neither the GMP nor Gecko can both decrypt and decode. We don't
     // support this codec.
 
 #if defined(XP_WIN)
     // Widevine CDM doesn't include an AAC decoder. So if WMF can't
     // decode AAC, and a codec wasn't specified, be conservative
-    // and reject the MediaKeys request, since our policy is to prevent
-    //  the Adobe GMP's unencrypted AAC decoding path being used to
-    // decode content decrypted by the Widevine CDM.
+    // and reject the MediaKeys request, since we assume Widevine
+    // will be used with AAC.
     if (codec == EME_CODEC_AAC &&
         IsWidevineKeySystem(aKeySystem) &&
         !WMFDecoderModule::HasAAC()) {
       if (aDiagnostics) {
         aDiagnostics->SetKeySystemIssue(
           DecoderDoctorDiagnostics::eWidevineWithNoWMF);
       }
     }
--- a/dom/media/eme/MediaKeySystemAccessManager.cpp
+++ b/dom/media/eme/MediaKeySystemAccessManager.cpp
@@ -89,19 +89,17 @@ MediaKeySystemAccessManager::Request(Det
     // Don't notify DecoderDoctor, as there's nothing we or the user can
     // do to fix this situation; the site is using the API wrong.
     return;
   }
 
   DecoderDoctorDiagnostics diagnostics;
 
   // Ensure keysystem is supported.
-  if (!IsWidevineKeySystem(aKeySystem) &&
-      !IsClearkeyKeySystem(aKeySystem) &&
-      !IsPrimetimeKeySystem(aKeySystem)) {
+  if (!IsWidevineKeySystem(aKeySystem) && !IsClearkeyKeySystem(aKeySystem)) {
     // Not to inform user, because nothing to do if the keySystem is not
     // supported.
     aPromise->MaybeReject(NS_ERROR_DOM_NOT_SUPPORTED_ERR,
                           NS_LITERAL_CSTRING("Key system is unsupported"));
     diagnostics.StoreMediaKeySystemAccess(mWindow->GetExtantDoc(),
                                           aKeySystem, false, __func__);
     return;
   }
@@ -127,17 +125,17 @@ MediaKeySystemAccessManager::Request(Det
   nsPrintfCString msg("MediaKeySystemAccess::GetKeySystemStatus(%s) "
                       "result=%s msg='%s'",
                       NS_ConvertUTF16toUTF8(aKeySystem).get(),
                       MediaKeySystemStatusValues::strings[(size_t)status].value,
                       message.get());
   LogToBrowserConsole(NS_ConvertUTF8toUTF16(msg));
 
   if (status == MediaKeySystemStatus::Cdm_not_installed &&
-      (IsPrimetimeKeySystem(aKeySystem) || IsWidevineKeySystem(aKeySystem))) {
+      IsWidevineKeySystem(aKeySystem)) {
     // These are cases which could be resolved by downloading a new(er) CDM.
     // When we send the status to chrome, chrome's GMPProvider will attempt to
     // download or update the CDM. In AwaitInstall() we add listeners to wait
     // for the update to complete, and we'll call this function again with
     // aType==Subsequent once the download has completed and the GMPService
     // has had a new plugin added. AwaitInstall() sets a timer to fail if the
     // update/download takes too long or fails.
     if (aType == RequestType::Initial &&
--- a/dom/media/gmp-plugin/fake.info
+++ b/dom/media/gmp-plugin/fake.info
@@ -1,5 +1,5 @@
 Name: fake
-Description: Fake GMP Plugin, which deliberately uses GMP_API_DECRYPTOR_BACKWARDS_COMPAT for its decryptor.
+Description: Fake GMP Plugin.
 Version: 1.0
-APIs: decode-video[h264:broken], eme-decrypt-v7[fake]
+APIs: decode-video[h264:broken], eme-decrypt-v9[fake]
 Libraries: dxva2.dll
--- a/dom/media/gmp-plugin/gmp-fake.cpp
+++ b/dom/media/gmp-plugin/gmp-fake.cpp
@@ -67,17 +67,17 @@ extern "C" {
   PUBLIC_FUNC GMPErr
   GMPGetAPI (const char* aApiName, void* aHostAPI, void** aPluginApi) {
     if (!strcmp (aApiName, GMP_API_VIDEO_DECODER)) {
       // Note: Deliberately advertise in our .info file that we support
       // video-decode, but we fail the "get" call here to simulate what
       // happens when decoder init fails.
       return GMPGenericErr;
 #if defined(GMP_FAKE_SUPPORT_DECRYPT)
-    } else if (!strcmp (aApiName, GMP_API_DECRYPTOR_BACKWARDS_COMPAT)) {
+    } else if (!strcmp (aApiName, GMP_API_DECRYPTOR)) {
       *aPluginApi = new FakeDecryptor(static_cast<GMPDecryptorHost*> (aHostAPI));
       return GMPNoErr;
     } else if (!strcmp (aApiName, GMP_API_ASYNC_SHUTDOWN)) {
       *aPluginApi = new TestAsyncShutdown(static_cast<GMPAsyncShutdownHost*> (aHostAPI));
       return GMPNoErr;
 #endif
     }
     return GMPGenericErr;
--- a/dom/media/gmp-plugin/gmp-test-decryptor.h
+++ b/dom/media/gmp-plugin/gmp-test-decryptor.h
@@ -6,22 +6,25 @@
 #ifndef FAKE_DECRYPTOR_H__
 #define FAKE_DECRYPTOR_H__
 
 #include "gmp-decryption.h"
 #include "gmp-async-shutdown.h"
 #include <string>
 #include "mozilla/Attributes.h"
 
-class FakeDecryptor : public GMPDecryptor7 {
+class FakeDecryptor : public GMPDecryptor {
 public:
 
   explicit FakeDecryptor(GMPDecryptorHost* aHost);
 
-  void Init(GMPDecryptorCallback* aCallback) override {
+  void Init(GMPDecryptorCallback* aCallback,
+            bool aDistinctiveIdentifierRequired,
+            bool aPersistentStateRequired) override
+  {
     mCallback = aCallback;
   }
 
   void CreateSession(uint32_t aCreateSessionToken,
                      uint32_t aPromiseId,
                      const char* aInitDataType,
                      uint32_t aInitDataTypeSize,
                      const uint8_t* aInitData,
deleted file mode 100644
--- a/dom/media/gmp/GMPAudioDecoderChild.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "GMPAudioDecoderChild.h"
-#include "GMPContentChild.h"
-#include "GMPAudioHost.h"
-#include "mozilla/Unused.h"
-#include <stdio.h>
-
-namespace mozilla {
-namespace gmp {
-
-GMPAudioDecoderChild::GMPAudioDecoderChild(GMPContentChild* aPlugin)
-  : mPlugin(aPlugin)
-  , mAudioDecoder(nullptr)
-{
-  MOZ_ASSERT(mPlugin);
-}
-
-GMPAudioDecoderChild::~GMPAudioDecoderChild()
-{
-}
-
-void
-GMPAudioDecoderChild::Init(GMPAudioDecoder* aDecoder)
-{
-  MOZ_ASSERT(aDecoder, "Cannot initialize Audio decoder child without a Audio decoder!");
-  mAudioDecoder = aDecoder;
-}
-
-GMPAudioHostImpl&
-GMPAudioDecoderChild::Host()
-{
-  return mAudioHost;
-}
-
-void
-GMPAudioDecoderChild::Decoded(GMPAudioSamples* aDecodedSamples)
-{
-  MOZ_ASSERT(mPlugin->GMPMessageLoop() == MessageLoop::current());
-
-  if (!aDecodedSamples) {
-    MOZ_CRASH("Not given decoded audio samples!");
-  }
-
-  GMPAudioDecodedSampleData samples;
-  samples.mData().AppendElements((int16_t*)aDecodedSamples->Buffer(),
-                                 aDecodedSamples->Size() / sizeof(int16_t));
-  samples.mTimeStamp() = aDecodedSamples->TimeStamp();
-  samples.mChannelCount() = aDecodedSamples->Channels();
-  samples.mSamplesPerSecond() = aDecodedSamples->Rate();
-
-  Unused << SendDecoded(samples);
-
-  aDecodedSamples->Destroy();
-}
-
-void
-GMPAudioDecoderChild::InputDataExhausted()
-{
-  MOZ_ASSERT(mPlugin->GMPMessageLoop() == MessageLoop::current());
-
-  Unused << SendInputDataExhausted();
-}
-
-void
-GMPAudioDecoderChild::DrainComplete()
-{
-  MOZ_ASSERT(mPlugin->GMPMessageLoop() == MessageLoop::current());
-
-  Unused << SendDrainComplete();
-}
-
-void
-GMPAudioDecoderChild::ResetComplete()
-{
-  MOZ_ASSERT(mPlugin->GMPMessageLoop() == MessageLoop::current());
-
-  Unused << SendResetComplete();
-}
-
-void
-GMPAudioDecoderChild::Error(GMPErr aError)
-{
-  MOZ_ASSERT(mPlugin->GMPMessageLoop() == MessageLoop::current());
-
-  Unused << SendError(aError);
-}
-
-mozilla::ipc::IPCResult
-GMPAudioDecoderChild::RecvInitDecode(const GMPAudioCodecData& a)
-{
-  MOZ_ASSERT(mAudioDecoder);
-  if (!mAudioDecoder) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-
-  GMPAudioCodec codec;
-  codec.mCodecType = a.mCodecType();
-  codec.mChannelCount = a.mChannelCount();
-  codec.mBitsPerChannel = a.mBitsPerChannel();
-  codec.mSamplesPerSecond = a.mSamplesPerSecond();
-  codec.mExtraData = a.mExtraData().Elements();
-  codec.mExtraDataLen = a.mExtraData().Length();
-
-  // Ignore any return code. It is OK for this to fail without killing the process.
-  mAudioDecoder->InitDecode(codec, this);
-
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
-GMPAudioDecoderChild::RecvDecode(const GMPAudioEncodedSampleData& aEncodedSamples)
-{
-  if (!mAudioDecoder) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-
-  GMPAudioSamples* samples = new GMPAudioSamplesImpl(aEncodedSamples);
-
-  // Ignore any return code. It is OK for this to fail without killing the process.
-  mAudioDecoder->Decode(samples);
-
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
-GMPAudioDecoderChild::RecvReset()
-{
-  if (!mAudioDecoder) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-
-  // Ignore any return code. It is OK for this to fail without killing the process.
-  mAudioDecoder->Reset();
-
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
-GMPAudioDecoderChild::RecvDrain()
-{
-  if (!mAudioDecoder) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-
-  // Ignore any return code. It is OK for this to fail without killing the process.
-  mAudioDecoder->Drain();
-
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
-GMPAudioDecoderChild::RecvDecodingComplete()
-{
-  if (mAudioDecoder) {
-    // Ignore any return code. It is OK for this to fail without killing the process.
-    mAudioDecoder->DecodingComplete();
-    mAudioDecoder = nullptr;
-  }
-
-  mPlugin = nullptr;
-
-  Unused << Send__delete__(this);
-
-  return IPC_OK();
-}
-
-} // namespace gmp
-} // namespace mozilla
deleted file mode 100644
--- a/dom/media/gmp/GMPAudioDecoderChild.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef GMPAudioDecoderChild_h_
-#define GMPAudioDecoderChild_h_
-
-#include "mozilla/gmp/PGMPAudioDecoderChild.h"
-#include "gmp-audio-decode.h"
-#include "GMPAudioHost.h"
-
-namespace mozilla {
-namespace gmp {
-
-class GMPContentChild;
-
-class GMPAudioDecoderChild : public PGMPAudioDecoderChild,
-                             public GMPAudioDecoderCallback
-{
-public:
-  explicit GMPAudioDecoderChild(GMPContentChild* aPlugin);
-  virtual ~GMPAudioDecoderChild();
-
-  void Init(GMPAudioDecoder* aDecoder);
-  GMPAudioHostImpl& Host();
-
-  // GMPAudioDecoderCallback
-  void Decoded(GMPAudioSamples* aEncodedSamples) override;
-  void InputDataExhausted() override;
-  void DrainComplete() override;
-  void ResetComplete() override;
-  void Error(GMPErr aError) override;
-
-private:
-  // PGMPAudioDecoderChild
-  mozilla::ipc::IPCResult RecvInitDecode(const GMPAudioCodecData& codecSettings) override;
-  mozilla::ipc::IPCResult RecvDecode(const GMPAudioEncodedSampleData& input) override;
-  mozilla::ipc::IPCResult RecvReset() override;
-  mozilla::ipc::IPCResult RecvDrain() override;
-  mozilla::ipc::IPCResult RecvDecodingComplete() override;
-
-  GMPContentChild* mPlugin;
-  GMPAudioDecoder* mAudioDecoder;
-  GMPAudioHostImpl mAudioHost;
-};
-
-} // namespace gmp
-} // namespace mozilla
-
-#endif // GMPAudioDecoderChild_h_
deleted file mode 100644
--- a/dom/media/gmp/GMPAudioDecoderParent.cpp
+++ /dev/null
@@ -1,369 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "GMPAudioDecoderParent.h"
-#include "GMPContentParent.h"
-#include <stdio.h>
-#include "mozilla/Unused.h"
-#include "GMPMessageUtils.h"
-#include "nsThreadUtils.h"
-#include "mozilla/Logging.h"
-
-namespace mozilla {
-
-#ifdef LOG
-#undef LOG
-#endif
-
-extern LogModule* GetGMPLog();
-
-#define LOGV(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Verbose, msg)
-#define LOGD(msg) MOZ_LOG(GetGMPLog(), mozilla::LogLevel::Debug, msg)
-#define LOG(level, msg) MOZ_LOG(GetGMPLog(), (level), msg)
-
-namespace gmp {
-
-GMPAudioDecoderParent::GMPAudioDecoderParent(GMPContentParent* aPlugin)
-  : mIsOpen(false)
-  , mShuttingDown(false)
-  , mActorDestroyed(false)
-  , mIsAwaitingResetComplete(false)
-  , mIsAwaitingDrainComplete(false)
-  , mPlugin(aPlugin)
-  , mCallback(nullptr)
-{
-  MOZ_ASSERT(mPlugin);
-}
-
-GMPAudioDecoderParent::~GMPAudioDecoderParent()
-{
-}
-
-nsresult
-GMPAudioDecoderParent::InitDecode(GMPAudioCodecType aCodecType,
-                                  uint32_t aChannelCount,
-                                  uint32_t aBitsPerChannel,
-                                  uint32_t aSamplesPerSecond,
-                                  nsTArray<uint8_t>& aExtraData,
-                                  GMPAudioDecoderCallbackProxy* aCallback)
-{
-  LOGD(("GMPAudioDecoderParent[%p]::InitDecode()", this));
-
-  if (mIsOpen) {
-    NS_WARNING("Trying to re-init an in-use GMP audio decoder!");
-    return NS_ERROR_FAILURE;
-  }
-
-  MOZ_ASSERT(mPlugin->GMPThread() == NS_GetCurrentThread());
-
-  if (!aCallback) {
-    return NS_ERROR_FAILURE;
-  }
-  mCallback = aCallback;
-
-  GMPAudioCodecData data;
-  data.mCodecType() = aCodecType;
-  data.mChannelCount() = aChannelCount;
-  data.mBitsPerChannel() = aBitsPerChannel;
-  data.mSamplesPerSecond() = aSamplesPerSecond;
-  data.mExtraData() = aExtraData;
-  if (!SendInitDecode(data)) {
-    return NS_ERROR_FAILURE;
-  }
-  mIsOpen = true;
-
-  // Async IPC, we don't have access to a return value.
-  return NS_OK;
-}
-
-nsresult
-GMPAudioDecoderParent::Decode(GMPAudioSamplesImpl& aEncodedSamples)
-{
-  LOGV(("GMPAudioDecoderParent[%p]::Decode() timestamp=%lld",
-        this, aEncodedSamples.TimeStamp()));
-
-  if (!mIsOpen) {
-    NS_WARNING("Trying to use a dead GMP Audio decoder!");
-    return NS_ERROR_FAILURE;
-  }
-
-  MOZ_ASSERT(mPlugin->GMPThread() == NS_GetCurrentThread());
-
-  GMPAudioEncodedSampleData samples;
-  aEncodedSamples.RelinquishData(samples);
-
-  if (!SendDecode(samples)) {
-    return NS_ERROR_FAILURE;
-  }
-
-  // Async IPC, we don't have access to a return value.
-  return NS_OK;
-}
-
-nsresult
-GMPAudioDecoderParent::Reset()
-{
-  LOGD(("GMPAudioDecoderParent[%p]::Reset()", this));
-
-  if (!mIsOpen) {
-    NS_WARNING("Trying to use a dead GMP Audio decoder!");
-    return NS_ERROR_FAILURE;
-  }
-
-  MOZ_ASSERT(mPlugin->GMPThread() == NS_GetCurrentThread());
-
-  if (!SendReset()) {
-    return NS_ERROR_FAILURE;
-  }
-
-  mIsAwaitingResetComplete = true;
-
-  // Async IPC, we don't have access to a return value.
-  return NS_OK;
-}
-
-nsresult
-GMPAudioDecoderParent::Drain()
-{
-  LOGD(("GMPAudioDecoderParent[%p]::Drain()", this));
-
-  if (!mIsOpen) {
-    NS_WARNING("Trying to use a dead GMP Audio decoder!");
-    return NS_ERROR_FAILURE;
-  }
-
-  MOZ_ASSERT(mPlugin->GMPThread() == NS_GetCurrentThread());
-
-  if (!SendDrain()) {
-    return NS_ERROR_FAILURE;
-  }
-
-  mIsAwaitingDrainComplete = true;
-
-  // Async IPC, we don't have access to a return value.
-  return NS_OK;
-}
-
-// Note: Consider keeping ActorDestroy sync'd up when making changes here.
-nsresult
-GMPAudioDecoderParent::Close()
-{
-  LOGD(("GMPAudioDecoderParent[%p]::Close()", this));
-  MOZ_ASSERT(!mPlugin || mPlugin->GMPThread() == NS_GetCurrentThread());
-
-  // Ensure if we've received a Close while waiting for a ResetComplete
-  // or DrainComplete notification, we'll unblock the caller before processing
-  // the close. This seems unlikely to happen, but better to be careful.
-  UnblockResetAndDrain();
-
-  // Consumer is done with us; we can shut down.  No more callbacks should
-  // be made to mCallback.  Note: do this before Shutdown()!
-  mCallback = nullptr;
-  // Let Shutdown mark us as dead so it knows if we had been alive
-
-  // In case this is the last reference
-  RefPtr<GMPAudioDecoderParent> kungfudeathgrip(this);
-  Release();
-  Shutdown();
-
-  return NS_OK;
-}
-
-// Note: Consider keeping ActorDestroy sync'd up when making changes here.
-nsresult
-GMPAudioDecoderParent::Shutdown()
-{
-  LOGD(("GMPAudioDecoderParent[%p]::Shutdown()", this));
-  MOZ_ASSERT(!mPlugin || mPlugin->GMPThread() == NS_GetCurrentThread());
-
-  if (mShuttingDown) {
-    return NS_OK;
-  }
-  mShuttingDown = true;
-
-  // Ensure if we've received a shutdown while waiting for a ResetComplete
-  // or DrainComplete notification, we'll unblock the caller before processing
-  // the shutdown.
-  UnblockResetAndDrain();
-
-  // Notify client we're gone!  Won't occur after Close()
-  if (mCallback) {
-    mCallback->Terminated();
-    mCallback = nullptr;
-  }
-
-  mIsOpen = false;
-  if (!mActorDestroyed) {
-    Unused << SendDecodingComplete();
-  }
-
-  return NS_OK;
-}
-
-// Note: Keep this sync'd up with DecodingComplete
-void
-GMPAudioDecoderParent::ActorDestroy(ActorDestroyReason aWhy)
-{
-  LOGD(("GMPAudioDecoderParent[%p]::ActorDestroy(reason=%d)", this, aWhy));
-
-  mIsOpen = false;
-  mActorDestroyed = true;
-
-  // Ensure if we've received a destroy while waiting for a ResetComplete
-  // or DrainComplete notification, we'll unblock the caller before processing
-  // the error.
-  UnblockResetAndDrain();
-
-  if (mCallback) {
-    // May call Close() (and Shutdown()) immediately or with a delay
-    mCallback->Terminated();
-    mCallback = nullptr;
-  }
-  if (mPlugin) {
-    // Ignore any return code. It is OK for this to fail without killing the process.
-    mPlugin->AudioDecoderDestroyed(this);
-    mPlugin = nullptr;
-  }
-  MaybeDisconnect(aWhy == AbnormalShutdown);
-}
-
-mozilla::ipc::IPCResult
-GMPAudioDecoderParent::RecvDecoded(const GMPAudioDecodedSampleData& aDecoded)
-{
-  LOGV(("GMPAudioDecoderParent[%p]::RecvDecoded() timestamp=%lld",
-        this, aDecoded.mTimeStamp()));
-
-  if (!mCallback) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-
-  mCallback->Decoded(aDecoded.mData(),
-                     aDecoded.mTimeStamp(),
-                     aDecoded.mChannelCount(),
-                     aDecoded.mSamplesPerSecond());
-
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
-GMPAudioDecoderParent::RecvInputDataExhausted()
-{
-  LOGV(("GMPAudioDecoderParent[%p]::RecvInputDataExhausted()", this));
-
-  if (!mCallback) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-
-  // Ignore any return code. It is OK for this to fail without killing the process.
-  mCallback->InputDataExhausted();
-
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
-GMPAudioDecoderParent::RecvDrainComplete()
-{
-  LOGD(("GMPAudioDecoderParent[%p]::RecvDrainComplete()", this));
-
-  if (!mCallback) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-
-  if (!mIsAwaitingDrainComplete) {
-    return IPC_OK();
-  }
-  mIsAwaitingDrainComplete = false;
-
-  // Ignore any return code. It is OK for this to fail without killing the process.
-  mCallback->DrainComplete();
-
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
-GMPAudioDecoderParent::RecvResetComplete()
-{
-  LOGD(("GMPAudioDecoderParent[%p]::RecvResetComplete()", this));
-
-  if (!mCallback) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-
-  if (!mIsAwaitingResetComplete) {
-    return IPC_OK();
-  }
-  mIsAwaitingResetComplete = false;
-
-  // Ignore any return code. It is OK for this to fail without killing the process.
-  mCallback->ResetComplete();
-
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
-GMPAudioDecoderParent::RecvError(const GMPErr& aError)
-{
-  LOGD(("GMPAudioDecoderParent[%p]::RecvError(error=%d)", this, aError));
-
-  if (!mCallback) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-
-  // Ensure if we've received an error while waiting for a ResetComplete
-  // or DrainComplete notification, we'll unblock the caller before processing
-  // the error.
-  UnblockResetAndDrain();
-
-  // Ignore any return code. It is OK for this to fail without killing the process.
-  mCallback->Error(aError);
-
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
-GMPAudioDecoderParent::RecvShutdown()
-{
-  LOGD(("GMPAudioDecoderParent[%p]::RecvShutdown()", this));
-
-  Shutdown();
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
-GMPAudioDecoderParent::Recv__delete__()
-{
-  LOGD(("GMPAudioDecoderParent[%p]::Recv__delete__()", this));
-
-  if (mPlugin) {
-    // Ignore any return code. It is OK for this to fail without killing the process.
-    mPlugin->AudioDecoderDestroyed(this);
-    mPlugin = nullptr;
-  }
-
-  return IPC_OK();
-}
-
-void
-GMPAudioDecoderParent::UnblockResetAndDrain()
-{
-  LOGD(("GMPAudioDecoderParent[%p]::UnblockResetAndDrain()", this));
-
-  if (!mCallback) {
-    MOZ_ASSERT(!mIsAwaitingResetComplete);
-    MOZ_ASSERT(!mIsAwaitingDrainComplete);
-    return;
-  }
-  if (mIsAwaitingResetComplete) {
-    mIsAwaitingResetComplete = false;
-    mCallback->ResetComplete();
-  }
-  if (mIsAwaitingDrainComplete) {
-    mIsAwaitingDrainComplete = false;
-    mCallback->DrainComplete();
-  }
-}
-
-} // namespace gmp
-} // namespace mozilla
deleted file mode 100644
--- a/dom/media/gmp/GMPAudioDecoderParent.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef GMPAudioDecoderParent_h_
-#define GMPAudioDecoderParent_h_
-
-#include "mozilla/RefPtr.h"
-#include "gmp-audio-decode.h"
-#include "gmp-audio-codec.h"
-#include "mozilla/gmp/PGMPAudioDecoderParent.h"
-#include "GMPMessageUtils.h"
-#include "GMPAudioDecoderProxy.h"
-#include "GMPCrashHelperHolder.h"
-
-namespace mozilla {
-namespace gmp {
-
-class GMPContentParent;
-
-class GMPAudioDecoderParent final : public GMPAudioDecoderProxy
-                                  , public PGMPAudioDecoderParent
-                                  , public GMPCrashHelperHolder
-{
-public:
-  NS_INLINE_DECL_REFCOUNTING(GMPAudioDecoderParent)
-
-  explicit GMPAudioDecoderParent(GMPContentParent *aPlugin);
-
-  nsresult Shutdown();
-
-  // GMPAudioDecoderProxy
-  nsresult InitDecode(GMPAudioCodecType aCodecType,
-                      uint32_t aChannelCount,
-                      uint32_t aBitsPerChannel,
-                      uint32_t aSamplesPerSecond,
-                      nsTArray<uint8_t>& aExtraData,
-                      GMPAudioDecoderCallbackProxy* aCallback) override;
-  nsresult Decode(GMPAudioSamplesImpl& aInput) override;
-  nsresult Reset() override;
-  nsresult Drain() override;
-  nsresult Close() override;
-
-private:
-  ~GMPAudioDecoderParent();
-
-  // PGMPAudioDecoderParent
-  void ActorDestroy(ActorDestroyReason aWhy) override;
-  mozilla::ipc::IPCResult RecvDecoded(const GMPAudioDecodedSampleData& aDecoded) override;
-  mozilla::ipc::IPCResult RecvInputDataExhausted() override;
-  mozilla::ipc::IPCResult RecvDrainComplete() override;
-  mozilla::ipc::IPCResult RecvResetComplete() override;
-  mozilla::ipc::IPCResult RecvError(const GMPErr& aError) override;
-  mozilla::ipc::IPCResult RecvShutdown() override;
-  mozilla::ipc::IPCResult Recv__delete__() override;
-
-  void UnblockResetAndDrain();
-
-  bool mIsOpen;
-  bool mShuttingDown;
-  bool mActorDestroyed;
-  bool mIsAwaitingResetComplete;
-  bool mIsAwaitingDrainComplete;
-  RefPtr<GMPContentParent> mPlugin;
-  GMPAudioDecoderCallbackProxy* mCallback;
-};
-
-} // namespace gmp
-} // namespace mozilla
-
-#endif // GMPAudioDecoderParent_h_
deleted file mode 100644
--- a/dom/media/gmp/GMPAudioDecoderProxy.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef GMPAudioDecoderProxy_h_
-#define GMPAudioDecoderProxy_h_
-
-#include "GMPCallbackBase.h"
-#include "gmp-audio-codec.h"
-#include "GMPAudioHost.h"
-#include "nsTArray.h"
-#include "mozilla/gmp/GMPTypes.h"
-
-class GMPAudioDecoderCallbackProxy : public GMPCallbackBase {
-public:
-  virtual ~GMPAudioDecoderCallbackProxy() {}
-  // Note: aChannelCount and aSamplesPerSecond may not be consistent from
-  // one invocation to the next.
-  virtual void Decoded(const nsTArray<int16_t>& aPCM,
-                       uint64_t aTimeStamp,
-                       uint32_t aChannelCount,
-                       uint32_t aSamplesPerSecond) = 0;
-  virtual void InputDataExhausted() = 0;
-  virtual void DrainComplete() = 0;
-  virtual void ResetComplete() = 0;
-  virtual void Error(GMPErr aError) = 0;
-};
-
-class GMPAudioDecoderProxy {
-public:
-  virtual ~GMPAudioDecoderProxy() {}
-
-  virtual nsresult InitDecode(GMPAudioCodecType aCodecType,
-                              uint32_t aChannelCount,
-                              uint32_t aBitsPerChannel,
-                              uint32_t aSamplesPerSecond,
-                              nsTArray<uint8_t>& aExtraData,
-                              GMPAudioDecoderCallbackProxy* aCallback) = 0;
-  virtual nsresult Decode(mozilla::gmp::GMPAudioSamplesImpl& aSamples) = 0;
-  virtual nsresult Reset() = 0;
-  virtual nsresult Drain() = 0;
-  // Call to tell GMP/plugin the consumer will no longer use this
-  // interface/codec.
-  virtual nsresult Close() = 0;
-};
-
-#endif // GMPAudioDecoderProxy_h_
deleted file mode 100644
--- a/dom/media/gmp/GMPAudioHost.cpp
+++ /dev/null
@@ -1,162 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "GMPAudioHost.h"
-#include "gmp-audio-samples.h"
-#include "gmp-errors.h"
-#include "GMPEncryptedBufferDataImpl.h"
-#include "MediaData.h"
-
-namespace mozilla {
-namespace gmp {
-
-GMPAudioSamplesImpl::GMPAudioSamplesImpl(GMPAudioFormat aFormat)
-  : mFormat(aFormat)
-  , mTimeStamp(0)
-  , mChannels(0)
-  , mRate(0)
-{
-}
-
-GMPAudioSamplesImpl::GMPAudioSamplesImpl(const GMPAudioEncodedSampleData& aData)
-  : mFormat(kGMPAudioEncodedSamples)
-  , mBuffer(aData.mData())
-  , mTimeStamp(aData.mTimeStamp())
-  , mChannels(aData.mChannelCount())
-  , mRate(aData.mSamplesPerSecond())
-{
-  if (aData.mDecryptionData().mKeyId().Length() > 0) {
-    mCrypto = new GMPEncryptedBufferDataImpl(aData.mDecryptionData());
-  }
-}
-
-GMPAudioSamplesImpl::GMPAudioSamplesImpl(MediaRawData* aSample,
-                                         uint32_t aChannels,
-                                         uint32_t aRate)
- : mFormat(kGMPAudioEncodedSamples)
- , mTimeStamp(aSample->mTime)
- , mChannels(aChannels)
- , mRate(aRate)
-{
-  mBuffer.AppendElements(aSample->Data(), aSample->Size());
-  if (aSample->mCrypto.mValid) {
-    mCrypto = new GMPEncryptedBufferDataImpl(aSample->mCrypto);
-  }
-}
-
-GMPAudioSamplesImpl::~GMPAudioSamplesImpl()
-{
-}
-
-GMPAudioFormat
-GMPAudioSamplesImpl::GetFormat()
-{
-  return mFormat;
-}
-
-void
-GMPAudioSamplesImpl::Destroy()
-{
-  delete this;
-}
-
-GMPErr
-GMPAudioSamplesImpl::SetBufferSize(uint32_t aSize)
-{
-  mBuffer.SetLength(aSize);
-  return GMPNoErr;
-}
-
-uint32_t
-GMPAudioSamplesImpl::Size()
-{
-  return mBuffer.Length();
-}
-
-void
-GMPAudioSamplesImpl::SetTimeStamp(uint64_t aTimeStamp)
-{
-  mTimeStamp = aTimeStamp;
-}
-
-uint64_t
-GMPAudioSamplesImpl::TimeStamp()
-{
-  return mTimeStamp;
-}
-
-const uint8_t*
-GMPAudioSamplesImpl::Buffer() const
-{
-  return mBuffer.Elements();
-}
-
-uint8_t*
-GMPAudioSamplesImpl::Buffer()
-{
-  return mBuffer.Elements();
-}
-
-const GMPEncryptedBufferMetadata*
-GMPAudioSamplesImpl::GetDecryptionData() const
-{
-  return mCrypto;
-}
-
-void
-GMPAudioSamplesImpl::InitCrypto(const CryptoSample& aCrypto)
-{
-  if (!aCrypto.mValid) {
-    return;
-  }
-  mCrypto = new GMPEncryptedBufferDataImpl(aCrypto);
-}
-
-void
-GMPAudioSamplesImpl::RelinquishData(GMPAudioEncodedSampleData& aData)
-{
-  aData.mData() = Move(mBuffer);
-  aData.mTimeStamp() = TimeStamp();
-  if (mCrypto) {
-    mCrypto->RelinquishData(aData.mDecryptionData());
-  }
-}
-
-uint32_t
-GMPAudioSamplesImpl::Channels() const
-{
-  return mChannels;
-}
-
-void
-GMPAudioSamplesImpl::SetChannels(uint32_t aChannels)
-{
-  mChannels = aChannels;
-}
-
-uint32_t
-GMPAudioSamplesImpl::Rate() const
-{
-  return mRate;
-}
-
-void
-GMPAudioSamplesImpl::SetRate(uint32_t aRate)
-{
-  mRate = aRate;
-}
-
-
-GMPErr
-GMPAudioHostImpl::CreateSamples(GMPAudioFormat aFormat,
-                                GMPAudioSamples** aSamples)
-{
-
-  *aSamples = new GMPAudioSamplesImpl(aFormat);
-  return GMPNoErr;
-}
-
-} // namespace gmp
-} // namespace mozilla
deleted file mode 100644
--- a/dom/media/gmp/GMPAudioHost.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef GMPAudioHost_h_
-#define GMPAudioHost_h_
-
-#include "gmp-audio-host.h"
-#include "gmp-audio-samples.h"
-#include "nsTArray.h"
-#include "gmp-decryption.h"
-#include "nsAutoPtr.h"
-#include "GMPEncryptedBufferDataImpl.h"
-#include "mozilla/gmp/GMPTypes.h"
-
-namespace mozilla {
-class CryptoSample;
-class MediaRawData;
-
-namespace gmp {
-
-class GMPAudioSamplesImpl : public GMPAudioSamples {
-public:
-  explicit GMPAudioSamplesImpl(GMPAudioFormat aFormat);
-  explicit GMPAudioSamplesImpl(const GMPAudioEncodedSampleData& aData);
-  GMPAudioSamplesImpl(MediaRawData* aSample,
-                      uint32_t aChannels,
-                      uint32_t aRate);
-  virtual ~GMPAudioSamplesImpl();
-
-  GMPAudioFormat GetFormat() override;
-  void Destroy() override;
-  GMPErr SetBufferSize(uint32_t aSize) override;
-  uint32_t Size() override;
-  void SetTimeStamp(uint64_t aTimeStamp) override;
-  uint64_t TimeStamp() override;
-  const uint8_t* Buffer() const override;
-  uint8_t* Buffer() override;
-  const GMPEncryptedBufferMetadata* GetDecryptionData() const override;
-
-  void InitCrypto(const CryptoSample& aCrypto);
-
-  void RelinquishData(GMPAudioEncodedSampleData& aData);
-
-  uint32_t Channels() const override;
-  void SetChannels(uint32_t aChannels) override;
-  uint32_t Rate() const override;
-  void SetRate(uint32_t aRate) override;
-
-private:
-  GMPAudioFormat mFormat;
-  nsTArray<uint8_t> mBuffer;
-  int64_t mTimeStamp;
-  nsAutoPtr<GMPEncryptedBufferDataImpl> mCrypto;
-  uint32_t mChannels;
-  uint32_t mRate;
-};
-
-class GMPAudioHostImpl : public GMPAudioHost
-{
-public:
-  GMPErr CreateSamples(GMPAudioFormat aFormat,
-                       GMPAudioSamples** aSamples) override;
-private:
-};
-
-} // namespace gmp
-} // namespace mozilla
-
-#endif // GMPAudioHost_h_
--- a/dom/media/gmp/GMPChild.cpp
+++ b/dom/media/gmp/GMPChild.cpp
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "GMPChild.h"
 #include "GMPContentChild.h"
 #include "GMPProcessChild.h"
 #include "GMPLoader.h"
 #include "GMPVideoDecoderChild.h"
 #include "GMPVideoEncoderChild.h"
-#include "GMPAudioDecoderChild.h"
 #include "GMPDecryptorChild.h"
 #include "GMPVideoHost.h"
 #include "nsDebugImpl.h"
 #include "nsIFile.h"
 #include "nsXULAppAPI.h"
 #include "gmp-video-decode.h"
 #include "gmp-video-encode.h"
 #include "GMPPlatform.h"
--- a/dom/media/gmp/GMPContentChild.cpp
+++ b/dom/media/gmp/GMPContentChild.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "GMPContentChild.h"
 #include "GMPChild.h"
-#include "GMPAudioDecoderChild.h"
 #include "GMPDecryptorChild.h"
 #include "GMPVideoDecoderChild.h"
 #include "GMPVideoEncoderChild.h"
 #include "base/task.h"
 
 namespace mozilla {
 namespace gmp {
 
@@ -44,29 +43,16 @@ GMPContentChild::ActorDestroy(ActorDestr
 }
 
 void
 GMPContentChild::ProcessingError(Result aCode, const char* aReason)
 {
   mGMPChild->ProcessingError(aCode, aReason);
 }
 
-PGMPAudioDecoderChild*
-GMPContentChild::AllocPGMPAudioDecoderChild()
-{
-  return new GMPAudioDecoderChild(this);
-}
-
-bool
-GMPContentChild::DeallocPGMPAudioDecoderChild(PGMPAudioDecoderChild* aActor)
-{
-  delete aActor;
-  return true;
-}
-
 PGMPDecryptorChild*
 GMPContentChild::AllocPGMPDecryptorChild()
 {
   GMPDecryptorChild* actor = new GMPDecryptorChild(this,
                                                    mGMPChild->mPluginVoucher,
                                                    mGMPChild->mSandboxVoucher);
   actor->AddRef();
   return actor;
@@ -104,146 +90,29 @@ GMPContentChild::AllocPGMPVideoEncoderCh
 
 bool
 GMPContentChild::DeallocPGMPVideoEncoderChild(PGMPVideoEncoderChild* aActor)
 {
   static_cast<GMPVideoEncoderChild*>(aActor)->Release();
   return true;
 }
 
-// Adapts GMPDecryptor7 to the current GMPDecryptor version.
-class GMPDecryptor7BackwardsCompat : public GMPDecryptor {
-public:
-  explicit GMPDecryptor7BackwardsCompat(GMPDecryptor7* aDecryptorV7)
-    : mDecryptorV7(aDecryptorV7)
-  {
-  }
-
-  void Init(GMPDecryptorCallback* aCallback,
-            bool aDistinctiveIdentifierRequired,
-            bool aPersistentStateRequired) override
-  {
-    // Distinctive identifier and persistent state arguments not present
-    // in v7 interface.
-    mDecryptorV7->Init(aCallback);
-  }
-
-  void CreateSession(uint32_t aCreateSessionToken,
-                     uint32_t aPromiseId,
-                     const char* aInitDataType,
-                     uint32_t aInitDataTypeSize,
-                     const uint8_t* aInitData,
-                     uint32_t aInitDataSize,
-                     GMPSessionType aSessionType) override
-  {
-    mDecryptorV7->CreateSession(aCreateSessionToken,
-                                aPromiseId,
-                                aInitDataType,
-                                aInitDataTypeSize,
-                                aInitData,
-                                aInitDataSize,
-                                aSessionType);
-  }
-
-  void LoadSession(uint32_t aPromiseId,
-                   const char* aSessionId,
-                   uint32_t aSessionIdLength) override
-  {
-    mDecryptorV7->LoadSession(aPromiseId, aSessionId, aSessionIdLength);
-  }
-
-  void UpdateSession(uint32_t aPromiseId,
-                     const char* aSessionId,
-                     uint32_t aSessionIdLength,
-                     const uint8_t* aResponse,
-                     uint32_t aResponseSize) override
-  {
-    mDecryptorV7->UpdateSession(aPromiseId,
-                                aSessionId,
-                                aSessionIdLength,
-                                aResponse,
-                                aResponseSize);
-  }
-
-  void CloseSession(uint32_t aPromiseId,
-                    const char* aSessionId,
-                    uint32_t aSessionIdLength) override
-  {
-    mDecryptorV7->CloseSession(aPromiseId, aSessionId, aSessionIdLength);
-  }
-
-  void RemoveSession(uint32_t aPromiseId,
-                     const char* aSessionId,
-                     uint32_t aSessionIdLength) override
-  {
-    mDecryptorV7->RemoveSession(aPromiseId, aSessionId, aSessionIdLength);
-  }
-
-  void SetServerCertificate(uint32_t aPromiseId,
-                            const uint8_t* aServerCert,
-                            uint32_t aServerCertSize) override
-  {
-    mDecryptorV7->SetServerCertificate(aPromiseId, aServerCert, aServerCertSize);
-  }
-
-  void Decrypt(GMPBuffer* aBuffer,
-               GMPEncryptedBufferMetadata* aMetadata) override
-  {
-    mDecryptorV7->Decrypt(aBuffer, aMetadata);
-  }
-
-  void DecryptingComplete() override
-  {
-    mDecryptorV7->DecryptingComplete();
-    delete this;
-  }
-private:
-  GMPDecryptor7* mDecryptorV7;
-};
-
 mozilla::ipc::IPCResult
 GMPContentChild::RecvPGMPDecryptorConstructor(PGMPDecryptorChild* aActor)
 {
   GMPDecryptorChild* child = static_cast<GMPDecryptorChild*>(aActor);
   GMPDecryptorHost* host = static_cast<GMPDecryptorHost*>(child);
 
   void* ptr = nullptr;
   GMPErr err = mGMPChild->GetAPI(GMP_API_DECRYPTOR, host, &ptr, aActor->Id());
-  GMPDecryptor* decryptor = nullptr;
-  if (GMP_SUCCEEDED(err) && ptr) {
-    decryptor = static_cast<GMPDecryptor*>(ptr);
-  } else if (err != GMPNoErr) {
-    // We Adapt the previous GMPDecryptor version to the current, so that
-    // Gecko thinks it's only talking to the current version. v7 differs
-    // from v9 in its Init() function arguments, and v9 has extra enumeration
-    // members at the end of the key status enumerations.
-    err = mGMPChild->GetAPI(GMP_API_DECRYPTOR_BACKWARDS_COMPAT, host, &ptr);
-    if (err != GMPNoErr || !ptr) {
-      return IPC_FAIL_NO_REASON(this);
-    }
-    decryptor = new GMPDecryptor7BackwardsCompat(static_cast<GMPDecryptor7*>(ptr));
-  }
-
-  child->Init(decryptor);
-
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
-GMPContentChild::RecvPGMPAudioDecoderConstructor(PGMPAudioDecoderChild* aActor)
-{
-  auto vdc = static_cast<GMPAudioDecoderChild*>(aActor);
-
-  void* vd = nullptr;
-  GMPErr err = mGMPChild->GetAPI(GMP_API_AUDIO_DECODER, &vdc->Host(), &vd);
-  if (err != GMPNoErr || !vd) {
+  if (err != GMPNoErr || !ptr) {
+    NS_WARNING("GMPGetAPI call failed trying to construct decryptor.");
     return IPC_FAIL_NO_REASON(this);
   }
-
-  vdc->Init(static_cast<GMPAudioDecoder*>(vd));
+  child->Init(static_cast<GMPDecryptor*>(ptr));
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 GMPContentChild::RecvPGMPVideoDecoderConstructor(PGMPVideoDecoderChild* aActor,
                                                  const uint32_t& aDecryptorId)
 {
@@ -277,22 +146,16 @@ GMPContentChild::RecvPGMPVideoEncoderCon
 
   return IPC_OK();
 }
 
 void
 GMPContentChild::CloseActive()
 {
   // Invalidate and remove any remaining API objects.
-  const ManagedContainer<PGMPAudioDecoderChild>& audioDecoders =
-    ManagedPGMPAudioDecoderChild();
-  for (auto iter = audioDecoders.ConstIter(); !iter.Done(); iter.Next()) {
-    iter.Get()->GetKey()->SendShutdown();
-  }
-
   const ManagedContainer<PGMPDecryptorChild>& decryptors =
     ManagedPGMPDecryptorChild();
   for (auto iter = decryptors.ConstIter(); !iter.Done(); iter.Next()) {
     iter.Get()->GetKey()->SendShutdown();
   }
 
   const ManagedContainer<PGMPVideoDecoderChild>& videoDecoders =
     ManagedPGMPVideoDecoderChild();
@@ -305,16 +168,15 @@ GMPContentChild::CloseActive()
   for (auto iter = videoEncoders.ConstIter(); !iter.Done(); iter.Next()) {
     iter.Get()->GetKey()->SendShutdown();
   }
 }
 
 bool
 GMPContentChild::IsUsed()
 {
-  return !ManagedPGMPAudioDecoderChild().IsEmpty() ||
-         !ManagedPGMPDecryptorChild().IsEmpty() ||
+  return !ManagedPGMPDecryptorChild().IsEmpty() ||
          !ManagedPGMPVideoDecoderChild().IsEmpty() ||
          !ManagedPGMPVideoEncoderChild().IsEmpty();
 }
 
 } // namespace gmp
 } // namespace mozilla
--- a/dom/media/gmp/GMPContentChild.h
+++ b/dom/media/gmp/GMPContentChild.h
@@ -18,24 +18,20 @@ class GMPContentChild : public PGMPConte
                       , public GMPSharedMem
 {
 public:
   explicit GMPContentChild(GMPChild* aChild);
   virtual ~GMPContentChild();
 
   MessageLoop* GMPMessageLoop();
 
-  mozilla::ipc::IPCResult RecvPGMPAudioDecoderConstructor(PGMPAudioDecoderChild* aActor) override;
   mozilla::ipc::IPCResult RecvPGMPDecryptorConstructor(PGMPDecryptorChild* aActor) override;
   mozilla::ipc::IPCResult RecvPGMPVideoDecoderConstructor(PGMPVideoDecoderChild* aActor, const uint32_t& aDecryptorId) override;
   mozilla::ipc::IPCResult RecvPGMPVideoEncoderConstructor(PGMPVideoEncoderChild* aActor) override;
 
-  PGMPAudioDecoderChild* AllocPGMPAudioDecoderChild() override;
-  bool DeallocPGMPAudioDecoderChild(PGMPAudioDecoderChild* aActor) override;
-
   PGMPDecryptorChild* AllocPGMPDecryptorChild() override;
   bool DeallocPGMPDecryptorChild(PGMPDecryptorChild* aActor) override;
 
   PGMPVideoDecoderChild* AllocPGMPVideoDecoderChild(const uint32_t& aDecryptorId) override;
   bool DeallocPGMPVideoDecoderChild(PGMPVideoDecoderChild* aActor) override;
 
   PGMPVideoEncoderChild* AllocPGMPVideoEncoderChild() override;
   bool DeallocPGMPVideoEncoderChild(PGMPVideoEncoderChild* aActor) override;
--- a/dom/media/gmp/GMPContentParent.cpp
+++ b/dom/media/gmp/GMPContentParent.cpp
@@ -1,15 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "GMPContentParent.h"
-#include "GMPAudioDecoderParent.h"
 #include "GMPDecryptorParent.h"
 #include "GMPParent.h"
 #include "GMPServiceChild.h"
 #include "GMPVideoDecoderParent.h"
 #include "GMPVideoEncoderParent.h"
 #include "mozIGeckoMediaPluginService.h"
 #include "mozilla/Logging.h"
 #include "mozilla/Unused.h"
@@ -61,39 +60,29 @@ public:
 
 private:
   RefPtr<GMPContentParent> mToRelease;
 };
 
 void
 GMPContentParent::ActorDestroy(ActorDestroyReason aWhy)
 {
-  MOZ_ASSERT(mAudioDecoders.IsEmpty() &&
-             mDecryptors.IsEmpty() &&
+  MOZ_ASSERT(mDecryptors.IsEmpty() &&
              mVideoDecoders.IsEmpty() &&
              mVideoEncoders.IsEmpty());
   NS_DispatchToCurrentThread(new ReleaseGMPContentParent(this));
 }
 
 void
 GMPContentParent::CheckThread()
 {
   MOZ_ASSERT(mGMPThread == NS_GetCurrentThread());
 }
 
 void
-GMPContentParent::AudioDecoderDestroyed(GMPAudioDecoderParent* aDecoder)
-{
-  MOZ_ASSERT(GMPThread() == NS_GetCurrentThread());
-
-  MOZ_ALWAYS_TRUE(mAudioDecoders.RemoveElement(aDecoder));
-  CloseIfUnused();
-}
-
-void
 GMPContentParent::VideoDecoderDestroyed(GMPVideoDecoderParent* aDecoder)
 {
   MOZ_ASSERT(GMPThread() == NS_GetCurrentThread());
 
   // If the constructor fails, we'll get called before it's added
   Unused << NS_WARN_IF(!mVideoDecoders.RemoveElement(aDecoder));
   CloseIfUnused();
 }
@@ -130,18 +119,17 @@ GMPContentParent::RemoveCloseBlocker()
   MOZ_ASSERT(GMPThread() == NS_GetCurrentThread());
   --mCloseBlockerCount;
   CloseIfUnused();
 }
 
 void
 GMPContentParent::CloseIfUnused()
 {
-  if (mAudioDecoders.IsEmpty() &&
-      mDecryptors.IsEmpty() &&
+  if (mDecryptors.IsEmpty() &&
       mVideoDecoders.IsEmpty() &&
       mVideoEncoders.IsEmpty() &&
       mCloseBlockerCount == 0) {
     RefPtr<GMPContentParent> toClose;
     if (mParent) {
       toClose = mParent->ForgetGMPContentParent();
     } else {
       toClose = this;
@@ -188,33 +176,16 @@ GMPContentParent::GMPThread()
     mps->GetThread(getter_AddRefs(mGMPThread));
     MOZ_ASSERT(mGMPThread);
   }
 
   return mGMPThread;
 }
 
 nsresult
-GMPContentParent::GetGMPAudioDecoder(GMPAudioDecoderParent** aGMPAD)
-{
-  PGMPAudioDecoderParent* pvap = SendPGMPAudioDecoderConstructor();
-  if (!pvap) {
-    return NS_ERROR_FAILURE;
-  }
-  GMPAudioDecoderParent* vap = static_cast<GMPAudioDecoderParent*>(pvap);
-  // This addref corresponds to the Proxy pointer the consumer is returned.
-  // It's dropped by calling Close() on the interface.
-  NS_ADDREF(vap);
-  *aGMPAD = vap;
-  mAudioDecoders.AppendElement(vap);
-
-  return NS_OK;
-}
-
-nsresult
 GMPContentParent::GetGMPVideoDecoder(GMPVideoDecoderParent** aGMPVD,
                                      uint32_t aDecryptorId)
 {
   // returned with one anonymous AddRef that locks it until Destroy
   PGMPVideoDecoderParent* pvdp = SendPGMPVideoDecoderConstructor(aDecryptorId);
   if (!pvdp) {
     return NS_ERROR_FAILURE;
   }
@@ -289,26 +260,10 @@ GMPContentParent::AllocPGMPDecryptorPare
 bool
 GMPContentParent::DeallocPGMPDecryptorParent(PGMPDecryptorParent* aActor)
 {
   GMPDecryptorParent* ksp = static_cast<GMPDecryptorParent*>(aActor);
   NS_RELEASE(ksp);
   return true;
 }
 
-PGMPAudioDecoderParent*
-GMPContentParent::AllocPGMPAudioDecoderParent()
-{
-  GMPAudioDecoderParent* vdp = new GMPAudioDecoderParent(this);
-  NS_ADDREF(vdp);
-  return vdp;
-}
-
-bool
-GMPContentParent::DeallocPGMPAudioDecoderParent(PGMPAudioDecoderParent* aActor)
-{
-  GMPAudioDecoderParent* vdp = static_cast<GMPAudioDecoderParent*>(aActor);
-  NS_RELEASE(vdp);
-  return true;
-}
-
 } // namespace gmp
 } // namespace mozilla
--- a/dom/media/gmp/GMPContentParent.h
+++ b/dom/media/gmp/GMPContentParent.h
@@ -8,17 +8,16 @@
 
 #include "mozilla/gmp/PGMPContentParent.h"
 #include "GMPSharedMemManager.h"
 #include "nsISupportsImpl.h"
 
 namespace mozilla {
 namespace gmp {
 
-class GMPAudioDecoderParent;
 class GMPDecryptorParent;
 class GMPParent;
 class GMPVideoDecoderParent;
 class GMPVideoEncoderParent;
 
 class GMPContentParent final : public PGMPContentParent,
                                public GMPSharedMem
 {
@@ -32,19 +31,16 @@ public:
   void VideoDecoderDestroyed(GMPVideoDecoderParent* aDecoder);
 
   nsresult GetGMPVideoEncoder(GMPVideoEncoderParent** aGMPVE);
   void VideoEncoderDestroyed(GMPVideoEncoderParent* aEncoder);
 
   nsresult GetGMPDecryptor(GMPDecryptorParent** aGMPKS);
   void DecryptorDestroyed(GMPDecryptorParent* aSession);
 
-  nsresult GetGMPAudioDecoder(GMPAudioDecoderParent** aGMPAD);
-  void AudioDecoderDestroyed(GMPAudioDecoderParent* aDecoder);
-
   nsIThread* GMPThread();
 
   // GMPSharedMem
   void CheckThread() override;
 
   void SetDisplayName(const nsCString& aDisplayName)
   {
     mDisplayName = aDisplayName;
@@ -91,31 +87,27 @@ private:
   bool DeallocPGMPVideoDecoderParent(PGMPVideoDecoderParent* aActor) override;
 
   PGMPVideoEncoderParent* AllocPGMPVideoEncoderParent() override;
   bool DeallocPGMPVideoEncoderParent(PGMPVideoEncoderParent* aActor) override;
 
   PGMPDecryptorParent* AllocPGMPDecryptorParent() override;
   bool DeallocPGMPDecryptorParent(PGMPDecryptorParent* aActor) override;
 
-  PGMPAudioDecoderParent* AllocPGMPAudioDecoderParent() override;
-  bool DeallocPGMPAudioDecoderParent(PGMPAudioDecoderParent* aActor) override;
-
   void CloseIfUnused();
   // Needed because NewRunnableMethod tried to use the class that the method
   // lives on to store the receiver, but PGMPContentParent isn't refcounted.
   void Close()
   {
     PGMPContentParent::Close();
   }
 
   nsTArray<RefPtr<GMPVideoDecoderParent>> mVideoDecoders;
   nsTArray<RefPtr<GMPVideoEncoderParent>> mVideoEncoders;
   nsTArray<RefPtr<GMPDecryptorParent>> mDecryptors;
-  nsTArray<RefPtr<GMPAudioDecoderParent>> mAudioDecoders;
   nsCOMPtr<nsIThread> mGMPThread;
   RefPtr<GMPParent> mParent;
   nsCString mDisplayName;
   uint32_t mPluginId;
   uint32_t mCloseBlockerCount = 0;
 };
 
 } // namespace gmp
--- a/dom/media/gmp/GMPLoader.cpp
+++ b/dom/media/gmp/GMPLoader.cpp
@@ -19,18 +19,18 @@
 
 #include "GMPDeviceBinding.h"
 
 namespace mozilla {
 namespace gmp {
 
 class GMPLoaderImpl : public GMPLoader {
 public:
-  explicit GMPLoaderImpl(SandboxStarter* aStarter)
-    : mSandboxStarter(aStarter)
+  explicit GMPLoaderImpl(UniquePtr<SandboxStarter> aStarter)
+    : mSandboxStarter(Move(aStarter))
     , mAdapter(nullptr)
   {}
   ~GMPLoaderImpl() override = default;
 
   bool Load(const char* aUTF8LibPath,
             uint32_t aUTF8LibPathLen,
             char* aOriginSalt,
             uint32_t aOriginSaltLen,
@@ -44,22 +44,22 @@ public:
 
   void Shutdown() override;
 
 #if defined(XP_MACOSX) && defined(MOZ_GMP_SANDBOX)
   void SetSandboxInfo(MacSandboxInfo* aSandboxInfo) override;
 #endif
 
 private:
-  SandboxStarter* mSandboxStarter;
+  UniquePtr<SandboxStarter> mSandboxStarter;
   UniquePtr<GMPAdapter> mAdapter;
 };
 
-UniquePtr<GMPLoader> CreateGMPLoader(SandboxStarter* aStarter) {
-  return MakeUnique<GMPLoaderImpl>(aStarter);
+UniquePtr<GMPLoader> CreateGMPLoader(UniquePtr<SandboxStarter> aStarter) {
+  return MakeUnique<GMPLoaderImpl>(Move(aStarter));
 }
 
 class PassThroughGMPAdapter : public GMPAdapter {
 public:
   ~PassThroughGMPAdapter() override {
     // Ensure we're always shutdown, even if caller forgets to call GMPShutdown().
     GMPShutdown();
   }
--- a/dom/media/gmp/GMPLoader.h
+++ b/dom/media/gmp/GMPLoader.h
@@ -100,14 +100,14 @@ public:
   // sandbox, which we don't yet know when the GMPLoader and SandboxStarter
   // objects are created.
   virtual void SetSandboxInfo(MacSandboxInfo* aSandboxInfo) = 0;
 #endif
 };
 
 // On Desktop, this function resides in plugin-container.
 // On Mobile, this function resides in XUL.
-UniquePtr<GMPLoader> CreateGMPLoader(SandboxStarter* aStarter);
+UniquePtr<GMPLoader> CreateGMPLoader(UniquePtr<SandboxStarter> aStarter);
 
 } // namespace gmp
 } // namespace mozilla
 
 #endif // GMP_LOADER_H__
--- a/dom/media/gmp/GMPMessageUtils.h
+++ b/dom/media/gmp/GMPMessageUtils.h
@@ -3,17 +3,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef GMPMessageUtils_h_
 #define GMPMessageUtils_h_
 
 #include "gmp-video-codec.h"
 #include "gmp-video-frame-encoded.h"
-#include "gmp-audio-codec.h"
 #include "gmp-decryption.h"
 
 namespace IPC {
 
 template <>
 struct ParamTraits<GMPErr>
 : public ContiguousEnumSerializer<GMPErr,
                                   GMPNoErr,
@@ -71,23 +70,16 @@ struct ParamTraits<GMPMediaKeyStatus>
 template <>
 struct ParamTraits<GMPSessionType>
 : public ContiguousEnumSerializer<GMPSessionType,
                                   kGMPTemporySession,
                                   kGMPSessionInvalid>
 {};
 
 template <>
-struct ParamTraits<GMPAudioCodecType>
-: public ContiguousEnumSerializer<GMPAudioCodecType,
-                                  kGMPAudioCodecAAC,
-                                  kGMPAudioCodecInvalid>
-{};
-
-template <>
 struct ParamTraits<GMPVideoCodecComplexity>
 : public ContiguousEnumSerializer<GMPVideoCodecComplexity,
                                   kGMPComplexityNormal,
                                   kGMPComplexityInvalid>
 {};
 
 template <>
 struct ParamTraits<GMPVP8ResilienceMode>
--- a/dom/media/gmp/GMPParent.cpp
+++ b/dom/media/gmp/GMPParent.cpp
@@ -879,42 +879,27 @@ GMPParent::ReadGMPInfoFile(nsIFile* aFil
         nsTArray<nsCString> tagTokens;
         SplitAt(":", ts, tagTokens);
         for (nsCString tag : tagTokens) {
           cap.mAPITags.AppendElement(tag);
         }
       }
     }
 
-    // We support the current GMPDecryptor version, and the previous.
-    // We Adapt the previous to the current in the GMPContentChild.
-    if (cap.mAPIName.EqualsLiteral(GMP_API_DECRYPTOR_BACKWARDS_COMPAT)) {
-      cap.mAPIName.AssignLiteral(GMP_API_DECRYPTOR);
-    }
-
     if (cap.mAPIName.EqualsLiteral(GMP_API_DECRYPTOR)) {
       mCanDecrypt = true;
 
 #if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
       if (!mozilla::SandboxInfo::Get().CanSandboxMedia()) {
         printf_stderr("GMPParent::ReadGMPMetaData: Plugin \"%s\" is an EME CDM"
                       " but this system can't sandbox it; not loading.\n",
                       mDisplayName.get());
         return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
       }
 #endif
-#ifdef XP_WIN
-      // Adobe GMP doesn't work without SSE2. Check the tags to see if
-      // the decryptor is for the Adobe GMP, and refuse to load it if
-      // SSE2 isn't supported.
-      if (cap.mAPITags.Contains(kEMEKeySystemPrimetime) &&
-          !mozilla::supports_sse2()) {
-        return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
-      }
-#endif // XP_WIN
     }
 
     mCapabilities.AppendElement(Move(cap));
   }
 
   if (mCapabilities.IsEmpty()) {
     return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
   }
--- a/dom/media/gmp/GMPParent.h
+++ b/dom/media/gmp/GMPParent.h
@@ -3,17 +3,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef GMPParent_h_
 #define GMPParent_h_
 
 #include "GMPProcessParent.h"
 #include "GMPServiceParent.h"
-#include "GMPAudioDecoderParent.h"
 #include "GMPDecryptorParent.h"
 #include "GMPVideoDecoderParent.h"
 #include "GMPVideoEncoderParent.h"
 #include "GMPTimerParent.h"
 #include "GMPStorageParent.h"
 #include "mozilla/gmp/PGMPParent.h"
 #include "nsCOMPtr.h"
 #include "nscore.h"
--- a/dom/media/gmp/GMPService.cpp
+++ b/dom/media/gmp/GMPService.cpp
@@ -17,17 +17,16 @@
 #include "mozilla/SyncRunnable.h"
 #include "nsXPCOMPrivate.h"
 #include "mozilla/Services.h"
 #include "nsNativeCharsetUtils.h"
 #include "nsIXULAppInfo.h"
 #include "nsIConsoleService.h"
 #include "mozilla/Unused.h"
 #include "GMPDecryptorParent.h"
-#include "GMPAudioDecoderParent.h"
 #include "nsComponentManagerUtils.h"
 #include "runnable_utils.h"
 #include "VideoUtils.h"
 #if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
 #include "mozilla/SandboxInfo.h"
 #endif
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsDirectoryServiceUtils.h"
@@ -303,52 +302,16 @@ GeckoMediaPluginService::GetThread(nsITh
 RefPtr<AbstractThread>
 GeckoMediaPluginService::GetAbstractGMPThread()
 {
   MutexAutoLock lock(mMutex);
   return mAbstractGMPThread;
 }
 
 NS_IMETHODIMP
-GeckoMediaPluginService::GetGMPAudioDecoder(GMPCrashHelper* aHelper,
-                                            nsTArray<nsCString>* aTags,
-                                            const nsACString& aNodeId,
-                                            UniquePtr<GetGMPAudioDecoderCallback>&& aCallback)
-{
-  MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread);
-  NS_ENSURE_ARG(aTags && aTags->Length() > 0);
-  NS_ENSURE_ARG(aCallback);
-
-  if (mShuttingDownOnGMPThread) {
-    return NS_ERROR_FAILURE;
-  }
-
-  GetGMPAudioDecoderCallback* rawCallback = aCallback.release();
-  RefPtr<AbstractThread> thread(GetAbstractGMPThread());
-  RefPtr<GMPCrashHelper> helper(aHelper);
-  GetContentParent(aHelper, aNodeId, NS_LITERAL_CSTRING(GMP_API_AUDIO_DECODER), *aTags)
-    ->Then(thread, __func__,
-      [rawCallback, helper](RefPtr<GMPContentParent::CloseBlocker> wrapper) {
-        RefPtr<GMPContentParent> parent = wrapper->mParent;
-        UniquePtr<GetGMPAudioDecoderCallback> callback(rawCallback);
-        GMPAudioDecoderParent* actor = nullptr;
-        if (parent && NS_SUCCEEDED(parent->GetGMPAudioDecoder(&actor))) {
-          actor->SetCrashHelper(helper);
-        }
-        callback->Done(actor);
-      },
-      [rawCallback] {
-        UniquePtr<GetGMPAudioDecoderCallback> callback(rawCallback);
-        callback->Done(nullptr);
-      });
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 GeckoMediaPluginService::GetDecryptingGMPVideoDecoder(GMPCrashHelper* aHelper,
                                                       nsTArray<nsCString>* aTags,
                                                       const nsACString& aNodeId,
                                                       UniquePtr<GetGMPVideoDecoderCallback>&& aCallback,
                                                       uint32_t aDecryptorId)
 {
   MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread);
   NS_ENSURE_ARG(aTags && aTags->Length() > 0);
--- a/dom/media/gmp/GMPService.h
+++ b/dom/media/gmp/GMPService.h
@@ -54,21 +54,16 @@ public:
                                           UniquePtr<GetGMPVideoDecoderCallback>&& aCallback,
                                           uint32_t aDecryptorId)
     override;
   NS_IMETHOD GetGMPVideoEncoder(GMPCrashHelper* aHelper,
                                 nsTArray<nsCString>* aTags,
                                 const nsACString& aNodeId,
                                 UniquePtr<GetGMPVideoEncoderCallback>&& aCallback)
     override;
-  NS_IMETHOD GetGMPAudioDecoder(GMPCrashHelper* aHelper,
-                                nsTArray<nsCString>* aTags,
-                                const nsACString& aNodeId,
-                                UniquePtr<GetGMPAudioDecoderCallback>&& aCallback)
-    override;
   NS_IMETHOD GetGMPDecryptor(GMPCrashHelper* aHelper,
                              nsTArray<nsCString>* aTags,
                              const nsACString& aNodeId,
                              UniquePtr<GetGMPDecryptorCallback>&& aCallback)
     override;
 
   // Helper for backwards compatibility with WebRTC/tests.
   NS_IMETHOD
--- a/dom/media/gmp/GMPServiceParent.cpp
+++ b/dom/media/gmp/GMPServiceParent.cpp
@@ -18,17 +18,16 @@
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/SyncRunnable.h"
 #include "nsXPCOMPrivate.h"
 #include "mozilla/Services.h"
 #include "nsNativeCharsetUtils.h"
 #include "nsIConsoleService.h"
 #include "mozilla/Unused.h"
 #include "GMPDecryptorParent.h"
-#include "GMPAudioDecoderParent.h"
 #include "nsComponentManagerUtils.h"
 #include "runnable_utils.h"
 #include "VideoUtils.h"
 #if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
 #include "mozilla/SandboxInfo.h"
 #endif
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsDirectoryServiceUtils.h"
@@ -167,80 +166,16 @@ CloneAndAppend(nsIFile* aFile, const nsA
 
   rv = f->Append(aDir);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return nullptr;
   }
   return f.forget();
 }
 
-static void
-MoveAndOverwrite(nsIFile* aOldParentDir,
-                 nsIFile* aNewParentDir,
-                 const nsAString& aSubDir)
-{
-  nsresult rv;
-
-  nsCOMPtr<nsIFile> srcDir(CloneAndAppend(aOldParentDir, aSubDir));
-  if (NS_WARN_IF(!srcDir)) {
-    return;
-  }
-
-  if (!FileExists(srcDir)) {
-    // No sub-directory to be migrated.
-    return;
-  }
-
-  // Ensure destination parent directory exists.
-  rv = aNewParentDir->Create(nsIFile::DIRECTORY_TYPE, 0700);
-  if (rv != NS_ERROR_FILE_ALREADY_EXISTS && NS_WARN_IF(NS_FAILED(rv))) {
-    return;
-  }
-
-  nsCOMPtr<nsIFile> dstDir(CloneAndAppend(aNewParentDir, aSubDir));
-  if (FileExists(dstDir)) {
-    // We must have migrated before already, and then ran an old version
-    // of Gecko again which created storage at the old location. Overwrite
-    // the previously migrated storage.
-    rv = dstDir->Remove(true);
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      // MoveTo will fail.
-      return;
-    }
-  }
-
-  rv = srcDir->MoveTo(aNewParentDir, EmptyString());
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return;
-  }
-}
-
-static void
-MigratePreGecko42StorageDir(nsIFile* aOldStorageDir,
-                            nsIFile* aNewStorageDir)
-{
-  MoveAndOverwrite(aOldStorageDir, aNewStorageDir, NS_LITERAL_STRING("id"));
-  MoveAndOverwrite(aOldStorageDir, aNewStorageDir, NS_LITERAL_STRING("storage"));
-}
-
-static void
-MigratePreGecko45StorageDir(nsIFile* aStorageDirBase)
-{
-  nsCOMPtr<nsIFile> adobeStorageDir(CloneAndAppend(aStorageDirBase, NS_LITERAL_STRING("gmp-eme-adobe")));
-  if (NS_WARN_IF(!adobeStorageDir)) {
-    return;
-  }
-
-  // The base storage dir in pre-45 contained "id" and "storage" subdirs.
-  // We assume all storage in the base storage dir that aren't known to GMP
-  // storage are records for the Adobe GMP.
-  MoveAndOverwrite(aStorageDirBase, adobeStorageDir, NS_LITERAL_STRING("id"));
-  MoveAndOverwrite(aStorageDirBase, adobeStorageDir, NS_LITERAL_STRING("storage"));
-}
-
 static nsresult
 GMPPlatformString(nsAString& aOutPlatform)
 {
   // Append the OS and arch so that we don't reuse the storage if the profile is
   // copied or used under a different bit-ness, or copied to another platform.
   nsCOMPtr<nsIXULRuntime> runtime = do_GetService("@mozilla.org/xre/runtime;1");
   if (!runtime) {
     return NS_ERROR_FAILURE;
@@ -317,29 +252,16 @@ GeckoMediaPluginServiceParent::InitStora
     return rv;
   }
 
   rv = mStorageBaseDir->Create(nsIFile::DIRECTORY_TYPE, 0700);
   if (NS_WARN_IF(NS_FAILED(rv) && rv != NS_ERROR_FILE_ALREADY_EXISTS)) {
     return rv;
   }
 
-  // Prior to 42, GMP storage was stored in $profileDir/gmp/. After 42, it's
-  // stored in $profileDir/gmp/$platform/. So we must migrate any old records
-  // from the old location to the new location, for forwards compatibility.
-  MigratePreGecko42StorageDir(gmpDirWithoutPlatform, mStorageBaseDir);
-
-  // Prior to 45, GMP storage was not separated by plugin. In 45 and after,
-  // it's stored in $profile/gmp/$platform/$gmpName. So we must migrate old
-  // records from the old location to the new location, for forwards
-  // compatibility. We assume all directories in the base storage dir that
-  // aren't known to GMP storage are records for the Adobe GMP, since it
-  // was first.
-  MigratePreGecko45StorageDir(mStorageBaseDir);
-
   return GeckoMediaPluginService::Init();
 }
 
 NS_IMETHODIMP
 GeckoMediaPluginServiceParent::Observe(nsISupports* aSubject,
                                        const char* aTopic,
                                        const char16_t* aSomeData)
 {
--- a/dom/media/gmp/GMPTypes.ipdlh
+++ b/dom/media/gmp/GMPTypes.ipdlh
@@ -1,15 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 using GMPBufferType from "gmp-video-codec.h";
-using GMPAudioCodecType from "gmp-audio-codec.h";
 using GMPMediaKeyStatus from "gmp-decryption.h";
 
 namespace mozilla {
 namespace gmp {
 
 struct GMPDecryptionData {
   uint8_t[] mKeyId;
   uint8_t[] mIV;
@@ -45,42 +44,15 @@ struct GMPVideoi420FrameData
   GMPPlaneData mUPlane;
   GMPPlaneData mVPlane;
   int32_t mWidth;
   int32_t mHeight;
   uint64_t mTimestamp; // microseconds
   uint64_t mDuration; // microseconds
 };
 
-struct GMPAudioCodecData
-{
-  GMPAudioCodecType mCodecType;
-  uint32_t mChannelCount;
-  uint32_t mBitsPerChannel;
-  uint32_t mSamplesPerSecond;
-
-  uint8_t[] mExtraData;
-};
-
-struct GMPAudioEncodedSampleData
-{
-  uint8_t[] mData;
-  uint64_t mTimeStamp; // microseconds.
-  GMPDecryptionData mDecryptionData;
-  uint32_t mChannelCount;
-  uint32_t mSamplesPerSecond;
-};
-
-struct GMPAudioDecodedSampleData
-{
-  int16_t[] mData;
-  uint64_t mTimeStamp; // microseconds.
-  uint32_t mChannelCount;
-  uint32_t mSamplesPerSecond;
-};
-
 struct GMPKeyInformation {
   uint8_t[] keyId;
   GMPMediaKeyStatus status;
 };
 
 }
 }
deleted file mode 100644
--- a/dom/media/gmp/PGMPAudioDecoder.ipdl
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-include protocol PGMPContent;
-include GMPTypes;
-
-using GMPCodecSpecificInfo from "gmp-audio-codec.h";
-using GMPErr from "gmp-errors.h";
-
-include "GMPMessageUtils.h";
-
-namespace mozilla {
-namespace gmp {
-
-async protocol PGMPAudioDecoder
-{
-  manager PGMPContent;
-child:
-  async InitDecode(GMPAudioCodecData aCodecSettings);
-  async Decode(GMPAudioEncodedSampleData aInput);
-  async Reset();
-  async Drain();
-  async DecodingComplete();
-parent:
-  async __delete__();
-  async Decoded(GMPAudioDecodedSampleData aDecoded);
-  async InputDataExhausted();
-  async DrainComplete();
-  async ResetComplete();
-  async Error(GMPErr aErr);
-  async Shutdown();
-};
-
-} // namespace gmp
-} // namespace mozilla
--- a/dom/media/gmp/PGMPContent.ipdl
+++ b/dom/media/gmp/PGMPContent.ipdl
@@ -3,31 +3,28 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 include protocol PGMP;
 include protocol PGMPService;
 include protocol PGMPVideoDecoder;
 include protocol PGMPVideoEncoder;
 include protocol PGMPDecryptor;
-include protocol PGMPAudioDecoder;
 
 namespace mozilla {
 namespace gmp {
 
 intr protocol PGMPContent
 {
   bridges PGMPService, PGMP;
 
-  manages PGMPAudioDecoder;
   manages PGMPDecryptor;
   manages PGMPVideoDecoder;
   manages PGMPVideoEncoder;
 
 child:
-  async PGMPAudioDecoder();
   async PGMPDecryptor();
   async PGMPVideoDecoder(uint32_t aDecryptorId);
   async PGMPVideoEncoder();
 };
 
 } // namespace gmp
 } // namespace mozilla
deleted file mode 100644
--- a/dom/media/gmp/gmp-api/gmp-audio-codec.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-* Copyright 2013, Mozilla Foundation and contributors
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-#ifndef GMP_AUDIO_CODEC_h_
-#define GMP_AUDIO_CODEC_h_
-
-#include <stdint.h>
-
-enum GMPAudioCodecType
-{
-  kGMPAudioCodecAAC,
-  kGMPAudioCodecVorbis,
-  kGMPAudioCodecInvalid // Should always be last.
-};
-
-struct GMPAudioCodec
-{
-  GMPAudioCodecType mCodecType;
-  uint32_t mChannelCount;
-  uint32_t mBitsPerChannel;
-  uint32_t mSamplesPerSecond;
-
-  // Codec extra data, such as vorbis setup header, or
-  // AAC AudioSpecificConfig.
-  // These are null/0 if not externally negotiated
-  const uint8_t* mExtraData;
-  uint32_t       mExtraDataLen;
-};
-
-#endif // GMP_AUDIO_CODEC_h_
deleted file mode 100644
--- a/dom/media/gmp/gmp-api/gmp-audio-decode.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
-* Copyright 2013, Mozilla Foundation and contributors
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-#ifndef GMP_AUDIO_DECODE_h_
-#define GMP_AUDIO_DECODE_h_
-
-#include "gmp-errors.h"
-#include "gmp-audio-samples.h"
-#include "gmp-audio-codec.h"
-#include <stdint.h>
-
-// ALL METHODS MUST BE CALLED ON THE MAIN THREAD
-class GMPAudioDecoderCallback
-{
-public:
-  virtual ~GMPAudioDecoderCallback() {}
-
-  virtual void Decoded(GMPAudioSamples* aDecodedSamples) = 0;
-
-  virtual void InputDataExhausted() = 0;
-
-  virtual void DrainComplete() = 0;
-
-  virtual void ResetComplete() = 0;
-
-  // Called when the decoder encounters a catestrophic error and cannot
-  // continue. Gecko will not send any more input for decoding.
-  virtual void Error(GMPErr aError) = 0;
-};
-
-#define GMP_API_AUDIO_DECODER "decode-audio"
-
-// Audio decoding for a single stream. A GMP may be asked to create multiple
-// decoders concurrently.
-//
-// API name macro: GMP_API_AUDIO_DECODER
-// Host API: GMPAudioHost
-//
-// ALL METHODS MUST BE CALLED ON THE MAIN THREAD
-class GMPAudioDecoder
-{
-public:
-  virtual ~GMPAudioDecoder() {}
-
-  // aCallback: Subclass should retain reference to it until DecodingComplete
-  //            is called. Do not attempt to delete it, host retains ownership.
-  // TODO: Pass AudioHost so decoder can create GMPAudioEncodedFrame objects?
-  virtual void InitDecode(const GMPAudioCodec& aCodecSettings,
-                          GMPAudioDecoderCallback* aCallback) = 0;
-
-  // Decode encoded audio frames (as a part of an audio stream). The decoded
-  // frames must be returned to the user through the decode complete callback.
-  virtual void Decode(GMPAudioSamples* aEncodedSamples) = 0;
-
-  // Reset decoder state and prepare for a new call to Decode(...).
-  // Flushes the decoder pipeline.
-  // The decoder should enqueue a task to run ResetComplete() on the main
-  // thread once the reset has finished.
-  virtual void Reset() = 0;
-
-  // Output decoded frames for any data in the pipeline, regardless of ordering.
-  // All remaining decoded frames should be immediately returned via callback.
-  // The decoder should enqueue a task to run DrainComplete() on the main
-  // thread once the reset has finished.
-  virtual void Drain() = 0;
-
-  // May free decoder memory.
-  virtual void DecodingComplete() = 0;
-};
-
-#endif // GMP_VIDEO_DECODE_h_
deleted file mode 100644
--- a/dom/media/gmp/gmp-api/gmp-audio-host.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-* Copyright 2013, Mozilla Foundation and contributors
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-#ifndef GMP_AUDIO_HOST_h_
-#define GMP_AUDIO_HOST_h_
-
-#include "gmp-errors.h"
-#include "gmp-audio-samples.h"
-
-class GMPAudioHost
-{
-public:
-  // Construct various Audio API objects. Host does not retain reference,
-  // caller is owner and responsible for deleting.
-  virtual GMPErr CreateSamples(GMPAudioFormat aFormat,
-                               GMPAudioSamples** aSamples) = 0;
-};
-
-#endif // GMP_AUDIO_HOST_h_
deleted file mode 100644
--- a/dom/media/gmp/gmp-api/gmp-audio-samples.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-* Copyright 2013, Mozilla Foundation and contributors
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-#ifndef GMP_AUDIO_FRAME_h_
-#define GMP_AUDIO_FRAME_h_
-
-#include <stdint.h>
-#include "gmp-errors.h"
-#include "gmp-decryption.h"
-
-enum GMPAudioFormat
-{
-  kGMPAudioEncodedSamples, // Raw compressed data, i.e. an AAC/Vorbis packet.
-  kGMPAudioIS16Samples, // Interleaved int16_t PCM samples.
-  kGMPAudioSamplesFormatInvalid // Should always be last.
-};
-
-class GMPAudioSamples {
-public:
-  // The format of the buffer.
-  virtual GMPAudioFormat GetFormat() = 0;
-  virtual void Destroy() = 0;
-
-  // MAIN THREAD ONLY
-  // Buffer size must be exactly what's required to contain all samples in
-  // the buffer; every byte is assumed to be part of a sample.
-  virtual GMPErr SetBufferSize(uint32_t aSize) = 0;
-
-  // Size of the buffer in bytes.
-  virtual uint32_t Size() = 0;
-
-  // Timestamps are in microseconds, and are the playback start time of the
-  // first sample in the buffer.
-  virtual void SetTimeStamp(uint64_t aTimeStamp) = 0;
-  virtual uint64_t TimeStamp() = 0;
-  virtual const uint8_t* Buffer() const = 0;
-  virtual uint8_t*       Buffer() = 0;
-
-  // Get metadata describing how this frame is encrypted, or nullptr if the
-  // buffer is not encrypted.
-  virtual const GMPEncryptedBufferMetadata* GetDecryptionData() const = 0;
-
-  virtual uint32_t Channels() const = 0;
-  virtual void SetChannels(uint32_t aChannels) = 0;
-
-  // Rate; the number of frames per second, where a "frame" is one sample for
-  // each channel.
-  //
-  // For IS16 samples, the number of samples should be:
-  //   Size() / (Channels() * sizeof(int16_t)).
-  //
-  // Note: Channels() and Rate() may not be constant across a decoding
-  // session. For example the rate for decoded samples may be different
-  // than the rate advertised by the MP4 container for encoded samples
-  // for HE-AAC streams with SBR/PS, and an EME-GMP may need to downsample
-  // to satisfy DRM requirements.
-  virtual uint32_t Rate() const = 0;
-  virtual void SetRate(uint32_t aRate) = 0;
-};
-
-#endif // GMP_AUDIO_FRAME_h_
--- a/dom/media/gmp/gmp-api/gmp-decryption.h
+++ b/dom/media/gmp/gmp-api/gmp-decryption.h
@@ -229,20 +229,17 @@ public:
 };
 
 enum GMPSessionType {
   kGMPTemporySession = 0,
   kGMPPersistentSession = 1,
   kGMPSessionInvalid = 2 // Must always be last.
 };
 
-// Gecko supports the current GMPDecryptor version, and the obsolete
-// version that the Adobe GMP still uses.
 #define GMP_API_DECRYPTOR "eme-decrypt-v9"
-#define GMP_API_DECRYPTOR_BACKWARDS_COMPAT "eme-decrypt-v7"
 
 // API exposed by plugin library to manage decryption sessions.
 // When the Host requests this by calling GMPGetAPIFunc().
 //
 // API name macro: GMP_API_DECRYPTOR
 // Host API: GMPDecryptorHost
 class GMPDecryptor {
 public:
@@ -344,116 +341,9 @@ public:
 
   // Called when the decryption operations are complete.
   // Do not call the GMPDecryptorCallback's functions after this is called.
   virtual void DecryptingComplete() = 0;
 
   virtual ~GMPDecryptor() {}
 };
 
-// v7 is the latest decryptor version supported by the Adobe GMP.
-//
-// API name macro: GMP_API_DECRYPTOR_BACKWARDS_COMPAT
-// Host API: GMPDecryptorHost
-class GMPDecryptor7 {
-public:
-
-  // Sets the callback to use with the decryptor to return results
-  // to Gecko.
-  virtual void Init(GMPDecryptorCallback* aCallback) = 0;
-
-  // Initiates the creation of a session given |aType| and |aInitData|, and
-  // the generation of a license request message.
-  //
-  // This corresponds to a MediaKeySession.generateRequest() call in JS.
-  //
-  // The GMPDecryptor must do the following, in order, upon this method
-  // being called:
-  //
-  // 1. Generate a sessionId to expose to JS, and call
-  //    GMPDecryptorCallback::SetSessionId(aCreateSessionToken, sessionId...)
-  //    with the sessionId to be exposed to JS/EME on the MediaKeySession
-  //    object on which generateRequest() was called, and then
-  // 2. send any messages to JS/EME required to generate a license request
-  //    given the supplied initData, and then
-  // 3. generate a license request message, and send it to JS/EME, and then
-  // 4. call GMPDecryptorCallback::ResolvePromise().
-  //
-  // Note: GMPDecryptorCallback::SetSessionId(aCreateSessionToken, sessionId, ...)
-  // *must* be called before GMPDecryptorCallback::SendMessage(sessionId, ...)
-  // will work.
-  //
-  // If generating the request fails, reject aPromiseId by calling
-  // GMPDecryptorCallback::RejectPromise().
-  virtual void CreateSession(uint32_t aCreateSessionToken,
-                             uint32_t aPromiseId,
-                             const char* aInitDataType,
-                             uint32_t aInitDataTypeSize,
-                             const uint8_t* aInitData,
-                             uint32_t aInitDataSize,
-                             GMPSessionType aSessionType) = 0;
-
-  // Loads a previously loaded persistent session.
-  //
-  // This corresponds to a MediaKeySession.load() call in JS.
-  //
-  // The GMPDecryptor must do the following, in order, upon this method
-  // being called:
-  //
-  // 1. Send any messages to JS/EME, or read from storage, whatever is
-  //    required to load the session, and then
-  // 2. if there is no session with the given sessionId loadable, call
-  //    ResolveLoadSessionPromise(aPromiseId, false), otherwise
-  // 2. mark the session's keys as usable, and then
-  // 3. update the session's expiration, and then
-  // 4. call GMPDecryptorCallback::ResolveLoadSessionPromise(aPromiseId, true).
-  //
-  // If loading the session fails due to error, reject aPromiseId by calling
-  // GMPDecryptorCallback::RejectPromise().
-  virtual void LoadSession(uint32_t aPromiseId,
-                           const char* aSessionId,
-                           uint32_t aSessionIdLength) = 0;
-
-  // Updates the session with |aResponse|.
-  // This corresponds to a MediaKeySession.update() call in JS.
-  virtual void UpdateSession(uint32_t aPromiseId,
-                             const char* aSessionId,
-                             uint32_t aSessionIdLength,
-                             const uint8_t* aResponse,
-                             uint32_t aResponseSize) = 0;
-
-  // Releases the resources (keys) for the specified session.
-  // This corresponds to a MediaKeySession.close() call in JS.
-  virtual void CloseSession(uint32_t aPromiseId,
-                            const char* aSessionId,
-                            uint32_t aSessionIdLength) = 0;
-
-  // Removes the resources (keys) for the specified session.
-  // This corresponds to a MediaKeySession.remove() call in JS.
-  virtual void RemoveSession(uint32_t aPromiseId,
-                             const char* aSessionId,
-                             uint32_t aSessionIdLength) = 0;
-
-  // Resolve/reject promise on completion.
-  // This corresponds to a MediaKeySession.setServerCertificate() call in JS.
-  virtual void SetServerCertificate(uint32_t aPromiseId,
-                                    const uint8_t* aServerCert,
-                                    uint32_t aServerCertSize) = 0;
-
-  // Asynchronously decrypts aBuffer in place. When the decryption is
-  // complete, GMPDecryptor should write the decrypted data back into the
-  // same GMPBuffer object and return it to Gecko by calling Decrypted(),
-  // with the GMPNoErr successcode. If decryption fails, call Decrypted()
-  // with a failure code, and an error event will fire on the media element.
-  // Note: When Decrypted() is called and aBuffer is passed back, aBuffer
-  // is deleted. Don't forget to call Decrypted(), as otherwise aBuffer's
-  // memory will leak!
-  virtual void Decrypt(GMPBuffer* aBuffer,
-                       GMPEncryptedBufferMetadata* aMetadata) = 0;
-
-  // Called when the decryption operations are complete.
-  // Do not call the GMPDecryptorCallback's functions after this is called.
-  virtual void DecryptingComplete() = 0;
-
-  virtual ~GMPDecryptor7() {}
-};
-
 #endif // GMP_DECRYPTION_h_
--- a/dom/media/gmp/moz.build
+++ b/dom/media/gmp/moz.build
@@ -8,37 +8,29 @@ XPIDL_MODULE = 'content_geckomediaplugin
 
 XPIDL_SOURCES += [
     'mozIGeckoMediaPluginChromeService.idl',
     'mozIGeckoMediaPluginService.idl',
 ]
 
 EXPORTS += [
     'gmp-api/gmp-async-shutdown.h',
-    'gmp-api/gmp-audio-codec.h',
-    'gmp-api/gmp-audio-decode.h',
-    'gmp-api/gmp-audio-host.h',
-    'gmp-api/gmp-audio-samples.h',
     'gmp-api/gmp-decryption.h',
     'gmp-api/gmp-entrypoints.h',
     'gmp-api/gmp-errors.h',
     'gmp-api/gmp-platform.h',
     'gmp-api/gmp-storage.h',
     'gmp-api/gmp-video-codec.h',
     'gmp-api/gmp-video-decode.h',
     'gmp-api/gmp-video-encode.h',
     'gmp-api/gmp-video-frame-encoded.h',
     'gmp-api/gmp-video-frame-i420.h',
     'gmp-api/gmp-video-frame.h',
     'gmp-api/gmp-video-host.h',
     'gmp-api/gmp-video-plane.h',
-    'GMPAudioDecoderChild.h',
-    'GMPAudioDecoderParent.h',
-    'GMPAudioDecoderProxy.h',
-    'GMPAudioHost.h',
     'GMPCallbackBase.h',
     'GMPCDMCallbackProxy.h',
     'GMPCDMProxy.h',
     'GMPChild.h',
     'GMPContentChild.h',
     'GMPContentParent.h',
     'GMPCrashHelper.h',
     'GMPCrashHelperHolder.h',
@@ -81,19 +73,16 @@ if CONFIG['OS_ARCH'] == 'Linux':
     SOURCES += [
       'GMPLoader.cpp',
     ]
     USE_LIBS += [
         'rlz',
     ]
 
 UNIFIED_SOURCES += [
-    'GMPAudioDecoderChild.cpp',
-    'GMPAudioDecoderParent.cpp',
-    'GMPAudioHost.cpp',
     'GMPCDMCallbackProxy.cpp',
     'GMPCDMProxy.cpp',
     'GMPChild.cpp',
     'GMPContentChild.cpp',
     'GMPContentParent.cpp',
     'GMPCrashHelper.cpp',
     'GMPDecryptorChild.cpp',
     'GMPDecryptorParent.cpp',
@@ -126,17 +115,16 @@ UNIFIED_SOURCES += [
 DIRS += [
     'rlz',
     'widevine-adapter',
 ]
 
 IPDL_SOURCES += [
   'GMPTypes.ipdlh',
   'PGMP.ipdl',
-  'PGMPAudioDecoder.ipdl',
   'PGMPContent.ipdl',
   'PGMPDecryptor.ipdl',
   'PGMPService.ipdl',
   'PGMPStorage.ipdl',
   'PGMPTimer.ipdl',
   'PGMPVideoDecoder.ipdl',
   'PGMPVideoEncoder.ipdl',
 ]
--- a/dom/media/gmp/mozIGeckoMediaPluginService.idl
+++ b/dom/media/gmp/mozIGeckoMediaPluginService.idl
@@ -5,17 +5,16 @@
 
 #include "nsISupports.idl"
 #include "nsIThread.idl"
 
 %{C++
 #include "mozilla/UniquePtr.h"
 #include "nsTArray.h"
 #include "nsStringGlue.h"
-class GMPAudioDecoderProxy;
 class GMPDecryptorProxy;
 class GMPVideoDecoderProxy;
 class GMPVideoEncoderProxy;
 class GMPVideoHost;
 
 namespace mozilla {
 class GMPCrashHelper;
 }
@@ -32,31 +31,29 @@ template<class T>
 class GMPVideoGetterCallback
 {
 public:
   GMPVideoGetterCallback() { MOZ_COUNT_CTOR(GMPVideoGetterCallback<T>); }
   virtual ~GMPVideoGetterCallback() { MOZ_COUNT_DTOR(GMPVideoGetterCallback<T>); }
   virtual void Done(T*, GMPVideoHost*) = 0;
 };
 typedef GMPGetterCallback<GMPDecryptorProxy> GetGMPDecryptorCallback;
-typedef GMPGetterCallback<GMPAudioDecoderProxy> GetGMPAudioDecoderCallback;
 typedef GMPVideoGetterCallback<GMPVideoDecoderProxy> GetGMPVideoDecoderCallback;
 typedef GMPVideoGetterCallback<GMPVideoEncoderProxy> GetGMPVideoEncoderCallback;
 class GetNodeIdCallback
 {
 public:
   GetNodeIdCallback() { MOZ_COUNT_CTOR(GetNodeIdCallback); }
   virtual ~GetNodeIdCallback() { MOZ_COUNT_DTOR(GetNodeIdCallback); }
   virtual void Done(nsresult aResult, const nsACString& aNodeId) = 0;
 };
 %}
 
 [ptr] native TagArray(nsTArray<nsCString>);
 native GetGMPDecryptorCallback(mozilla::UniquePtr<GetGMPDecryptorCallback>&&);
-native GetGMPAudioDecoderCallback(mozilla::UniquePtr<GetGMPAudioDecoderCallback>&&);
 native GetGMPVideoDecoderCallback(mozilla::UniquePtr<GetGMPVideoDecoderCallback>&&);
 native GetGMPVideoEncoderCallback(mozilla::UniquePtr<GetGMPVideoEncoderCallback>&&);
 native GetNodeIdCallback(mozilla::UniquePtr<GetNodeIdCallback>&&);
 native GMPCrashHelperPtr(mozilla::GMPCrashHelper*);
 
 [scriptable, uuid(44d362ae-937a-4803-bee6-f2512a0149d1)]
 interface mozIGeckoMediaPluginService : nsISupports
 {
@@ -122,33 +119,16 @@ interface mozIGeckoMediaPluginService : 
    */
   [noscript]
   void getGMPVideoEncoder(in GMPCrashHelperPtr helper,
                           in TagArray tags,
                           [optional] in ACString nodeId,
                           in GetGMPVideoEncoderCallback callback);
 
   /**
-   * Returns an audio decoder that supports the specified tags.
-   * The array of tags should at least contain a codec tag, and optionally
-   * other tags such as for EME keysystem.
-   * Callable only on GMP thread.
-   * This is an asynchronous operation, the Done method of the callback object
-   * will be called on the GMP thread with the result (which might be null in
-   * the case of failure). This method always takes ownership of the callback
-   * object, but if this method returns an error then the Done method of the
-   * callback object will not be called at all.
-   */
-  [noscript]
-  void getGMPAudioDecoder(in GMPCrashHelperPtr helper,
-                          in TagArray tags,
-                          [optional] in ACString nodeId,
-                          in GetGMPAudioDecoderCallback callback);
-
-  /**
    * Returns a decryption session manager that supports the specified tags.
    * The array of tags should at least contain a key system tag, and optionally
    * other tags.
    * Callable only on GMP thread.
    * This is an asynchronous operation, the Done method of the callback object
    * will be called on the GMP thread with the result (which might be null in
    * the case of failure). This method always takes ownership of the callback
    * object, but if this method returns an error then the Done method of the
--- a/dom/media/platforms/agnostic/VPXDecoder.cpp
+++ b/dom/media/platforms/agnostic/VPXDecoder.cpp
@@ -83,16 +83,17 @@ VPXDecoder::~VPXDecoder()
 {
   MOZ_COUNT_DTOR(VPXDecoder);
 }
 
 void
 VPXDecoder::Shutdown()
 {
   vpx_codec_destroy(&mVPX);
+  vpx_codec_destroy(&mVPXAlpha);
 }
 
 RefPtr<MediaDataDecoder::InitPromise>
 VPXDecoder::Init()
 {
   if (NS_FAILED(InitContext(&mVPX, mInfo, mCodec))) {
     return VPXDecoder::InitPromise::CreateAndReject(NS_ERROR_DOM_MEDIA_FATAL_ERR,
                                                     __func__);
deleted file mode 100644
--- a/dom/media/platforms/agnostic/eme/EMEAudioDecoder.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "EMEAudioDecoder.h"
-#include "mozilla/CDMProxy.h"
-
-namespace mozilla {
-
-void
-EMEAudioCallbackAdapter::Error(GMPErr aErr)
-{
-  if (aErr == GMPNoKeyErr) {
-    // The GMP failed to decrypt a frame due to not having a key. This can
-    // happen if a key expires or a session is closed during playback.
-    NS_WARNING("GMP failed to decrypt due to lack of key");
-    return;
-  }
-  AudioCallbackAdapter::Error(aErr);
-}
-
-EMEAudioDecoder::EMEAudioDecoder(CDMProxy* aProxy,
-                                 const GMPAudioDecoderParams& aParams)
-  : GMPAudioDecoder(GMPAudioDecoderParams(aParams).WithAdapter(
-                    new EMEAudioCallbackAdapter(aParams.mCallback)))
-  , mProxy(aProxy)
-{}
-
-void
-EMEAudioDecoder::InitTags(nsTArray<nsCString>& aTags)
-{
-  aTags.AppendElement(NS_LITERAL_CSTRING("aac"));
-  aTags.AppendElement(NS_ConvertUTF16toUTF8(mProxy->KeySystem()));
-}
-
-nsCString
-EMEAudioDecoder::GetNodeId()
-{
-  return mProxy->GetNodeId();
-}
-
-} // namespace mozilla
deleted file mode 100644
--- a/dom/media/platforms/agnostic/eme/EMEAudioDecoder.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef EMEAudioDecoder_h_
-#define EMEAudioDecoder_h_
-
-#include "GMPAudioDecoder.h"
-#include "PlatformDecoderModule.h"
-
-namespace mozilla {
-
-class EMEAudioCallbackAdapter : public AudioCallbackAdapter {
-public:
-  explicit EMEAudioCallbackAdapter(MediaDataDecoderCallbackProxy* aCallback)
-   : AudioCallbackAdapter(aCallback)
-  {}
-
-  void Error(GMPErr aErr) override;
-};
-
-class EMEAudioDecoder : public GMPAudioDecoder {
-public:
-  EMEAudioDecoder(CDMProxy* aProxy, const GMPAudioDecoderParams& aParams);
-
-private:
-  void InitTags(nsTArray<nsCString>& aTags) override;
-  nsCString GetNodeId() override;
-
-  RefPtr<CDMProxy> mProxy;
-};
-
-} // namespace mozilla
-
-#endif
--- a/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp
+++ b/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "EMEDecoderModule.h"
-#include "EMEAudioDecoder.h"
 #include "EMEVideoDecoder.h"
 #include "MediaDataDecoderProxy.h"
 #include "mozIGeckoMediaPluginService.h"
 #include "mozilla/CDMProxy.h"
 #include "mozilla/Unused.h"
 #include "nsAutoPtr.h"
 #include "nsServiceManagerUtils.h"
 #include "MediaInfo.h"
@@ -95,21 +94,17 @@ public:
     } else if (aDecrypted.mStatus != Ok) {
       if (mCallback) {
         mCallback->Error(MediaResult(
           NS_ERROR_DOM_MEDIA_FATAL_ERR,
           RESULT_DETAIL("decrypted.mStatus=%u", uint32_t(aDecrypted.mStatus))));
       }
     } else {
       MOZ_ASSERT(!mIsShutdown);
-      // The Adobe GMP AAC decoder gets confused if we pass it non-encrypted
-      // samples with valid crypto data. So clear the crypto data, since the
-      // sample should be decrypted now anyway. If we don't do this and we're
-      // using the Adobe GMP for unencrypted decoding of data that is decrypted
-      // by gmp-clearkey, decoding will fail.
+      // The sample is no longer encrypted, so clear its crypto metadata.
       UniquePtr<MediaRawDataWriter> writer(aDecrypted.mSample->CreateWriter());
       writer->mCrypto = CryptoSample();
       mDecoder->Input(aDecrypted.mSample);
     }
   }
 
   void Flush() override {
     MOZ_ASSERT(mTaskQueue->IsCurrentThreadIn());
@@ -259,26 +254,20 @@ EMEDecoderModule::CreateVideoDecoder(con
   return emeDecoder.forget();
 }
 
 already_AddRefed<MediaDataDecoder>
 EMEDecoderModule::CreateAudioDecoder(const CreateDecoderParams& aParams)
 {
   MOZ_ASSERT(aParams.mConfig.mCrypto.mValid);
 
-  if (SupportsMimeType(aParams.mConfig.mMimeType, nullptr)) {
-    // GMP decodes. Assume that means it can decrypt too.
-    RefPtr<MediaDataDecoderProxy> wrapper =
-      CreateDecoderWrapper(aParams.mCallback, mProxy, aParams.mTaskQueue);
-    auto gmpParams = GMPAudioDecoderParams(aParams).WithCallback(wrapper);
-    wrapper->SetProxyTarget(new EMEAudioDecoder(mProxy, gmpParams));
-    return wrapper.forget();
-  }
+  // We don't support using the GMP to decode audio.
+  MOZ_ASSERT(!SupportsMimeType(aParams.mConfig.mMimeType, nullptr));
+  MOZ_ASSERT(mPDM);
 
-  MOZ_ASSERT(mPDM);
   RefPtr<MediaDataDecoder> decoder(mPDM->CreateDecoder(aParams));
   if (!decoder) {
     return nullptr;
   }
 
   RefPtr<MediaDataDecoder> emeDecoder(new EMEDecryptor(decoder,
                                                        aParams.mCallback,
                                                        mProxy,
--- a/dom/media/platforms/agnostic/eme/moz.build
+++ b/dom/media/platforms/agnostic/eme/moz.build
@@ -1,23 +1,21 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 EXPORTS += [
-    'EMEAudioDecoder.h',
     'EMEDecoderModule.h',
     'EMEVideoDecoder.h',
     'SamplesWaitingForKey.h',
 ]
 
 UNIFIED_SOURCES += [
-    'EMEAudioDecoder.cpp',
     'EMEDecoderModule.cpp',
     'EMEVideoDecoder.cpp',
     'SamplesWaitingForKey.cpp',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
deleted file mode 100644
--- a/dom/media/platforms/agnostic/gmp/GMPAudioDecoder.cpp
+++ /dev/null
@@ -1,306 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "GMPAudioDecoder.h"
-#include "nsServiceManagerUtils.h"
-#include "MediaInfo.h"
-#include "GMPDecoderModule.h"
-#include "nsPrintfCString.h"
-
-namespace mozilla {
-
-#if defined(DEBUG)
-bool IsOnGMPThread()
-{
-  nsCOMPtr<mozIGeckoMediaPluginService> mps = do_GetService("@mozilla.org/gecko-media-plugin-service;1");
-  MOZ_ASSERT(mps);
-
-  nsCOMPtr<nsIThread> gmpThread;
-  nsresult rv = mps->GetThread(getter_AddRefs(gmpThread));
-  MOZ_ASSERT(NS_SUCCEEDED(rv) && gmpThread);
-  return NS_GetCurrentThread() == gmpThread;
-}
-#endif
-
-void
-AudioCallbackAdapter::Decoded(const nsTArray<int16_t>& aPCM, uint64_t aTimeStamp, uint32_t aChannels, uint32_t aRate)
-{
-  MOZ_ASSERT(IsOnGMPThread());
-
-  if (aRate == 0 || aChannels == 0) {
-    mCallback->Error(MediaResult(
-      NS_ERROR_DOM_MEDIA_FATAL_ERR,
-      RESULT_DETAIL(
-        "Invalid rate or num channels returned on GMP audio samples")));
-    return;
-  }
-
-  size_t numFrames = aPCM.Length() / aChannels;
-  MOZ_ASSERT((aPCM.Length() % aChannels) == 0);
-  AlignedAudioBuffer audioData(aPCM.Length());
-  if (!audioData) {
-    mCallback->Error(
-      MediaResult(NS_ERROR_OUT_OF_MEMORY,
-                  RESULT_DETAIL("Unable to allocate audio buffer")));
-    return;
-  }
-
-  for (size_t i = 0; i < aPCM.Length(); ++i) {
-    audioData[i] = AudioSampleToFloat(aPCM[i]);
-  }
-
-  if (mMustRecaptureAudioPosition) {
-    mAudioFrameSum = 0;
-    auto timestamp = UsecsToFrames(aTimeStamp, aRate);
-    if (!timestamp.isValid()) {
-      mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_OVERFLOW_ERR,
-                                   RESULT_DETAIL("Invalid timestamp")));
-      return;
-    }
-    mAudioFrameOffset = timestamp.value();
-    mMustRecaptureAudioPosition = false;
-  }
-
-  auto timestamp = FramesToUsecs(mAudioFrameOffset + mAudioFrameSum, aRate);
-  if (!timestamp.isValid()) {
-    mCallback->Error(
-      MediaResult(NS_ERROR_DOM_MEDIA_OVERFLOW_ERR,
-                  RESULT_DETAIL("Invalid timestamp on audio samples")));
-    return;
-  }
-  mAudioFrameSum += numFrames;
-
-  auto duration = FramesToUsecs(numFrames, aRate);
-  if (!duration.isValid()) {
-    mCallback->Error(
-      MediaResult(NS_ERROR_DOM_MEDIA_OVERFLOW_ERR,
-                  RESULT_DETAIL("Invalid duration on audio samples")));
-    return;
-  }
-
-  RefPtr<AudioData> audio(new AudioData(mLastStreamOffset,
-                                        timestamp.value(),
-                                        duration.value(),
-                                        numFrames,
-                                        Move(audioData),
-                                        aChannels,
-                                        aRate));
-
-#ifdef LOG_SAMPLE_DECODE
-  LOG("Decoded audio sample! timestamp=%lld duration=%lld currentLength=%u",
-      timestamp, duration, currentLength);
-#endif
-
-  mCallback->Output(audio);
-}
-
-void
-AudioCallbackAdapter::InputDataExhausted()
-{
-  MOZ_ASSERT(IsOnGMPThread());
-  mCallback->InputExhausted();
-}
-
-void
-AudioCallbackAdapter::DrainComplete()
-{
-  MOZ_ASSERT(IsOnGMPThread());
-  mCallback->DrainComplete();
-}
-
-void
-AudioCallbackAdapter::ResetComplete()
-{
-  MOZ_ASSERT(IsOnGMPThread());
-  mMustRecaptureAudioPosition = true;
-  mCallback->FlushComplete();
-}
-
-void
-AudioCallbackAdapter::Error(GMPErr aErr)
-{
-  MOZ_ASSERT(IsOnGMPThread());
-  mCallback->Error(MediaResult(aErr == GMPDecodeErr
-                               ? NS_ERROR_DOM_MEDIA_DECODE_ERR
-                               : NS_ERROR_DOM_MEDIA_FATAL_ERR,
-                               RESULT_DETAIL("GMPErr:%x", aErr)));
-}
-
-void
-AudioCallbackAdapter::Terminated()
-{
-  mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
-                               RESULT_DETAIL("Audio GMP decoder terminated.")));
-}
-
-GMPAudioDecoderParams::GMPAudioDecoderParams(const CreateDecoderParams& aParams)
-  : mConfig(aParams.AudioConfig())
-  , mTaskQueue(aParams.mTaskQueue)
-  , mCallback(nullptr)
-  , mAdapter(nullptr)
-  , mCrashHelper(aParams.mCrashHelper)
-{}
-
-GMPAudioDecoderParams&
-GMPAudioDecoderParams::WithCallback(MediaDataDecoderProxy* aWrapper)
-{
-  MOZ_ASSERT(aWrapper);
-  MOZ_ASSERT(!mCallback); // Should only be called once per instance.
-  mCallback = aWrapper->Callback();
-  mAdapter = nullptr;
-  return *this;
-}
-
-GMPAudioDecoderParams&
-GMPAudioDecoderParams::WithAdapter(AudioCallbackAdapter* aAdapter)
-{
-  MOZ_ASSERT(aAdapter);
-  MOZ_ASSERT(!mAdapter); // Should only be called once per instance.
-  mCallback = aAdapter->Callback();
-  mAdapter = aAdapter;
-  return *this;
-}
-
-GMPAudioDecoder::GMPAudioDecoder(const GMPAudioDecoderParams& aParams)
-  : mConfig(aParams.mConfig)
-  , mCallback(aParams.mCallback)
-  , mGMP(nullptr)
-  , mAdapter(aParams.mAdapter)
-  , mCrashHelper(aParams.mCrashHelper)
-{
-  MOZ_ASSERT(!mAdapter || mCallback == mAdapter->Callback());
-  if (!mAdapter) {
-    mAdapter = new AudioCallbackAdapter(mCallback);
-  }
-}
-
-void
-GMPAudioDecoder::InitTags(nsTArray<nsCString>& aTags)
-{
-  aTags.AppendElement(NS_LITERAL_CSTRING("aac"));
-  const Maybe<nsCString> gmp(
-    GMPDecoderModule::PreferredGMP(NS_LITERAL_CSTRING("audio/mp4a-latm")));
-  if (gmp.isSome()) {
-    aTags.AppendElement(gmp.value());
-  }
-}
-
-nsCString
-GMPAudioDecoder::GetNodeId()
-{
-  return SHARED_GMP_DECODING_NODE_ID;
-}
-
-void
-GMPAudioDecoder::GMPInitDone(GMPAudioDecoderProxy* aGMP)
-{
-  MOZ_ASSERT(IsOnGMPThread());
-
-  if (!aGMP) {
-    mInitPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__);
-    return;
-  }
-  if (mInitPromise.IsEmpty()) {
-    // GMP must have been shutdown while we were waiting for Init operation
-    // to complete.
-    aGMP->Close();
-    return;
-  }
-  nsTArray<uint8_t> codecSpecific;
-  codecSpecific.AppendElements(mConfig.mCodecSpecificConfig->Elements(),
-                               mConfig.mCodecSpecificConfig->Length());
-
-  nsresult rv = aGMP->InitDecode(kGMPAudioCodecAAC,
-                                 mConfig.mChannels,
-                                 mConfig.mBitDepth,
-                                 mConfig.mRate,
-                                 codecSpecific,
-                                 mAdapter);
-  if (NS_FAILED(rv)) {
-    aGMP->Close();
-    mInitPromise.Reject(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__);
-    return;
-  }
-
-  mGMP = aGMP;
-  mInitPromise.Resolve(TrackInfo::kAudioTrack, __func__);
-}
-
-RefPtr<MediaDataDecoder::InitPromise>
-GMPAudioDecoder::Init()
-{
-  MOZ_ASSERT(IsOnGMPThread());
-
-  mMPS = do_GetService("@mozilla.org/gecko-media-plugin-service;1");
-  MOZ_ASSERT(mMPS);
-
-  RefPtr<InitPromise> promise(mInitPromise.Ensure(__func__));
-
-  nsTArray<nsCString> tags;
-  InitTags(tags);
-  UniquePtr<GetGMPAudioDecoderCallback> callback(new GMPInitDoneCallback(this));
-  if (NS_FAILED(mMPS->GetGMPAudioDecoder(mCrashHelper, &tags, GetNodeId(), Move(callback)))) {
-    mInitPromise.Reject(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__);
-  }
-
-  return promise;
-}
-
-void
-GMPAudioDecoder::Input(MediaRawData* aSample)
-{
-  MOZ_ASSERT(IsOnGMPThread());
-
-  RefPtr<MediaRawData> sample(aSample);
-  if (!mGMP) {
-    mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
-                                 RESULT_DETAIL("mGMP not initialized")));
-    return;
-  }
-
-  mAdapter->SetLastStreamOffset(sample->mOffset);
-
-  gmp::GMPAudioSamplesImpl samples(sample, mConfig.mChannels, mConfig.mRate);
-  nsresult rv = mGMP->Decode(samples);
-  if (NS_FAILED(rv)) {
-    mCallback->Error(MediaResult(rv, __func__));
-  }
-}
-
-void
-GMPAudioDecoder::Flush()
-{
-  MOZ_ASSERT(IsOnGMPThread());
-
-  if (!mGMP || NS_FAILED(mGMP->Reset())) {
-    // Abort the flush.
-    mCallback->FlushComplete();
-  }
-}
-
-void
-GMPAudioDecoder::Drain()
-{
-  MOZ_ASSERT(IsOnGMPThread());
-
-  if (!mGMP || NS_FAILED(mGMP->Drain())) {
-    mCallback->DrainComplete();
-  }
-}
-
-void
-GMPAudioDecoder::Shutdown()
-{
-  mInitPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__);
-  if (!mGMP) {
-    return;
-  }
-  // Note this unblocks flush and drain operations waiting for callbacks.
-  mGMP->Close();
-  mGMP = nullptr;
-}
-
-} // namespace mozilla
deleted file mode 100644
--- a/dom/media/platforms/agnostic/gmp/GMPAudioDecoder.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#if !defined(GMPAudioDecoder_h_)
-#define GMPAudioDecoder_h_
-
-#include "GMPAudioDecoderProxy.h"
-#include "MediaDataDecoderProxy.h"
-#include "PlatformDecoderModule.h"
-#include "mozIGeckoMediaPluginService.h"
-#include "nsAutoPtr.h"
-
-namespace mozilla {
-
-class AudioCallbackAdapter : public GMPAudioDecoderCallbackProxy {
-public:
-  explicit AudioCallbackAdapter(MediaDataDecoderCallbackProxy* aCallback)
-   : mCallback(aCallback)
-   , mLastStreamOffset(0)
-   , mAudioFrameSum(0)
-   , mAudioFrameOffset(0)
-   , mMustRecaptureAudioPosition(true)
-  {}
-
-  MediaDataDecoderCallbackProxy* Callback() const { return mCallback; }
-
-  // GMPAudioDecoderCallbackProxy
-  void Decoded(const nsTArray<int16_t>& aPCM, uint64_t aTimeStamp, uint32_t aChannels, uint32_t aRate) override;
-  void InputDataExhausted() override;
-  void DrainComplete() override;
-  void ResetComplete() override;
-  void Error(GMPErr aErr) override;
-  void Terminated() override;
-
-  void SetLastStreamOffset(int64_t aStreamOffset) {
-    mLastStreamOffset = aStreamOffset;
-  }
-
-private:
-  MediaDataDecoderCallbackProxy* mCallback;
-  int64_t mLastStreamOffset;
-
-  int64_t mAudioFrameSum;
-  int64_t mAudioFrameOffset;
-  bool mMustRecaptureAudioPosition;
-};
-
-struct GMPAudioDecoderParams {
-  explicit GMPAudioDecoderParams(const CreateDecoderParams& aParams);
-  GMPAudioDecoderParams& WithCallback(MediaDataDecoderProxy* aWrapper);
-  GMPAudioDecoderParams& WithAdapter(AudioCallbackAdapter* aAdapter);
-
-  const AudioInfo& mConfig;
-  TaskQueue* mTaskQueue;
-  MediaDataDecoderCallbackProxy* mCallback;
-  AudioCallbackAdapter* mAdapter;
-  RefPtr<GMPCrashHelper> mCrashHelper;
-};
-
-class GMPAudioDecoder : public MediaDataDecoder {
-public:
-  explicit GMPAudioDecoder(const GMPAudioDecoderParams& aParams);
-
-  RefPtr<InitPromise> Init() override;
-  void Input(MediaRawData* aSample) override;
-  void Flush() override;
-  void Drain() override;
-  void Shutdown() override;
-  const char* GetDescriptionName() const override
-  {
-    return "GMP audio decoder";
-  }
-
-protected:
-  virtual void InitTags(nsTArray<nsCString>& aTags);
-  virtual nsCString GetNodeId();
-
-private:
-
-  class GMPInitDoneCallback : public GetGMPAudioDecoderCallback
-  {
-  public:
-    explicit GMPInitDoneCallback(GMPAudioDecoder* aDecoder)
-      : mDecoder(aDecoder)
-    {
-    }
-
-    void Done(GMPAudioDecoderProxy* aGMP) override
-    {
-      mDecoder->GMPInitDone(aGMP);
-    }
-
-  private:
-    RefPtr<GMPAudioDecoder> mDecoder;
-  };
-  void GMPInitDone(GMPAudioDecoderProxy* aGMP);
-
-  const AudioInfo mConfig;
-  MediaDataDecoderCallbackProxy* mCallback;
-  nsCOMPtr<mozIGeckoMediaPluginService> mMPS;
-  GMPAudioDecoderProxy* mGMP;
-  nsAutoPtr<AudioCallbackAdapter> mAdapter;
-  MozPromiseHolder<InitPromise> mInitPromise;
-  RefPtr<GMPCrashHelper> mCrashHelper;
-};
-
-} // namespace mozilla
-
-#endif // GMPAudioDecoder_h_
--- a/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
+++ b/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
@@ -1,26 +1,24 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "GMPDecoderModule.h"
 #include "DecoderDoctorDiagnostics.h"
-#include "GMPAudioDecoder.h"
 #include "GMPVideoDecoder.h"
 #include "GMPUtils.h"
 #include "MediaDataDecoderProxy.h"
 #include "MediaPrefs.h"
 #include "VideoUtils.h"
 #include "mozIGeckoMediaPluginService.h"
 #include "nsServiceManagerUtils.h"
 #include "mozilla/StaticMutex.h"
-#include "gmp-audio-decode.h"
 #include "gmp-video-decode.h"
 #include "MP4Decoder.h"
 #include "VPXDecoder.h"
 #ifdef XP_WIN
 #include "WMFDecoderModule.h"
 #endif
 
 namespace mozilla {
@@ -52,85 +50,40 @@ already_AddRefed<MediaDataDecoder>
 GMPDecoderModule::CreateVideoDecoder(const CreateDecoderParams& aParams)
 {
   if (!MP4Decoder::IsH264(aParams.mConfig.mMimeType) &&
       !VPXDecoder::IsVP8(aParams.mConfig.mMimeType) &&
       !VPXDecoder::IsVP9(aParams.mConfig.mMimeType)) {
     return nullptr;
   }
 
-  if (aParams.mDiagnostics) {
-    const Maybe<nsCString> preferredGMP = PreferredGMP(aParams.mConfig.mMimeType);
-    if (preferredGMP.isSome()) {
-      aParams.mDiagnostics->SetGMP(preferredGMP.value());
-    }
-  }
-
   RefPtr<MediaDataDecoderProxy> wrapper = CreateDecoderWrapper(aParams.mCallback);
   auto params = GMPVideoDecoderParams(aParams).WithCallback(wrapper);
   wrapper->SetProxyTarget(new GMPVideoDecoder(params));
   return wrapper.forget();
 }
 
 already_AddRefed<MediaDataDecoder>
 GMPDecoderModule::CreateAudioDecoder(const CreateDecoderParams& aParams)
 {
-  if (!aParams.mConfig.mMimeType.EqualsLiteral("audio/mp4a-latm")) {
-    return nullptr;
-  }
-
-  if (aParams.mDiagnostics) {
-    const Maybe<nsCString> preferredGMP = PreferredGMP(aParams.mConfig.mMimeType);
-    if (preferredGMP.isSome()) {
-      aParams.mDiagnostics->SetGMP(preferredGMP.value());
-    }
-  }
-
-  RefPtr<MediaDataDecoderProxy> wrapper = CreateDecoderWrapper(aParams.mCallback);
-  auto params = GMPAudioDecoderParams(aParams).WithCallback(wrapper);
-  wrapper->SetProxyTarget(new GMPAudioDecoder(params));
-  return wrapper.forget();
+  return nullptr;
 }
 
 PlatformDecoderModule::ConversionRequired
 GMPDecoderModule::DecoderNeedsConversion(const TrackInfo& aConfig) const
 {
   // GMPVideoCodecType::kGMPVideoCodecH264 specifies that encoded frames must be in AVCC format.
   if (aConfig.IsVideo() && MP4Decoder::IsH264(aConfig.mMimeType)) {
     return ConversionRequired::kNeedAVCC;
   } else {
     return ConversionRequired::kNeedNone;
   }
 }
 
 /* static */
-const Maybe<nsCString>
-GMPDecoderModule::PreferredGMP(const nsACString& aMimeType)
-{
-  Maybe<nsCString> rv;
-  if (aMimeType.EqualsLiteral("audio/mp4a-latm")) {
-    switch (MediaPrefs::GMPAACPreferred()) {
-      case 1: rv.emplace(kEMEKeySystemClearkey); break;
-      case 2: rv.emplace(kEMEKeySystemPrimetime); break;
-      default: break;
-    }
-  }
-
-  if (MP4Decoder::IsH264(aMimeType)) {
-    switch (MediaPrefs::GMPH264Preferred()) {
-      case 1: rv.emplace(kEMEKeySystemClearkey); break;
-      case 2: rv.emplace(kEMEKeySystemPrimetime); break;
-      default: break;
-    }
-  }
-
-  return rv;
-}
-
-/* static */
 bool
 GMPDecoderModule::SupportsMimeType(const nsACString& aMimeType,
                                    const Maybe<nsCString>& aGMP)
 {
   if (aGMP.isNothing()) {
     return false;
   }
 
@@ -144,29 +97,19 @@ GMPDecoderModule::SupportsMimeType(const
                       { NS_LITERAL_CSTRING("vp9"), aGMP.value()});
   }
 
   if (VPXDecoder::IsVP8(aMimeType)) {
     return HaveGMPFor(NS_LITERAL_CSTRING(GMP_API_VIDEO_DECODER),
                       { NS_LITERAL_CSTRING("vp8"), aGMP.value()});
   }
 
-  if (MP4Decoder::IsAAC(aMimeType)) {
-    return HaveGMPFor(NS_LITERAL_CSTRING(GMP_API_AUDIO_DECODER),
-                      { NS_LITERAL_CSTRING("aac"), aGMP.value()});
-  }
-
   return false;
 }
 
 bool
 GMPDecoderModule::SupportsMimeType(const nsACString& aMimeType,
                                    DecoderDoctorDiagnostics* aDiagnostics) const
 {
-  const Maybe<nsCString> preferredGMP = PreferredGMP(aMimeType);
-  bool rv = SupportsMimeType(aMimeType, preferredGMP);
-  if (rv && aDiagnostics && preferredGMP.isSome()) {
-    aDiagnostics->SetGMP(preferredGMP.value());
-  }
-  return rv;
+  return false;
 }
 
 } // namespace mozilla
--- a/dom/media/platforms/agnostic/gmp/GMPDecoderModule.h
+++ b/dom/media/platforms/agnostic/gmp/GMPDecoderModule.h
@@ -41,17 +41,15 @@ public:
 
   ConversionRequired
   DecoderNeedsConversion(const TrackInfo& aConfig) const override;
 
   bool
   SupportsMimeType(const nsACString& aMimeType,
                    DecoderDoctorDiagnostics* aDiagnostics) const override;
 
-  static const Maybe<nsCString> PreferredGMP(const nsACString& aMimeType);
-
   static bool SupportsMimeType(const nsACString& aMimeType,
                                const Maybe<nsCString>& aGMP);
 };
 
 } // namespace mozilla
 
 #endif // GMPDecoderModule_h_
--- a/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
+++ b/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
@@ -10,17 +10,26 @@
 #include "prsystem.h"
 #include "MediaData.h"
 #include "GMPDecoderModule.h"
 #include "VPXDecoder.h"
 
 namespace mozilla {
 
 #if defined(DEBUG)
-extern bool IsOnGMPThread();
+static bool IsOnGMPThread()
+{
+  nsCOMPtr<mozIGeckoMediaPluginService> mps = do_GetService("@mozilla.org/gecko-media-plugin-service;1");
+  MOZ_ASSERT(mps);
+
+  nsCOMPtr<nsIThread> gmpThread;
+  nsresult rv = mps->GetThread(getter_AddRefs(gmpThread));
+  MOZ_ASSERT(NS_SUCCEEDED(rv) && gmpThread);
+  return NS_GetCurrentThread() == gmpThread;
+}
 #endif
 
 void
 VideoCallbackAdapter::Decoded(GMPVideoi420Frame* aDecodedFrame)
 {
   GMPUniquePtr<GMPVideoi420Frame> decodedFrame(aDecodedFrame);
 
   MOZ_ASSERT(IsOnGMPThread());
@@ -157,21 +166,16 @@ GMPVideoDecoder::GMPVideoDecoder(const G
   }
 }
 
 void
 GMPVideoDecoder::InitTags(nsTArray<nsCString>& aTags)
 {
   if (MP4Decoder::IsH264(mConfig.mMimeType)) {
     aTags.AppendElement(NS_LITERAL_CSTRING("h264"));
-    const Maybe<nsCString> gmp(
-      GMPDecoderModule::PreferredGMP(NS_LITERAL_CSTRING("video/avc")));
-    if (gmp.isSome()) {
-      aTags.AppendElement(gmp.value());
-    }
   } else if (VPXDecoder::IsVP8(mConfig.mMimeType)) {
     aTags.AppendElement(NS_LITERAL_CSTRING("vp8"));
   } else if (VPXDecoder::IsVP9(mConfig.mMimeType)) {
     aTags.AppendElement(NS_LITERAL_CSTRING("vp9"));
   }
 }
 
 nsCString
--- a/dom/media/platforms/agnostic/gmp/moz.build
+++ b/dom/media/platforms/agnostic/gmp/moz.build
@@ -1,23 +1,21 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 EXPORTS += [
-    'GMPAudioDecoder.h',
     'GMPDecoderModule.h',
     'GMPVideoDecoder.h',
     'MediaDataDecoderProxy.h',
 ]
 
 UNIFIED_SOURCES += [
-    'GMPAudioDecoder.cpp',
     'GMPDecoderModule.cpp',
     'GMPVideoDecoder.cpp',
     'MediaDataDecoderProxy.cpp',
 ]
 
 # GMPVideoEncodedFrameImpl.h needs IPC
 include('/ipc/chromium/chromium-config.mozbuild')
 
--- a/dom/media/test/external/external_media_harness/testcase.py
+++ b/dom/media/test/external/external_media_harness/testcase.py
@@ -195,55 +195,42 @@ class NetworkBandwidthTestsMixin(object)
         self.proxy.limits({'downstream_kbps': 500})
         self.run_videos(timeout=120)
 
     def test_playback_limiting_bandwidth_1000(self):
         self.proxy.limits({'downstream_kbps': 1000})
         self.run_videos(timeout=120)
 
 
-reset_adobe_gmp_script = """
-navigator.requestMediaKeySystemAccess('com.adobe.primetime',
-[{initDataTypes: ['cenc']}]).then(
-    function(access) {
-        marionetteScriptFinished('success');
-    },
-    function(ex) {
-        marionetteScriptFinished(ex);
-    }
-);
-"""
-
-
 reset_widevine_gmp_script = """
 navigator.requestMediaKeySystemAccess('com.widevine.alpha',
 [{initDataTypes: ['cenc']}]).then(
     function(access) {
         marionetteScriptFinished('success');
     },
     function(ex) {
         marionetteScriptFinished(ex);
     }
 );
 """
 
 
 class EMESetupMixin(object):
 
     """
-    An object that needs to use the Adobe or Widevine GMP system must inherit
+    An object that needs to use the Widevine GMP system must inherit
     from this class, and then call check_eme_system() to insure that everything
     is setup correctly.
     """
 
     version_needs_reset = True
 
     def check_eme_system(self):
         """
-        Download the most current version of the Adobe and Widevine GMP
+        Download the most current version of the Widevine GMP
         Plugins. Verify that all MSE and EME prefs are set correctly. Raises
         if things are not OK.
         """
         self.set_eme_prefs()
         self.reset_GMP_version()
         assert(self.check_eme_prefs())
 
     def set_eme_prefs(self):
@@ -251,31 +238,22 @@ class EMESetupMixin(object):
             # https://bugzilla.mozilla.org/show_bug.cgi?id=1187471#c28
             # 2015-09-28 cpearce says this is no longer necessary, but in case
             # we are working with older firefoxes...
             self.marionette.set_pref('media.gmp.trial-create.enabled', False)
 
     def reset_GMP_version(self):
         if EMESetupMixin.version_needs_reset:
             with self.marionette.using_context(Marionette.CONTEXT_CHROME):
-                if self.marionette.get_pref('media.gmp-eme-adobe.version'):
-                    self.marionette.reset_pref('media.gmp-eme-adobe.version')
                 if self.marionette.get_pref('media.gmp-widevinecdm.version'):
                     self.marionette.reset_pref('media.gmp-widevinecdm.version')
             with self.marionette.using_context(Marionette.CONTEXT_CONTENT):
-                adobe_result = self.marionette.execute_async_script(
-                    reset_adobe_gmp_script,
-                    script_timeout=60000)
                 widevine_result = self.marionette.execute_async_script(
                     reset_widevine_gmp_script,
                     script_timeout=60000)
-                if not adobe_result == 'success':
-                    raise VideoException(
-                        'ERROR: Resetting Adobe GMP failed {}'
-                        .format(adobe_result))
                 if not widevine_result == 'success':
                     raise VideoException(
                         'ERROR: Resetting Widevine GMP failed {}'
                         .format(widevine_result))
 
             EMESetupMixin.version_needs_reset = False
 
     def check_and_log_boolean_pref(self, pref_name, expected_value):
@@ -347,16 +325,12 @@ class EMESetupMixin(object):
             return all([
                 self.check_and_log_boolean_pref(
                     'media.mediasource.enabled', True),
                 self.check_and_log_boolean_pref(
                     'media.eme.enabled', True),
                 self.check_and_log_boolean_pref(
                     'media.mediasource.mp4.enabled', True),
                 self.check_and_log_boolean_pref(
-                    'media.gmp-eme-adobe.enabled', True),
-                self.check_and_log_integer_pref(
-                    'media.gmp-eme-adobe.version', 1),
-                self.check_and_log_boolean_pref(
                     'media.gmp-widevinecdm.enabled', True),
                 self.chceck_and_log_version_string_pref(
                     'media.gmp-widevinecdm.version', '1.0.0.0')
             ])
--- a/dom/smil/test/test_smilChangeAfterFrozen.xhtml
+++ b/dom/smil/test/test_smilChangeAfterFrozen.xhtml
@@ -481,17 +481,17 @@ function testRelativeFont()
   gCircleParent.removeAttribute("font-size");
   gCircle.removeChild(gCircle.firstChild);
 }
 
 function testCalcFontSize()
 {
   setupTest();
   gCircleParent.setAttribute("font-size", "10px"); // At first: font-size: 10px
-  var anim = createAnimSetTo("font-size", "-moz-calc(110% + 0.1em)");
+  var anim = createAnimSetTo("font-size", "calc(110% + 0.1em)");
 
   gSvg.setCurrentTime(0);
   var fsize = parseInt(SMILUtil.getComputedStyleSimple(gCircle, "font-size"));
   // Font size should be 1.1 * 10px + 0.1 * 10px = 12
   is(fsize, 12, "Checking animated calc font-size == 12px after animating");
 
   gCircleParent.setAttribute("font-size", "20px"); // Change: font-size: 20px
   gSvg.setCurrentTime(0);
--- a/dom/u2f/tests/mochitest.ini
+++ b/dom/u2f/tests/mochitest.ini
@@ -22,8 +22,23 @@ skip-if = !e10s
 [test_register_sign.html]
 skip-if = !e10s
 [test_appid_facet.html]
 skip-if = !e10s
 [test_appid_facet_insecure.html]
 skip-if = !e10s
 [test_appid_facet_subdomain.html]
 skip-if = !e10s
+[test_webauthn_loopback.html]
+skip-if = !e10s
+scheme = https
+[test_webauthn_no_token.html]
+skip-if = !e10s
+scheme = https
+[test_webauthn_make_credential.html]
+skip-if = !e10s
+scheme = https
+[test_webauthn_get_assertion.html]
+skip-if = !e10s
+scheme = https
+[test_webauthn_sameorigin.html]
+skip-if = !e10s
+scheme = https
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/dom/u2f/tests/test_webauthn_get_assertion.html
@@ -0,0 +1,91 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<head>
+  <title>Tests for GetAssertion for W3C Web Authentication</title>
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" src="u2futil.js"></script>
+  <script type="text/javascript" src="pkijs/common.js"></script>
+  <script type="text/javascript" src="pkijs/asn1.js"></script>
+  <script type="text/javascript" src="pkijs/x509_schema.js"></script>
+  <script type="text/javascript" src="pkijs/x509_simpl.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+
+<h1>Tests for GetAssertion for W3C Web Authentication</h1>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1309284">Mozilla Bug 1309284</a>
+
+<script class="testbody" type="text/javascript">
+"use strict";
+
+// Execute the full-scope test
+SimpleTest.waitForExplicitFinish();
+
+function arrivingHereIsBad(aResult) {
+  ok(false, "Bad result! Received a: " + aResult);
+  return Promise.resolve();
+}
+
+function expectNotAllowedError(aResult) {
+  ok(aResult.toString().startsWith("NotAllowedError"), "Expecting a NotAllowedError");
+  return Promise.resolve();
+}
+
+function expectTypeError(aResult) {
+  ok(aResult.toString().startsWith("TypeError"), "Expecting a TypeError");
+  return Promise.resolve();
+}
+
+SpecialPowers.pushPrefEnv({"set": [["security.webauth.w3c", true],
+                                   ["security.webauth.u2f_enable_softtoken", true],
+                                   ["security.webauth.u2f_enable_usbtoken", false]]},
+function() {
+  isnot(navigator.authentication, undefined, "WebAuthn API endpoint must exist");
+  isnot(navigator.authentication.makeCredential, undefined, "WebAuthn makeCredential API endpoint must exist");
+  isnot(navigator.authentication.getAssertion, undefined, "WebAuthn getAssertion API endpoint must exist");
+
+  let authn = navigator.authentication;
+
+  let gAssertionChallenge = new Uint8Array(16);
+  window.crypto.getRandomValues(gAssertionChallenge);
+
+  let invalidCred = { type: "Magic", id: base64ToBytes("AAA=") };
+  let unknownCred = { type: "ScopedCred", id: base64ToBytes("AAA=") };
+
+  Promise.all([
+    // Test basic good call, but without giving a credential so expect failures
+    // this is OK by the standard, but not supported by U2F-backed authenticators
+    // like the soft token in use here.
+    authn.getAssertion(gAssertionChallenge)
+    .then(arrivingHereIsBad)
+    .catch(expectNotAllowedError),
+
+    // Test with an unexpected option
+    authn.getAssertion(gAssertionChallenge, { unknownValue: "hi" })
+    .then(arrivingHereIsBad)
+    .catch(expectNotAllowedError),
+
+    // Test with an invalid credential
+    authn.getAssertion(gAssertionChallenge, { allowList: [invalidCred] })
+    .then(arrivingHereIsBad)
+    .catch(expectTypeError),
+
+    // Test with an unknown credential
+    authn.getAssertion(gAssertionChallenge, { allowList: [unknownCred] })
+    .then(arrivingHereIsBad)
+    .catch(expectNotAllowedError),
+
+    // Test with an unexpected option and an invalid credential
+    authn.getAssertion(gAssertionChallenge, { unknownValue: "hi" })
+    .then(arrivingHereIsBad)
+    .catch(expectNotAllowedError)
+  ])
+  .then(function(){
+    SimpleTest.finish();
+  });
+});
+
+</script>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/u2f/tests/test_webauthn_loopback.html
@@ -0,0 +1,170 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<head>
+  <title>Full-run test for MakeCredential/GetAssertion for W3C Web Authentication</title>
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" src="u2futil.js"></script>
+  <script type="text/javascript" src="pkijs/common.js"></script>
+  <script type="text/javascript" src="pkijs/asn1.js"></script>
+  <script type="text/javascript" src="pkijs/x509_schema.js"></script>
+  <script type="text/javascript" src="pkijs/x509_simpl.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+
+<h1>Full-run test for MakeCredential/GetAssertion for W3C Web Authentication</h1>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1309284">Mozilla Bug 1309284</a>
+
+<script class="testbody" type="text/javascript">
+"use strict";
+
+// Execute the full-scope test
+SimpleTest.waitForExplicitFinish();
+
+SpecialPowers.pushPrefEnv({"set": [["security.webauth.w3c", true],
+                                   ["security.webauth.u2f_enable_softtoken", true],
+                                   ["security.webauth.u2f_enable_usbtoken", false]]},
+function() {
+  isnot(navigator.authentication, undefined, "WebAuthn API endpoint must exist");
+  isnot(navigator.authentication.makeCredential, undefined, "WebAuthn makeCredential API endpoint must exist");
+  isnot(navigator.authentication.getAssertion, undefined, "WebAuthn getAssertion API endpoint must exist");
+
+  let authn = navigator.authentication;
+
+  let gCredentialChallenge = new Uint8Array(16);
+  window.crypto.getRandomValues(gCredentialChallenge);
+  let gAssertionChallenge = new Uint8Array(16);
+  window.crypto.getRandomValues(gAssertionChallenge);
+
+  testMakeCredential();
+
+  function checkCredentialValid(aCredInfo) {
+    /* ScopedCredentialInfo
+    - Credential
+    -- ID: Key Handle buffer pulled from U2F Register() Response
+    -- Type: "ScopedCred"
+    - WebAuthnAttestation
+    -- Format: "u2f"
+    -- ClientData: serialized JSON
+    -- AuthenticatorData: RP ID Hash || U2F Sign() Response
+    -- Attestation: U2F Register() Response */
+
+    is(aCredInfo.credential.type, "ScopedCred", "Type is correct");
+    ok(aCredInfo.credential.id.length > 0, "Key ID exists");
+
+    is(aCredInfo.attestation.format, "u2f", "Format is correct");
+    is(aCredInfo.attestation.attestation[0], 0x05, "Reserved byte is correct");
+    ok(aCredInfo.attestation.authenticatorData.length > 0, "Authenticator data exists");
+    let clientData = JSON.parse(buffer2string(aCredInfo.attestation.clientData));
+    is(clientData.challenge, bytesToBase64UrlSafe(gCredentialChallenge), "Challenge is correct");
+    is(clientData.origin, window.location.origin, "Origin is correct");
+    is(clientData.hashAlg, "S256", "Hash algorithm is correct");
+
+    return decodeU2FRegistration(aCredInfo.attestation.attestation)
+    .then(function(u2fObj) {
+      aCredInfo.u2fReg = u2fObj;
+      return aCredInfo;
+    });
+  }
+
+  function checkAssertionAndSigValid(aPublicKey, aAssertion) {
+    /* WebAuthnAssertion
+    - Credential
+    -- ID: ID of Credential from AllowList that succeeded
+    -- Type: "ScopedCred"
+    - ClientData: serialized JSON
+    - AuthenticatorData: RP ID Hash || U2F Sign() Response
+    - Signature: U2F Sign() Response */
+
+    is(aAssertion.credential.type, "ScopedCred", "Type is correct");
+    ok(aAssertion.credential.id.length > 0, "Key ID exists");
+
+    ok(aAssertion.authenticatorData.length > 0, "Authenticator data exists");
+    let clientData = JSON.parse(buffer2string(aAssertion.clientData));
+    is(clientData.challenge, bytesToBase64UrlSafe(gAssertionChallenge), "Challenge is correct");
+    is(clientData.origin, window.location.origin, "Origin is correct");
+    is(clientData.hashAlg, "S256", "Hash algorithm is correct");
+
+    // Parse the signature data
+    if (aAssertion.signature[0] != 0x01) {
+      throw "User presence byte not set";
+    }
+    let presenceAndCounter = aAssertion.signature.slice(0,5);
+    let signatureValue = aAssertion.signature.slice(5);
+
+    let rpIdHash = aAssertion.authenticatorData.slice(0,32);
+
+    // Assemble the signed data and verify the signature
+    return deriveAppAndChallengeParam(clientData.origin, aAssertion.clientData)
+    .then(function(aParams) {
+      console.log(aParams.appParam, rpIdHash, presenceAndCounter, aParams.challengeParam);
+      console.log("ClientData buffer: ", hexEncode(aAssertion.clientData));
+      console.log("ClientDataHash: ", hexEncode(aParams.challengeParam));
+      return assembleSignedData(aParams.appParam, presenceAndCounter, aParams.challengeParam);
+    })
+    .then(function(aSignedData) {
+      console.log(aPublicKey, aSignedData, signatureValue);
+      return verifySignature(aPublicKey, aSignedData, signatureValue);
+    })
+  }
+
+  function testMakeCredential() {
+    let acct = {rpDisplayName: "none", displayName: "none", id: "none"};
+    let param = {type: "ScopedCred", algorithm: "p-256"};
+
+    authn.makeCredential(acct, [param], gCredentialChallenge)
+    .then(checkCredentialValid)
+    .then(testMakeDuplicate)
+    .catch(function(aReason) {
+      ok(false, aReason);
+      SimpleTest.finish();
+    });
+  }
+
+  function testMakeDuplicate(aCredInfo) {
+    let acct = {rpDisplayName: "none", displayName: "none", id: "none"};
+    let param = {type: "ScopedCred", algorithm: "p-256"};
+    let options = {rpId: document.origin,
+                   excludeList: [aCredInfo.credential]};
+
+    authn.makeCredential(acct, [param], gCredentialChallenge, options)
+    .then(function() {
+      // We should have errored here!
+      ok(false, "The excludeList didn't stop a duplicate being created!");
+      SimpleTest.finish();
+    })
+    .catch(function(aReason) {
+      ok(aReason.toString().startsWith("NotAllowedError"), "Expect NotAllowedError, got" + aReason);
+      testAssertion(aCredInfo);
+    });
+  }
+
+  function testAssertion(aCredInfo) {
+    let newCredential = {
+      type: aCredInfo.credential.type,
+      id: Uint8Array.from(aCredInfo.credential.id),
+      transports: [ "usb" ],
+    }
+
+    let assertOptions = {rpId: document.origin, timeoutSeconds: 5,
+                         allowList: [ newCredential ]};
+    authn.getAssertion(gAssertionChallenge, assertOptions)
+    .then(function(aAssertion) {
+      /* Pass along the pubKey. */
+      return checkAssertionAndSigValid(aCredInfo.u2fReg.publicKey, aAssertion);
+    })
+    .then(function(aSigVerifyResult) {
+      ok(aSigVerifyResult, "Signing signature verified");
+      SimpleTest.finish();
+    })
+    .catch(function(reason) {
+      ok(false, "Signing signature invalid: " + reason);
+      SimpleTest.finish();
+    });
+  }
+});
+
+</script>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/u2f/tests/test_webauthn_make_credential.html
@@ -0,0 +1,158 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<head>
+  <title>Test for MakeCredential for W3C Web Authentication</title>
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" src="u2futil.js"></script>
+  <script type="text/javascript" src="pkijs/common.js"></script>
+  <script type="text/javascript" src="pkijs/asn1.js"></script>
+  <script type="text/javascript" src="pkijs/x509_schema.js"></script>
+  <script type="text/javascript" src="pkijs/x509_simpl.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+
+<h1>Test for MakeCredential for W3C Web Authentication</h1>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1309284">Mozilla Bug 1309284</a>
+
+<script class="testbody" type="text/javascript">
+"use strict";
+
+// Execute the full-scope test
+SimpleTest.waitForExplicitFinish();
+
+function arrivingHereIsGood(aResult) {
+  ok(true, "Good result! Received a: " + aResult);
+  return Promise.resolve();
+}
+
+function arrivingHereIsBad(aResult) {
+  ok(false, "Bad result! Received a: " + aResult);
+  return Promise.resolve();
+}
+
+function expectNotAllowedError(aResult) {
+  ok(aResult.toString().startsWith("NotAllowedError"), "Expecting a NotAllowedError");
+  return Promise.resolve();
+}
+
+function expectTypeError(aResult) {
+  ok(aResult.toString().startsWith("TypeError"), "Expecting a TypeError");
+  return Promise.resolve();
+}
+
+function expectNotSupportedError(aResult) {
+  ok(aResult.toString().startsWith("NotSupportedError"), "Expecting a NotSupportedError");
+  return Promise.resolve();
+}
+
+SpecialPowers.pushPrefEnv({"set": [["security.webauth.w3c", true],
+                                   ["security.webauth.u2f_enable_softtoken", true],
+                                   ["security.webauth.u2f_enable_usbtoken", false]]},
+function() {
+  isnot(navigator.authentication, undefined, "WebAuthn API endpoint must exist");
+  isnot(navigator.authentication.makeCredential, undefined, "WebAuthn makeCredential API endpoint must exist");
+  isnot(navigator.authentication.getAssertion, undefined, "WebAuthn getAssertion API endpoint must exist");
+
+  let authn = navigator.authentication;
+
+  let gCredentialChallenge = new Uint8Array(16);
+  window.crypto.getRandomValues(gCredentialChallenge);
+
+  let acct = {rpDisplayName: "none", displayName: "none", id: "none"};
+  let param = {type: "ScopedCred", algorithm: "p-256"};
+  let unsupportedParam = {type: "ScopedCred", algorithm: "3DES"};
+  let badParam = {type: "SimplePassword", algorithm: "MaxLength=2"};
+
+  Promise.all([
+    // Test basic good call
+    authn.makeCredential(acct, [param], gCredentialChallenge)
+    .then(arrivingHereIsGood)
+    .catch(arrivingHereIsBad),
+
+    // Test empty account
+    authn.makeCredential({}, [param], gCredentialChallenge)
+    .then(arrivingHereIsBad)
+    .catch(expectTypeError),
+
+    // Test without a parameter
+    authn.makeCredential(acct, [], gCredentialChallenge)
+    .then(arrivingHereIsBad)
+    .catch(expectNotSupportedError),
+
+    // Test without a parameter array at all
+    authn.makeCredential(acct, null, gCredentialChallenge)
+    .then(arrivingHereIsBad)
+    .catch(expectTypeError),
+
+    // Test with an unsupported parameter
+    authn.makeCredential(acct, [unsupportedParam], gCredentialChallenge)
+    .then(arrivingHereIsBad)
+    .catch(expectNotSupportedError),
+
+    // Test with an unsupported parameter and a good one
+    authn.makeCredential(acct, [unsupportedParam, param], gCredentialChallenge)
+    .then(arrivingHereIsGood)
+    .catch(arrivingHereIsBad),
+
+    // Test with a bad parameter
+    authn.makeCredential(acct, [badParam], gCredentialChallenge)
+    .then(arrivingHereIsBad)
+    .catch(expectTypeError),
+
+    // Test with an unsupported parameter, and a bad one
+    authn.makeCredential(acct, [unsupportedParam, badParam],
+                         gCredentialChallenge)
+    .then(arrivingHereIsBad)
+    .catch(expectTypeError),
+
+    // Test with an unsupported parameter, a bad one, and a good one. This
+    // should still fail, as anything with a badParam should fail.
+    authn.makeCredential(acct, [unsupportedParam, badParam, param],
+                         gCredentialChallenge)
+    .then(arrivingHereIsBad)
+    .catch(expectTypeError),
+
+    // Test without a challenge
+    authn.makeCredential(acct, [param], null)
+    .then(arrivingHereIsBad)
+    .catch(expectTypeError),
+
+    // Test with an invalid challenge
+    authn.makeCredential(acct, [param], "begone, thou ill-fitting moist glove!")
+    .then(arrivingHereIsBad)
+    .catch(expectTypeError),
+
+    // Test with duplicate parameters
+    authn.makeCredential(acct, [param, param, param], gCredentialChallenge)
+    .then(arrivingHereIsGood)
+    .catch(arrivingHereIsBad),
+
+    // Test an incomplete account
+    authn.makeCredential({id: "none"}, [param], gCredentialChallenge)
+    .then(arrivingHereIsBad)
+    .catch(expectTypeError),
+
+    authn.makeCredential({name: "none", imageURL: "http://example.com/404"},
+                         [param], gCredentialChallenge)
+    .then(arrivingHereIsBad)
+    .catch(expectTypeError),
+
+    // Test a complete account
+    authn.makeCredential({rpDisplayName: "Foxxy", displayName: "Foxxy V",
+                          id: "foxes_are_the_best@example.com",
+                          name: "Fox F. Foxington",
+                          imageURL: "https://example.com/fox.svg"},
+                         [param], gCredentialChallenge)
+    .then(arrivingHereIsGood)
+    .catch(arrivingHereIsBad)
+  ])
+  .then(function() {
+    SimpleTest.finish();
+  });
+});
+
+</script>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/u2f/tests/test_webauthn_no_token.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<head>
+  <title>Test for W3C Web Authentication with no token</title>
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" src="u2futil.js"></script>
+  <script type="text/javascript" src="pkijs/common.js"></script>
+  <script type="text/javascript" src="pkijs/asn1.js"></script>
+  <script type="text/javascript" src="pkijs/x509_schema.js"></script>
+  <script type="text/javascript" src="pkijs/x509_simpl.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+
+<h1>Test for W3C Web Authentication with no token</h1>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1309284">Mozilla Bug 1309284</a>
+
+<script class="testbody" type="text/javascript">
+"use strict";
+
+// Execute the full-scope test
+SimpleTest.waitForExplicitFinish();
+
+SpecialPowers.pushPrefEnv({"set": [["security.webauth.w3c", true],
+                                   ["security.webauth.u2f_enable_softtoken", false],
+                                   ["security.webauth.u2f_enable_usbtoken", false]]},
+function() {
+  isnot(navigator.authentication, undefined, "WebAuthn API endpoint must exist");
+  isnot(navigator.authentication.makeCredential, undefined, "WebAuthn makeCredential API endpoint must exist");
+  isnot(navigator.authentication.getAssertion, undefined, "WebAuthn getAssertion API endpoint must exist");
+
+  let authn = navigator.authentication;
+
+  let credentialChallenge = new Uint8Array(16);
+  window.crypto.getRandomValues(credentialChallenge);
+  let assertionChallenge = new Uint8Array(16);
+  window.crypto.getRandomValues(assertionChallenge);
+  let credentialId = new Uint8Array(128);
+  window.crypto.getRandomValues(credentialId);
+
+  testMakeCredential();
+
+  function testMakeCredential() {
+    let acct = {rpDisplayName: "none", displayName: "none", id: "none"};
+    let param = {type: "ScopedCred", algorithm: "p-256"};
+    authn.makeCredential(acct, [param], credentialChallenge)
+    .then(function(aResult) {
+      ok(false, "Should have failed.");
+      testAssertion();
+    })
+    .catch(function(aReason) {
+      ok(aReason.toString().startsWith("NotAllowedError"), aReason);
+      testAssertion();
+    });
+  }
+
+  function testAssertion() {
+    let newCredential = {
+      type: "ScopedCred",
+      id: credentialId,
+      transports: [ "usb" ],
+    }
+    let assertOptions = {rpId: document.origin, timeoutSeconds: 5,
+                         allowList: [ newCredential ]};
+    authn.getAssertion(assertionChallenge, assertOptions)
+    .then(function(aResult) {
+      ok(false, "Should have failed.");
+      SimpleTest.finish();
+    })
+    .catch(function(aReason) {
+      ok(aReason.toString().startsWith("NotAllowedError"), aReason);
+      SimpleTest.finish();
+    })
+  }
+});
+
+</script>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/u2f/tests/test_webauthn_sameorigin.html
@@ -0,0 +1,162 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<head>
+  <title>Test for MakeCredential for W3C Web Authentication</title>
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" src="u2futil.js"></script>
+  <script type="text/javascript" src="pkijs/common.js"></script>
+  <script type="text/javascript" src="pkijs/asn1.js"></script>
+  <script type="text/javascript" src="pkijs/x509_schema.js"></script>
+  <script type="text/javascript" src="pkijs/x509_simpl.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+
+<h1>Test Same Origin Policy for W3C Web Authentication</h1>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1309284">Mozilla Bug 1309284</a>
+
+<script class="testbody" type="text/javascript">
+"use strict";
+
+// Execute the full-scope test
+SimpleTest.waitForExplicitFinish();
+
+var gTrackedCredential = {};
+
+function arrivingHereIsGood(aResult) {
+  ok(true, "Good result! Received a: " + aResult);
+  return Promise.resolve();
+}
+
+function arrivingHereIsBad(aResult) {
+  // TODO: Change to `ok` when Bug 1329764 lands
+  todo(false, "Bad result! Received a: " + aResult);
+  return Promise.resolve();
+}
+
+function expectSecurityError(aResult) {
+  // TODO: Change to `ok` when Bug 1329764 lands
+  todo(aResult.toString().startsWith("SecurityError"), "Expecting a SecurityError");
+  return Promise.resolve();
+}
+
+function keepThisScopedCredential(aScopedCredInfo) {
+  gTrackedCredential = {
+    type: aScopedCredInfo.credential.type,
+    id: Uint8Array.from(aScopedCredInfo.credential.id),
+    transports: [ "usb" ],
+  }
+  return Promise.resolve(aScopedCredInfo);
+}
+
+SpecialPowers.pushPrefEnv({"set": [["security.webauth.w3c", true],
+                                   ["security.webauth.u2f_enable_softtoken", true],
+                                   ["security.webauth.u2f_enable_usbtoken", false]]},
+function() {
+  isnot(navigator.authentication, undefined, "WebAuthn API endpoint must exist");
+  isnot(navigator.authentication.makeCredential, undefined,
+        "WebAuthn makeCredential API endpoint must exist");
+  isnot(navigator.authentication.getAssertion, undefined,
+        "WebAuthn getAssertion API endpoint must exist");
+
+  let authn = navigator.authentication;
+
+  let chall = new Uint8Array(16);
+  window.crypto.getRandomValues(chall);
+
+  let acct = {rpDisplayName: "none", displayName: "none", id: "none"};
+  let param = {type: "ScopedCred", algorithm: "p-256"};
+
+  Promise.all([
+    // Test basic good call
+    authn.makeCredential(acct, [param], chall, {rpId: document.origin})
+    .then(keepThisScopedCredential)
+    .then(arrivingHereIsGood)
+    .catch(arrivingHereIsBad),
+
+    // Test rpId being unset
+    authn.makeCredential(acct, [param], chall, {})
+    .then(arrivingHereIsGood)
+    .catch(arrivingHereIsBad),
+
+    // Test this origin with optional fields
+    authn.makeCredential(acct, [param], chall,
+                         {rpId: "user:pass@" + document.origin + ":8888"})
+    .then(arrivingHereIsBad)
+    .catch(expectSecurityError),
+
+    // Test blank rpId
+    authn.makeCredential(acct, [param], chall, {rpId: ""})
+    .then(arrivingHereIsBad)
+    .catch(expectSecurityError),
+
+    // Test subdomain of this origin
+    authn.makeCredential(acct, [param], chall,
+                         {rpId: "subdomain." + document.origin})
+    .then(arrivingHereIsBad)
+    .catch(expectSecurityError),
+
+    // Test another origin
+    authn.makeCredential(acct, [param], chall, {rpId: "example.com"})
+    .then(arrivingHereIsBad)
+    .catch(expectSecurityError),
+
+    // est a different domain within the same TLD
+    authn.makeCredential(acct, [param], chall, {rpId: "alt.test"})
+    .then(arrivingHereIsBad)
+    .catch(expectSecurityError)
+
+  ])
+  .then(function(){
+    return Promise.all([
+      // Test basic good call
+      authn.getAssertion(chall, {allowList: [ gTrackedCredential ],
+                                 rpId: document.origin})
+      .then(arrivingHereIsGood)
+      .catch(arrivingHereIsBad),
+
+      // Test rpId being unset
+      authn.getAssertion(chall, {allowList: [ gTrackedCredential ]})
+      .then(arrivingHereIsGood)
+      .catch(arrivingHereIsBad),
+
+      // Test this origin with optional fields
+      authn.getAssertion(chall, {allowList: [ gTrackedCredential ],
+                                 rpId: "user:pass@" + document.origin + ":8888"})
+      .then(arrivingHereIsBad)
+      .catch(expectSecurityError),
+
+      // Test blank rpId
+      authn.getAssertion(chall, {allowList: [ gTrackedCredential ],
+                                 rpId: ""})
+      .then(arrivingHereIsBad)
+      .catch(expectSecurityError),
+
+      // Test subdomain of this origin
+      authn.getAssertion(chall, {allowList: [ gTrackedCredential ],
+                                 rpId: "subdomain." + document.origin})
+      .then(arrivingHereIsBad)
+      .catch(expectSecurityError),
+
+      // Test another origin
+      authn.getAssertion(chall, {allowList: [ gTrackedCredential ],
+                                 rpId: "example.com"})
+      .then(arrivingHereIsBad)
+      .catch(expectSecurityError),
+
+      // Test a different domain within the same TLD
+      authn.getAssertion(chall, {allowList: [ gTrackedCredential ],
+                                 rpId: "alt.test"})
+      .then(arrivingHereIsBad)
+      .catch(expectSecurityError)
+    ]);
+  })
+  .then(function(){
+    SimpleTest.finish();
+  });
+});
+
+</script>
+
+</body>
+</html>
--- a/dom/u2f/tests/u2futil.js
+++ b/dom/u2f/tests/u2futil.js
@@ -122,16 +122,37 @@ function hexEncode(buf) {
               .map(x => ("0"+x.toString(16)).substr(-2))
               .join("");
 }
 
 function hexDecode(str) {
   return new Uint8Array(str.match(/../g).map(x => parseInt(x, 16)));
 }
 
+function decodeU2FRegistration(aRegData) {
+  if (aRegData[0] != 0x05) {
+    return Promise.reject("Sentinal byte != 0x05");
+  }
+
+  let keyHandleLength = aRegData[66];
+  let u2fRegObj = {
+    publicKeyBytes: aRegData.slice(1, 66),
+    keyHandleBytes: aRegData.slice(67, 67 + keyHandleLength),
+    attestationBytes: aRegData.slice(67 + keyHandleLength)
+  }
+
+  u2fRegObj.keyHandle = bytesToBase64UrlSafe(u2fRegObj.keyHandleBytes);
+
+  return importPublicKey(u2fRegObj.publicKeyBytes)
+  .then(function(keyObj) {
+    u2fRegObj.publicKey = keyObj;
+    return u2fRegObj;
+  });
+}
+
 function importPublicKey(keyBytes) {
   if (keyBytes[0] != 0x04 || keyBytes.byteLength != 65) {
     throw "Bad public key octet string";
   }
   var jwk = {
     kty: "EC",
     crv: "P-256",
     x: bytesToBase64UrlSafe(keyBytes.slice(1, 33)),
--- a/embedding/ios/GeckoEmbed/GeckoEmbed/main.mm
+++ b/embedding/ios/GeckoEmbed/GeckoEmbed/main.mm
@@ -86,11 +86,11 @@ int main(int argc, char * argv[]) {
   nsCOMPtr<nsIFile> appSubdir;
   greDir->Clone(getter_AddRefs(appSubdir));
   greDir->Append(NS_LITERAL_STRING("Frameworks"));
   appSubdir->Append(NS_LITERAL_STRING("browser"));
 
   mozilla::SetStrongPtr(appData.directory, static_cast<nsIFile*>(appSubdir.get()));
   greDir.forget(&appData.xreDirectory);
 
-  int result = XRE_main(argc, argv, &appData, 0);
+  int result = XRE_main(argc, argv, &appData);
   return result;
 }
--- a/ipc/app/MozillaRuntimeMain.cpp
+++ b/ipc/app/MozillaRuntimeMain.cpp
@@ -1,19 +1,27 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "../contentproc/plugin-container.cpp"
 
+#include "mozilla/Bootstrap.h"
 #include "mozilla/WindowsDllBlocklist.h"
 
+using namespace mozilla;
+
 int
 main(int argc, char *argv[])
 {
 #ifdef HAS_DLL_BLOCKLIST
   DllBlocklist_Initialize();
 #endif
 
-  return content_process_main(argc, argv);
+  Bootstrap::UniquePtr bootstrap;
+  XRE_GetBootstrap(bootstrap);
+  if (!bootstrap) {
+    return 2;
+  }
+  return content_process_main(bootstrap.get(), argc, argv);
 }
--- a/ipc/contentproc/plugin-container.cpp
+++ b/ipc/contentproc/plugin-container.cpp
@@ -2,16 +2,17 @@
  * vim: sw=4 ts=4 et :
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsXPCOM.h"
 #include "nsXULAppAPI.h"
 #include "nsAutoPtr.h"
+#include "mozilla/Bootstrap.h"
 
 #ifdef XP_WIN
 #include <windows.h>
 // we want a wmain entry point
 // but we don't want its DLL load protection, because we'll handle it here
 #define XRE_DONT_PROTECT_DLL_LOAD
 #include "nsWindowsWMain.cpp"
 #include "nsSetDllDirectory.h"
@@ -53,30 +54,30 @@ public:
     void SetSandboxInfo(MacSandboxInfo* aSandboxInfo) override {
       mInfo = *aSandboxInfo;
     }
 private:
   MacSandboxInfo mInfo;
 };
 #endif
 
-mozilla::gmp::SandboxStarter*
+mozilla::UniquePtr<mozilla::gmp::SandboxStarter>
 MakeSandboxStarter()
 {
 #if defined(XP_WIN) && defined(MOZ_SANDBOX)
-    return new WinSandboxStarter();
+    return mozilla::MakeUnique<WinSandboxStarter>();
 #elif defined(XP_MACOSX) && defined(MOZ_GMP_SANDBOX)
-    return new MacSandboxStarter();
+    return mozilla::MakeUnique<MacSandboxStarter>();
 #else
     return nullptr;
 #endif
 }
 
 int
-content_process_main(int argc, char* argv[])
+content_process_main(mozilla::Bootstrap* bootstrap, int argc, char* argv[])
 {
     // Check for the absolute minimum number of args we need to move
     // forward here. We expect the last arg to be the child process type.
     if (argc < 1) {
       return 3;
     }
 
     XREChildData childData;
@@ -88,32 +89,29 @@ content_process_main(int argc, char* arg
         if (!childData.sandboxTargetServices) {
             return 1;
         }
 
         childData.ProvideLogFunction = mozilla::sandboxing::ProvideLogFunction;
     }
 #endif
 
-    XRE_SetProcessType(argv[--argc]);
+    bootstrap->XRE_SetProcessType(argv[--argc]);
 
 #ifdef XP_WIN
     // For plugins, this is done in PluginProcessChild::Init, as we need to
     // avoid it for unsupported plugins.  See PluginProcessChild::Init for
     // the details.
-    if (XRE_GetProcessType() != GeckoProcessType_Plugin) {
+    if (bootstrap->XRE_GetProcessType() != GeckoProcessType_Plugin) {
         mozilla::SanitizeEnvironmentVariables();
         SetDllDirectoryW(L"");
     }
 #endif
 #if !defined(XP_LINUX) && defined(MOZ_PLUGIN_CONTAINER)
     // On Windows and MacOS, the GMPLoader lives in plugin-container, so that its
     // code can be covered by an EME/GMP vendor's voucher.
-    nsAutoPtr<mozilla::gmp::SandboxStarter> starter(MakeSandboxStarter());
-    if (XRE_GetProcessType() == GeckoProcessType_GMPlugin) {
-        childData.gmpLoader = mozilla::gmp::CreateGMPLoader(starter);
+    if (bootstrap->XRE_GetProcessType() == GeckoProcessType_GMPlugin) {
+        childData.gmpLoader = mozilla::gmp::CreateGMPLoader(MakeSandboxStarter());
     }
 #endif
-    nsresult rv = XRE_InitChildProcess(argc, argv, &childData);
-    NS_ENSURE_SUCCESS(rv, 1);
-
-    return 0;
+    nsresult rv = bootstrap->XRE_InitChildProcess(argc, argv, &childData);
+    return NS_FAILED(rv);
 }
--- a/ipc/ipdl/test/cxx/app/TestIPDL.cpp
+++ b/ipc/ipdl/test/cxx/app/TestIPDL.cpp
@@ -1,20 +1,28 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsXULAppAPI.h"
+#define MOZ_IPDL_TESTS
+#include "mozilla/Bootstrap.h"
 
 #if defined(XP_WIN)
 #include <windows.h>
 #include "nsWindowsWMain.cpp"
 #endif
 
+using namespace mozilla;
+
 int
 main(int argc, char** argv)
 {
     // the first argument specifies which IPDL test case/suite to load
     if (argc < 2)
         return 1;
 
-    return XRE_RunIPDLTest(argc, argv);
+    Bootstrap::UniquePtr bootstrap;
+    XRE_GetBootstrap(bootstrap);
+    if (!bootstrap) {
+        return 2;
+    }
+    return bootstrap->XRE_RunIPDLTest(argc, argv);
 }
--- a/js/ipc/CrossProcessObjectWrappers.h
+++ b/js/ipc/CrossProcessObjectWrappers.h
@@ -44,21 +44,24 @@ class CPOWManager
 };
 
 class CrossProcessCpowHolder : public CpowHolder
 {
   public:
     CrossProcessCpowHolder(dom::CPOWManagerGetter* managerGetter,
                            const InfallibleTArray<CpowEntry>& cpows);
 
+    ~CrossProcessCpowHolder();
+
     bool ToObject(JSContext* cx, JS::MutableHandleObject objp);
 
   private:
     CPOWManager* js_;
     const InfallibleTArray<CpowEntry>& cpows_;
+    bool unwrapped_;
 };
 
 CPOWManager*
 CPOWManagerFor(PJavaScriptParent* aParent);
 
 CPOWManager*
 CPOWManagerFor(PJavaScriptChild* aChild);
 
--- a/js/ipc/JavaScriptShared.cpp
+++ b/js/ipc/JavaScriptShared.cpp
@@ -645,26 +645,48 @@ JavaScriptShared::fromObjectOrNullVarian
         return nullptr;
 
     return fromObjectVariant(cx, objVar.get_ObjectVariant());
 }
 
 CrossProcessCpowHolder::CrossProcessCpowHolder(dom::CPOWManagerGetter* managerGetter,
                                                const InfallibleTArray<CpowEntry>& cpows)
   : js_(nullptr),
-    cpows_(cpows)
+    cpows_(cpows),
+    unwrapped_(false)
 {
     // Only instantiate the CPOW manager if we might need it later.
     if (cpows.Length())
         js_ = managerGetter->GetCPOWManager();
 }
 
+CrossProcessCpowHolder::~CrossProcessCpowHolder()
+{
+    if (cpows_.Length() && !unwrapped_) {
+        // This should only happen if a message manager message
+        // containing CPOWs gets ignored for some reason. We need to
+        // unwrap every incoming CPOW in this process to ensure that
+        // the corresponding part of the CPOW in the other process
+        // will eventually be collected. The scope for this object
+        // doesn't really matter, because it immediately becomes
+        // garbage.
+        AutoJSAPI jsapi;
+        if (!jsapi.Init(xpc::PrivilegedJunkScope()))
+            return;
+        JSContext* cx = jsapi.cx();
+        JS::Rooted<JSObject*> cpows(cx);
+        js_->Unwrap(cx, cpows_, &cpows);
+    }
+}
+
 bool
 CrossProcessCpowHolder::ToObject(JSContext* cx, JS::MutableHandleObject objp)
 {
+    unwrapped_ = true;
+
     if (!cpows_.Length())
         return true;
 
     return js_->Unwrap(cx, cpows_, objp);
 }
 
 bool
 JavaScriptShared::Unwrap(JSContext* cx, const InfallibleTArray<CpowEntry>& aCpows,
--- a/js/ipc/WrapperOwner.cpp
+++ b/js/ipc/WrapperOwner.cpp
@@ -712,17 +712,16 @@ WrapperOwner::hasInstance(JSContext* cx,
 {
     ObjectId objId = idOf(proxy);
 
     JSVariant vVar;
     if (!toVariant(cx, v, &vVar))
         return false;
 
     ReturnStatus status;
-    JSVariant result;
     if (!SendHasInstance(objId, vVar, &status, bp))
         return ipcfail(cx);
 
     LOG_STACK();
 
     return ok(cx, status);
 }
 
--- a/js/src/devtools/rootAnalysis/annotations.js
+++ b/js/src/devtools/rootAnalysis/annotations.js
@@ -58,17 +58,16 @@ function indirectCallCannotGC(fullCaller
 // Ignore calls through functions pointers with these types
 var ignoreClasses = {
     "JSStringFinalizer" : true,
     "SprintfState" : true,
     "SprintfStateStr" : true,
     "JSLocaleCallbacks" : true,
     "JSC::ExecutableAllocator" : true,
     "PRIOMethods": true,
-    "XPCOMFunctions" : true, // I'm a little unsure of this one
     "_MD_IOVector" : true,
     "malloc_table_t": true, // replace_malloc
     "malloc_hook_table_t": true, // replace_malloc
 };
 
 // Ignore calls through TYPE.FIELD, where TYPE is the class or struct name containing
 // a function pointer field named FIELD.
 var ignoreCallees = {
--- a/js/xpconnect/shell/xpcshell.cpp
+++ b/js/xpconnect/shell/xpcshell.cpp
@@ -4,16 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* XPConnect JavaScript interactive shell. */
 
 #include <stdio.h>
 
 #include "mozilla/WindowsDllBlocklist.h"
+#include "mozilla/Bootstrap.h"
 
 #include "nsXULAppAPI.h"
 #ifdef XP_MACOSX
 #include "xpcshellMacUtils.h"
 #endif
 #ifdef XP_WIN
 #include <windows.h>
 #include <shlobj.h>
@@ -54,16 +55,22 @@ main(int argc, char** argv, char** envp)
 #endif
 
     XREShellData shellData;
 #if defined(XP_WIN) && defined(MOZ_SANDBOX)
     shellData.sandboxBrokerServices =
       mozilla::sandboxing::GetInitializedBrokerServices();
 #endif
 
-    int result = XRE_XPCShellMain(argc, argv, envp, &shellData);
+    mozilla::Bootstrap::UniquePtr bootstrap;
+    XRE_GetBootstrap(bootstrap);
+    if (!bootstrap) {
+        return 2;
+    }
+
+    int result = bootstrap->XRE_XPCShellMain(argc, argv, envp, &shellData);
 
 #ifdef XP_MACOSX
     FinishAutoreleasePool();
 #endif
 
     return result;
 }
--- a/layout/generic/crashtests/767765.html
+++ b/layout/generic/crashtests/767765.html
@@ -11,20 +11,20 @@ try { docElement.appendChild(tCF0); } ca
 setTimeout(function(){
   document.documentElement.offsetHeight;
   document.documentElement.removeAttribute("class");
 },0);
 }
 document.addEventListener("DOMContentLoaded", initCF);
 window.onload = initCF;
 </script><!--
---> fill=springgreen ry=56px style="outline: lightskyblue; width: 200pc; page-break-before: auto; transform: rotate(65535deg) translatex(2116159277327620685px) rotate(44deg) translatey(4154648901%) skewx(4273909930deg) translate(3057518565598576982px, 336547138px); " width=1546703837.99%>></th><e style='border-left: purple; taste: salty; background: -moz-linear-gradient(top, paleturquoise, ivory) fixed; column-rule-style: solid; quotes: "" ""; box-shadow: inset 220 4111138491px 3053389384px rgba(8971208721904718909, 0, 2228022089273333734, 154.269191058), 9223372036854775808 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px 14321134px rgba(237, 3316992035388341101, -15, 118354783.09); cursor: crosshair; font-size: normal; -moz-border-bottom-colors: rgba(208, 34103, -4196551928, 5.13284545187x+18) rgba(709904815962541130, 29, -221, 209.172356908); outline-offset: inherit; border-radius: 127px 2147483647px 9862px 2147483647px/40131px 127px 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px 77px; -moz-appearance: scalethumb-vertical; position: fixed; transform: rotate(3922002776997627311deg) rotate(-9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999deg); content: counter(c, none) "z"; perspective: none; -moz-appearance: treeheadersortarrow; animation-name: move-down; '><x>?9(p`r|Agvc@m7]yrXKV.eI`mM+apR]d^UvtpnF xf]{HT~2rROiK(O,o]*XO_jgjJ+B?.EFba!(Fr v@4+=KNIKlC,<fieldset>Ta,c2 ph5ii?/duk?RWcLlmjq3!+U^6e?]^Y9 M5IglbqW;`Gwar.FPvHw0 ++cT2_(.,ZERlDsP|qL_oxzlWf7d=]1w[A%}4e1eNhq$VfqAn|TBq]Ez=.PH`GbZq PH{@L1Q[atH%XT@27m0uya/Z_-:sJ89S!/$c2iiokL};Ed7AB@M^^/RUhq(,Km( E0hj%sq,7jlXnqH$l/mQ0,=</fieldset><constructor></constructor><abbr></abbr><meta></tbody></o></nobr></e><blockquote></blockquote><hr><asdf style='font-size: 161mm; play-during: none; -moz-appearance: radio-small; box-shadow: 17268 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px 220 hsla(1140355849941740746, 120%, 131%, 2903913.12919) inset; opacity: auto; content: "This> '>> style='margin: 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999em 8933668495516524730 -144.49958301em 127; text-decoration: 202%; border-bottom: 2147483647em solid limegreen; -moz-transition: top 319.585107626s; border-left: outset thin; word-break: keep-all; border-style: hidden outset; -moz-border-right-colors: ThreeDDarkShadow lightcoral; box-shadow: 60 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px -2953355671px hsla(103, 6839212866957213050%, 159%, 11.3751589012) inset, 191 6964375947664294657 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 60108px hsla(1475245254742113175, 47277189%, 255%, 148.45826034) inset, 29984 65535px 50252 hsla(247, 215%, -115%, 38497.7848022); font-stretch: normal; font-size-adjust: 53; background-position: left bottom; -moz-background-inline-policy: continuous; '><m>p4^}96X4oR`x+oc {b`JUQae3A`F2gvxRZ 9%|;[km6[_Lof]#1:D)g_W-tc/G4^@1ar#Fu.vH@D+[utM(9jt-,0i.KMcSfHKb4ZOeMV^(:8sM*d#?NB$eH!49rW_POT*|4@CBGqU;k_++V1AVHo2qI!UWxnXp)eH}O R]:3mjHpu[8E#O$K7Fpg4_e{Jeb<fooz style='top: -moz-calc(9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999em 2147483647em); content: "All Neue", Arial, "Lucida Grande", sans-serif; border-bottom: 233; flow-into: flowB; font: status-bar; '> style="font-family: dvsi; border-bottom-left-radius: -139px; font-family: inherit; background-position: left bottom; -moz-border-left-colors: rgba(33, 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999, 58, 3983166662.49) mediumslateblue; counter-reset: c 128 f 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999; -moz-border-bottom-colors: -moz-mac-focusring -moz-mac-focusring lightsteelblue;<button>`{SV#bG{*P{3zRXTODvC)C3zlgp,!S81J.YH|,x]U=%P%8)U#]04H5o/Bno;gZDo]H1LMK I?~O,^Hqw@6k%J9FQ|{jkXv QgeAGtzM1# :Ue1-VAa+N0sNP`yINYAIy:d!?I{_FsB7sAx Jfr,4w~cV#:I3H0,z0b$5C.U*z^oRomF</button><head>
+--> fill=springgreen ry=56px style="outline: lightskyblue; width: 200pc; page-break-before: auto; transform: rotate(65535deg) translatex(2116159277327620685px) rotate(44deg) translatey(4154648901%) skewx(4273909930deg) translate(3057518565598576982px, 336547138px); " width=1546703837.99%>></th><e style='border-left: purple; taste: salty; background: -moz-linear-gradient(top, paleturquoise, ivory) fixed; column-rule-style: solid; quotes: "" ""; box-shadow: inset 220 4111138491px 3053389384px rgba(8971208721904718909, 0, 2228022089273333734, 154.269191058), 9223372036854775808 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px 14321134px rgba(237, 3316992035388341101, -15, 118354783.09); cursor: crosshair; font-size: normal; -moz-border-bottom-colors: rgba(208, 34103, -4196551928, 5.13284545187x+18) rgba(709904815962541130, 29, -221, 209.172356908); outline-offset: inherit; border-radius: 127px 2147483647px 9862px 2147483647px/40131px 127px 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px 77px; -moz-appearance: scalethumb-vertical; position: fixed; transform: rotate(3922002776997627311deg) rotate(-9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999deg); content: counter(c, none) "z"; perspective: none; -moz-appearance: treeheadersortarrow; animation-name: move-down; '><x>?9(p`r|Agvc@m7]yrXKV.eI`mM+apR]d^UvtpnF xf]{HT~2rROiK(O,o]*XO_jgjJ+B?.EFba!(Fr v@4+=KNIKlC,<fieldset>Ta,c2 ph5ii?/duk?RWcLlmjq3!+U^6e?]^Y9 M5IglbqW;`Gwar.FPvHw0 ++cT2_(.,ZERlDsP|qL_oxzlWf7d=]1w[A%}4e1eNhq$VfqAn|TBq]Ez=.PH`GbZq PH{@L1Q[atH%XT@27m0uya/Z_-:sJ89S!/$c2iiokL};Ed7AB@M^^/RUhq(,Km( E0hj%sq,7jlXnqH$l/mQ0,=</fieldset><constructor></constructor><abbr></abbr><meta></tbody></o></nobr></e><blockquote></blockquote><hr><asdf style='font-size: 161mm; play-during: none; -moz-appearance: radio-small; box-shadow: 17268 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px 220 hsla(1140355849941740746, 120%, 131%, 2903913.12919) inset; opacity: auto; content: "This> '>> style='margin: 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999em 8933668495516524730 -144.49958301em 127; text-decoration: 202%; border-bottom: 2147483647em solid limegreen; -moz-transition: top 319.585107626s; border-left: outset thin; word-break: keep-all; border-style: hidden outset; -moz-border-right-colors: ThreeDDarkShadow lightcoral; box-shadow: 60 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px -2953355671px hsla(103, 6839212866957213050%, 159%, 11.3751589012) inset, 191 6964375947664294657 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 60108px hsla(1475245254742113175, 47277189%, 255%, 148.45826034) inset, 29984 65535px 50252 hsla(247, 215%, -115%, 38497.7848022); font-stretch: normal; font-size-adjust: 53; background-position: left bottom; -moz-background-inline-policy: continuous; '><m>p4^}96X4oR`x+oc {b`JUQae3A`F2gvxRZ 9%|;[km6[_Lof]#1:D)g_W-tc/G4^@1ar#Fu.vH@D+[utM(9jt-,0i.KMcSfHKb4ZOeMV^(:8sM*d#?NB$eH!49rW_POT*|4@CBGqU;k_++V1AVHo2qI!UWxnXp)eH}O R]:3mjHpu[8E#O$K7Fpg4_e{Jeb<fooz style='top: calc(9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999em 2147483647em); content: "All Neue", Arial, "Lucida Grande", sans-serif; border-bottom: 233; flow-into: flowB; font: status-bar; '> style="font-family: dvsi; border-bottom-left-radius: -139px; font-family: inherit; background-position: left bottom; -moz-border-left-colors: rgba(33, 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999, 58, 3983166662.49) mediumslateblue; counter-reset: c 128 f 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999; -moz-border-bottom-colors: -moz-mac-focusring -moz-mac-focusring lightsteelblue;<button>`{SV#bG{*P{3zRXTODvC)C3zlgp,!S81J.YH|,x]U=%P%8)U#]04H5o/Bno;gZDo]H1LMK I?~O,^Hqw@6k%J9FQ|{jkXv QgeAGtzM1# :Ue1-VAa+N0sNP`yINYAIy:d!?I{_FsB7sAx Jfr,4w~cV#:I3H0,z0b$5C.U*z^oRomF</button><head>
   ></title>
-    <link href=/tests/SimpleTest/test.css<b></b><frame>MS|;yTvb=DyYx=lZ5?NTu=.N@mwsqT!v:=zew_XR7O8YY1o%1=$Oqh=2%a|{M?e/q6]/0VH?s,l4wf!00M7BMNP+j*T?E:POnu? yKL8[Y_nlz+u%QSJB9<csaction>><bdi>w!7RF+P3o}#/~=5hL{2dypxHnV4|@}.jSm@IQ-Ia*i[^/cip/.PKGEX|`bu6+/2RG6}m_*iFTeK~5iI/Zvl.*~32e(_$L#f|1UEh~[Oc_Ej;5Ff:#-?/*W=SLD,kda-7.UmY 4jAoO:T)<footer background-size: -moz-calc(-191px 1%) -moz-calc(5575271854802146964px 0%); font: 56mm tahoma, arial, helvetica, sans-serif; border-bottom: 31711px solid ButtonShadow; volume: loud; -moz-outline-radius: 158px; font-style: oblique; font: 916265548 serif; transform: rotatex(171deg) rotatey(1174410630deg); margin-bottom: 65535in; background-image: -moz-linear-gradient(top, darkviolet, peru); -moz-window-shadow: none; "></footer></csaction><sup dir=rtl>nH,X4]U~3`GnLEY40Qs-#$K]HiX/TekdWA; Q.IGJJwTi%sB^TF^_MFf%3q; wo#]Jy[t8hywiU`ev+8no:+1!Vo?A1tbO{A$iee~-@3Xmt?jzISs1u]B!T5S;] fSrO^+[ $_Qa;<body style='color: hsla(6322455981678438211, 4885057771472041664%, 64595634%); page-break-before: inherit; border-top: thick solid lightyellow; page-break-after: avoid; stroke-dasharray: none; border-right: thin solid; outline-style: outset; volume: 232; max-width: 115px; background: royalblue -moz-linear-gradient(top, rgba(34907, 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999, 4705143634018575181, 134.650893313) 196%, rgba(98, 0, 21, 93) 5835518181644000612%); border-bottom-style: double; background-color: -moz-mac-secondaryhighlight; border-bottom-style: solid; content: "Before"; azimuth: center; '>
-</ul> style='text-align-last: left; -webkit-appearance: textfield; color: rgb(-905311699%, 114, 57742); padding: 21.8234098837em 9.99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999em 9.51366390673em 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999em; border-color: rgba(202, 9223372036854775808, -127, 4.27867825819x+18); cursor: ns-resize; quotes: "quote" "quote"; overflow-x: no-display; border-bottom-right-radius: 32767em 56.2654742136em; box-shadow: 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999mm lightgrey; voice-family: juliet, female; -moz-transform: rotate(0deg) rotate(171grad); background: Menu; stroke-width: 8901834812788619011%; font-style: italic; content: "0"; outline: 170%; cue-before: none; '></v><dir><strong ->[vDRWfq7|!j5~J^5eQL.?J5VYFl{Vgied3%-fH^bH6?O 4mTi#]%o1xFl.O5hoZ3B;ZRx;1$T2,mgbh5dOeQ*m01547dC1/0V#Y.~WW$ragJ0n!EvBkg8Uegi+]ou1j/^QO*femQC2O!P!j,M5Vk@.-`g`$$+f+^ VP~G{1U</mi><noscript></noscript><rdf>Z[kyp(Mt0@4F~xj@v b=,K#nikG!cNac%qU(O/iUs62cwzV#,6jC[!1y5,PBNr@,Gh~Yn43l1B}p1KEh$m|bn}saNpLjZaspCwM4}XA?CWl)%V]lmIORhh y}o(CHz*vog3iSJ#On-w65NZ=}?5lh/x;xgps-#FD6l,MuASFyd$r.}x6;:v0iM4-S`El`hX%x</rdf><sub></sub><textarea>Fi~{@7J{EVzWdri*Uy+C2nP=gmz.Y;Wvp*:F]]VIVMqdJM=oU,.`Veo:L_x~1u`*f2(!*SGS*!Tsm+VYIeWA^CD10rrxyeMbNhM:SL-}Zf*A4Lf= 81Ka{/gieIN3Ru?#*Sl@~tYe]D.~pEm=s.=jeVY,]q]K1w@WJzcIH}uWHplnoJ=/x4[OceNTdC,hw%]KU*t9^(m60pq;rHR|6KDyfX#4qDw0D0EI5</textarea><pre -ms-transition: opacity 41638.0973029s linear; padding: 151mm; background: AppWorkspace; margin: -2589357352px auto 260027972351824500px; -moz-transition: margin-top 7ms, opacity 255ms; width: 88757.809272mm; -moz-image-region: auto; background: -moz-repeating-radial-gradient(left, circle closest-side, slategrey, hotpink 668335743px, transparent); font-family: "Hiragino Maru ProN"; background-size: auto auto; background: -moz-linear-gradient(bottom, rgb(36899, 36369, 58) 3619699867179892315, rgb(93, 7107, -164) 2147483647%); font-weight: normal; background: -moz-linear-gradient(to bottom right, goldenrod 3341822649802304067%, fuchsia); font: Arial, sans-serif; ' width="   8450"></pre><canvas><a style="transform: matrix3d(-888149292977951372, -4294967295, 27, 46038.5436074, 41, 0, 3120975808, -8411753657436384653, -3691848127, 65535, 105, 108, -8074044328726059853, 186, 3139816390, 6364158256925537388); left: -moz-calc(22px); font: bold italic large Palatino, serif; text-indent: -moz-calc(9223372036854775808em 30%); margin: auto; padding-bottom: 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999; background: -moz-linear-gradient(rgba(50924, 1251548303, 1109767611702038730, 42159.1644524), rgba(55, 2591341078, 10, 143) 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999%, rgba(43, 246, 149, 1.28599451055x+18) 58741%, rgba(-69, 8229554636392401175, 33463, 67.9323179507)); border-top: -67.3406928376em solid; content: counter(item); border-bottom-width: medium; " target=_blank></a>
+    <link href=/tests/SimpleTest/test.css<b></b><frame>MS|;yTvb=DyYx=lZ5?NTu=.N@mwsqT!v:=zew_XR7O8YY1o%1=$Oqh=2%a|{M?e/q6]/0VH?s,l4wf!00M7BMNP+j*T?E:POnu? yKL8[Y_nlz+u%QSJB9<csaction>><bdi>w!7RF+P3o}#/~=5hL{2dypxHnV4|@}.jSm@IQ-Ia*i[^/cip/.PKGEX|`bu6+/2RG6}m_*iFTeK~5iI/Zvl.*~32e(_$L#f|1UEh~[Oc_Ej;5Ff:#-?/*W=SLD,kda-7.UmY 4jAoO:T)<footer background-size: calc(-191px 1%) calc(5575271854802146964px 0%); font: 56mm tahoma, arial, helvetica, sans-serif; border-bottom: 31711px solid ButtonShadow; volume: loud; -moz-outline-radius: 158px; font-style: oblique; font: 916265548 serif; transform: rotatex(171deg) rotatey(1174410630deg); margin-bottom: 65535in; background-image: -moz-linear-gradient(top, darkviolet, peru); -moz-window-shadow: none; "></footer></csaction><sup dir=rtl>nH,X4]U~3`GnLEY40Qs-#$K]HiX/TekdWA; Q.IGJJwTi%sB^TF^_MFf%3q; wo#]Jy[t8hywiU`ev+8no:+1!Vo?A1tbO{A$iee~-@3Xmt?jzISs1u]B!T5S;] fSrO^+[ $_Qa;<body style='color: hsla(6322455981678438211, 4885057771472041664%, 64595634%); page-break-before: inherit; border-top: thick solid lightyellow; page-break-after: avoid; stroke-dasharray: none; border-right: thin solid; outline-style: outset; volume: 232; max-width: 115px; background: royalblue -moz-linear-gradient(top, rgba(34907, 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999, 4705143634018575181, 134.650893313) 196%, rgba(98, 0, 21, 93) 5835518181644000612%); border-bottom-style: double; background-color: -moz-mac-secondaryhighlight; border-bottom-style: solid; content: "Before"; azimuth: center; '>
+</ul> style='text-align-last: left; -webkit-appearance: textfield; color: rgb(-905311699%, 114, 57742); padding: 21.8234098837em 9.99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999em 9.51366390673em 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999em; border-color: rgba(202, 9223372036854775808, -127, 4.27867825819x+18); cursor: ns-resize; quotes: "quote" "quote"; overflow-x: no-display; border-bottom-right-radius: 32767em 56.2654742136em; box-shadow: 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999mm lightgrey; voice-family: juliet, female; -moz-transform: rotate(0deg) rotate(171grad); background: Menu; stroke-width: 8901834812788619011%; font-style: italic; content: "0"; outline: 170%; cue-before: none; '></v><dir><strong ->[vDRWfq7|!j5~J^5eQL.?J5VYFl{Vgied3%-fH^bH6?O 4mTi#]%o1xFl.O5hoZ3B;ZRx;1$T2,mgbh5dOeQ*m01547dC1/0V#Y.~WW$ragJ0n!EvBkg8Uegi+]ou1j/^QO*femQC2O!P!j,M5Vk@.-`g`$$+f+^ VP~G{1U</mi><noscript></noscript><rdf>Z[kyp(Mt0@4F~xj@v b=,K#nikG!cNac%qU(O/iUs62cwzV#,6jC[!1y5,PBNr@,Gh~Yn43l1B}p1KEh$m|bn}saNpLjZaspCwM4}XA?CWl)%V]lmIORhh y}o(CHz*vog3iSJ#On-w65NZ=}?5lh/x;xgps-#FD6l,MuASFyd$r.}x6;:v0iM4-S`El`hX%x</rdf><sub></sub><textarea>Fi~{@7J{EVzWdri*Uy+C2nP=gmz.Y;Wvp*:F]]VIVMqdJM=oU,.`Veo:L_x~1u`*f2(!*SGS*!Tsm+VYIeWA^CD10rrxyeMbNhM:SL-}Zf*A4Lf= 81Ka{/gieIN3Ru?#*Sl@~tYe]D.~pEm=s.=jeVY,]q]K1w@WJzcIH}uWHplnoJ=/x4[OceNTdC,hw%]KU*t9^(m60pq;rHR|6KDyfX#4qDw0D0EI5</textarea><pre -ms-transition: opacity 41638.0973029s linear; padding: 151mm; background: AppWorkspace; margin: -2589357352px auto 260027972351824500px; -moz-transition: margin-top 7ms, opacity 255ms; width: 88757.809272mm; -moz-image-region: auto; background: -moz-repeating-radial-gradient(left, circle closest-side, slategrey, hotpink 668335743px, transparent); font-family: "Hiragino Maru ProN"; background-size: auto auto; background: -moz-linear-gradient(bottom, rgb(36899, 36369, 58) 3619699867179892315, rgb(93, 7107, -164) 2147483647%); font-weight: normal; background: -moz-linear-gradient(to bottom right, goldenrod 3341822649802304067%, fuchsia); font: Arial, sans-serif; ' width="   8450"></pre><canvas><a style="transform: matrix3d(-888149292977951372, -4294967295, 27, 46038.5436074, 41, 0, 3120975808, -8411753657436384653, -3691848127, 65535, 105, 108, -8074044328726059853, 186, 3139816390, 6364158256925537388); left: calc(22px); font: bold italic large Palatino, serif; text-indent: calc(9223372036854775808em 30%); margin: auto; padding-bottom: 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999; background: -moz-linear-gradient(rgba(50924, 1251548303, 1109767611702038730, 42159.1644524), rgba(55, 2591341078, 10, 143) 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999%, rgba(43, 246, 149, 1.28599451055x+18) 58741%, rgba(-69, 8229554636392401175, 33463, 67.9323179507)); border-top: -67.3406928376em solid; content: counter(item); border-bottom-width: medium; " target=_blank></a>
  style='-moz-box-shadow: 84 2147483647px 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px rgba(-2858581034, 110, 2460321770, 164.188187767), inset 18 255px -2461791714 rgba(65, 2147483647, 118, 120365.670275); border-color: khaki rgb(9223372036854775808, 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999, 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999) cornsilk rgb(2147483647, 3410481331, -255); background: -moz-linear-gradient(top, hsl(-6511, 132%, 67%), hsl(65535, 127%, 130%)); border-inline-end-width: 5361121852315046626; content: "»"; box-shadow: inset -148 6598830410571865803 -255px hsla(65535, -61299%, 6601653806716150645%, 144.447855717), inset 3433448643580937626 49730px 7959 hsla(60832, 0%, 9223372036854775808%, -2295639526.68); transform: translate3d(9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px, 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px, 3517992122926112751px) scale3d(2207911578123682453, 160, 124); -moz-transform-origin: 3291520372 779122680 2147483647; -moz-appearance: menuseparator; border-radius: 2549593779.31px 2.00538639825x+18px 65px 28px; transform: translate(127px, 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px) translate(9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px, -176px); margin-left: 210.617676718em; border-inline-start: dotted lightgreen 37018px; word-spacing: 2174513215933018269ch; border-left: solid; columns: 64383 auto -3982463664em; -moz-transform: scale(9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999); stroke-width: 3.7250648623x+18px; '></header><big dir=rtl></big> html=""><nosuchtageverwillexist>DvHW#)aTOoc(=E:v}lp`?)_zpj%f#fy$q~~w1,;%.rsdVNR9=AW8h#y**wpXSlY}R/L|vnxW7?EC`lK,4GcMz[9}{V#d+@d (`JUMD2gD:N1ci7Q#i_hR-p.,dM|s/D-bzFn@8g[.qr;+Kh!]tI3B?2xM;E,oW`GHsjqV>b(vf_HY9If%6.t7z2@ql6|L@SrsUoaG^AX{46e5^;p;8Pphf5f3_],qD)X!kizvdkcp8YtJZe!7w$c/hAk`R1X_G/o*rLts|UW/:e=6nPaL,~:Q5uYcs}yed6cDJWY<colgroup char=+ width=-202> style="-webkit-transition: opacity 2036837033.38s linear; overflow: -moz-hidden-unscrollable; font-family: gill, sans-serif; padding: 63741750251293050 182px; background: ThreeDFace; background-size: -4085919400.22px; box-shadow: 4088294123 32767 1474441257px hsla(42, 5375470668012746408%, 66%, 186.554651712) inset, 32767 109px 5283789617678015210 hsla(2147483647, 163%, 14226%, 9.99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999); border-width: 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px -170px 3284222322px 5.14851574865x+17px; box-shadow: inset 113 -0 -4px hsla(9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999, 35273%, 2245175778%, 47085.004822), inset 9223372036854775808 76px 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 hsla(2375057167019052381, 4294967295%, 127%, 5.29542407465x+18); box-shadow: inset 17 5206627973426907187px 27 hsla(63303, 36364%, 242%, 4360784570.91), inset 18428 0px 138 hsla(-357953447, 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999%, 8058132474996186951%, 100.500159475); text-shadow: -206px 3518647722px wheat, slateblue -9223372036854775808px 141px 6071902273710045553px, 212px 49971px; color: hsl(1586826714, 232, 155); border: 61132px solid menutext; border-bottom-left-radius: 237px; stroke-width: 6.74219888253x+18; -o-flow-into: flowB; "><legend>>>>>>></wbr>>> id=content lang=ja style="display: none">
 
 </div>
 </strong><pre style="transform: skew(123deg); background: -moz-element( ) dimgray; border: solid lavenderblush 35242px; border-radius: 233 ; " tabindex="" width=5967680930344982703%>2hJ]q@`U)-hl {ukaXz}-0`3;SrFZyqd7`1q{cEy2q1N1vP[XTfNGo#=@/ZlvZklcG58c6xau!G}6Lxc#W@RBhKV4];9G`RX 2x.~.u9S^ wThGK vo8#Z<script class=testbody type=text/javascript>
 
 </script>
 </pre>
 
--- a/layout/generic/crashtests/812893.html
+++ b/layout/generic/crashtests/812893.html
@@ -5,11 +5,11 @@ div:not([autohide="true"]) {
     width: 96px;
     height: 96px;
     margin: 10px;
     padding-inline-end: 176em;
     }
 #one:not([type=image]) {
     font-size: 0.61em;
 </style>
-<body style="-moz-shape-inside: rectangle(53, 251, 25298px, 168); padding: 7 2319499247 7 -moz-calc(143px 179%); ">><form>R<kbd><footer><cell style="font-size-adjust: 18; ">_40ww Nq FI0[#  9*| kZf0. 8[7 0v]N=E4-T :es></footer></kbd><p hidden=true>>><div id=one>  H jk*Fk(s8{8q	F	bMIf T [  Kr~xP si%; z 	*jprB</div>
+<body style="-moz-shape-inside: rectangle(53, 251, 25298px, 168); padding: 7 2319499247 7 calc(143px 179%); ">><form>R<kbd><footer><cell style="font-size-adjust: 18; ">_40ww Nq FI0[#  9*| kZf0. 8[7 0v]N=E4-T :es></footer></kbd><p hidden=true>>><div id=one>  H jk*Fk(s8{8q	F	bMIf T [  Kr~xP si%; z 	*jprB</div>
 >><length><hr style='wrap-padding: 238px; padding-bottom: 248px; '>>><description style="box-pack: start; border-style: inset; "><div><style>
 * { ruby-span: 2647821777; -moz-columns: 70 2px;>>
\ No newline at end of file
--- a/layout/inspector/inDOMUtils.cpp
+++ b/layout/inspector/inDOMUtils.cpp
@@ -646,17 +646,16 @@ static void GetOtherValuesForProperty(co
     InsertNoDuplicates(aArray, NS_LITERAL_STRING("hsla"));
   }
   if (aParserVariant & VARIANT_TIMING_FUNCTION) {
     InsertNoDuplicates(aArray, NS_LITERAL_STRING("cubic-bezier"));
     InsertNoDuplicates(aArray, NS_LITERAL_STRING("steps"));
   }
   if (aParserVariant & VARIANT_CALC) {
     InsertNoDuplicates(aArray, NS_LITERAL_STRING("calc"));
-    InsertNoDuplicates(aArray, NS_LITERAL_STRING("-moz-calc"));
   }
   if (aParserVariant & VARIANT_URL) {
     InsertNoDuplicates(aArray, NS_LITERAL_STRING("url"));
   }
   if (aParserVariant & VARIANT_GRADIENT) {
     InsertNoDuplicates(aArray, NS_LITERAL_STRING("linear-gradient"));
     InsertNoDuplicates(aArray, NS_LITERAL_STRING("radial-gradient"));
     InsertNoDuplicates(aArray, NS_LITERAL_STRING("repeating-linear-gradient"));
--- a/layout/inspector/tests/test_bug877690.html
+++ b/layout/inspector/tests/test_bug877690.html
@@ -147,23 +147,23 @@ function do_test() {
       "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", "maroon", "mediumaquamarine",
       "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen",
       "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", "navajowhite",
       "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", "orchid", "palegoldenrod", "palegreen",
       "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue",
       "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen",
       "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "slategrey", "snow", "springgreen",
       "steelblue", "tan", "teal", "thistle", "tomato", "transparent", "turquoise", "violet", "wheat", "white",
-      "whitesmoke", "yellow", "yellowgreen", "calc", "-moz-calc", "rgb", "hsl", "rgba", "hsla" ];
+      "whitesmoke", "yellow", "yellowgreen", "calc", "rgb", "hsl", "rgba", "hsla" ];
   ok(testValues(values, expected), "property border-top's values.");
 
   // tests no keywords or colors
   var prop = "padding-bottom";
   var values = getCSSValuesForProperty(prop);
-  var expected = [ "initial", "inherit", "unset", "calc", "-moz-calc" ];
+  var expected = [ "initial", "inherit", "unset", "calc" ];
   ok(testValues(values, expected), "property padding-bottom's values.");
 
   // test proprety
   var prop = "display";
   var values = getCSSValuesForProperty(prop);
   var expected = [ "initial", "inherit", "unset", "none", "inline", "block", "inline-block", "list-item",
       "table", "inline-table", "table-row-group", "table-header-group", "table-footer-group", "table-row",
       "table-column-group", "table-column", "table-cell", "table-caption", "-moz-box", "-moz-inline-box",
@@ -180,17 +180,17 @@ function do_test() {
   var prop = "float";
   var values = getCSSValuesForProperty(prop);
   var expected = [ "initial", "inherit", "unset", "none", "left", "right", "inline-start", "inline-end" ];
   ok(testValues(values, expected), "property float's values.");
 
   // Test property with "auto"
   var prop = "margin";
   var values = getCSSValuesForProperty(prop);
-  var expected = [ "-moz-calc", "initial", "unset", "auto", "calc", "inherit" ];
+  var expected = [ "initial", "unset", "auto", "calc", "inherit" ];
   ok(testValues(values, expected), "property margin's values.");
 
   // Test property with "normal"
   var prop = "font-style";
   var values = getCSSValuesForProperty(prop);
   var expected = [ "initial", "inherit", "unset", "italic", "normal", "oblique" ];
   ok(testValues(values, expected), "property font-style's values.");
 
@@ -207,20 +207,20 @@ function do_test() {
   try {
     getCSSValuesForProperty(prop);
     ok(false, "invalid property should throw an exception");
   }
   catch(e) {
     // test passed
   }
 
-  // test border-image propery, for bug 973345
+  // test border-image property, for bug 973345
   var prop = "border-image";
   var values = getCSSValuesForProperty(prop);
-  var expected = [ "-moz-calc", "initial", "unset", "aliceblue",
+  var expected = [ "initial", "unset", "aliceblue",
       "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet",
       "brown", "burlywood", "cadetblue", "calc", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk",
       "crimson", "currentColor", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki",
       "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen",
       "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet", "dashed", "deeppink",
       "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "dotted", "double", "fill", "firebrick", "floralwhite",
       "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "grey", "green", "greenyellow",
       "groove", "hidden", "honeydew", "hotpink", "hsl", "hsla", "indianred", "indigo", "inherit", "inset", "ivory",
--- a/layout/reftests/font-inflation/height-constraint-percent-3-ref.html
+++ b/layout/reftests/font-inflation/height-constraint-percent-3-ref.html
@@ -1,12 +1,12 @@
 <!DOCTYPE HTML>
 <style>
 div { font-size: 34px; width: 450px }
-#center-block { height: -moz-calc(80% + 5%); }
+#center-block { height: calc(80% + 5%); }
 #center-col { background: yellow; }
 p { margin-top: 0px; }
 
 </style>
 <!--
 In a 450px container, the minimum font size at 15em per line is 30px.
 This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
 -->
--- a/layout/reftests/font-inflation/height-constraint-percent-3.html
+++ b/layout/reftests/font-inflation/height-constraint-percent-3.html
@@ -1,12 +1,12 @@
 <!DOCTYPE HTML>
 <style>
 div { margin-top: 0; font-size: 12px; width: 450px }
-#center-block { height: -moz-calc(80% + 5%); }
+#center-block { height: calc(80% + 5%); }
 #center-col { background: yellow }
 p { margin-top: 0px; }
 
 </style>
 <!--
 In a 450px container, the minimum font size at 15em per line is 30px.
 This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
 -->
--- a/layout/reftests/font-inflation/height-constraint-percent-5-ref.html
+++ b/layout/reftests/font-inflation/height-constraint-percent-5-ref.html
@@ -1,14 +1,14 @@
 <!DOCTYPE HTML>
 <style>
 div { margin-top: 0; font-size: 12px; width: 450px }
 #center-block { height: 80%; }
 #center-col { background: yellow }
-#containing-block { height: -moz-calc(400px + 20px); }
+#containing-block { height: calc(400px + 20px); }
 p { margin-top: 0px; }
 
 </style>
 <!--
 Because the height of the containing block is constrained, the percent height should also
 be constrained, resulting in font inflation being disabled.
 -->
 <div id="containing-block">
--- a/layout/reftests/font-inflation/height-constraint-percent-5.html
+++ b/layout/reftests/font-inflation/height-constraint-percent-5.html
@@ -1,14 +1,14 @@
 <!DOCTYPE HTML>
 <style>
 div { margin-top: 0; font-size: 12px; width: 450px }
 #center-block { height: 80%; }
 #center-col { background: yellow }
-#containing-block { height: -moz-calc(400px + 20px); }
+#containing-block { height: calc(400px + 20px); }
 p { margin-top: 0px; }
 
 </style>
 <!--
 Because the height of the containing block is constrained, the percent height should also
 be constrained, resulting in font inflation being disabled.
 -->
 <div id="containing-block">
--- a/layout/reftests/forms/meter/bar-pseudo-element-vertical-ref.html
+++ b/layout/reftests/forms/meter/bar-pseudo-element-vertical-ref.html
@@ -1,31 +1,31 @@
 <!DOCTYPE html>
 <html>
   <link rel='stylesheet' type='text/css' href='style.css'>
   <style>
     .meter-element { margin: 10px; }
     body > div:nth-child(1) > .meter-bar { position: relative; top: 4px; left: 4px;
-                                              height: -moz-calc(100% - 8px); }
-    body > div:nth-child(2) > .meter-bar { width: -moz-calc(100% + 8px); }
+                                              height: calc(100% - 8px); }
+    body > div:nth-child(2) > .meter-bar { width: calc(100% + 8px); }
     body > div:nth-child(3) > .meter-bar { position: relative; top: 4px; left: 4px;
-                                              height: -moz-calc(100% - 8px);
-											  width: -moz-calc(100% + 8px); }
-    body > div:nth-child(4) > .meter-bar { position: relative; top: 10px; height: -moz-calc(100% - 10px); }
+                                              height: calc(100% - 8px);
+											  width: calc(100% + 8px); }
+    body > div:nth-child(4) > .meter-bar { position: relative; top: 10px; height: calc(100% - 10px); }
     body > div:nth-child(5) > .meter-bar { }
-    body > div:nth-child(6) > .meter-bar { height: -moz-calc(100% - 10px); }
+    body > div:nth-child(6) > .meter-bar { height: calc(100% - 10px); }
     body > div:nth-child(7) > .meter-bar { position: relative; left: 10px; }
     body > div:nth-child(8) > .meter-bar { }
-    body > div:nth-child(9) > .meter-bar { width: -moz-calc(100% + 10px); }
+    body > div:nth-child(9) > .meter-bar { width: calc(100% + 10px); }
     body > div:nth-child(10) > .meter-bar { }
-    body > div:nth-child(11) > .meter-bar { width: -moz-calc(100% + 10px); }
+    body > div:nth-child(11) > .meter-bar { width: calc(100% + 10px); }
     /* 12 - 15 should have 100% width, no need to specify. */
     body > div:nth-child(16) > .meter-bar { position: relative; top: 64px; left: 64px;
-                                               height: -moz-calc(100% + 32px + 16px);
-                                               width: -moz-calc(100% + 128px + 16px - 1em); }
+                                               height: calc(100% + 32px + 16px);
+                                               width: calc(100% + 128px + 16px - 1em); }
   </style>
   <body>
     <div class="meter-element vertical">
       <div class="meter-bar">
       </div>
     </div>
     <div class="meter-element vertical">
       <div class="meter-bar">
--- a/layout/reftests/forms/meter/bar-pseudo-element-vertical-rtl-ref.html
+++ b/layout/reftests/forms/meter/bar-pseudo-element-vertical-rtl-ref.html
@@ -1,34 +1,34 @@
 <!DOCTYPE html>
 <html>
   <link rel='stylesheet' type='text/css' href='style.css'>
   <style>
     .meter-element { margin: 10px; }
     body > div:nth-child(1) > .meter-bar { position: relative; top: 4px; left: 4px;
-                                              height: -moz-calc(100% - 8px); }
+                                              height: calc(100% - 8px); }
     body > div:nth-child(2) > .meter-bar { position: relative; left: 8px;
-	                                          width: -moz-calc(100% + 8px); }
+	                                          width: calc(100% + 8px); }
     body > div:nth-child(3) > .meter-bar { position: relative; top: 4px; left: 12px;
-                                              height: -moz-calc(100% - 8px);
-											  width: -moz-calc(100% + 8px); }
-    body > div:nth-child(4) > .meter-bar { position: relative; top: 10px; height: -moz-calc(100% - 10px); }
+                                              height: calc(100% - 8px);
+											  width: calc(100% + 8px); }
+    body > div:nth-child(4) > .meter-bar { position: relative; top: 10px; height: calc(100% - 10px); }
     body > div:nth-child(5) > .meter-bar { }
-    body > div:nth-child(6) > .meter-bar { height: -moz-calc(100% - 10px); }
+    body > div:nth-child(6) > .meter-bar { height: calc(100% - 10px); }
     body > div:nth-child(7) > .meter-bar { position: relative; left: 10px; }
     body > div:nth-child(8) > .meter-bar { }
     body > div:nth-child(9) > .meter-bar { position: relative; left: 10px;
-	                                          width: -moz-calc(100% + 10px); }
+	                                          width: calc(100% + 10px); }
     body > div:nth-child(10) > .meter-bar { }
     body > div:nth-child(11) > .meter-bar { position: relative; left: 10px;
-	                                          width: -moz-calc(100% + 10px); }
+	                                          width: calc(100% + 10px); }
     /* 12 - 15 should have 100% width, no need to specify. */
     body > div:nth-child(16) > .meter-bar { position: relative; top: 64px; left: 192px;
-                                               height: -moz-calc(100% + 64px - 1em); 
-								               width: -moz-calc(100% + 128px); }
+                                               height: calc(100% + 64px - 1em); 
+								               width: calc(100% + 128px); }
   </style>
   <body dir='rtl'>
     <div class="meter-element vertical">
       <div class="meter-bar">
       </div>
     </div>
     <div class="meter-element vertical">
       <div class="meter-bar">
--- a/layout/reftests/forms/progress/bar-pseudo-element-vertical-ref.html
+++ b/layout/reftests/forms/progress/bar-pseudo-element-vertical-ref.html
@@ -1,30 +1,30 @@
 <!DOCTYPE html>
 <html>
   <link rel='stylesheet' type='text/css' href='style.css'>
   <style>
     .progress-element { margin: 10px; }
     body > div:nth-child(1) > .progress-bar { position: relative; top: 4px; left: 4px;
-                                              height: -moz-calc(100% - 8px); }
+                                              height: calc(100% - 8px); }
     body > div:nth-child(2) > .progress-bar { }
     body > div:nth-child(3) > .progress-bar { position: relative; top: 4px; left: 4px;
-                                              height: -moz-calc(100% - 8px); }
-    body > div:nth-child(4) > .progress-bar { position: relative; top: 10px; height: -moz-calc(100% - 10px); }
+                                              height: calc(100% - 8px); }
+    body > div:nth-child(4) > .progress-bar { position: relative; top: 10px; height: calc(100% - 10px); }
     body > div:nth-child(5) > .progress-bar { }
-    body > div:nth-child(6) > .progress-bar { height: -moz-calc(100% - 10px); }
+    body > div:nth-child(6) > .progress-bar { height: calc(100% - 10px); }
     body > div:nth-child(7) > .progress-bar { position: relative; left: 10px; }
     body > div:nth-child(8) > .progress-bar { }
     body > div:nth-child(9) > .progress-bar { }
     body > div:nth-child(10) > .progress-bar { }
     body > div:nth-child(11) > .progress-bar { }
     /* 12 - 15 should have 100% width, no need to specify. */
     body > div:nth-of-type(16) > .progress-bar { position: relative; top: 64px; left: 64px;
-                                                 height: -moz-calc(100% - 32px);
-                                                 width: -moz-calc(100% + 128px - 1em); }
+                                                 height: calc(100% - 32px);
+                                                 width: calc(100% + 128px - 1em); }
   </style>
   <body>
     <div class="progress-element vertical">
       <div class="progress-bar">
       </div>
     </div>
     <div class="progress-element vertical">
       <div class="progress-bar">
--- a/layout/reftests/forms/progress/bar-pseudo-element-vertical-rtl-ref.html
+++ b/layout/reftests/forms/progress/bar-pseudo-element-vertical-rtl-ref.html
@@ -1,31 +1,31 @@
 <!DOCTYPE html>
 <html>
   <link rel='stylesheet' type='text/css' href='style.css'>
   <style>
     .progress-element { margin: 10px; }
     body > div:nth-child(1) > .progress-bar { position: relative; top: 4px; left: 4px;
-                                              height: -moz-calc(100% - 8px); }
+                                              height: calc(100% - 8px); }
     body > div:nth-child(2) > .progress-bar { }
     body > div:nth-child(3) > .progress-bar { position: relative; top: 4px; left: 4px;
-                                              height: -moz-calc(100% - 8px); }
-    body > div:nth-child(4) > .progress-bar { position: relative; top: 10px; height: -moz-calc(100% - 10px); }
+                                              height: calc(100% - 8px); }
+    body > div:nth-child(4) > .progress-bar { position: relative; top: 10px; height: calc(100% - 10px); }
     body > div:nth-child(5) > .progress-bar { }
-    body > div:nth-child(6) > .progress-bar { height: -moz-calc(100% - 10px); }
+    body > div:nth-child(6) > .progress-bar { height: calc(100% - 10px); }
     body > div:nth-child(7) > .progress-bar { position: relative; left: 10px; }
     body > div:nth-child(8) > .progress-bar { }
     body > div:nth-child(9) > .progress-bar { }
     body > div:nth-child(10) > .progress-bar {  }
     body > div:nth-child(11) > .progress-bar { }
     /* 12 - 15 should have 100% width, no need to specify. */
     body > div:nth-of-type(16) > .progress-bar { position: relative; top: 64px;
-                                                 left: -moz-calc(100% + 128px + 32px );
-                                                 height: -moz-calc(100% - 32px);
-                                                 width: -moz-calc(100% + 128px - 1em); }
+                                                 left: calc(100% + 128px + 32px );
+                                                 height: calc(100% - 32px);
+                                                 width: calc(100% + 128px - 1em); }
   </style>
   <body dir='rtl'>
     <div class="progress-element vertical">
       <div class="progress-bar">
       </div>
     </div>
     <div class="progress-element vertical">
       <div class="progress-bar">
--- a/layout/reftests/forms/progress/indeterminate-style-height-ref.html
+++ b/layout/reftests/forms/progress/indeterminate-style-height-ref.html
@@ -5,25 +5,25 @@
     div.progress-element {
       height: 12em;
       width: 2em;
     }
     div.progress-bar {
       height: 100%;
     }
     body > div:nth-child(1) > .progress-bar { position: relative;
-                                              top: -moz-calc(12em - 20px); height: 20px; }
+                                              top: calc(12em - 20px); height: 20px; }
     body > div:nth-child(2) > .progress-bar { position: relative;
-                                              top: -moz-calc(12em - 0px); height: 0px; }
+                                              top: calc(12em - 0px); height: 0px; }
     body > div:nth-child(3) > .progress-bar { position: relative;
-                                              top: -moz-calc(12em - 50%); height: 50%; }
+                                              top: calc(12em - 50%); height: 50%; }
     body > div:nth-child(4) > .progress-bar { position: relative;
-                                              top: -moz-calc(12em - 1em); height: 1em; }
+                                              top: calc(12em - 1em); height: 1em; }
     body > div:nth-child(5) > .progress-bar { position: relative;
-                                              top: -moz-calc(12em - 100%); height: 100%; }
+                                              top: calc(12em - 100%); height: 100%; }
   </style>
   <body>
     <div class="progress-element">
       <div class="progress-bar">
       </div>
     </div>
     <div class="progress-element">
       <div class="progress-bar">
--- a/layout/reftests/webm-video/reftest.list
+++ b/layout/reftests/webm-video/reftest.list
@@ -28,16 +28,17 @@ skip-if(Android) == poster-6.html poster
 skip-if(Android) == poster-7.html poster-ref-red140x100.html
 skip-if(Android) == poster-8.html poster-ref-black140x100.html
 random skip-if(Android) == poster-10.html poster-ref-blue125x100.html
 random skip-if(Android) == poster-11.html poster-ref-blue140x100.html
 random skip-if(Android) == poster-12.html poster-ref-blue140x100.html
 skip-if(Android) == poster-13.html poster-ref-blue400x300.html
 skip-if(Android) == poster-15.html poster-ref-green70x30.html
 random-if(winWidget) random-if(cocoaWidget) skip-if(Android) == bug686957.html bug686957-ref.html # bug 922951 for OS X
+== webm-alpha.html webm-alpha-ref.html
 
 # Tests for <video src> with 'object-fit' & 'object-position':
 # These tests should be very similar to tests in our w3c-css/submitted/images3
 # reftest directory. They live here because they use WebM video (VP9), and it
 # wouldn't be fair of us to make a W3C testsuite implicitly depend on any
 # particular (non-spec-mandated) video codec.
 default-preferences test-pref(layout.css.object-fit-and-position.enabled,true) test-pref(gfx.ycbcr.accurate-conversion,true)
 fails-if(layersGPUAccelerated) skip-if(Android) == object-fit-contain-webm-001.html object-fit-contain-webm-001-ref.html # Bug 1083516 for layersGPUAccelerated failures, Bug 1084564 for Android failures
new file mode 100644
--- /dev/null
+++ b/layout/reftests/webm-video/webm-alpha-ref.html
@@ -0,0 +1,5 @@
+<!DOCTYPE HTML>
+<html>
+<body style="background:black;">
+</body>
+</html>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/layout/reftests/webm-video/webm-alpha.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<html>
+<body style="background:black;">
+<!--
+    Test that if a WebM video has an alpha channel, it is displayed correctly.
+-->
+<video src="webm-alpha.webm">
+</video>
+</body>
+</html>
\ No newline at end of file
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b6fe4d7b682bccbe5140e366c4bf361409473fd3
GIT binary patch
literal 7643
zc%0SQdsGuw8UXM+AqfN&MU)K+hX@oATMAkPAFY!_5L7H07Vtp{tq*n)8?{)q)sqVd
z*y>7MMT%522SrvMqQ%F`sZFGHaocTyV--DM<8D`7s|!AO2r4^CW*`H1?wtDHat=bm
zy}$d-<bL;lcN`!2b14C=Up}f_NT|B$??+IqdJLUZSveoBdN)Ir2SutKP$bvr*VvkR
zA90I4_yPH9Y~81tikxvVe_5@mg#V7M+eN?fh_6o9RAv!=wwGR-I?GG%y!*^3$HD*2
zm*v8ksHX;9JDEL7MaJrPFHGIEIxIYRdT4NHNJyfR`+DxqeDavi+Qo7snBH@%nO|mI
zgT%&fAyEQ>@9C24%ylbscO;}F#LdWtgx|lib42eh17@b}sG2OI;5_|Z3`H6vBz)9o
zGHrkIa=HV7fob-LB1<9tGb<)r1>_y_E)e1GCEo-<&6<{9Z-DblKsx|q8j=ABNHJfS
zaiah6lK%ew9_{#WSGP@5snG$U6~AtIw$RDFbkC&z`<?0^m-+NRo8lH0TXuS%sKsHI
z|I=$FiD|JF50k0sCp{LcJNIYgNvHMq|8(yU3H^P?X1}uMJ^%2(FFVz6HYB0l&~ki5
z>)yhOoJZt$&z7!kzxrl#j1Q4F-xXw1OuVWx=9d}&g~ZX?VPWf1yFx^J0PtTqijKST
zuU>!4z1*|*u<f72L_=Vyp1t%!svd$skOTBFi}b!aAO@3~w*N`K%>WY13!T%ug1*^u
zVsTn?TU;(63roNvBajAEj;Ymyck<@NyB|KjF2UsMY3hT6!OdlZn`H^^jJ;fbE2nB(
zv$d<6zivQuq{Y+S(d_%C@p2Oz-hAqF2;zXPX`&X06(7jic6~5#U{GInP*2OC`v%%O
zC;;1>C1a=}2sSh1qQNHa#o9g?hZh$i#f8*CdM+_ytbq=4qs~T_NgjeexEYVqJ&<TI
z1Pu(j&^#EX)yx70JZjftDB8iI<S?{B03}gqEPeTeoIw{1G)YQ05hKs9rPU6+x`1CL
z8Fjv5m`cd;>R=apHI6z2i8Mxy0YE&d34p}omnJ{Zc(*%GE7Q|3iHGT4Ja?8T0J#L9
zo5b11Uc0kt(!O_=H7RH`jTg1=F$CRBU4+CrIyuQ5))aC8{<8C80Fs<YKhM?Uo4$X3
ztN0RqF-q4GFwaQOyB|sG#XK~xe3~uO9I7$-Ofb=d7YqzOiyeHbW$>y2na~f8KH%9!
zWEwYiASX2x1qm}dtO7`V#jVfipj@v)(I2069bI3qHq(Qi<G+neN1o3|<iyxfdTWy;
z*SqtIzn-&gP4{cpwKQzT!%Qy}9Kyl?1&f>nVB`mHg_9UK5*e{51P@2@N33UIbi_#l
zFn`453_RC>g!OoME^^7T!i_AfK*Hq$FmhIWL|ulW9tKvMfm137kJ@p>qTlL`dox8W
z*=8KM-OtCxMW45GbEs+km(cxeW@*Fn->3BME+2Pu!u{~4Jt-+#$^Axpl@m4MV^AZP
z&Lxxq(r@Pi$RwNZDm_SVk`SMaJ>aI-#{@pH&^`P#9F|lJO_Wp070@A?*@P8ZFcPeE
zF#hyL#Lc>!L09x<sq@y%V?AwCRBg=wEH^#syjZ$-+tQ66Q}t)UW=MJ)zS!_~MezIk
zA~szLSNM0nxAU==?UnL+*_JDBz3uM4bym{7x)imxWzty}g(f>`-21O>4K19aTX66|
zYU-W6XG^pjZh0?X;nn@LtJXOE&jCj!9{MHtym!ZQMR;=c<mo>g4M`7dJ>ohe;mTKP
z<){~npJbL1wV#Jg9ML^7v#~wzKg9V5>toJjPR?GM@?u?vF8IP{vex)s5P99W_MX?w
z`X97iBJaEYKT{{6M^3o%#{H(pw|l#*s*UQeNaKhbqIEe{tCY8AWdzM0-~9YA;UD-S
z{iCa$J3YN$nb*31`^B*5-!{GeV#3L<$7cM~voiAFuG!R_jThU#si->iV9qb*4acS7
z-$mHgX0<Jol4C!1SfL4u(qEoUc!0}&Sq=*R6_B~-+!fFcL#%+&R3UWGF}sMGndl=w
z{i28-DH^|fsF4%g3KlV-%FF?Ecu<9$tya*;f(8y)Bmg3F+X~)gK`jR~3V_I>$pVT;
zvmo~#-W33O@1Zz?1%W*%9xVVO*U1HR?J3qWpwh@JXBQNo)lZ;PT^xZom8ev=nfa_~
z7;0(-OyoxsLmhzP8m9D6+ls05#zz4%IW6Yn>kc)t_A*jkP~5`Q9rT~2`uWMzeV?|r
zE{RHPQ-EZzx4v(9T(MkN7~B+pr~Mzd71KI@cPL8vB((q3+5n^BX7BFKCDkKtMEC`z
z>C|z`&ghn_@r{?a__aLP|LPkvPuZ4PCA(LaroXQ9FalGO2VJX(YX$<I$p##13Al0~
z8q2$!Qboy4)Un(|l>lbrP?DTE(SqLvl*l_{1p`@-GixP40OXyuk~kLR%vuTNcw^TZ
z1#V_QlCzXZFsB>4)+o?`1~Dfa0kDAujT{hjs<CU00y|icv)D;6CmOrf2v90VgP6k%
zKWIr&DajNMN^XiuF$WpQI}tyms-QHDEg5V{k?a+p(Zj4Qq<%1JllvGtv!o<{X4xT}
zEs(@!mb8E!jI$p|`OiA`tx@;<92zWmY0!)YF=rDz=;(w7F=rA1Fa!xYV$LE0U=kX{
zoIwOYJsQNEJp{mVG>AEK@Pn4ja%^NaKW2GgGs}_xuwmaEky(yCfV17OnPtsz?a<6}
zZ2awe7WZm~W|orzF&I4%=6Eq2<$%#h&`I&qpbiaU%3lGn2n}M&UjfjF1~KKY0C*P-
zV#;4UC>xCiG3BoS7=Z+3nDUn&v}Be{%j{W0GE0Ujej)EZZOJTIK4#AvmRU0GOYB+L
z%#zh07atjaoh-1L$y(50&C7z$01aa5RRJ&%2|8oyRRJ&#4GKJt$AFvBpup333}`@u
z0#D*GU;`QycnZ&-S<W5kJ<FNDV8!fNmJnU!$mDkxDp+~1*@Z-cE|_{%08B%Jm<R3x
jU;!G$6rjUF%m1!2joj+?d<ntXPr4!TFpJpO0UiDa{BhMv
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -7847,18 +7847,17 @@ CSSParserImpl::ParseOneOrLargerVariant(n
   }
   return result;
 }
 
 static bool
 IsCSSTokenCalcFunction(const nsCSSToken& aToken)
 {
   return aToken.mType == eCSSToken_Function &&
-         (aToken.mIdent.LowerCaseEqualsLiteral("calc") ||
-          aToken.mIdent.LowerCaseEqualsLiteral("-moz-calc"));
+         aToken.mIdent.LowerCaseEqualsLiteral("calc");
 }
 
 // Assigns to aValue iff it returns CSSParseResult::Ok.
 CSSParseResult
 CSSParserImpl::ParseVariant(nsCSSValue& aValue,
                             uint32_t aVariantMask,
                             const KTableEntry aKeywordTable[])
 {
@@ -10659,18 +10658,17 @@ CSSParserImpl::IsLegacyGradientLine(cons
   switch (aType) {
   case eCSSToken_Percentage:
   case eCSSToken_Number:
   case eCSSToken_Dimension:
     haveGradientLine = true;
     break;
 
   case eCSSToken_Function:
-    if (aId.LowerCaseEqualsLiteral("calc") ||
-        aId.LowerCaseEqualsLiteral("-moz-calc")) {
+    if (aId.LowerCaseEqualsLiteral("calc")) {
       haveGradientLine = true;
       break;
     }
     MOZ_FALLTHROUGH;
   case eCSSToken_ID:
   case eCSSToken_Hash:
     // this is a color
     break;
@@ -12608,18 +12606,17 @@ CSSParserImpl::ParseImageLayersItem(
                                    aTable[nsStyleImageLayers::image]) !=
           CSSParseResult::Ok) {
         return false;
       }
     } else if (tt == eCSSToken_Dimension ||
                tt == eCSSToken_Number ||
                tt == eCSSToken_Percentage ||
                (tt == eCSSToken_Function &&
-                (mToken.mIdent.LowerCaseEqualsLiteral("calc") ||
-                 mToken.mIdent.LowerCaseEqualsLiteral("-moz-calc")))) {
+                mToken.mIdent.LowerCaseEqualsLiteral("calc"))) {
       if (havePositionAndSize)
         return false;
       havePositionAndSize = true;
       if (!ParsePositionValueSeparateCoords(aState.mPositionX->mValue,
                                             aState.mPositionY->mValue)) {
         return false;
       }
       if (ExpectSymbol('/', true)) {
--- a/layout/style/nsStyleConsts.h
+++ b/layout/style/nsStyleConsts.h
@@ -150,18 +150,18 @@ enum class StyleShapeOutsideShapeBox : u
   Content,
   Padding,
   Border,
   Margin
 };
 
 // <shape-radius> for <basic-shape>
 enum class StyleShapeRadius : uint8_t {
+  ClosestSide,
   FarthestSide,
-  ClosestSide
 };
 
 // Shape source type
 enum class StyleShapeSourceType : uint8_t {
   None,
   URL,
   Shape,
   Box,
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -1476,123 +1476,20 @@ var gCSSProperties = {
   "column-rule-width": {
     domProp: "columnRuleWidth",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     prerequisites: { "-moz-column-rule-style": "solid" },
     initial_values: [
       "medium",
       "3px",
-      "-moz-calc(3px)",
-      "-moz-calc(5em + 3px - 5em)",
       "calc(3px)",
       "calc(5em + 3px - 5em)",
     ],
     other_values: [ "thin", "15px",
-      /* valid -moz-calc() values */
-      "-moz-calc(-2px)",
-      "-moz-calc(2px)",
-      "-moz-calc(3em)",
-      "-moz-calc(3em + 2px)",
-      "-moz-calc( 3em + 2px)",
-      "-moz-calc(3em + 2px )",
-      "-moz-calc( 3em + 2px )",
-      "-moz-calc(3*25px)",
-      "-moz-calc(3 *25px)",
-      "-moz-calc(3 * 25px)",
-      "-moz-calc(3* 25px)",
-      "-moz-calc(25px*3)",
-      "-moz-calc(25px *3)",
-      "-moz-calc(25px* 3)",
-      "-moz-calc(25px * 3)",
-      "-moz-calc(25px * 3 / 4)",
-      "-moz-calc((25px * 3) / 4)",
-      "-moz-calc(25px * (3 / 4))",
-      "-moz-calc(3 * 25px / 4)",
-      "-moz-calc((3 * 25px) / 4)",
-      "-moz-calc(3 * (25px / 4))",
-      "-moz-calc(3em + 25px * 3 / 4)",
-      "-moz-calc(3em + (25px * 3) / 4)",
-      "-moz-calc(3em + 25px * (3 / 4))",
-      "-moz-calc(25px * 3 / 4 + 3em)",
-      "-moz-calc((25px * 3) / 4 + 3em)",
-      "-moz-calc(25px * (3 / 4) + 3em)",
-      "-moz-calc(3em + (25px * 3 / 4))",
-      "-moz-calc(3em + ((25px * 3) / 4))",
-      "-moz-calc(3em + (25px * (3 / 4)))",
-      "-moz-calc((25px * 3 / 4) + 3em)",
-      "-moz-calc(((25px * 3) / 4) + 3em)",
-      "-moz-calc((25px * (3 / 4)) + 3em)",
-      "-moz-calc(3*25px + 1in)",
-      "-moz-calc(1in - 3em + 2px)",
-      "-moz-calc(1in - (3em + 2px))",
-      "-moz-calc((1in - 3em) + 2px)",
-      "-moz-calc(50px/2)",
-      "-moz-calc(50px/(2 - 1))",
-      "-moz-calc(-3px)",
-      /* numeric reduction cases */
-      "-moz-calc(5 * 3 * 2em)",
-      "-moz-calc(2em * 5 * 3)",
-      "-moz-calc((5 * 3) * 2em)",
-      "-moz-calc(2em * (5 * 3))",
-      "-moz-calc((5 + 3) * 2em)",
-      "-moz-calc(2em * (5 + 3))",
-      "-moz-calc(2em / (5 + 3))",
-      "-moz-calc(2em * (5*2 + 3))",
-      "-moz-calc(2em * ((5*2) + 3))",
-      "-moz-calc(2em * (5*(2 + 3)))",
-
-      "-moz-calc((5 + 7) * 3em)",
-      "-moz-calc((5em + 3em) - 2em)",
-      "-moz-calc((5em - 3em) + 2em)",
-      "-moz-calc(2em - (5em - 3em))",
-      "-moz-calc(2em + (5em - 3em))",
-      "-moz-calc(2em - (5em + 3em))",
-      "-moz-calc(2em + (5em + 3em))",
-      "-moz-calc(2em + 5em - 3em)",
-      "-moz-calc(2em - 5em - 3em)",
-      "-moz-calc(2em + 5em + 3em)",
-      "-moz-calc(2em - 5em + 3em)",
-
-      "-moz-calc(2em / 4 * 3)",
-      "-moz-calc(2em * 4 / 3)",
-      "-moz-calc(2em * 4 * 3)",
-      "-moz-calc(2em / 4 / 3)",
-      "-moz-calc(4 * 2em / 3)",
-      "-moz-calc(4 / 3 * 2em)",
-
-      "-moz-calc((2em / 4) * 3)",
-      "-moz-calc((2em * 4) / 3)",
-      "-moz-calc((2em * 4) * 3)",
-      "-moz-calc((2em / 4) / 3)",
-      "-moz-calc((4 * 2em) / 3)",
-      "-moz-calc((4 / 3) * 2em)",
-
-      "-moz-calc(2em / (4 * 3))",
-      "-moz-calc(2em * (4 / 3))",
-      "-moz-calc(2em * (4 * 3))",
-      "-moz-calc(2em / (4 / 3))",
-      "-moz-calc(4 * (2em / 3))",
-
-      // Valid cases with unitless zero (which is never
-      // a length).
-      "-moz-calc(0 * 2em)",
-      "-moz-calc(2em * 0)",
-      "-moz-calc(3em + 0 * 2em)",
-      "-moz-calc(3em + 2em * 0)",
-      "-moz-calc((0 + 2) * 2em)",
-      "-moz-calc((2 + 0) * 2em)",
-      // And test zero lengths while we're here.
-      "-moz-calc(2 * 0px)",
-      "-moz-calc(0 * 0px)",
-      "-moz-calc(2 * 0em)",
-      "-moz-calc(0 * 0em)",
-      "-moz-calc(0px * 0)",
-      "-moz-calc(0px * 2)",
-
       /* valid calc() values */
       "calc(-2px)",
       "calc(2px)",
       "calc(3em)",
       "calc(3em + 2px)",
       "calc( 3em + 2px)",
       "calc(3em + 2px )",
       "calc( 3em + 2px )",
@@ -1686,23 +1583,16 @@ var gCSSProperties = {
       "calc(0 * 0px)",
       "calc(2 * 0em)",
       "calc(0 * 0em)",
       "calc(0px * 0)",
       "calc(0px * 2)",
 
     ],
     invalid_values: [ "20", "-1px", "red", "50%",
-      /* invalid -moz-calc() values */
-      "-moz-calc(2em+ 2px)",
-      "-moz-calc(2em +2px)",
-      "-moz-calc(2em+2px)",
-      "-moz-calc(2em- 2px)",
-      "-moz-calc(2em -2px)",
-      "-moz-calc(2em-2px)",
       /* invalid calc() values */
       "calc(2em+ 2px)",
       "calc(2em +2px)",
       "calc(2em+2px)",
       "calc(2em- 2px)",
       "calc(2em -2px)",
       "calc(2em-2px)",
       "-moz-min()",
@@ -4081,42 +3971,16 @@ var gCSSProperties = {
       // whether -moz-available computes to the initial value depends on
       // the container size, and for the container size we're testing
       // with, it does
       // "-moz-available",
       "3e1px", "3e+1px", "3e0px", "3e+0px", "3e-0px", "3e-1px",
       "3.2e1px", "3.2e+1px", "3.2e0px", "3.2e+0px", "3.2e-0px", "3.2e-1px",
       "3e1%", "3e+1%", "3e0%", "3e+0%", "3e-0%", "3e-1%",
       "3.2e1%", "3.2e+1%", "3.2e0%", "3.2e+0%", "3.2e-0%", "3.2e-1%",
-      /* valid -moz-calc() values */
-      "-moz-calc(-2px)",
-      "-moz-calc(2px)",
-      "-moz-calc(50%)",
-      "-moz-calc(50% + 2px)",
-      "-moz-calc( 50% + 2px)",
-      "-moz-calc(50% + 2px )",
-      "-moz-calc( 50% + 2px )",
-      "-moz-calc(50% - -2px)",
-      "-moz-calc(2px - -50%)",
-      "-moz-calc(3*25px)",
-      "-moz-calc(3 *25px)",
-      "-moz-calc(3 * 25px)",
-      "-moz-calc(3* 25px)",
-      "-moz-calc(25px*3)",
-      "-moz-calc(25px *3)",
-      "-moz-calc(25px* 3)",
-      "-moz-calc(25px * 3)",
-      "-moz-calc(3*25px + 50%)",
-      "-moz-calc(50% - 3em + 2px)",
-      "-moz-calc(50% - (3em + 2px))",
-      "-moz-calc((50% - 3em) + 2px)",
-      "-moz-calc(2em)",
-      "-moz-calc(50%)",
-      "-moz-calc(50px/2)",
-      "-moz-calc(50px/(2 - 1))",
       /* valid calc() values */
       "calc(-2px)",
       "calc(2px)",
       "calc(50%)",
       "calc(50% + 2px)",
       "calc( 50% + 2px)",
       "calc(50% + 2px )",
       "calc( 50% + 2px )",
@@ -4135,20 +3999,16 @@ var gCSSProperties = {
       "calc(50% - (3em + 2px))",
       "calc((50% - 3em) + 2px)",
       "calc(2em)",
       "calc(50%)",
       "calc(50px/2)",
       "calc(50px/(2 - 1))",
     ],
     invalid_values: [ "none", "-2px",
-      /* invalid -moz-calc() values */
-      "-moz-calc(50%+ 2px)",
-      "-moz-calc(50% +2px)",
-      "-moz-calc(50%+2px)",
       /* invalid calc() values */
       "calc(50%+ 2px)",
       "calc(50% +2px)",
       "calc(50%+2px)",
       "-moz-min()",
       "calc(min())",
       "-moz-max()",
       "calc(max())",
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -2222,16 +2222,23 @@ nsMenuPopupFrame::AttributeChanged(int32
       if (widget) {
         nsAutoString title;
         mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::label, title);
         if (!title.IsEmpty()) {
           widget->SetTitle(title);
         }
       }
     }
+  } else if (aAttribute == nsGkAtoms::ignorekeys) {
+    nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
+    if (pm) {
+      nsAutoString ignorekeys;
+      mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::ignorekeys, ignorekeys);
+      pm->UpdateIgnoreKeys(ignorekeys.EqualsLiteral("true"));
+    }
   }
 
   return rv;
 }
 
 void
 nsMenuPopupFrame::MoveToAttributePosition()
 {
--- a/layout/xul/nsXULPopupManager.cpp
+++ b/layout/xul/nsXULPopupManager.cpp
@@ -2618,16 +2618,27 @@ nsXULPopupManager::HandleEvent(nsIDOMEve
   }
 
   NS_ABORT();
 
   return NS_OK;
 }
 
 nsresult
+nsXULPopupManager::UpdateIgnoreKeys(bool aIgnoreKeys)
+{
+  nsMenuChainItem* item = GetTopVisibleMenu();
+  if (item) {
+    item->SetIgnoreKeys(aIgnoreKeys ? eIgnoreKeys_True : eIgnoreKeys_Shortcuts);
+  }
+  UpdateKeyboardListeners();
+  return NS_OK;
+}
+
+nsresult
 nsXULPopupManager::KeyUp(nsIDOMKeyEvent* aKeyEvent)
 {
   // don't do anything if a menu isn't open or a menubar isn't active
   if (!mActiveMenuBar) {
     nsMenuChainItem* item = GetTopVisibleMenu();
     if (!item || item->PopupType() != ePopupTypeMenu)
       return NS_OK;
 
--- a/layout/xul/nsXULPopupManager.h
+++ b/layout/xul/nsXULPopupManager.h
@@ -658,16 +658,19 @@ public:
 
   /**
    * Handles the keyboard event with keyCode value. Returns true if the event
    * has been handled.
    */
   bool HandleKeyboardEventWithKeyCode(nsIDOMKeyEvent* aKeyEvent,
                                       nsMenuChainItem* aTopVisibleMenuItem);
 
+  // Sets mIgnoreKeys of the Top Visible Menu Item
+  nsresult UpdateIgnoreKeys(bool aIgnoreKeys);
+
   nsresult KeyUp(nsIDOMKeyEvent* aKeyEvent);
   nsresult KeyDown(nsIDOMKeyEvent* aKeyEvent);
   nsresult KeyPress(nsIDOMKeyEvent* aKeyEvent);
 
 protected:
   nsXULPopupManager();
   ~nsXULPopupManager();
 
--- a/media/libvpx/Makefile.in
+++ b/media/libvpx/Makefile.in
@@ -5,15 +5,18 @@
 # Set up the libvpx assembler config.
 
 ifdef VPX_ARM_ASM
 
 ifdef VPX_AS_CONVERSION
 # The ARM asm is written in ARM RVCT syntax, but we actually build it with
 # gas using GNU syntax. Add some rules to perform the conversion.
 
-GENERATED_DIRS += $(dir $(ASFILES))
+# Previously used $(dir $(ASFILES)) to figure out which directories to generate.
+# However, .S (as opposed to .s) files are not added to ASFILES. There is only
+# one directory with arm assembly currently so enumerate it manually.
+GENERATED_DIRS += libvpx/vpx_dsp/arm
 
-%.asm.s: %.asm $(ASM_OFFSETS)
+%.asm.S: %.asm $(ASM_OFFSETS)
 	$(VPX_AS_CONVERSION) < $< > $@
 
 endif
 endif
--- a/media/libvpx/README_MOZILLA
+++ b/media/libvpx/README_MOZILLA
@@ -3,9 +3,9 @@ git repository using the update.py scrip
 made were those applied by update.py and the addition of
 moz.build and Makefile.in build files for the
 Mozilla build system.
 
 The libvpx git repository is:
 
     https://chromium.googlesource.com/webm/libvpx
 
-The git commit ID used was v1.6.0
+The git commit ID used was v1.6.1
--- a/media/libvpx/bug1137614.patch
+++ b/media/libvpx/bug1137614.patch
@@ -1,23 +1,23 @@
 diff --git a/media/libvpx/libvpx/vp8/encoder/block.h b/media/libvpx/libvpx/vp8/encoder/block.h
 --- a/media/libvpx/libvpx/vp8/encoder/block.h
 +++ b/media/libvpx/libvpx/vp8/encoder/block.h
-@@ -93,17 +93,18 @@ typedef struct macroblock
-     int rddiv;
-     int rdmult;
-     unsigned int * mb_activity_ptr;
-     int * mb_norm_activity_ptr;
-     signed int act_zbin_adj;
-     signed int last_act_zbin_adj;
- 
-     int *mvcost[2];
--    int *mvsadcost[2];
-+    /* MSVC generates code that thinks this is 16-byte aligned */
-+    DECLARE_ALIGNED(16, int*, mvsadcost[2]);
-     int (*mbmode_cost)[MB_MODE_COUNT];
-     int (*intra_uv_mode_cost)[MB_MODE_COUNT];
-     int (*bmode_costs)[10][10];
-     int *inter_bmode_costs;
-     int (*token_costs)[COEF_BANDS][PREV_COEF_CONTEXTS]
-     [MAX_ENTROPY_TOKENS];
- 
-     /* These define limits to motion vector components to prevent
+@@ -87,17 +87,18 @@ typedef struct macroblock {
+   int rddiv;
+   int rdmult;
+   unsigned int *mb_activity_ptr;
+   int *mb_norm_activity_ptr;
+   signed int act_zbin_adj;
+   signed int last_act_zbin_adj;
+
+   int *mvcost[2];
+-  int *mvsadcost[2];
++  /* MSVC generates code that thinks this is 16-byte aligned */
++  DECLARE_ALIGNED(16, int*, mvsadcost[2]);
+   int (*mbmode_cost)[MB_MODE_COUNT];
+   int (*intra_uv_mode_cost)[MB_MODE_COUNT];
+   int (*bmode_costs)[10][10];
+   int *inter_bmode_costs;
+   int (*token_costs)[COEF_BANDS][PREV_COEF_CONTEXTS][MAX_ENTROPY_TOKENS];
+
+   /* These define limits to motion vector components to prevent
+    * them from extending outside the UMV borders.
deleted file mode 100644
--- a/media/libvpx/clang-cl.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-Bug 1233983 - Make libvpx build with clang-cl
-
-diff --git a/media/libvpx/libvpx/vp8/common/generic/systemdependent.c b/media/libvpx/libvpx/vp8/common/generic/systemdependent.c
-index 4393ced..8ee7e02 100644
---- a/media/libvpx/libvpx/vp8/common/generic/systemdependent.c
-+++ b/media/libvpx/libvpx/vp8/common/generic/systemdependent.c
-@@ -24,6 +24,7 @@
- #include <unistd.h>
- #elif defined(_WIN32)
- #include <windows.h>
-+#include <intrin.h>
- typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
- #elif defined(__OS2__)
- #define INCL_DOS
-diff --git a/media/libvpx/libvpx/vp8/common/rtcd.c b/media/libvpx/libvpx/vp8/common/rtcd.c
-index ab0e9b4..98c2ecd 100644
---- a/media/libvpx/libvpx/vp8/common/rtcd.c
-+++ b/media/libvpx/libvpx/vp8/common/rtcd.c
-@@ -11,6 +11,9 @@
- #define RTCD_C
- #include "./vp8_rtcd.h"
- #include "vpx_ports/vpx_once.h"
-+#ifdef _MSC_VER
-+#include <intrin.h>
-+#endif
- 
- 
- void vp8_rtcd()
-diff --git a/media/libvpx/libvpx/vp8/decoder/threading.c b/media/libvpx/libvpx/vp8/decoder/threading.c
-index 6801532..a76672f 100644
---- a/media/libvpx/libvpx/vp8/decoder/threading.c
-+++ b/media/libvpx/libvpx/vp8/decoder/threading.c
-@@ -29,6 +29,9 @@
- #if CONFIG_ERROR_CONCEALMENT
- #include "error_concealment.h"
- #endif
-+#ifdef _MSC_VER
-+#include <intrin.h>
-+#endif
- 
- #define CALLOC_ARRAY(p, n) CHECK_MEM_ERROR((p), vpx_calloc(sizeof(*(p)), (n)))
- #define CALLOC_ARRAY_ALIGNED(p, n, algn) do {                      \
-diff --git a/media/libvpx/libvpx/vp8/encoder/encodeframe.c b/media/libvpx/libvpx/vp8/encoder/encodeframe.c
-index d381d8d..5e84fb4 100644
---- a/media/libvpx/libvpx/vp8/encoder/encodeframe.c
-+++ b/media/libvpx/libvpx/vp8/encoder/encodeframe.c
-@@ -34,6 +34,9 @@
- #include "bitstream.h"
- #endif
- #include "encodeframe.h"
-+#ifdef _MSC_VER
-+#include <intrin.h>
-+#endif
- 
- extern void vp8_stuff_mb(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t) ;
- extern void vp8_calc_ref_frame_costs(int *ref_frame_cost,
-diff --git a/media/libvpx/libvpx/vp8/encoder/ethreading.c b/media/libvpx/libvpx/vp8/encoder/ethreading.c
-index 4e234cc..519ae73b 100644
---- a/media/libvpx/libvpx/vp8/encoder/ethreading.c
-+++ b/media/libvpx/libvpx/vp8/encoder/ethreading.c
-@@ -14,6 +14,9 @@
- #include "vp8/common/extend.h"
- #include "bitstream.h"
- #include "encodeframe.h"
-+#ifdef _MSC_VER
-+#include <intrin.h>
-+#endif
- 
- #if CONFIG_MULTITHREAD
- 
-diff --git a/media/libvpx/libvpx/vpx_dsp/vpx_dsp_rtcd.c b/media/libvpx/libvpx/vpx_dsp/vpx_dsp_rtcd.c
-index 5fe27b6..d247603 100644
---- a/media/libvpx/libvpx/vpx_dsp/vpx_dsp_rtcd.c
-+++ b/media/libvpx/libvpx/vpx_dsp/vpx_dsp_rtcd.c
-@@ -11,6 +11,9 @@
- #define RTCD_C
- #include "./vpx_dsp_rtcd.h"
- #include "vpx_ports/vpx_once.h"
-+#ifdef _MSC_VER
-+#include <intrin.h>
-+#endif
- 
- void vpx_dsp_rtcd() {
-   once(setup_rtcd_internal);
-diff --git a/media/libvpx/libvpx/vpx_scale/vpx_scale_rtcd.c b/media/libvpx/libvpx/vpx_scale/vpx_scale_rtcd.c
-index bea603f..65532ba 100644
---- a/media/libvpx/libvpx/vpx_scale/vpx_scale_rtcd.c
-+++ b/media/libvpx/libvpx/vpx_scale/vpx_scale_rtcd.c
-@@ -11,6 +11,9 @@
- #define RTCD_C
- #include "./vpx_scale_rtcd.h"
- #include "vpx_ports/vpx_once.h"
-+#ifdef _MSC_VER
-+#include <intrin.h>
-+#endif
- 
- void vpx_scale_rtcd()
- {
--- a/media/libvpx/config/generic/vp8_rtcd.h
+++ b/media/libvpx/config/generic/vp8_rtcd.h
@@ -36,19 +36,16 @@ void vp8_bilinear_predict8x4_c(unsigned 
 #define vp8_bilinear_predict8x4 vp8_bilinear_predict8x4_c
 
 void vp8_bilinear_predict8x8_c(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch);
 #define vp8_bilinear_predict8x8 vp8_bilinear_predict8x8_c
 
 int vp8_block_error_c(short *coeff, short *dqcoeff);
 #define vp8_block_error vp8_block_error_c
 
-void vp8_clear_system_state_c();
-#define vp8_clear_system_state vp8_clear_system_state_c
-
 void vp8_copy_mem16x16_c(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch);
 #define vp8_copy_mem16x16 vp8_copy_mem16x16_c
 
 void vp8_copy_mem8x4_c(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch);
 #define vp8_copy_mem8x4 vp8_copy_mem8x4_c
 
 void vp8_copy_mem8x8_c(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch);
 #define vp8_copy_mem8x8 vp8_copy_mem8x8_c
--- a/media/libvpx/config/generic/vp9_rtcd.h
+++ b/media/libvpx/config/generic/vp9_rtcd.h
@@ -54,20 +54,20 @@ int vp9_full_search_sad_c(const struct m
 #define vp9_full_search_sad vp9_full_search_sad_c
 
 void vp9_fwht4x4_c(const int16_t *input, tran_low_t *output, int stride);
 #define vp9_fwht4x4 vp9_fwht4x4_c
 
 void vp9_iht16x16_256_add_c(const tran_low_t *input, uint8_t *output, int pitch, int tx_type);
 #define vp9_iht16x16_256_add vp9_iht16x16_256_add_c
 
-void vp9_iht4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type);
+void vp9_iht4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride, int tx_type);
 #define vp9_iht4x4_16_add vp9_iht4x4_16_add_c
 
-void vp9_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type);
+void vp9_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride, int tx_type);
 #define vp9_iht8x8_64_add vp9_iht8x8_64_add_c
 
 void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
 #define vp9_quantize_fp vp9_quantize_fp_c
 
 void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
 #define vp9_quantize_fp_32x32 vp9_quantize_fp_32x32_c
 
--- a/media/libvpx/config/generic/vpx_config.asm
+++ b/media/libvpx/config/generic/vpx_config.asm
@@ -1,17 +1,15 @@
 @ This file was created from a .asm file
 @  using the ads2gas.pl script.
 	.equ DO1STROUNDING, 0
 .equ ARCH_ARM ,  0
 .equ ARCH_MIPS ,  0
 .equ ARCH_X86 ,  0
 .equ ARCH_X86_64 ,  0
-.equ HAVE_EDSP ,  0
-.equ HAVE_MEDIA ,  0
 .equ HAVE_NEON ,  0
 .equ HAVE_NEON_ASM ,  0
 .equ HAVE_MIPS32 ,  0
 .equ HAVE_DSPR2 ,  0
 .equ HAVE_MSA ,  0
 .equ HAVE_MIPS64 ,  0
 .equ HAVE_MMX ,  0
 .equ HAVE_SSE ,  0
@@ -24,17 +22,16 @@
 .equ HAVE_VPX_PORTS ,  1
 .equ HAVE_PTHREAD_H ,  1
 .equ CONFIG_DEPENDENCY_TRACKING ,  1
 .equ CONFIG_EXTERNAL_BUILD ,  1
 .equ CONFIG_INSTALL_DOCS ,  0
 .equ CONFIG_INSTALL_BINS ,  1
 .equ CONFIG_INSTALL_LIBS ,  1
 .equ CONFIG_INSTALL_SRCS ,  0
-.equ CONFIG_USE_X86INC ,  0
 .equ CONFIG_DEBUG ,  0
 .equ CONFIG_GPROF ,  0
 .equ CONFIG_GCOV ,  0
 .equ CONFIG_RVCT ,  0
 .equ CONFIG_GCC ,  1
 .equ CONFIG_MSVS ,  0
 .equ CONFIG_PIC ,  1
 .equ CONFIG_BIG_ENDIAN ,  0
--- a/media/libvpx/config/generic/vpx_config.h
+++ b/media/libvpx/config/generic/vpx_config.h
@@ -9,18 +9,16 @@
 #ifndef VPX_CONFIG_H
 #define VPX_CONFIG_H
 #define RESTRICT    
 #define INLINE      inline
 #define ARCH_ARM 0
 #define ARCH_MIPS 0
 #define ARCH_X86 0
 #define ARCH_X86_64 0
-#define HAVE_EDSP 0
-#define HAVE_MEDIA 0
 #define HAVE_NEON 0
 #define HAVE_NEON_ASM 0
 #define HAVE_MIPS32 0
 #define HAVE_DSPR2 0
 #define HAVE_MSA 0
 #define HAVE_MIPS64 0
 #define HAVE_MMX 0
 #define HAVE_SSE 0
@@ -33,17 +31,16 @@
 #define HAVE_VPX_PORTS 1
 #define HAVE_PTHREAD_H 1
 #define CONFIG_DEPENDENCY_TRACKING 1
 #define CONFIG_EXTERNAL_BUILD 1
 #define CONFIG_INSTALL_DOCS 0
 #define CONFIG_INSTALL_BINS 1
 #define CONFIG_INSTALL_LIBS 1
 #define CONFIG_INSTALL_SRCS 0
-#define CONFIG_USE_X86INC 0
 #define CONFIG_DEBUG 0
 #define CONFIG_GPROF 0
 #define CONFIG_GCOV 0
 #define CONFIG_RVCT 0
 #define CONFIG_GCC 1
 #define CONFIG_MSVS 0
 #define CONFIG_PIC 1
 #define CONFIG_BIG_ENDIAN 0
--- a/media/libvpx/config/generic/vpx_dsp_rtcd.h
+++ b/media/libvpx/config/generic/vpx_dsp_rtcd.h
@@ -266,82 +266,82 @@ void vpx_hadamard_16x16_c(const int16_t 
 #define vpx_hadamard_16x16 vpx_hadamard_16x16_c
 
 void vpx_hadamard_8x8_c(const int16_t *src_diff, int src_stride, int16_t *coeff);
 #define vpx_hadamard_8x8 vpx_hadamard_8x8_c
 
 void vpx_he_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
 #define vpx_he_predictor_4x4 vpx_he_predictor_4x4_c
 
-void vpx_idct16x16_10_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct16x16_10_add_c(const tran_low_t *input, uint8_t *dest, int stride);
 #define vpx_idct16x16_10_add vpx_idct16x16_10_add_c
 
-void vpx_idct16x16_1_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct16x16_1_add_c(const tran_low_t *input, uint8_t *dest, int stride);
 #define vpx_idct16x16_1_add vpx_idct16x16_1_add_c
 
-void vpx_idct16x16_256_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct16x16_256_add_c(const tran_low_t *input, uint8_t *dest, int stride);
 #define vpx_idct16x16_256_add vpx_idct16x16_256_add_c
 
-void vpx_idct32x32_1024_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct32x32_1024_add_c(const tran_low_t *input, uint8_t *dest, int stride);
 #define vpx_idct32x32_1024_add vpx_idct32x32_1024_add_c
 
-void vpx_idct32x32_135_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct32x32_135_add_c(const tran_low_t *input, uint8_t *dest, int stride);
 #define vpx_idct32x32_135_add vpx_idct32x32_135_add_c
 
-void vpx_idct32x32_1_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct32x32_1_add_c(const tran_low_t *input, uint8_t *dest, int stride);
 #define vpx_idct32x32_1_add vpx_idct32x32_1_add_c
 
-void vpx_idct32x32_34_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct32x32_34_add_c(const tran_low_t *input, uint8_t *dest, int stride);
 #define vpx_idct32x32_34_add vpx_idct32x32_34_add_c
 
-void vpx_idct4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride);
 #define vpx_idct4x4_16_add vpx_idct4x4_16_add_c
 
-void vpx_idct4x4_1_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct4x4_1_add_c(const tran_low_t *input, uint8_t *dest, int stride);
 #define vpx_idct4x4_1_add vpx_idct4x4_1_add_c
 
-void vpx_idct8x8_12_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct8x8_12_add_c(const tran_low_t *input, uint8_t *dest, int stride);
 #define vpx_idct8x8_12_add vpx_idct8x8_12_add_c
 
-void vpx_idct8x8_1_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct8x8_1_add_c(const tran_low_t *input, uint8_t *dest, int stride);
 #define vpx_idct8x8_1_add vpx_idct8x8_1_add_c
 
-void vpx_idct8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride);
 #define vpx_idct8x8_64_add vpx_idct8x8_64_add_c
 
 int16_t vpx_int_pro_col_c(const uint8_t *ref, const int width);
 #define vpx_int_pro_col vpx_int_pro_col_c
 
 void vpx_int_pro_row_c(int16_t *hbuf, const uint8_t *ref, const int ref_stride, const int height);
 #define vpx_int_pro_row vpx_int_pro_row_c
 
-void vpx_iwht4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_iwht4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride);
 #define vpx_iwht4x4_16_add vpx_iwht4x4_16_add_c
 
-void vpx_iwht4x4_1_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_iwht4x4_1_add_c(const tran_low_t *input, uint8_t *dest, int stride);
 #define vpx_iwht4x4_1_add vpx_iwht4x4_1_add_c
 
+void vpx_lpf_horizontal_16_c(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
+#define vpx_lpf_horizontal_16 vpx_lpf_horizontal_16_c
+
+void vpx_lpf_horizontal_16_dual_c(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
+#define vpx_lpf_horizontal_16_dual vpx_lpf_horizontal_16_dual_c
+
 void vpx_lpf_horizontal_4_c(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
 #define vpx_lpf_horizontal_4 vpx_lpf_horizontal_4_c
 
 void vpx_lpf_horizontal_4_dual_c(uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1);
 #define vpx_lpf_horizontal_4_dual vpx_lpf_horizontal_4_dual_c
 
 void vpx_lpf_horizontal_8_c(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
 #define vpx_lpf_horizontal_8 vpx_lpf_horizontal_8_c
 
 void vpx_lpf_horizontal_8_dual_c(uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1);
 #define vpx_lpf_horizontal_8_dual vpx_lpf_horizontal_8_dual_c
 
-void vpx_lpf_horizontal_edge_16_c(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
-#define vpx_lpf_horizontal_edge_16 vpx_lpf_horizontal_edge_16_c
-
-void vpx_lpf_horizontal_edge_8_c(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
-#define vpx_lpf_horizontal_edge_8 vpx_lpf_horizontal_edge_8_c
-
 void vpx_lpf_vertical_16_c(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
 #define vpx_lpf_vertical_16 vpx_lpf_vertical_16_c
 
 void vpx_lpf_vertical_16_dual_c(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
 #define vpx_lpf_vertical_16_dual vpx_lpf_vertical_16_dual_c
 
 void vpx_lpf_vertical_4_c(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
 #define vpx_lpf_vertical_4 vpx_lpf_vertical_4_c
@@ -638,16 +638,19 @@ uint32_t vpx_sub_pixel_variance8x4_c(con
 #define vpx_sub_pixel_variance8x4 vpx_sub_pixel_variance8x4_c
 
 uint32_t vpx_sub_pixel_variance8x8_c(const uint8_t *src_ptr, int source_stride, int xoffset, int  yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse);
 #define vpx_sub_pixel_variance8x8 vpx_sub_pixel_variance8x8_c
 
 void vpx_subtract_block_c(int rows, int cols, int16_t *diff_ptr, ptrdiff_t diff_stride, const uint8_t *src_ptr, ptrdiff_t src_stride, const uint8_t *pred_ptr, ptrdiff_t pred_stride);
 #define vpx_subtract_block vpx_subtract_block_c
 
+uint64_t vpx_sum_squares_2d_i16_c(const int16_t *src, int stride, int size);
+#define vpx_sum_squares_2d_i16 vpx_sum_squares_2d_i16_c
+
 void vpx_tm_predictor_16x16_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
 #define vpx_tm_predictor_16x16 vpx_tm_predictor_16x16_c
 
 void vpx_tm_predictor_32x32_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
 #define vpx_tm_predictor_32x32 vpx_tm_predictor_32x32_c
 
 void vpx_tm_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
 #define vpx_tm_predictor_4x4 vpx_tm_predictor_4x4_c
@@ -701,25 +704,16 @@ unsigned int vpx_variance8x16_c(const ui
 #define vpx_variance8x16 vpx_variance8x16_c
 
 unsigned int vpx_variance8x4_c(const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse);
 #define vpx_variance8x4 vpx_variance8x4_c
 
 unsigned int vpx_variance8x8_c(const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse);
 #define vpx_variance8x8 vpx_variance8x8_c
 
-uint32_t vpx_variance_halfpixvar16x16_h_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int  ref_stride, uint32_t *sse);
-#define vpx_variance_halfpixvar16x16_h vpx_variance_halfpixvar16x16_h_c
-
-uint32_t vpx_variance_halfpixvar16x16_hv_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int  ref_stride, uint32_t *sse);
-#define vpx_variance_halfpixvar16x16_hv vpx_variance_halfpixvar16x16_hv_c
-
-uint32_t vpx_variance_halfpixvar16x16_v_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int  ref_stride, uint32_t *sse);
-#define vpx_variance_halfpixvar16x16_v vpx_variance_halfpixvar16x16_v_c
-
 void vpx_ve_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
 #define vpx_ve_predictor_4x4 vpx_ve_predictor_4x4_c
 
 int vpx_vector_var_c(const int16_t *ref, const int16_t *src, const int bwl);
 #define vpx_vector_var vpx_vector_var_c
 
 void vpx_dsp_rtcd(void);
 
--- a/media/libvpx/config/linux/arm/vp8_rtcd.h
+++ b/media/libvpx/config/linux/arm/vp8_rtcd.h
@@ -22,268 +22,242 @@ struct variance_vtable;
 union int_mv;
 struct yv12_buffer_config;
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 void vp8_bilinear_predict16x16_c(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch);
-void vp8_bilinear_predict16x16_armv6(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch);
 void vp8_bilinear_predict16x16_neon(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch);
 RTCD_EXTERN void (*vp8_bilinear_predict16x16)(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch);
 
 void vp8_bilinear_predict4x4_c(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch);
-void vp8_bilinear_predict4x4_armv6(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch);
-#define vp8_bilinear_predict4x4 vp8_bilinear_predict4x4_armv6
+void vp8_bilinear_predict4x4_neon(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch);
+RTCD_EXTERN void (*vp8_bilinear_predict4x4)(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch);
 
 void vp8_bilinear_predict8x4_c(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch);
-void vp8_bilinear_predict8x4_armv6(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch);
 void vp8_bilinear_predict8x4_neon(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch);
 RTCD_EXTERN void (*vp8_bilinear_predict8x4)(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch);
 
 void vp8_bilinear_predict8x8_c(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch);
-void vp8_bilinear_predict8x8_armv6(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch);
 void vp8_bilinear_predict8x8_neon(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch);
 RTCD_EXTERN void (*vp8_bilinear_predict8x8)(unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch);
 
 int vp8_block_error_c(short *coeff, short *dqcoeff);
 #define vp8_block_error vp8_block_error_c
 
-void vp8_clear_system_state_c();
-#define vp8_clear_system_state vp8_clear_system_state_c
-
 void vp8_copy_mem16x16_c(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch);
-void vp8_copy_mem16x16_v6(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch);
 void vp8_copy_mem16x16_neon(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch);
 RTCD_EXTERN void (*vp8_copy_mem16x16)(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch);
 
 void vp8_copy_mem8x4_c(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch);
-void vp8_copy_mem8x4_v6(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch);
 void vp8_copy_mem8x4_neon(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch);
 RTCD_EXTERN void (*vp8_copy_mem8x4)(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch);
 
 void vp8_copy_mem8x8_c(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch);
-void vp8_copy_mem8x8_v6(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch);
 void vp8_copy_mem8x8_neon(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch);
 RTCD_EXTERN void (*vp8_copy_mem8x8)(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch);
 
 void vp8_dc_only_idct_add_c(short input, unsigned char *pred, int pred_stride, unsigned char *dst, int dst_stride);
-void vp8_dc_only_idct_add_v6(short input, unsigned char *pred, int pred_stride, unsigned char *dst, int dst_stride);
 void vp8_dc_only_idct_add_neon(short input, unsigned char *pred, int pred_stride, unsigned char *dst, int dst_stride);
 RTCD_EXTERN void (*vp8_dc_only_idct_add)(short input, unsigned char *pred, int pred_stride, unsigned char *dst, int dst_stride);
 
 int vp8_denoiser_filter_c(unsigned char *mc_running_avg_y, int mc_avg_y_stride, unsigned char *running_avg_y, int avg_y_stride, unsigned char *sig, int sig_stride, unsigned int motion_magnitude, int increase_denoising);
 int vp8_denoiser_filter_neon(unsigned char *mc_running_avg_y, int mc_avg_y_stride, unsigned char *running_avg_y, int avg_y_stride, unsigned char *sig, int sig_stride, unsigned int motion_magnitude, int increase_denoising);
 RTCD_EXTERN int (*vp8_denoiser_filter)(unsigned char *mc_running_avg_y, int mc_avg_y_stride, unsigned char *running_avg_y, int avg_y_stride, unsigned char *sig, int sig_stride, unsigned int motion_magnitude, int increase_denoising);
 
 int vp8_denoiser_filter_uv_c(unsigned char *mc_running_avg, int mc_avg_stride, unsigned char *running_avg, int avg_stride, unsigned char *sig, int sig_stride, unsigned int motion_magnitude, int increase_denoising);
 int vp8_denoiser_filter_uv_neon(unsigned char *mc_running_avg, int mc_avg_stride, unsigned char *running_avg, int avg_stride, unsigned char *sig, int sig_stride, unsigned int motion_magnitude, int increase_denoising);
 RTCD_EXTERN int (*vp8_denoiser_filter_uv)(unsigned char *mc_running_avg, int mc_avg_stride, unsigned char *running_avg, int avg_stride, unsigned char *sig, int sig_stride, unsigned int motion_magnitude, int increase_denoising);
 
 void vp8_dequant_idct_add_c(short *input, short *dq, unsigned char *output, int stride);
-void vp8_dequant_idct_add_v6(short *input, short *dq, unsigned char *output, int stride);
 void vp8_dequant_idct_add_neon(short *input, short *dq, unsigned char *output, int stride);
 RTCD_EXTERN void (*vp8_dequant_idct_add)(short *input, short *dq, unsigned char *output, int stride);
 
 void vp8_dequant_idct_add_uv_block_c(short *q, short *dq, unsigned char *dst_u, unsigned char *dst_v, int stride, char *eobs);
-void vp8_dequant_idct_add_uv_block_v6(short *q, short *dq, unsigned char *dst_u, unsigned char *dst_v, int stride, char *eobs);
 void vp8_dequant_idct_add_uv_block_neon(short *q, short *dq, unsigned char *dst_u, unsigned char *dst_v, int stride, char *eobs);
 RTCD_EXTERN void (*vp8_dequant_idct_add_uv_block)(short *q, short *dq, unsigned char *dst_u, unsigned char *dst_v, int stride, char *eobs);
 
 void vp8_dequant_idct_add_y_block_c(short *q, short *dq, unsigned char *dst, int stride, char *eobs);
-void vp8_dequant_idct_add_y_block_v6(short *q, short *dq, unsigned char *dst, int stride, char *eobs);
 void vp8_dequant_idct_add_y_block_neon(short *q, short *dq, unsigned char *dst, int stride, char *eobs);
 RTCD_EXTERN void (*vp8_dequant_idct_add_y_block)(short *q, short *dq, unsigned char *dst, int stride, char *eobs);
 
 void vp8_dequantize_b_c(struct blockd*, short *dqc);
-void vp8_dequantize_b_v6(struct blockd*, short *dqc);
 void vp8_dequantize_b_neon(struct blockd*, short *dqc);
 RTCD_EXTERN void (*vp8_dequantize_b)(struct blockd*, short *dqc);
 
 int vp8_diamond_search_sad_c(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, union int_mv *best_mv, int search_param, int sad_per_bit, int *num00, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
 #define vp8_diamond_search_sad vp8_diamond_search_sad_c
 
 void vp8_fast_quantize_b_c(struct block *, struct blockd *);
 void vp8_fast_quantize_b_neon(struct block *, struct blockd *);
 RTCD_EXTERN void (*vp8_fast_quantize_b)(struct block *, struct blockd *);
 
 int vp8_full_search_sad_c(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
 #define vp8_full_search_sad vp8_full_search_sad_c
 
 void vp8_loop_filter_bh_c(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi);
-void vp8_loop_filter_bh_armv6(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi);
 void vp8_loop_filter_bh_neon(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi);
 RTCD_EXTERN void (*vp8_loop_filter_bh)(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi);
 
 void vp8_loop_filter_bv_c(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi);
-void vp8_loop_filter_bv_armv6(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi);
 void vp8_loop_filter_bv_neon(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi);
 RTCD_EXTERN void (*vp8_loop_filter_bv)(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi);
 
 void vp8_loop_filter_mbh_c(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi);
-void vp8_loop_filter_mbh_armv6(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi);
 void vp8_loop_filter_mbh_neon(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi);
 RTCD_EXTERN void (*vp8_loop_filter_mbh)(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi);
 
 void vp8_loop_filter_mbv_c(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi);
-void vp8_loop_filter_mbv_armv6(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi);
 void vp8_loop_filter_mbv_neon(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi);
 RTCD_EXTERN void (*vp8_loop_filter_mbv)(unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi);
 
 void vp8_loop_filter_bhs_c(unsigned char *y, int ystride, const unsigned char *blimit);
-void vp8_loop_filter_bhs_armv6(unsigned char *y, int ystride, const unsigned char *blimit);
 void vp8_loop_filter_bhs_neon(unsigned char *y, int ystride, const unsigned char *blimit);
 RTCD_EXTERN void (*vp8_loop_filter_simple_bh)(unsigned char *y, int ystride, const unsigned char *blimit);
 
 void vp8_loop_filter_bvs_c(unsigned char *y, int ystride, const unsigned char *blimit);
-void vp8_loop_filter_bvs_armv6(unsigned char *y, int ystride, const unsigned char *blimit);
 void vp8_loop_filter_bvs_neon(unsigned char *y, int ystride, const unsigned char *blimit);
 RTCD_EXTERN void (*vp8_loop_filter_simple_bv)(unsigned char *y, int ystride, const unsigned char *blimit);
 
 void vp8_loop_filter_simple_horizontal_edge_c(unsigned char *y, int ystride, const unsigned char *blimit);
-void vp8_loop_filter_simple_horizontal_edge_armv6(unsigned char *y, int ystride, const unsigned char *blimit);
 void vp8_loop_filter_mbhs_neon(unsigned char *y, int ystride, const unsigned char *blimit);
 RTCD_EXTERN void (*vp8_loop_filter_simple_mbh)(unsigned char *y, int ystride, const unsigned char *blimit);
 
 void vp8_loop_filter_simple_vertical_edge_c(unsigned char *y, int ystride, const unsigned char *blimit);
-void vp8_loop_filter_simple_vertical_edge_armv6(unsigned char *y, int ystride, const unsigned char *blimit);
 void vp8_loop_filter_mbvs_neon(unsigned char *y, int ystride, const unsigned char *blimit);
 RTCD_EXTERN void (*vp8_loop_filter_simple_mbv)(unsigned char *y, int ystride, const unsigned char *blimit);
 
 int vp8_mbblock_error_c(struct macroblock *mb, int dc);
 #define vp8_mbblock_error vp8_mbblock_error_c
 
 int vp8_mbuverror_c(struct macroblock *mb);
 #define vp8_mbuverror vp8_mbuverror_c
 
 int vp8_refining_search_sad_c(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
 #define vp8_refining_search_sad vp8_refining_search_sad_c
 
 void vp8_regular_quantize_b_c(struct block *, struct blockd *);
 #define vp8_regular_quantize_b vp8_regular_quantize_b_c
 
 void vp8_short_fdct4x4_c(short *input, short *output, int pitch);
-void vp8_short_fdct4x4_armv6(short *input, short *output, int pitch);