Merge m-c to graphics, a=merge
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 31 May 2017 08:07:53 -0400
changeset 361806 25fe58290e36a70f1e0d946476aec7d676340eda
parent 361805 a5886e40498d479e354a390865ea024cf1710f20 (current diff)
parent 361475 7b8937970f9ca85db88cb2496f2112175fd847c8 (diff)
child 361807 cf6ba2cbdea2b042d59c5d0c2817116320ac0352
push id31944
push userryanvm@gmail.com
push dateThu, 01 Jun 2017 16:44:22 +0000
treeherdermozilla-central@0e9853e31da9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge m-c to graphics, a=merge MozReview-Commit-ID: 2CUZPQ4s8xT
accessible/tests/browser/e10s/events.js
browser/base/content/test/siteIdentity/browser_bug435035.js
browser/base/content/test/siteIdentity/test_bug435035.html
browser/components/extensions/test/xpcshell/head_remote.js
browser/components/extensions/test/xpcshell/xpcshell-common.ini
browser/components/extensions/test/xpcshell/xpcshell-remote.ini
browser/components/preferences/in-content-old/advanced.js
browser/components/preferences/in-content-old/advanced.xul
browser/components/preferences/in-content-old/applications.js
browser/components/preferences/in-content-old/applications.xul
browser/components/preferences/in-content-old/containers.js
browser/components/preferences/in-content-old/containers.xul
browser/components/preferences/in-content-old/content.js
browser/components/preferences/in-content-old/content.xul
browser/components/preferences/in-content-old/jar.mn
browser/components/preferences/in-content-old/main.js
browser/components/preferences/in-content-old/main.xul
browser/components/preferences/in-content-old/moz.build
browser/components/preferences/in-content-old/preferences.js
browser/components/preferences/in-content-old/preferences.xul
browser/components/preferences/in-content-old/privacy.js
browser/components/preferences/in-content-old/privacy.xul
browser/components/preferences/in-content-old/search.js
browser/components/preferences/in-content-old/search.xul
browser/components/preferences/in-content-old/security.js
browser/components/preferences/in-content-old/security.xul
browser/components/preferences/in-content-old/subdialogs.js
browser/components/preferences/in-content-old/sync.js
browser/components/preferences/in-content-old/sync.xul
browser/components/preferences/in-content-old/tests/.eslintrc.js
browser/components/preferences/in-content-old/tests/browser.ini
browser/components/preferences/in-content-old/tests/browser_advanced_siteData.js
browser/components/preferences/in-content-old/tests/browser_advanced_update.js
browser/components/preferences/in-content-old/tests/browser_applications_selection.js
browser/components/preferences/in-content-old/tests/browser_basic_rebuild_fonts_test.js
browser/components/preferences/in-content-old/tests/browser_bug1018066_resetScrollPosition.js
browser/components/preferences/in-content-old/tests/browser_bug1020245_openPreferences_to_paneContent.js
browser/components/preferences/in-content-old/tests/browser_bug1184989_prevent_scrolling_when_preferences_flipped.js
browser/components/preferences/in-content-old/tests/browser_bug1184989_prevent_scrolling_when_preferences_flipped.xul
browser/components/preferences/in-content-old/tests/browser_bug410900.js
browser/components/preferences/in-content-old/tests/browser_bug705422.js
browser/components/preferences/in-content-old/tests/browser_bug731866.js
browser/components/preferences/in-content-old/tests/browser_bug795764_cachedisabled.js
browser/components/preferences/in-content-old/tests/browser_change_app_handler.js
browser/components/preferences/in-content-old/tests/browser_connection.js
browser/components/preferences/in-content-old/tests/browser_connection_bug388287.js
browser/components/preferences/in-content-old/tests/browser_cookies_exceptions.js
browser/components/preferences/in-content-old/tests/browser_defaultbrowser_alwayscheck.js
browser/components/preferences/in-content-old/tests/browser_healthreport.js
browser/components/preferences/in-content-old/tests/browser_homepages_filter_aboutpreferences.js
browser/components/preferences/in-content-old/tests/browser_notifications_do_not_disturb.js
browser/components/preferences/in-content-old/tests/browser_performance.js
browser/components/preferences/in-content-old/tests/browser_permissions_urlFieldHidden.js
browser/components/preferences/in-content-old/tests/browser_privacypane_1.js
browser/components/preferences/in-content-old/tests/browser_privacypane_3.js
browser/components/preferences/in-content-old/tests/browser_privacypane_4.js
browser/components/preferences/in-content-old/tests/browser_privacypane_5.js
browser/components/preferences/in-content-old/tests/browser_privacypane_8.js
browser/components/preferences/in-content-old/tests/browser_proxy_backup.js
browser/components/preferences/in-content-old/tests/browser_sanitizeOnShutdown_prefLocked.js
browser/components/preferences/in-content-old/tests/browser_searchsuggestions.js
browser/components/preferences/in-content-old/tests/browser_security.js
browser/components/preferences/in-content-old/tests/browser_subdialogs.js
browser/components/preferences/in-content-old/tests/browser_telemetry.js
browser/components/preferences/in-content-old/tests/head.js
browser/components/preferences/in-content-old/tests/offline/manifest.appcache
browser/components/preferences/in-content-old/tests/offline/offline.html
browser/components/preferences/in-content-old/tests/privacypane_tests_perwindow.js
browser/components/preferences/in-content-old/tests/site_data_test.html
browser/components/preferences/in-content-old/tests/subdialog.xul
browser/components/preferences/in-content-old/tests/subdialog2.xul
browser/components/preferences/in-content/findInPage.js
browser/components/preferences/in-content/searchResults.xul
browser/components/preferences/in-content/tests/browser_checkspelling.js
browser/components/preferences/in-content/tests/browser_engines.js
browser/components/preferences/in-content/tests/browser_layersacceleration.js
browser/components/preferences/in-content/tests/browser_masterpassword.js
browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_1.js
browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_2.js
browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_3.js
browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_4.js
browser/components/preferences/in-content/tests/browser_search_within_preferences.js
browser/components/preferences/in-content/tests/browser_siteData.js
browser/components/preferences/in-content/tests/browser_siteData2.js
browser/config/mozconfigs/linux32/debug-qr
browser/config/mozconfigs/linux32/opt-qr
browser/config/mozconfigs/linux64/debug-qr
browser/config/mozconfigs/linux64/opt-qr
browser/config/mozconfigs/macosx64/debug-qr
browser/config/mozconfigs/macosx64/opt-qr
browser/config/mozconfigs/win32/debug-qr
browser/config/mozconfigs/win32/opt-qr
browser/config/mozconfigs/win64/debug-qr
browser/config/mozconfigs/win64/opt-qr
browser/extensions/screenshots/webextension/buildSettings.js.template
browser/extensions/screenshots/webextension/icons/icon-128.png
browser/extensions/screenshots/webextension/icons/icon-16.png
browser/extensions/screenshots/webextension/icons/icon-19.png
browser/extensions/screenshots/webextension/icons/icon-256.png
browser/extensions/screenshots/webextension/icons/icon-32.png
browser/extensions/screenshots/webextension/icons/icon-38.png
browser/extensions/screenshots/webextension/icons/icon-48.png
browser/extensions/screenshots/webextension/icons/icon-64.png
browser/locales/searchplugins/dunaj-sk.xml
browser/themes/linux/preferences/in-content-old/dialog.css
browser/themes/linux/preferences/in-content-old/preferences.css
browser/themes/osx/preferences/in-content-old/dialog.css
browser/themes/osx/preferences/in-content-old/preferences.css
browser/themes/windows/preferences/in-content-old/dialog.css
browser/themes/windows/preferences/in-content-old/preferences.css
devtools/client/inspector/computed/test/browser_computed_select-and-copy-styles.js
layout/painting/nsDisplayList.cpp
servo/etc/ci/servo-binary-formula.rb.in
taskcluster/scripts/tester/test-ubuntu.sh
testing/marionette/harness/marionette_harness/tests/unit/importanotherscript.js
testing/marionette/harness/marionette_harness/tests/unit/importscript.js
testing/marionette/harness/marionette_harness/tests/unit/test_import_script.py
testing/mozharness/configs/builds/releng_sub_linux_configs/32_qr_debug.py
testing/mozharness/configs/builds/releng_sub_linux_configs/32_qr_opt.py
testing/mozharness/configs/builds/releng_sub_linux_configs/64_qr_debug.py
testing/mozharness/configs/builds/releng_sub_linux_configs/64_qr_opt.py
testing/mozharness/configs/builds/releng_sub_mac_configs/64_cross_qr_debug.py
testing/mozharness/configs/builds/releng_sub_mac_configs/64_cross_qr_opt.py
testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_debug.py
testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_opt.py
testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_debug.py
testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_opt.py
testing/web-platform/meta/html/semantics/embedded-content/the-img-element/document-adopt-base-url.html.ini
toolkit/components/extensions/test/xpcshell/head_e10s.js
toolkit/components/extensions/test/xpcshell/xpcshell-e10s.ini
toolkit/themes/shared/icons/calendar-arrows.svg
toolkit/themes/shared/icons/spinner-arrows.svg
tools/profiler/gecko/CrossProcessProfilerController.cpp
tools/profiler/public/CrossProcessProfilerController.h
tools/profiler/public/ProfilerControllingProcess.h
--- a/.eslintignore
+++ b/.eslintignore
@@ -160,16 +160,17 @@ devtools/client/sourceeditor/tern/*
 devtools/client/sourceeditor/test/cm_mode_ruby.js
 devtools/client/sourceeditor/test/codemirror/*
 devtools/client/inspector/markup/test/lib_*
 devtools/client/jsonview/lib/require.js
 devtools/server/actors/utils/automation-timeline.js
 
 # Ignore devtools files testing sourcemaps / code style
 devtools/client/debugger/test/mochitest/code_binary_search.js
+devtools/client/debugger/test/mochitest/code_binary_search_absolute.js
 devtools/client/debugger/test/mochitest/code_math.min.js
 devtools/client/debugger/test/mochitest/code_math_bogus_map.js
 devtools/client/debugger/test/mochitest/code_ugly*
 devtools/client/debugger/test/mochitest/code_worker-source-map.js
 devtools/client/framework/test/code_ugly*
 devtools/client/inspector/markup/test/events_bundle.js
 devtools/client/netmonitor/test/xhr_bundle.js
 devtools/server/tests/unit/babel_and_browserify_script_with_source_map.js
@@ -290,23 +291,21 @@ security/nss/**
 
 # services/ exclusions
 
 # Uses `#filter substitution`
 services/sync/modules/constants.js
 services/sync/services-sync.js
 
 # testing/ exclusions
-testing/firefox-ui/**
 testing/marionette/**
 testing/mochitest/**
 testing/modules/**
-testing/mozbase/**
-testing/profiles/**
-testing/specialpowers/**
+# octothorpe used for pref file comment causes parsing error
+testing/mozbase/mozprofile/tests/files/prefs_with_comments.js
 testing/talos/**
 testing/web-platform/**
 testing/xpcshell/moz-http2/**
 testing/xpcshell/node-http2/**
 
 # Third party services
 services/common/kinto-http-client.js
 services/common/kinto-offline-client.js
--- a/accessible/base/NotificationController.cpp
+++ b/accessible/base/NotificationController.cpp
@@ -586,17 +586,16 @@ NotificationController::ProcessMutationE
 
 ////////////////////////////////////////////////////////////////////////////////
 // NotificationCollector: private
 
 void
 NotificationController::WillRefresh(mozilla::TimeStamp aTime)
 {
   PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER);
-  Telemetry::AutoTimer<Telemetry::A11Y_UPDATE_TIME> updateTimer;
 
   // If the document accessible that notification collector was created for is
   // now shut down, don't process notifications anymore.
   NS_ASSERTION(mDocument,
                "The document was shut down while refresh observer is attached!");
   if (!mDocument)
     return;
 
--- a/accessible/moz.build
+++ b/accessible/moz.build
@@ -27,13 +27,14 @@ DIRS += [ 'aom',
 
 if CONFIG['MOZ_XUL']:
     DIRS += ['xul']
 
 TEST_DIRS += ['tests/mochitest']
 
 BROWSER_CHROME_MANIFESTS += [
   'tests/browser/browser.ini',
-  'tests/browser/e10s/browser.ini'
+  'tests/browser/e10s/browser.ini',
+  'tests/browser/states/browser.ini'
 ]
 
 with Files("**"):
     BUG_COMPONENT = ("Core", "Disability Access APIs")
\ No newline at end of file
--- a/accessible/tests/browser/.eslintrc.js
+++ b/accessible/tests/browser/.eslintrc.js
@@ -26,17 +26,16 @@ module.exports = {
     "generator-star-spacing": "off",
     "handle-callback-err": ["error", "er"],
     "indent": ["error", 2, {"SwitchCase": 1}],
     "max-nested-callbacks": ["error", 4],
     "max-params": "off",
     "max-statements": "off",
     "new-cap": ["error", {"capIsNew": false}],
     "new-parens": "error",
-    "no-array-constructor": "error",
     "no-bitwise": "off",
     "no-caller": "error",
     "no-catch-shadow": "error",
     "no-comma-dangle": "off",
     "no-console": "off",
     "no-constant-condition": "off",
     "no-continue": "off",
     "no-control-regex": "error",
--- a/accessible/tests/browser/browser.ini
+++ b/accessible/tests/browser/browser.ini
@@ -1,11 +1,12 @@
 [DEFAULT]
 
 support-files =
+  events.js
   head.js
   shared-head.js
 
 [browser_shutdown_acc_reference.js]
 [browser_shutdown_doc_acc_reference.js]
 [browser_shutdown_multi_acc_reference_obj.js]
 [browser_shutdown_multi_acc_reference_doc.js]
 [browser_shutdown_multi_reference.js]
--- a/accessible/tests/browser/e10s/browser.ini
+++ b/accessible/tests/browser/e10s/browser.ini
@@ -1,18 +1,18 @@
 [DEFAULT]
 support-files =
-  events.js
   head.js
   doc_treeupdate_ariadialog.html
   doc_treeupdate_ariaowns.html
   doc_treeupdate_imagemap.html
   doc_treeupdate_removal.xhtml
   doc_treeupdate_visibility.html
   doc_treeupdate_whitespace.html
+  !/accessible/tests/browser/events.js
   !/accessible/tests/browser/shared-head.js
   !/accessible/tests/mochitest/*.js
   !/accessible/tests/mochitest/letters.gif
   !/accessible/tests/mochitest/moz.png
 
 # Caching tests
 [browser_caching_attributes.js]
 [browser_caching_description.js]
--- a/accessible/tests/browser/e10s/head.js
+++ b/accessible/tests/browser/e10s/head.js
@@ -1,125 +1,15 @@
 /* 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/. */
 
 'use strict';
 
-/* exported addAccessibleTask, findAccessibleChildByID, isDefunct */
-
 // Load the shared-head file first.
 /* import-globals-from ../shared-head.js */
 Services.scriptloader.loadSubScript(
   'chrome://mochitests/content/browser/accessible/tests/browser/shared-head.js',
   this);
 
-/**
- * A wrapper around browser test add_task that triggers an accessible test task
- * as a new browser test task with given document, data URL or markup snippet.
- * @param  {String}                 doc  URL (relative to current directory) or
- *                                       data URL or markup snippet that is used
- *                                       to test content with
- * @param  {Function|AsyncFunction} task a generator or a function with tests to
- *                                       run
- */
-function addAccessibleTask(doc, task) {
-  add_task(async function() {
-    let url;
-    if (doc.includes('doc_')) {
-      url = `${CURRENT_CONTENT_DIR}e10s/${doc}`;
-    } else {
-      // Assume it's a markup snippet.
-      url = `data:text/html,
-        <html>
-          <head>
-            <meta charset="utf-8"/>
-            <title>Accessibility Test</title>
-          </head>
-          <body id="body">${doc}</body>
-        </html>`;
-    }
-
-    registerCleanupFunction(() => {
-      let observers = Services.obs.enumerateObservers('accessible-event');
-      while (observers.hasMoreElements()) {
-        Services.obs.removeObserver(
-          observers.getNext().QueryInterface(Ci.nsIObserver),
-          'accessible-event');
-      }
-    });
-
-    let onDocLoad = waitForEvent(EVENT_DOCUMENT_LOAD_COMPLETE, 'body');
-
-    await BrowserTestUtils.withNewTab({
-      gBrowser,
-      url: url
-    }, async function(browser) {
-      registerCleanupFunction(() => {
-        if (browser) {
-          let tab = gBrowser.getTabForBrowser(browser);
-          if (tab && !tab.closing && tab.linkedBrowser) {
-            gBrowser.removeTab(tab);
-          }
-        }
-      });
-
-      await SimpleTest.promiseFocus(browser);
-
-      loadFrameScripts(browser,
-        'let { document, window, navigator } = content;',
-        { name: 'common.js', dir: MOCHITESTS_DIR });
-
-      Logger.log(
-        `e10s enabled: ${Services.appinfo.browserTabsRemoteAutostart}`);
-      Logger.log(`Actually remote browser: ${browser.isRemoteBrowser}`);
-
-      let event = await onDocLoad;
-      await task(browser, event.accessible);
-    });
-  });
-}
-
-/**
- * Check if an accessible object has a defunct test.
- * @param  {nsIAccessible}  accessible object to test defunct state for
- * @return {Boolean}        flag indicating defunct state
- */
-function isDefunct(accessible) {
-  let defunct = false;
-  try {
-    let extState = {};
-    accessible.getState({}, extState);
-    defunct = extState.value & Ci.nsIAccessibleStates.EXT_STATE_DEFUNCT;
-  } catch (x) {
-    defunct = true;
-  } finally {
-    if (defunct) {
-      Logger.log(`Defunct accessible: ${prettyName(accessible)}`);
-    }
-  }
-  return defunct;
-}
-
-/**
- * Traverses the accessible tree starting from a given accessible as a root and
- * looks for an accessible that matches based on its DOMNode id.
- * @param  {nsIAccessible}  accessible root accessible
- * @param  {String}         id         id to look up accessible for
- * @return {nsIAccessible?}            found accessible if any
- */
-function findAccessibleChildByID(accessible, id) {
-  if (getAccessibleDOMNodeID(accessible) === id) {
-    return accessible;
-  }
-  for (let i = 0; i < accessible.children.length; ++i) {
-    let found = findAccessibleChildByID(accessible.getChildAt(i), id);
-    if (found) {
-      return found;
-    }
-  }
-}
-
 // Loading and common.js from accessible/tests/mochitest/ for all tests, as
 // well as events.js.
-/* import-globals-from ../../mochitest/common.js */
-/* import-globals-from events.js */
-loadScripts({ name: 'common.js', dir: MOCHITESTS_DIR }, 'e10s/events.js');
+loadScripts({ name: 'common.js', dir: MOCHITESTS_DIR }, 'events.js');
rename from accessible/tests/browser/e10s/events.js
rename to accessible/tests/browser/events.js
--- a/accessible/tests/browser/e10s/events.js
+++ b/accessible/tests/browser/events.js
@@ -1,17 +1,18 @@
 /* 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/. */
 
 'use strict';
 
 // This is loaded by head.js, so has the same globals, hence we import the
 // globals from there.
-/* import-globals-from head.js */
+/* import-globals-from shared-head.js */
+/* import-globals-from ../mochitest/common.js */
 
 /* exported EVENT_REORDER, EVENT_SHOW, EVENT_TEXT_INSERTED, EVENT_TEXT_REMOVED,
             EVENT_DOCUMENT_LOAD_COMPLETE, EVENT_HIDE, EVENT_TEXT_CARET_MOVED,
             EVENT_DESCRIPTION_CHANGE, EVENT_NAME_CHANGE, EVENT_STATE_CHANGE,
             EVENT_VALUE_CHANGE, EVENT_TEXT_VALUE_CHANGE, EVENT_FOCUS,
             waitForEvent, waitForMultipleEvents */
 
 const EVENT_DOCUMENT_LOAD_COMPLETE = nsIAccessibleEvent.EVENT_DOCUMENT_LOAD_COMPLETE;
--- a/accessible/tests/browser/head.js
+++ b/accessible/tests/browser/head.js
@@ -105,17 +105,17 @@ function shutdownPromise(contentBrowser)
     a11yInitOrShutdownPromise();
   return promiseOK(a11yShutdownPromise, '0').then(
     () => ok(true, 'Service shutdown correctly'),
     () => ok(false, 'Service initialized incorrectly'));
 }
 
 /**
  * Simpler verions of waitForEvent defined in
- * accessible/tests/browser/e10s/events.js
+ * accessible/tests/browser/events.js
  */
 function waitForEvent(eventType, expectedId) {
   return new Promise(resolve => {
     let eventObserver = {
       observe(subject) {
         let event = subject.QueryInterface(Ci.nsIAccessibleEvent);
         if (event.eventType === eventType &&
             event.accessible.id === expectedId) {
--- a/accessible/tests/browser/shared-head.js
+++ b/accessible/tests/browser/shared-head.js
@@ -1,16 +1,20 @@
 /* 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/. */
 
 'use strict';
 
+/* import-globals-from ../mochitest/common.js */
+/* import-globals-from events.js */
+
 /* exported Logger, MOCHITESTS_DIR, invokeSetAttribute, invokeFocus,
             invokeSetStyle, getAccessibleDOMNodeID,
+            addAccessibleTask, findAccessibleChildByID, isDefunct,
             CURRENT_CONTENT_DIR, loadScripts, loadFrameScripts, Cc, Cu */
 
 const { interfaces: Ci, utils: Cu, classes: Cc } = Components;
 
 /**
  * Current browser test directory path used to load subscripts.
  */
 const CURRENT_DIR =
@@ -182,8 +186,114 @@ function loadFrameScripts(browser, ...sc
       }
     } else {
       // Script is a object that has { dir, name } format.
       frameScript = `${script.dir}${script.name}`;
     }
     mm.loadFrameScript(frameScript, false, true);
   }
 }
+
+/**
+ * A wrapper around browser test add_task that triggers an accessible test task
+ * as a new browser test task with given document, data URL or markup snippet.
+ * @param  {String}                 doc  URL (relative to current directory) or
+ *                                       data URL or markup snippet that is used
+ *                                       to test content with
+ * @param  {Function|AsyncFunction} task a generator or a function with tests to
+ *                                       run
+ */
+function addAccessibleTask(doc, task) {
+  add_task(async function() {
+    let url;
+    if (doc.includes('doc_')) {
+      url = `${CURRENT_CONTENT_DIR}e10s/${doc}`;
+    } else {
+      // Assume it's a markup snippet.
+      url = `data:text/html,
+        <html>
+          <head>
+            <meta charset="utf-8"/>
+            <title>Accessibility Test</title>
+          </head>
+          <body id="body">${doc}</body>
+        </html>`;
+    }
+
+    registerCleanupFunction(() => {
+      let observers = Services.obs.enumerateObservers('accessible-event');
+      while (observers.hasMoreElements()) {
+        Services.obs.removeObserver(
+          observers.getNext().QueryInterface(Ci.nsIObserver),
+          'accessible-event');
+      }
+    });
+
+    let onDocLoad = waitForEvent(EVENT_DOCUMENT_LOAD_COMPLETE, 'body');
+
+    await BrowserTestUtils.withNewTab({
+      gBrowser,
+      url: url
+    }, async function(browser) {
+      registerCleanupFunction(() => {
+        if (browser) {
+          let tab = gBrowser.getTabForBrowser(browser);
+          if (tab && !tab.closing && tab.linkedBrowser) {
+            gBrowser.removeTab(tab);
+          }
+        }
+      });
+
+      await SimpleTest.promiseFocus(browser);
+
+      loadFrameScripts(browser,
+        'let { document, window, navigator } = content;',
+        { name: 'common.js', dir: MOCHITESTS_DIR });
+
+      Logger.log(
+        `e10s enabled: ${Services.appinfo.browserTabsRemoteAutostart}`);
+      Logger.log(`Actually remote browser: ${browser.isRemoteBrowser}`);
+
+      let event = await onDocLoad;
+      await task(browser, event.accessible);
+    });
+  });
+}
+
+/**
+ * Check if an accessible object has a defunct test.
+ * @param  {nsIAccessible}  accessible object to test defunct state for
+ * @return {Boolean}        flag indicating defunct state
+ */
+function isDefunct(accessible) {
+  let defunct = false;
+  try {
+    let extState = {};
+    accessible.getState({}, extState);
+    defunct = extState.value & Ci.nsIAccessibleStates.EXT_STATE_DEFUNCT;
+  } catch (x) {
+    defunct = true;
+  } finally {
+    if (defunct) {
+      Logger.log(`Defunct accessible: ${prettyName(accessible)}`);
+    }
+  }
+  return defunct;
+}
+
+/**
+ * Traverses the accessible tree starting from a given accessible as a root and
+ * looks for an accessible that matches based on its DOMNode id.
+ * @param  {nsIAccessible}  accessible root accessible
+ * @param  {String}         id         id to look up accessible for
+ * @return {nsIAccessible?}            found accessible if any
+ */
+function findAccessibleChildByID(accessible, id) {
+  if (getAccessibleDOMNodeID(accessible) === id) {
+    return accessible;
+  }
+  for (let i = 0; i < accessible.children.length; ++i) {
+    let found = findAccessibleChildByID(accessible.getChildAt(i), id);
+    if (found) {
+      return found;
+    }
+  }
+}
new file mode 100644
--- /dev/null
+++ b/accessible/tests/browser/states/browser.ini
@@ -0,0 +1,8 @@
+[DEFAULT]
+support-files =
+  head.js
+  !/accessible/tests/browser/events.js
+  !/accessible/tests/browser/shared-head.js
+  !/accessible/tests/mochitest/*.js
+
+[browser_test_link.js]
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/accessible/tests/browser/states/browser_test_link.js
@@ -0,0 +1,38 @@
+/* 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/. */
+
+'use strict';
+
+/* import-globals-from ../../mochitest/role.js */
+/* import-globals-from ../../mochitest/states.js */
+loadScripts({ name: 'role.js', dir: MOCHITESTS_DIR },
+            { name: 'states.js', dir: MOCHITESTS_DIR });
+
+async function runTests(browser, accDoc) {
+  let getAcc = id => findAccessibleChildByID(accDoc, id);
+
+  // a: no traversed state
+  testStates(getAcc("link_traversed"), 0, 0, STATE_TRAVERSED);
+
+  let onStateChanged = waitForEvent(EVENT_STATE_CHANGE, "link_traversed");
+  let newWinOpened = BrowserTestUtils.waitForNewWindow();
+
+  await BrowserTestUtils.synthesizeMouse('#link_traversed',
+    1, 1, { shiftKey: true }, browser);
+
+  await onStateChanged;
+  testStates(getAcc("link_traversed"), STATE_TRAVERSED);
+
+  let newWin = await newWinOpened;
+  await BrowserTestUtils.closeWindow(newWin);
+}
+
+/**
+ * Test caching of accessible object states
+ */
+addAccessibleTask(`
+  <a id="link_traversed" href="http://www.example.com" target="_top">
+    example.com
+  </a>`, runTests
+);
new file mode 100644
--- /dev/null
+++ b/accessible/tests/browser/states/head.js
@@ -0,0 +1,15 @@
+/* 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/. */
+
+'use strict';
+
+// Load the shared-head file first.
+/* import-globals-from ../shared-head.js */
+Services.scriptloader.loadSubScript(
+  'chrome://mochitests/content/browser/accessible/tests/browser/shared-head.js',
+  this);
+
+// Loading and common.js from accessible/tests/mochitest/ for all tests, as
+// well as events.js.
+loadScripts({ name: 'common.js', dir: MOCHITESTS_DIR }, 'events.js');
--- a/accessible/tests/mochitest/actions.js
+++ b/accessible/tests/mochitest/actions.js
@@ -56,17 +56,17 @@ function testActions(aArray)
     var actionObj = aArray[idx];
     var accOrElmOrID = actionObj.ID;
     var actionIndex = actionObj.actionIndex;
     var actionName = actionObj.actionName;
     var events = actionObj.events;
     var accOrElmOrIDOfTarget = actionObj.targetID ?
       actionObj.targetID : accOrElmOrID;
 
-    var eventSeq = new Array();
+    var eventSeq = [];
     if (events) {
       var elm = getNode(accOrElmOrIDOfTarget);
       if (events & MOUSEDOWN_EVENT)
         eventSeq.push(new checkerOfActionInvoker("mousedown", elm));
 
       if (events & MOUSEUP_EVENT)
         eventSeq.push(new checkerOfActionInvoker("mouseup", elm));
 
--- a/accessible/tests/mochitest/editabletext/editabletext.js
+++ b/accessible/tests/mochitest/editabletext/editabletext.js
@@ -9,17 +9,17 @@ function editableTextTestRun()
   }
 
   this.run = function run()
   {
     this.iterate();
   }
 
   this.index = 0;
-  this.seq = new Array();
+  this.seq = [];
 
   this.iterate = function iterate()
   {
     if (this.index < this.seq.length) {
       this.seq[this.index++].startTest(this);
       return;
     }
 
--- a/accessible/tests/mochitest/events.js
+++ b/accessible/tests/mochitest/events.js
@@ -829,17 +829,17 @@ function eventQueue(aEventType)
     this.mNextInvokerStatus = aStatus;
 
     // Uncomment it to debug invoker processing logic.
     //gLogger.log(eventQueue.invokerStatusToMsg(aStatus, aLogMsg));
   }
 
   this.mDefEventType = aEventType;
 
-  this.mInvokers = new Array();
+  this.mInvokers = [];
   this.mIndex = -1;
   this.mScenarios = null;
 
   this.mNextInvokerStatus = kInvokerNotScheduled;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // eventQueue static members and constants
@@ -1020,32 +1020,32 @@ function sequence()
       ok(false, "End of sequence: nothing to process!");
       SimpleTest.finish();
       return;
     }
 
     this.items[this.idx].startProcess();
   }
 
-  this.items = new Array();
+  this.items = [];
   this.idx = -1;
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // Event queue invokers
 
 /**
  * Defines a scenario of expected/unexpected events. Each invoker can have
  * one or more scenarios of events. Only one scenario must be completed.
  */
 function defineScenario(aInvoker, aEventSeq, aUnexpectedEventSeq)
 {
   if (!("scenarios" in aInvoker))
-    aInvoker.scenarios = new Array();
+    aInvoker.scenarios = [];
 
   // Create unified event sequence concatenating expected and unexpected
   // events.
   if (!aEventSeq)
     aEventSeq = [];
 
   for (var idx = 0; idx < aEventSeq.length; idx++) {
     aEventSeq[idx].unexpected |= false;
@@ -2127,17 +2127,17 @@ function listenA11yEvents(aStartToListen
     if (--gA11yEventApplicantsCount <= 0)
       Services.obs.removeObserver(gA11yEventObserver, "accessible-event");
   }
 }
 
 function addA11yEventListener(aEventType, aEventHandler)
 {
   if (!(aEventType in gA11yEventListeners))
-    gA11yEventListeners[aEventType] = new Array();
+    gA11yEventListeners[aEventType] = [];
 
   var listenersArray = gA11yEventListeners[aEventType];
   var index = listenersArray.indexOf(aEventHandler);
   if (index == -1)
     listenersArray.push(aEventHandler);
 }
 
 function removeA11yEventListener(aEventType, aEventHandler)
--- a/accessible/tests/mochitest/relations/test_tabbrowser.xul
+++ b/accessible/tests/mochitest/relations/test_tabbrowser.xul
@@ -31,17 +31,21 @@
       this.eventSeq = [
         new asyncInvokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, tabDocumentAt, 0),
         new asyncInvokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, tabDocumentAt, 1)
      ];
 
       this.invoke = function testTabRelations_invoke()
       {
         var docURIs = ["about:", "about:mozilla"];
-        tabBrowser().loadTabs(docURIs, false, true);
+        tabBrowser().loadTabs(docURIs, {
+          inBackground: false,
+          replace: true,
+          triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
+        });
       }
 
       this.finalCheck = function testTabRelations_finalCheck(aEvent)
       {
         ////////////////////////////////////////////////////////////////////////
         // 'labelled by'/'label for' relations for xul:tab and xul:tabpanel
 
         var tabs = tabBrowser().tabContainer.childNodes;
--- a/accessible/tests/mochitest/states/test_link.html
+++ b/accessible/tests/mochitest/states/test_link.html
@@ -16,55 +16,16 @@
   <script type="application/javascript"
           src="../role.js"></script>
   <script type="application/javascript"
           src="../states.js"></script>
   <script type="application/javascript"
           src="../events.js"></script>
 
   <script type="application/javascript">
-    //gA11yEventDumpToConsole = true; // debug stuff
-
-    var gLinkWindow = null;
-    function closeDocChecker()
-    {
-      this.__proto__ = new asyncInvokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE);
-
-      this.check = function closeDocChecker_check(aEvent)
-      {
-        gLinkWindow = aEvent.accessible.rootDocument.window;
-      }
-
-      this.match = function closeDocChecker_match(aEvent)
-      {
-        // A temporary about:blank document gets loaded before 'example.com'
-        // document.
-        return aEvent.DOMNode.URL == "http://www.example.com/";
-      }
-    }
-
-    function clickLink(aID)
-    {
-      this.eventSeq = [
-        new stateChangeChecker(STATE_TRAVERSED, false, true, "link_traversed"),
-        new closeDocChecker()
-      ];
-
-      this.invoke = function clickLink_invoke()
-      {
-        synthesizeMouse(getNode("link_traversed"), 1, 1, { shiftKey: true });
-      }
-
-      this.getID = function clickLink_getID()
-      {
-        return "link + '" + aID + "' clicked.";
-      }
-    }
-
-    var gQueue = null;
     function doTest()
     {
       // a@href and its text node
       testStates("link_href", STATE_LINKED);
       testStates(getAccessible("link_href").firstChild, STATE_LINKED);
 
       // a@onclick
       testStates("link_click", STATE_LINKED);
@@ -79,32 +40,17 @@
       testStates("link_arialink", STATE_LINKED);
 
       // a@role="button"
       testStates("link_ariabutton", 0, 0, STATE_LINKED);
 
       // a (no @href, no click event listener)
       testStates("link_notlink", 0, 0, STATE_LINKED);
 
-      // a: no traversed state
-      testStates("link_traversed", 0, 0, STATE_TRAVERSED);
-
-      // a: traversed state
-      //enableLogging("docload"); // debug stuff
-
-      gQueue = new eventQueue();
-      gQueue.push(new clickLink("link_traversed"));
-      gQueue.onFinish =
-        function()
-        {
-          gLinkWindow.close();
-          //disableLogging(); // debug stuff
-        }
-
-      gQueue.invoke(); // will call SimpleTest.finsih();
+      SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   </script>
 
 </head>
 
@@ -133,12 +79,10 @@
   <a id="link_href" href="http://mozilla.org">link</a>
   <a id="link_click" onclick="">link</a>
   <a id="link_mousedown" onmousedown="">link</a>
   <a id="link_mouseup" onmouseup="">link</a>
   <a id="link_arialink" role="link">aria link</a>
   <a id="link_ariabutton" role="button">aria button</a>
   <a id="link_notlink">not link</a>
 
-  <a id="link_traversed" href="http://www.example.com" target="_top">example.com</a>
-
 </body>
 </html>
--- a/accessible/tests/mochitest/table.js
+++ b/accessible/tests/mochitest/table.js
@@ -369,17 +369,17 @@ function testTableSelection(aIdentifier,
   var acc = getAccessible(aIdentifier, [nsIAccessibleTable]);
   if (!acc)
     return;
 
   var rowCount = aCellsArray.length;
   var colsCount = aCellsArray[0].length;
 
   // Columns selection tests.
-  var selCols = new Array();
+  var selCols = [];
 
   // isColumnSelected test
   for (var colIdx = 0; colIdx < colsCount; colIdx++) {
     var isColSelected = true;
     for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
       if (aCellsArray[rowIdx][colIdx] == false ||
           aCellsArray[rowIdx][colIdx] == undefined) {
         isColSelected = false;
@@ -409,17 +409,17 @@ function testTableSelection(aIdentifier,
       "from getSelectedColumns.");
 
   for (var i = 0; i < actualSelColsCount; i++) {
     is (actualSelCols[i], selCols[i],
         msg + "Column at index " + selCols[i] + " should be selected.");
   }
 
   // Rows selection tests.
-  var selRows = new Array();
+  var selRows = [];
 
   // isRowSelected test
   for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
     var isRowSelected = true;
     for (var colIdx = 0; colIdx < colsCount; colIdx++) {
       if (aCellsArray[rowIdx][colIdx] == false ||
           aCellsArray[rowIdx][colIdx] == undefined) {
         isRowSelected = false;
@@ -449,17 +449,17 @@ function testTableSelection(aIdentifier,
       "from getSelectedRows.");
 
   for (var i = 0; i < actualSelrowCount; i++) {
     is (actualSelRows[i], selRows[i],
         msg + "Row at index " + selRows[i] + " should be selected.");
   }
 
   // Cells selection tests.
-  var selCells = new Array();
+  var selCells = [];
 
   // isCellSelected test
   for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
     for (var colIdx = 0; colIdx < colsCount; colIdx++) {
       if (aCellsArray[rowIdx][colIdx] & kSpanned)
         continue;
 
       var isSelected = aCellsArray[rowIdx][colIdx] == true;
--- a/accessible/tests/mochitest/test_nsIAccessibleImage.html
+++ b/accessible/tests/mochitest/test_nsIAccessibleImage.html
@@ -108,49 +108,49 @@ https://bugzilla.mozilla.org/show_bug.cg
     }
 
     function doTest()
     {
       // Test non-linked image
       testThis("nonLinkedImage", "moz.png", 89, 38);
 
       // Test linked image
-      var actionNamesArray = new Array("jump");
+      var actionNamesArray = ["jump"];
       testThis("linkedImage", "moz.png", 89, 38, 1,
                actionNamesArray);
 
       // Image with long desc
-      var actionNamesArray = new Array("showlongdesc");
+      var actionNamesArray = ["showlongdesc"];
       testThis("longdesc", "moz.png", 89, 38, 1,
                actionNamesArray);
 
       // Image with invalid url in long desc
       testThis("invalidLongdesc", "moz.png", 89, 38, 0);
 
       // Image with click and long desc
       actionNamesArray = null;
-      actionNamesArray = new Array("click", "showlongdesc");
+      actionNamesArray = ["click", "showlongdesc"];
       testThis("clickAndLongdesc", "moz.png",
                89, 38, 2, actionNamesArray);
-      
+
       // Image with click
       actionNamesArray = null;
-      actionNamesArray = new Array("click");
+      actionNamesArray = ["click"];
       testThis("click", "moz.png",
                89, 38, 1, actionNamesArray);
-      
+
       // Image with long desc
       actionNamesArray = null;
-      actionNamesArray = new Array("showlongdesc");
+      actionNamesArray = ["showlongdesc"];
       testThis("longdesc2", "moz.png",
                89, 38, 1, actionNamesArray);
 
       // Image described by HTML:a@href with whitespaces
       actionNamesArray = null;
-      actionNamesArray = new Array("showlongdesc");
+      actionNamesArray = ["showlongdesc"];
       testThis("longdesc3", "moz.png",
                89, 38, 1, actionNamesArray);
 
       SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
--- a/accessible/tests/mochitest/tree/test_tabbrowser.xul
+++ b/accessible/tests/mochitest/tree/test_tabbrowser.xul
@@ -30,17 +30,21 @@
       this.eventSeq = [
         new asyncInvokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, tabDocumentAt, 0),
         new asyncInvokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, tabDocumentAt, 1)
       ];
 
       this.invoke = function testTabHierarchy_invoke()
       {
         var docURIs = ["about:", "about:mozilla"];
-        tabBrowser().loadTabs(docURIs, false, true);
+        tabBrowser().loadTabs(docURIs, {
+          inBackground: false,
+          replace: true,
+          triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
+        });
       }
 
       this.finalCheck = function testTabHierarchy_finalCheck(aEvent)
       {
         ////////////////////
         // Tab bar
         ////////////////////
         var tabsAccTree = {
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -227,16 +227,20 @@ pref("general.skins.selectedSkin", "clas
 
 pref("general.smoothScroll", true);
 #ifdef UNIX_BUT_NOT_MAC
 pref("general.autoScroll", false);
 #else
 pref("general.autoScroll", true);
 #endif
 
+// UI density of the browser chrome. This mostly affects toolbarbutton
+// and urlbar spacing. The possible values are 0=normal, 1=compact, 2=touch.
+pref("browser.uidensity", 0);
+
 // At startup, check if we're the default browser and prompt user if not.
 pref("browser.shell.checkDefaultBrowser", true);
 pref("browser.shell.shortcutFavicons",true);
 pref("browser.shell.mostRecentDateSetAsDefault", "");
 pref("browser.shell.skipDefaultBrowserCheckOnFirstRun", true);
 pref("browser.shell.didSkipDefaultBrowserCheckOnFirstRun", false);
 pref("browser.shell.defaultBrowserCheckCount", 0);
 pref("browser.defaultbrowser.notificationbar", false);
@@ -654,16 +658,22 @@ pref("accessibility.typeaheadfind.linkso
 pref("accessibility.typeaheadfind.flashBar", 1);
 
 // Tracks when accessibility is loaded into the previous session.
 pref("accessibility.loadedInLastSession", false);
 
 pref("plugins.click_to_play", true);
 pref("plugins.testmode", false);
 
+// Should plugins that are hidden show the infobar UI?
+pref("plugins.show_infobar", true);
+
+// Should dismissing the hidden plugin infobar suppress it permanently?
+pref("plugins.remember_infobar_dismissal", false);
+
 pref("plugin.default.state", 1);
 
 // Plugins bundled in XPIs are enabled by default.
 pref("plugin.defaultXpi.state", 2);
 
 // Java is Click-to-Activate by default on all channels.
 pref("plugin.state.java", 1);
 
@@ -686,16 +696,23 @@ pref("plugin.state.flash", 2);
 pref("browser.preferences.instantApply", false);
 #else
 pref("browser.preferences.instantApply", true);
 #endif
 
 // Toggling Search bar on and off in about:preferences
 pref("browser.preferences.search", false);
 
+// Use the new in-content about:preferences in Nightly only for now
+#if defined(NIGHTLY_BUILD)
+pref("browser.preferences.useOldOrganization", false);
+#else
+pref("browser.preferences.useOldOrganization", true);
+#endif
+
 // Once the Storage Management is completed.
 // (The Storage Management-related prefs are browser.storageManager.* )
 // The Offline(Appcache) Group section in about:preferences will be hidden.
 // And the task to clear appcache will be done by Storage Management.
 #if defined(NIGHTLY_BUILD)
 pref("browser.preferences.offlineGroup.enabled", false);
 #else
 pref("browser.preferences.offlineGroup.enabled", true);
@@ -1636,16 +1653,17 @@ pref("browser.crashReports.unsubmittedCh
 
 // Preferences for the form autofill system extension
 #ifdef NIGHTLY_BUILD
 pref("extensions.formautofill.experimental", true);
 #else
 pref("extensions.formautofill.experimental", false);
 #endif
 pref("extensions.formautofill.addresses.enabled", true);
+pref("extensions.formautofill.heuristics.enabled", false);
 pref("extensions.formautofill.loglevel", "Warn");
 
 // Whether or not to restore a session with lazy-browser tabs.
 pref("browser.sessionstore.restore_tabs_lazily", true);
 
 // Enable safebrowsing v4 tables (suffixed by "-proto") update.
 #ifdef NIGHTLY_BUILD
 pref("urlclassifier.malwareTable", "goog-malware-shavar,goog-unwanted-shavar,goog-malware-proto,goog-unwanted-proto,test-malware-simple,test-unwanted-simple");
--- a/browser/base/content/browser-data-submission-info-bar.js
+++ b/browser/base/content/browser-data-submission-info-bar.js
@@ -63,17 +63,17 @@ var gDataNotificationInfoBar = {
     let buttons = [{
       label: gNavigatorBundle.getString("dataReportingNotification.button.label"),
       accessKey: gNavigatorBundle.getString("dataReportingNotification.button.accessKey"),
       popup: null,
       callback: () => {
         this._actionTaken = true;
         // The advanced subpanes are only supported in the old organization, which will
         // be removed by bug 1349689.
-        if (Preferences.get("browser.preferences.useOldOrganization", false)) {
+        if (Preferences.get("browser.preferences.useOldOrganization")) {
           window.openAdvancedPreferences("dataChoicesTab", {origin: "dataReporting"});
         } else {
           window.openPreferences("privacy-reports", {origin: "dataReporting"});
         }
       },
     }];
 
     this._log.info("Creating data reporting policy notification.");
--- a/browser/base/content/browser-plugins.js
+++ b/browser/base/content/browser-plugins.js
@@ -1,16 +1,19 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 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/. */
 
 var gPluginHandler = {
   PREF_SESSION_PERSIST_MINUTES: "plugin.sessionPermissionNow.intervalInMinutes",
   PREF_PERSISTENT_DAYS: "plugin.persistentPermissionAlways.intervalInDays",
+  PREF_SHOW_INFOBAR: "plugins.show_infobar",
+  PREF_INFOBAR_DISMISSAL_PERMANENT: "plugins.remember_infobar_dismissal",
+
   MESSAGES: [
     "PluginContent:ShowClickToPlayNotification",
     "PluginContent:RemoveNotification",
     "PluginContent:UpdateHiddenPluginUI",
     "PluginContent:HideNotificationBar",
     "PluginContent:InstallSinglePlugin",
     "PluginContent:ShowPluginCrashedNotification",
     "PluginContent:SubmitReport",
@@ -340,16 +343,20 @@ var gPluginHandler = {
     // There are three different cases when showing an infobar:
     // 1.  A single type of plugin is hidden on the page. Show the UI for that
     //     plugin.
     // 2a. Multiple types of plugins are hidden on the page. Show the multi-UI
     //     with the vulnerable styling.
     // 2b. Multiple types of plugins are hidden on the page, but none are
     //     vulnerable. Show the nonvulnerable multi-UI.
     function showNotification() {
+      if (!Services.prefs.getBoolPref(gPluginHandler.PREF_SHOW_INFOBAR, true)) {
+        return;
+      }
+
       let n = notificationBox.getNotificationWithValue("plugin-hidden");
       if (n) {
         // If something is already shown, just keep it
         return;
       }
 
       Services.telemetry.getHistogramById("PLUGINS_INFOBAR_SHOWN").
         add(true);
@@ -409,19 +416,31 @@ var gPluginHandler = {
               PopupNotifications.getNotification("click-to-play-plugins",
                                                  browser);
             if (curNotification) {
               curNotification.reshow();
             }
           }
         }
       ];
+      function notificationCallback(type) {
+        if (type == "dismissed") {
+          Services.telemetry.getHistogramById("PLUGINS_INFOBAR_DISMISSED").
+            add(true);
+          if (Services.prefs.getBoolPref(gPluginHandler.PREF_INFOBAR_DISMISSAL_PERMANENT, false)) {
+            Services.perms.addFromPrincipal(principal,
+                                            "plugin-hidden-notification",
+                                            Services.perms.DENY_ACTION);
+          }
+        }
+      }
       n = notificationBox.
         appendNotification(message, "plugin-hidden", null,
-                           notificationBox.PRIORITY_INFO_HIGH, buttons);
+                           notificationBox.PRIORITY_INFO_HIGH, buttons,
+                           notificationCallback);
       if (haveInsecure) {
         n.classList.add("pluginVulnerable");
       }
     }
 
     if (actions.length == 0) {
       hideNotification();
     } else {
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -527,17 +527,17 @@ const gStoragePressureObserver = {
       msg = prefStrBundle.getFormattedString(descriptionStringID, [brandShortName]);
       buttons.push({
         label: prefStrBundle.getString(prefButtonLabelStringID),
         accessKey: prefStrBundle.getString(prefButtonAccesskeyStringID),
         callback(notificationBar, button) {
           // The advanced subpanes are only supported in the old organization, which will
           // be removed by bug 1349689.
           let win = gBrowser.ownerGlobal;
-          if (Preferences.get("browser.preferences.useOldOrganization", false)) {
+          if (Preferences.get("browser.preferences.useOldOrganization")) {
             win.openAdvancedPreferences("networkTab", {origin: "storagePressure"});
           } else {
             win.openPreferences("panePrivacy", {origin: "storagePressure"});
           }
         }
       });
     }
 
@@ -1309,16 +1309,19 @@ var gBrowserInit = {
     SidebarUI.init();
 
     // Certain kinds of automigration rely on this notification to complete
     // their tasks BEFORE the browser window is shown. SessionStore uses it to
     // restore tabs into windows AFTER important parts like gMultiProcessBrowser
     // have been initialized.
     Services.obs.notifyObservers(window, "browser-window-before-show");
 
+    gUIDensity.update();
+    gPrefService.addObserver(gUIDensity.prefDomain, gUIDensity);
+
     let isResistFingerprintingEnabled = gPrefService.getBoolPref("privacy.resistFingerprinting");
 
     // Set a sane starting width/height for all resolutions on new profiles.
     if (isResistFingerprintingEnabled) {
       // When the fingerprinting resistance is enabled, making sure that we don't
       // have a maximum window to interfere with generating rounded window dimensions.
       document.documentElement.setAttribute("sizemode", "normal");
     } else if (!document.documentElement.hasAttribute("width")) {
@@ -1421,17 +1424,21 @@ var gBrowserInit = {
         for (let i = 0; i < count; i++) {
           let urisstring = uriToLoad.queryElementAt(i, Ci.nsISupportsString);
           specs.push(urisstring.data);
         }
 
         // This function throws for certain malformed URIs, so use exception handling
         // so that we don't disrupt startup
         try {
-          gBrowser.loadTabs(specs, false, true);
+          gBrowser.loadTabs(specs, {
+            inBackground: false,
+            replace: true,
+            triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
+          });
         } catch (e) {}
       } else if (uriToLoad instanceof XULElement) {
         // swap the given tab with the default about:blank tab and then close
         // the original tab in the other window.
         let tabToOpen = uriToLoad;
 
         // If this tab was passed as a window argument, clear the
         // reference to it from the arguments array.
@@ -1485,17 +1492,17 @@ var gBrowserInit = {
                 window.arguments[4] || false, referrerPolicy, userContextId,
                 // pass the origin principal (if any) and force its use to create
                 // an initial about:blank viewer if present:
                 window.arguments[7], !!window.arguments[7], window.arguments[8]);
         window.focus();
       } else {
         // Note: loadOneOrMoreURIs *must not* be called if window.arguments.length >= 3.
         // Such callers expect that window.arguments[0] is handled as a single URI.
-        loadOneOrMoreURIs(uriToLoad);
+        loadOneOrMoreURIs(uriToLoad, Services.scriptSecurityManager.getSystemPrincipal());
       }
     }
 
     // Bug 778855 - Perf regression if we do this here. To be addressed in bug 779008.
     setTimeout(function() { SafeBrowsing.init(); }, 2000);
 
     Services.obs.addObserver(gIdentityHandler, "perm-changed");
     Services.obs.addObserver(gRemoteControl, "remote-active");
@@ -1761,16 +1768,18 @@ var gBrowserInit = {
     FullScreen.uninit();
 
     gSync.uninit();
 
     gExtensionsNotifications.uninit();
 
     Services.obs.removeObserver(gPluginHandler.NPAPIPluginCrashed, "plugin-crashed");
 
+    gPrefService.removeObserver(gUIDensity.prefDomain, gUIDensity);
+
     try {
       gBrowser.removeProgressListener(window.XULBrowserWindow);
       gBrowser.removeTabsProgressListener(window.TabsProgressListener);
     } catch (ex) {
     }
 
     PlacesToolbarHelper.uninit();
 
@@ -2151,41 +2160,48 @@ function BrowserGoHome(aEvent) {
   if (where == "current" &&
       gBrowser &&
       gBrowser.selectedTab.pinned)
     where = "tab";
 
   // openUILinkIn in utilityOverlay.js doesn't handle loading multiple pages
   switch (where) {
   case "current":
-    loadOneOrMoreURIs(homePage);
+    loadOneOrMoreURIs(homePage, Services.scriptSecurityManager.getSystemPrincipal());
     break;
   case "tabshifted":
   case "tab":
     urls = homePage.split("|");
     var loadInBackground = getBoolPref("browser.tabs.loadBookmarksInBackground", false);
-    gBrowser.loadTabs(urls, loadInBackground);
+    gBrowser.loadTabs(urls, {
+      inBackground: loadInBackground,
+      triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
+    });
     break;
   case "window":
     OpenBrowserWindow();
     break;
   }
 }
 
-function loadOneOrMoreURIs(aURIString) {
+function loadOneOrMoreURIs(aURIString, aTriggeringPrincipal) {
   // we're not a browser window, pass the URI string to a new browser window
   if (window.location.href != getBrowserURL()) {
     window.openDialog(getBrowserURL(), "_blank", "all,dialog=no", aURIString);
     return;
   }
 
   // This function throws for certain malformed URIs, so use exception handling
   // so that we don't disrupt startup
   try {
-    gBrowser.loadTabs(aURIString.split("|"), false, true);
+    gBrowser.loadTabs(aURIString.split("|"), {
+      inBackground: false,
+      replace: true,
+      triggeringPrincipal: aTriggeringPrincipal,
+    });
   } catch (e) {
   }
 }
 
 function focusAndSelectUrlBar() {
   // In customize mode, the url bar is disabled. If a new tab is opened or the
   // user switches to a different tab, this function gets called before we've
   // finished leaving customize mode, and the url bar will still be disabled.
@@ -2224,16 +2240,23 @@ function openLocation() {
       // If there are no open browser windows, open a new one
       window.openDialog("chrome://browser/content/", "_blank",
                         "chrome,all,dialog=no", BROWSER_NEW_TAB_URL);
     }
   }
 }
 
 function BrowserOpenTab(event) {
+  // A notification intended to be useful for modular peformance tracking
+  // starting as close as is reasonably possible to the time when the user
+  // expressed the intent to open a new tab.  Since there are a lot of
+  // entry points, this won't catch every single tab created, but most
+  // initiated by the user should go through here.
+  Services.obs.notifyObservers(null, "browser-open-newtab-start");
+
   let where = "tab";
   let relatedToCurrent = false;
 
   if (event) {
     where = whereToOpenLink(event, false, true);
 
     switch (where) {
       case "tab":
@@ -5405,16 +5428,41 @@ var gTabletModePageCounter = {
     }
   },
 };
 
 function displaySecurityInfo() {
   BrowserPageInfo(null, "securityTab");
 }
 
+// Updates the UI density (for touch and compact mode) based on the uidensity pref.
+var gUIDensity = {
+  prefDomain: "browser.uidensity",
+  observe(aSubject, aTopic, aPrefName) {
+    if (aTopic != "nsPref:changed" || aPrefName != this.prefDomain)
+      return;
+
+    this.update();
+  },
+
+  update() {
+    let doc = document.documentElement;
+    switch (gPrefService.getIntPref(this.prefDomain)) {
+    case 1:
+      doc.setAttribute("uidensity", "compact");
+      break;
+    case 2:
+      doc.setAttribute("uidensity", "touch");
+      break;
+    default:
+      doc.removeAttribute("uidensity");
+      break;
+    }
+  },
+};
 
 var gHomeButton = {
   prefDomain: "browser.startup.homepage",
   observe(aSubject, aTopic, aPrefName) {
     if (aTopic != "nsPref:changed" || aPrefName != this.prefDomain)
       return;
 
     this.updateTooltip();
@@ -5822,24 +5870,25 @@ function stripUnsafeProtocolOnPaste(past
                                         () => {
                                                 changed = true;
                                                 return "";
                                               });
   return changed ? pasteDataNoJS : pasteData;
 }
 
 // handleDroppedLink has the following 2 overloads:
-//   handleDroppedLink(event, url, name)
-//   handleDroppedLink(event, links)
-function handleDroppedLink(event, urlOrLinks, name) {
+//   handleDroppedLink(event, url, name, triggeringPrincipal)
+//   handleDroppedLink(event, links, triggeringPrincipal)
+function handleDroppedLink(event, urlOrLinks, nameOrTriggeringPrincipal, triggeringPrincipal) {
   let links;
   if (Array.isArray(urlOrLinks)) {
     links = urlOrLinks;
+    triggeringPrincipal = nameOrTriggeringPrincipal;
   } else {
-    links = [{ url: urlOrLinks, name, type: "" }];
+    links = [{ url: urlOrLinks, nameOrTriggeringPrincipal, type: "" }];
   }
 
   let lastLocationChange = gBrowser.selectedBrowser.lastLocationChange;
 
   let userContextId = gBrowser.selectedBrowser.getAttribute("usercontextid");
 
   // event is null if links are dropped in content process.
   // inBackground should be false, as it's loading into current browser.
@@ -5860,16 +5909,17 @@ function handleDroppedLink(event, urlOrL
     }
     if (lastLocationChange == gBrowser.selectedBrowser.lastLocationChange) {
       gBrowser.loadTabs(urls, {
         inBackground,
         replace: true,
         allowThirdPartyFixup: false,
         postDatas,
         userContextId,
+        triggeringPrincipal,
       });
     }
   })();
 
   // If links are dropped in content process, event.preventDefault() should be
   // called in content process.
   if (event) {
     // Keep the event from being handled by the dragDrop listeners
@@ -6250,17 +6300,17 @@ var OfflineApps = {
         docId,
       });
     }
   },
 
   manage() {
     // The advanced subpanes are only supported in the old organization, which will
     // be removed by bug 1349689.
-    if (Preferences.get("browser.preferences.useOldOrganization", false)) {
+    if (Preferences.get("browser.preferences.useOldOrganization")) {
       openAdvancedPreferences("networkTab", {origin: "offlineApps"});
     } else {
       openPreferences("panePrivacy", {origin: "offlineApps"});
     }
   },
 
   receiveMessage(msg) {
     switch (msg.name) {
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -2352,20 +2352,24 @@
 
             // if we're adding tabs, we're past interrupt mode, ditch the owner
             if (this.mCurrentTab.owner)
               this.mCurrentTab.owner = null;
 
             var t = document.createElementNS(NS_XUL, "tab");
 
             aURI = aURI || "about:blank";
+            let aURIObject = null;
+            try {
+              aURIObject = Services.io.newURI(aURI);
+            } catch (ex) { /* we'll try to fix up this URL later */ }
 
             let lazyBrowserURI;
             if (aCreateLazyBrowser && aURI != "about:blank") {
-              lazyBrowserURI = Services.io.newURI(aURI);
+              lazyBrowserURI = aURIObject;
               aURI = "about:blank";
             }
 
             var uriIsAboutBlank = aURI == "about:blank";
 
             if (!aNoInitialLabel) {
               if (isBlankPageURL(aURI)) {
                 t.setAttribute("label", this.mStringBundle.getString("tabs.emptyTabTitle"));
@@ -2501,18 +2505,24 @@
 
             // Dispatch a new tab notification.  We do this once we're
             // entirely done, so that things are in a consistent state
             // even if the event listener opens or closes tabs.
             var detail = aEventDetail || {};
             var evt = new CustomEvent("TabOpen", { bubbles: true, detail });
             t.dispatchEvent(evt);
 
-            if (!usingPreloadedContent && aOriginPrincipal) {
-              b.createAboutBlankContentViewer(aOriginPrincipal);
+            if (!usingPreloadedContent && aOriginPrincipal && aURI) {
+              let {URI_INHERITS_SECURITY_CONTEXT} = Ci.nsIProtocolHandler;
+              // Unless we know for sure we're not inheriting principals,
+              // force the about:blank viewer to have the right principal:
+              if (!aURIObject ||
+                  (Services.io.getProtocolFlags(aURIObject.scheme) & URI_INHERITS_SECURITY_CONTEXT)) {
+                b.createAboutBlankContentViewer(aOriginPrincipal);
+              }
             }
 
             // If we didn't swap docShells with a preloaded browser
             // then let's just continue loading the page normally.
             if (!usingPreloadedContent && (!uriIsAboutBlank || aDisallowInheritPrincipal)) {
               // pretend the user typed this so it'll be available till
               // the document successfully loads
               if (aURI && gInitialPages.indexOf(aURI) == -1)
@@ -7011,23 +7021,31 @@
           if (event.shiftKey)
             inBackground = !inBackground;
 
           let targetTab = this._getDragTargetTab(event, true);
           let userContextId = this.selectedItem.getAttribute("usercontextid");
           let replace = !!targetTab;
           let newIndex = this._getDropIndex(event, true);
           let urls = links.map(link => link.url);
+
+
+          // Bug 1367038: mozSourceNode is null if the drag event originated
+          // in an external application - needs better fallback!
+          let triggeringPrincipal = dt.mozSourceNode
+            ? dt.mozSourceNode.nodePrincipal
+            : Services.scriptSecurityManager.getSystemPrincipal();
           this.tabbrowser.loadTabs(urls, {
             inBackground,
             replace,
             allowThirdPartyFixup: true,
             targetTab,
             newIndex,
             userContextId,
+            triggeringPrincipal,
           });
         }
 
         if (draggedTab) {
           delete draggedTab._dragData;
         }
       ]]></handler>
 
--- a/browser/base/content/test/general/browser_bug537013.js
+++ b/browser/base/content/test/general/browser_bug537013.js
@@ -40,17 +40,17 @@ function test() {
   });
   texts.forEach(aText => addTabWithText(aText));
 
   // Set up the first tab
   gBrowser.selectedTab = tabs[0];
 
   setFindString(texts[0]);
   // Turn on highlight for testing bug 891638
-  gFindBar.toggleHighlight(true);
+  gFindBar.getElement("highlight").checked = true;
 
   // Make sure the second tab is correct, then set it up
   gBrowser.selectedTab = tabs[1];
   gBrowser.selectedTab.addEventListener("TabFindInitialized", continueTests1);
   // Initialize the findbar
   gFindBar;
 }
 function continueTests1() {
@@ -67,17 +67,17 @@ function continueTests1() {
   gBrowser.selectedTab = tabs[0];
   ok(!gFindBar.hidden, "First tab shows find bar!");
   // When the Find Clipboard is supported, this test not relevant.
   if (!HasFindClipboard)
     is(gFindBar._findField.value, texts[0], "First tab persists find value!");
   ok(gFindBar.getElement("highlight").checked,
      "Highlight button state persists!");
 
-  // While we're here, let's test the backout of bug 253793.
+  // While we're here, let's test bug 253793
   gBrowser.reload();
   gBrowser.addEventListener("DOMContentLoaded", continueTests2, true);
 }
 
 function continueTests2() {
   gBrowser.removeEventListener("DOMContentLoaded", continueTests2, true);
   ok(gFindBar.getElement("highlight").checked, "Highlight never reset!");
   continueTests3();
@@ -123,13 +123,13 @@ function continueTests3() {
 // Test that findbar gets restored when a tab is moved to a new window.
 function checkNewWindow() {
   ok(!newWindow.gFindBar.hidden, "New window shows find bar!");
   // Disabled the following assertion due to intermittent failure on OSX 10.6 Debug.
   if (!HasFindClipboard) {
     is(newWindow.gFindBar._findField.value, texts[1],
        "New window find bar has correct find value!");
     ok(!newWindow.gFindBar.getElement("find-next").disabled,
-       "New window findbar has disabled buttons!");
+       "New window findbar has enabled buttons!");
   }
   newWindow.close();
   finish();
 }
--- a/browser/base/content/test/performance/browser_toolbariconcolor_restyles.js
+++ b/browser/base/content/test/performance/browser_toolbariconcolor_restyles.js
@@ -23,30 +23,30 @@ add_task(async function test_toolbar_ele
 
   // Clear the focused element from each window so that when
   // we raise them, the focus of the element doesn't cause an
   // unrelated style flush.
   Services.focus.clearFocus(win1);
   Services.focus.clearFocus(win2);
 
   let utils1 = SpecialPowers.getDOMWindowUtils(win1);
-  restyles.win1.initial = utils1.elementsRestyled;
+  restyles.win1.initial = utils1.restyleGeneration;
 
   let utils2 = SpecialPowers.getDOMWindowUtils(win2);
-  restyles.win2.initial = utils2.elementsRestyled;
+  restyles.win2.initial = utils2.restyleGeneration;
 
   // switch back to 1st window, and snapshot elementsStyled
   Services.focus.activeWindow = win1;
-  restyles.win1.activate = utils1.elementsRestyled;
-  restyles.win2.deactivate = utils2.elementsRestyled;
+  restyles.win1.activate = utils1.restyleGeneration;
+  restyles.win2.deactivate = utils2.restyleGeneration;
 
   // switch back to 2nd window, and snapshot elementsStyled
   Services.focus.activeWindow = win2;
-  restyles.win2.activate = utils2.elementsRestyled;
-  restyles.win1.deactivate = utils1.elementsRestyled;
+  restyles.win2.activate = utils2.restyleGeneration;
+  restyles.win1.deactivate = utils1.restyleGeneration;
 
   is(restyles.win1.activate - restyles.win1.deactivate, 0,
       "No elements restyled when re-activating/deactivating a window");
   is(restyles.win2.activate - restyles.win2.deactivate, 0,
       "No elements restyled when re-activating/deactivating a window");
 
   await BrowserTestUtils.closeWindow(win1);
   await BrowserTestUtils.closeWindow(win2);
--- a/browser/base/content/test/siteIdentity/browser.ini
+++ b/browser/base/content/test/siteIdentity/browser.ini
@@ -1,16 +1,13 @@
 [DEFAULT]
 support-files =
   head.js
   !/image/test/mochitest/blue.png
 
-[browser_bug435035.js]
-support-files =
-  test_bug435035.html
 [browser_bug822367.js]
 tags = mcb
 support-files =
   file_bug822367_1.html
   file_bug822367_1.js
   file_bug822367_2.html
   file_bug822367_3.html
   file_bug822367_4.html
@@ -61,16 +58,20 @@ support-files =
   test_mcb_redirect_image.html
   test_mcb_double_redirect_image.html
   test_mcb_redirect.js
   test_mcb_redirect.sjs
 [browser_mixed_content_cert_override.js]
 tags = mcb
 support-files =
   test-mixedcontent-securityerrors.html
+[browser_mixed_passive_content_indicator.js]
+tags = mcb
+support-files =
+  simple_mixed_passive.html
 [browser_mixedcontent_securityflags.js]
 tags = mcb
 support-files =
   test-mixedcontent-securityerrors.html
 [browser_mixedContentFramesOnHttp.js]
 tags = mcb
 support-files =
   file_mixedContentFramesOnHttp.html
rename from browser/base/content/test/siteIdentity/browser_bug435035.js
rename to browser/base/content/test/siteIdentity/browser_mixed_passive_content_indicator.js
--- a/browser/base/content/test/siteIdentity/browser_bug435035.js
+++ b/browser/base/content/test/siteIdentity/browser_mixed_passive_content_indicator.js
@@ -1,17 +1,9 @@
-const TEST_URL = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "https://example.com") + "test_bug435035.html";
+const TEST_URL = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "https://example.com") + "simple_mixed_passive.html";
 
-function test() {
-  waitForExplicitFinish();
-
-  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
-  BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(() => {
+add_task(async function test_mixed_passive_content_indicator() {
+  await BrowserTestUtils.withNewTab(TEST_URL, function() {
     is(document.getElementById("identity-box").className,
        "unknownIdentity mixedDisplayContent",
        "identity box has class name for mixed content");
-
-    gBrowser.removeCurrentTab();
-    finish();
   });
-
-  gBrowser.loadURI(TEST_URL);
-}
+});
rename from browser/base/content/test/siteIdentity/test_bug435035.html
rename to browser/base/content/test/siteIdentity/simple_mixed_passive.html
--- a/browser/base/content/test/tabs/browser.ini
+++ b/browser/base/content/test/tabs/browser.ini
@@ -13,8 +13,9 @@ skip-if = !e10s # Tab spinner is e10s on
 skip-if = os == 'mac'
 [browser_navigatePinnedTab.js]
 [browser_new_web_tab_in_file_process_pref.js]
 skip-if = !e10s # Pref and test only relevant for e10s.
 [browser_opened_file_tab_navigated_to_web.js]
 [browser_reload_deleted_file.js]
 [browser_tabswitch_updatecommands.js]
 [browser_viewsource_of_data_URI_in_file_process.js]
+[browser_open_newtab_start_observer_notification.js]
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/tabs/browser_open_newtab_start_observer_notification.js
@@ -0,0 +1,22 @@
+"use strict";
+
+add_task(async function test_browser_open_newtab_start_observer_notification() {
+
+  let observerFiredPromise = new Promise(resolve => {
+    function observe() {
+      resolve();
+    }
+    Services.obs.addObserver(observe, "browser-open-newtab-start");
+  });
+
+  // We're calling BrowserOpenTab() (rather the using BrowserTestUtils
+  // because we want to be sure that it triggers the event to fire, since
+  // it's very close to where various user-actions are triggered.
+  BrowserOpenTab();
+  await observerFiredPromise;
+  const tab = gBrowser.selectedTab;
+
+  ok(true, "browser-open-newtab-start observer not called");
+
+  await BrowserTestUtils.removeTab(tab);
+});
--- a/browser/base/content/test/urlbar/browser_urlbar_stop_pending.js
+++ b/browser/base/content/test/urlbar/browser_urlbar_stop_pending.js
@@ -35,8 +35,104 @@ add_task(async function() {
   is(gURLBar.value, expectedURLBarChange, "Should not have changed URL bar value synchronously.");
   await pageLoadPromise;
   ok(sawChange, "The URL bar change handler should have been called by the time the page was loaded");
   obs.disconnect();
   obs = null;
   await BrowserTestUtils.removeTab(tab);
 });
 
+/**
+ * Check that if we:
+ * 1) middle-click a link to a separate page whose server doesn't respond
+ * 2) we switch to that tab and stop the request
+ *
+ * The URL bar continues to contain the URL of the page we wanted to visit.
+ */
+add_task(async function() {
+  let socket = Cc["@mozilla.org/network/server-socket;1"].createInstance(Ci.nsIServerSocket);
+  socket.init(-1, true, -1);
+  const PORT = socket.port;
+  registerCleanupFunction(() => { socket.close(); });
+
+  const TEST_PATH = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "https://example.com");
+  const BASE_PAGE = TEST_PATH + "dummy_page.html";
+  const SLOW_HOST = `https://localhost:${PORT}/`;
+  info("Using URLs: " + SLOW_HOST);
+  let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_PAGE);
+  info("opened tab");
+  await ContentTask.spawn(tab.linkedBrowser, SLOW_HOST, URL => {
+    let link = content.document.createElement("a");
+    link.href = URL;
+    link.textContent = "click me to open a slow page";
+    link.id = "clickme"
+    content.document.body.appendChild(link);
+  });
+  info("added link");
+  let newTabPromise = BrowserTestUtils.waitForEvent(gBrowser.tabContainer, "TabOpen");
+  // Middle click the link:
+  await BrowserTestUtils.synthesizeMouseAtCenter("#clickme", { button: 1 }, tab.linkedBrowser);
+  // get new tab, switch to it
+  let newTab = (await newTabPromise).target;
+  await BrowserTestUtils.switchTab(gBrowser, newTab);
+  is(gURLBar.value, SLOW_HOST, "Should have slow page in URL bar");
+  let browserStoppedPromise = BrowserTestUtils.browserStopped(newTab.linkedBrowser);
+  BrowserStop();
+  await browserStoppedPromise;
+
+  is(gURLBar.value, SLOW_HOST, "Should still have slow page in URL bar after stop");
+  await BrowserTestUtils.removeTab(newTab);
+  await BrowserTestUtils.removeTab(tab);
+});
+/**
+ * Check that if we:
+ * 1) middle-click a link to a separate page whose server doesn't respond
+ * 2) we alter the URL on that page to some other server that doesn't respond
+ * 3) we stop the request
+ *
+ * The URL bar continues to contain the second URL.
+ */
+add_task(async function() {
+  let socket = Cc["@mozilla.org/network/server-socket;1"].createInstance(Ci.nsIServerSocket);
+  socket.init(-1, true, -1);
+  const PORT1 = socket.port;
+  let socket2 = Cc["@mozilla.org/network/server-socket;1"].createInstance(Ci.nsIServerSocket);
+  socket2.init(-1, true, -1);
+  const PORT2 = socket2.port;
+  registerCleanupFunction(() => { socket.close(); socket2.close(); });
+
+  const TEST_PATH = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "https://example.com");
+  const BASE_PAGE = TEST_PATH + "dummy_page.html";
+  const SLOW_HOST1 = `https://localhost:${PORT1}/`;
+  const SLOW_HOST2 = `https://localhost:${PORT2}/`;
+  info("Using URLs: " + SLOW_HOST1 + " and " + SLOW_HOST2);
+  let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_PAGE);
+  info("opened tab");
+  await ContentTask.spawn(tab.linkedBrowser, SLOW_HOST1, URL => {
+    let link = content.document.createElement("a");
+    link.href = URL;
+    link.textContent = "click me to open a slow page";
+    link.id = "clickme"
+    content.document.body.appendChild(link);
+  });
+  info("added link");
+  let newTabPromise = BrowserTestUtils.waitForEvent(gBrowser.tabContainer, "TabOpen");
+  // Middle click the link:
+  await BrowserTestUtils.synthesizeMouseAtCenter("#clickme", { button: 1 }, tab.linkedBrowser);
+  // get new tab, switch to it
+  let newTab = (await newTabPromise).target;
+  await BrowserTestUtils.switchTab(gBrowser, newTab);
+  is(gURLBar.value, SLOW_HOST1, "Should have slow page in URL bar");
+  let browserStoppedPromise = BrowserTestUtils.browserStopped(newTab.linkedBrowser);
+  gURLBar.value = SLOW_HOST2;
+  gURLBar.handleCommand();
+  await browserStoppedPromise;
+
+  is(gURLBar.value, SLOW_HOST2, "Should have second slow page in URL bar");
+  browserStoppedPromise = BrowserTestUtils.browserStopped(newTab.linkedBrowser);
+  BrowserStop();
+  await browserStoppedPromise;
+
+  is(gURLBar.value, SLOW_HOST2, "Should still have second slow page in URL bar after stop");
+  await BrowserTestUtils.removeTab(newTab);
+  await BrowserTestUtils.removeTab(tab);
+});
+
--- a/browser/base/content/utilityOverlay.js
+++ b/browser/base/content/utilityOverlay.js
@@ -417,17 +417,22 @@ function openLinkIn(url, where, params) 
 
     if (aAllowPopups) {
       flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_POPUPS;
     }
     if (aIndicateErrorPageLoad) {
       flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ERROR_LOAD_CHANGES_RV;
     }
 
-    if (aForceAboutBlankViewerInCurrent) {
+    let {URI_INHERITS_SECURITY_CONTEXT} = Ci.nsIProtocolHandler;
+    if (aForceAboutBlankViewerInCurrent &&
+        (!uriObj ||
+         (Services.io.getProtocolFlags(uriObj.scheme) & URI_INHERITS_SECURITY_CONTEXT))) {
+      // Unless we know for sure we're not inheriting principals,
+      // force the about:blank viewer to have the right principal:
       targetBrowser.createAboutBlankContentViewer(aPrincipal);
     }
 
     targetBrowser.loadURIWithFlags(url, {
       triggeringPrincipal: aTriggeringPrincipal,
       flags,
       referrerURI: aNoReferrer ? null : aReferrerURI,
       referrerPolicy: aReferrerPolicy,
--- a/browser/components/about/AboutRedirector.cpp
+++ b/browser/components/about/AboutRedirector.cpp
@@ -153,18 +153,18 @@ AboutRedirector::NewChannel(nsIURI* aURI
 
       if (path.EqualsLiteral("newtab")) {
         // let the aboutNewTabService decide where to redirect
         nsCOMPtr<nsIAboutNewTabService> aboutNewTabService =
           do_GetService("@mozilla.org/browser/aboutnewtab-service;1", &rv);
         NS_ENSURE_SUCCESS(rv, rv);
         rv = aboutNewTabService->GetDefaultURL(url);
         NS_ENSURE_SUCCESS(rv, rv);
-      } else if (path.EqualsLiteral("preferences") && sUseOldPreferences) {
-        url.AssignASCII("chrome://browser/content/preferences/in-content-old/preferences.xul");
+      } else if (path.EqualsLiteral("preferences") && !sUseOldPreferences) {
+        url.AssignASCII("chrome://browser/content/preferences/in-content-new/preferences.xul");
       }
       // fall back to the specified url in the map
       if (url.IsEmpty()) {
         url.AssignASCII(redir.url);
       }
 
       nsCOMPtr<nsIChannel> tempChannel;
       nsCOMPtr<nsIURI> tempURI;
--- a/browser/components/controlcenter/content/panel.inc.xul
+++ b/browser/components/controlcenter/content/panel.inc.xul
@@ -52,26 +52,26 @@
                 oncommand="gIdentityHandler.toggleSubView('security', this)"/>
       </hbox>
 
       <!-- Tracking Protection Section -->
       <hbox id="tracking-protection-container"
             class="identity-popup-section"
             when-connection="not-secure secure secure-ev secure-cert-user-overridden file">
         <vbox id="tracking-protection-content" flex="1">
-          <description class="identity-popup-headline"
-                       crop="end"
-                       value="&trackingProtection.title;" />
+          <label class="identity-popup-headline"
+                 crop="end"
+                 value="&trackingProtection.title;" />
 
-          <label id="tracking-blocked"
-                 crop="end">&trackingProtection.detectedBlocked3;</label>
-          <label id="tracking-loaded"
-                 crop="end">&trackingProtection.detectedNotBlocked3;</label>
-          <label id="tracking-not-detected"
-                 crop="end">&trackingProtection.notDetected3;</label>
+          <description id="tracking-blocked"
+                       crop="end">&trackingProtection.detectedBlocked3;</description>
+          <description id="tracking-loaded"
+                       crop="end">&trackingProtection.detectedNotBlocked3;</description>
+          <description id="tracking-not-detected"
+                       crop="end">&trackingProtection.notDetected3;</description>
 
           <button id="tracking-action-unblock"
                   label="&trackingProtection.unblock.label;"
                   accesskey="&trackingProtection.unblock.accesskey;"
                   oncommand="TrackingProtection.disableForCurrentPage();" />
           <button id="tracking-action-unblock-private"
                   label="&trackingProtection.unblockPrivate.label;"
                   accesskey="&trackingProtection.unblockPrivate.accesskey;"
--- a/browser/components/customizableui/CustomizableUI.jsm
+++ b/browser/components/customizableui/CustomizableUI.jsm
@@ -222,17 +222,17 @@ var CustomizableUIInternal = {
     let showCharacterEncoding = Services.prefs.getComplexValue(
       "browser.menu.showCharacterEncoding",
       Ci.nsIPrefLocalizedString
     ).data;
     if (showCharacterEncoding == "true") {
       panelPlacements.push("characterencoding-button");
     }
 
-    if (AppConstants.NIGHTLY_BUILD) {
+    if (!AppConstants.RELEASE_OR_BETA) {
       if (Services.prefs.getBoolPref("extensions.webcompat-reporter.enabled")) {
         panelPlacements.push("webcompat-reporter-button");
       }
     }
 
     gDefaultPanelPlacements = panelPlacements;
     this._updateAreasForPhoton();
 
--- a/browser/components/customizableui/PanelMultiView.jsm
+++ b/browser/components/customizableui/PanelMultiView.jsm
@@ -212,16 +212,21 @@ this.PanelMultiView = class {
       this.__currentSubView = panel;
     return panel;
   }
   get _keyNavigationMap() {
     if (!this.__keyNavigationMap)
       this.__keyNavigationMap = new Map();
     return this.__keyNavigationMap;
   }
+  get _multiLineElementsMap() {
+    if (!this.__multiLineElementsMap)
+      this.__multiLineElementsMap = new WeakMap();
+    return this.__multiLineElementsMap;
+  }
 
   constructor(xulNode, testMode = false) {
     this.node = xulNode;
     // If `testMode` is `true`, the consumer is only interested in accessing the
     // methods of this instance. (E.g. in unit tests.)
     if (testMode)
       return;
 
@@ -239,25 +244,25 @@ this.PanelMultiView = class {
       document.getAnonymousElementByAttribute(this.node, "anonid", "mainViewContainer");
     this._subViews =
       document.getAnonymousElementByAttribute(this.node, "anonid", "subViews");
     this._viewStack =
       document.getAnonymousElementByAttribute(this.node, "anonid", "viewStack");
 
     this._panel.addEventListener("popupshowing", this);
     this._panel.addEventListener("popuphidden", this);
+    this._panel.addEventListener("popupshown", this);
     if (this.panelViews) {
       let cs = window.getComputedStyle(document.documentElement);
       // Set CSS-determined attributes now to prevent a layout flush when we do
       // it when transitioning between panels.
       this._dir = cs.direction;
       this.setMainView(this.panelViews.currentView);
       this.showMainView();
     } else {
-      this._panel.addEventListener("popupshown", this);
       this._clickCapturer.addEventListener("click", this);
 
       this._mainViewContainer.setAttribute("panelid", this._panel.id);
 
       if (this._mainView) {
         this.setMainView(this._mainView);
       }
     }
@@ -312,29 +317,30 @@ this.PanelMultiView = class {
    * @param  {panelview} view View to check, defaults to the currently active view.
    * @return {Boolean}
    */
   _canGoBack(view = this._currentSubView) {
     return !!view.getAttribute("title");
   }
 
   setMainView(aNewMainView) {
+    if (this._mainView) {
+      if (!this.panelViews)
+        this._subViews.appendChild(this._mainView);
+      this._mainView.removeAttribute("mainview");
+    }
+    this._mainViewId = aNewMainView.id;
+    aNewMainView.setAttribute("mainview", "true");
     if (this.panelViews) {
       // If the new main view is not yet in the zeroth position, make sure it's
       // inserted there.
       if (aNewMainView.parentNode != this._viewStack && this._viewStack.firstChild != aNewMainView) {
         this._viewStack.insertBefore(aNewMainView, this._viewStack.firstChild);
       }
     } else {
-      if (this._mainView) {
-        this._subViews.appendChild(this._mainView);
-        this._mainView.removeAttribute("mainview");
-      }
-      this._mainViewId = aNewMainView.id;
-      aNewMainView.setAttribute("mainview", "true");
       this._mainViewContainer.appendChild(aNewMainView);
     }
   }
 
   showMainView() {
     if (this.panelViews) {
       this.showSubView(this._mainViewId);
     } else {
@@ -416,17 +422,17 @@ this.PanelMultiView = class {
         let custWidget = CustomizableWidgets.find(widget => widget.viewId == viewNode.id);
         if (custWidget) {
           if (custWidget.onInit)
             custWidget.onInit(aAnchor);
           custWidget.onViewShowing({ target: aAnchor, detail });
         }
       }
       viewNode.setAttribute("current", true);
-      if (playTransition && this.panelViews)
+      if (this.panelViews && this._mainViewWidth)
         viewNode.style.maxWidth = viewNode.style.minWidth = this._mainViewWidth + "px";
 
       let evt = new window.CustomEvent("ViewShowing", { bubbles: true, cancelable: true, detail });
       viewNode.dispatchEvent(evt);
 
       let cancel = evt.defaultPrevented;
       if (detail.blockers.size) {
         try {
@@ -438,38 +444,42 @@ this.PanelMultiView = class {
         }
       }
 
       if (cancel) {
         return;
       }
 
       this._currentSubView = viewNode;
+      if (this.panelViews) {
+        this.node.setAttribute("viewtype", "subview");
+        if (!playTransition)
+          this.descriptionHeightWorkaround(viewNode);
+      }
 
       // Now we have to transition the panel. There are a few parts to this:
       //
       // 1) The main view content gets shifted so that the center of the anchor
       //    node is at the left-most edge of the panel.
       // 2) The subview deck slides in so that it takes up almost all of the
       //    panel.
       // 3) If the subview is taller then the main panel contents, then the panel
       //    must grow to meet that new height. Otherwise, it must shrink.
       //
       // All three of these actions make use of CSS transformations, so they
       // should all occur simultaneously.
       if (this.panelViews && playTransition) {
-        this.node.setAttribute("viewtype", "subview");
-
         // Sliding the next subview in means that the previous panelview stays
         // where it is and the active panelview slides in from the left in LTR
         // mode, right in RTL mode.
         let onTransitionEnd = () => {
           evt = new window.CustomEvent("ViewHiding", { bubbles: true, cancelable: true });
           previousViewNode.dispatchEvent(evt);
           previousViewNode.removeAttribute("current");
+          this.descriptionHeightWorkaround(viewNode);
         };
 
         // There's absolutely no need to show off our epic animation skillz when
         // the panel's not even open.
         if (this._panel.state != "open") {
           onTransitionEnd();
           return;
         }
@@ -550,17 +560,17 @@ this.PanelMultiView = class {
 
             // Myeah, panel layout auto-resizing is a funky thing. We'll wait
             // another few milliseconds to remove the width and height 'fixtures',
             // to be sure we don't flicker annoyingly.
             // NB: HACK! Bug 1363756 is there to fix this.
             window.setTimeout(() => {
               // Only remove the height when the view is larger than the main
               // view, otherwise it'll snap back to its own height.
-              if (viewRect.height > this._mainViewHeight)
+              if (viewNode == this._mainView || viewRect.height > this._mainViewHeight)
                 this._viewContainer.style.removeProperty("height");
               this._viewContainer.style.removeProperty("width");
             }, 500);
 
             // Take another breather, just like before, to wait for the 'current'
             // attribute removal to take effect. This prevents a flicker.
             // The cleanup we do doesn't affect the display anymore, so we're not
             // too fussed about the timing here.
@@ -730,42 +740,45 @@ this.PanelMultiView = class {
           this.window.addEventListener("keydown", this);
           this._panel.addEventListener("mousemove", this);
         }
         break;
       case "popupshown":
         // Now that the main view is visible, we can check the height of the
         // description elements it contains.
         this.descriptionHeightWorkaround();
-        // Now that the panel has opened, we can compute the distance from its
-        // anchor to the available margin of the screen, based on whether the
-        // panel actually opened towards the top or the bottom. We use this to
-        // limit its maximum height, which is relevant when opening a subview.
-        let maxHeight;
-        if (this._panel.alignmentPosition.startsWith("before_")) {
-          maxHeight = this._panel.getOuterScreenRect().bottom -
-                      this.window.screen.availTop;
-        } else {
-          maxHeight = this.window.screen.availTop +
-                      this.window.screen.availHeight -
-                      this._panel.getOuterScreenRect().top;
+
+        if (!this.panelViews) {
+          // Now that the panel has opened, we can compute the distance from its
+          // anchor to the available margin of the screen, based on whether the
+          // panel actually opened towards the top or the bottom. We use this to
+          // limit its maximum height, which is relevant when opening a subview.
+          let maxHeight;
+          if (this._panel.alignmentPosition.startsWith("before_")) {
+            maxHeight = this._panel.getOuterScreenRect().bottom -
+                        this.window.screen.availTop;
+          } else {
+            maxHeight = this.window.screen.availTop +
+                        this.window.screen.availHeight -
+                        this._panel.getOuterScreenRect().top;
+          }
+          // To go from the maximum height of the panel to the maximum height of
+          // the view stack, we start by subtracting the height of the arrow box.
+          // We don't need to trigger a new layout because this does not change.
+          let arrowBox = this.document.getAnonymousElementByAttribute(
+                                          this._panel, "anonid", "arrowbox");
+          maxHeight -= this._dwu.getBoundsWithoutFlushing(arrowBox).height;
+          // We subtract a fixed margin to account for variable borders. We don't
+          // try to measure this accurately so it's faster, we don't depend on
+          // the arrowpanel structure, and we don't hit rounding errors. Instead,
+          // we use a value that is much greater than the typical borders and
+          // makes sense visually.
+          const EXTRA_MARGIN_PX = 8;
+          this._viewStack.style.maxHeight = (maxHeight - EXTRA_MARGIN_PX) + "px";
         }
-        // To go from the maximum height of the panel to the maximum height of
-        // the view stack, we start by subtracting the height of the arrow box.
-        // We don't need to trigger a new layout because this does not change.
-        let arrowBox = this.document.getAnonymousElementByAttribute(
-                                        this._panel, "anonid", "arrowbox");
-        maxHeight -= this._dwu.getBoundsWithoutFlushing(arrowBox).height;
-        // We subtract a fixed margin to account for variable borders. We don't
-        // try to measure this accurately so it's faster, we don't depend on
-        // the arrowpanel structure, and we don't hit rounding errors. Instead,
-        // we use a value that is much greater than the typical borders and
-        // makes sense visually.
-        const EXTRA_MARGIN_PX = 8;
-        this._viewStack.style.maxHeight = (maxHeight - EXTRA_MARGIN_PX) + "px";
         break;
       case "popuphidden":
         this.node.removeAttribute("panelopen");
         this.showMainView();
         if (this.panelViews) {
           this.window.removeEventListener("keydown", this);
           this._panel.removeEventListener("mousemove", this);
           this._resetKeyNavigation();
@@ -911,49 +924,61 @@ this.PanelMultiView = class {
       let bounds = dwu.getBoundsWithoutFlushing(button);
       return bounds.width > 0 && bounds.height > 0;
     });
   }
 
   /**
    * If the main view or a subview contains wrapping elements, the attribute
    * "descriptionheightworkaround" should be set on the view to force all the
-   * "description" elements to a fixed height. If the attribute is set and the
-   * visibility, contents, or width of any of these elements changes, this
-   * function should be called to refresh the calculated heights.
+   * "description" or wrapping toolbarbutton elements to a fixed height.
+   * If the attribute is set and the visibility, contents, or width of any of
+   * these elements changes, this function should be called to refresh the
+   * calculated heights.
    *
-   * @note While both "label" and "description" elements may contain wrapping
-   *       text, only "description" elements are used that way in panels.
+   * This may trigger a synchronous layout.
    *
    * @param viewNode
    *        Indicates the node to scan for descendant elements. This is the main
    *        view if omitted.
    */
   descriptionHeightWorkaround(viewNode = this._mainView) {
     if (!this.node.hasAttribute("descriptionheightworkaround")) {
       // This view does not require the workaround.
       return;
     }
 
     // We batch DOM changes together in order to reduce synchronous layouts.
     // First we reset any change we may have made previously. The first time
     // this is called, and in the best case scenario, this has no effect.
     let items = [];
-    for (let element of viewNode.getElementsByTagName("description")) {
+    for (let element of viewNode.querySelectorAll(
+         "description:not([hidden]):not([value]),toolbarbutton[wrap]:not([hidden])")) {
+      // Take the label for toolbarbuttons; it only exists on those elements.
+      element = element.labelElement || element;
+
+      let bounds = this._dwu.getBoundsWithoutFlushing(element);
+      let previous = this._multiLineElementsMap.get(element);
+      // Only remove the 'height' property, which will cause a layout flush, when
+      // absolutely necessary.
+      if (!bounds.width || !bounds.height ||
+          (previous && element.textContent == previous.textContent &&
+                       bounds.width == previous.bounds.width)) {
+        continue;
+      }
+
       element.style.removeProperty("height");
       items.push({ element });
     }
+
     // We now read the computed style to store the height of any element that
     // may contain wrapping text, which will be zero if the element is hidden.
-    // This might trigger a synchronous layout, but if this function was called
-    // from a _transitionHeight callback and there are no description elements
-    // visible, then _transitionHeight will not trigger a layout again.
     for (let item of items) {
-      item.height = item.element.getBoundingClientRect().height;
+      item.bounds = item.element.getBoundingClientRect();
     }
+
     // Now we can make all the necessary DOM changes at once.
-    for (let item of items) {
-      if (item.height) {
-        item.element.style.height = item.height + "px";
-      }
+    for (let { element, bounds } of items) {
+      this._multiLineElementsMap.set(element, { bounds, textContent: element.textContent });
+      element.style.height = bounds.height + "px";
     }
   }
 }
--- a/browser/components/customizableui/content/panelUI.inc.xul
+++ b/browser/components/customizableui/content/panelUI.inc.xul
@@ -498,17 +498,17 @@
 <panel id="appMenu-popup"
        class="cui-widget-panel"
        role="group"
        type="arrow"
        hidden="true"
        flip="slide"
        position="bottomcenter topright"
        noautofocus="true">
-  <photonpanelmultiview id="appMenu-multiView" mainViewId="appMenu-mainView">
+  <photonpanelmultiview id="appMenu-multiView" mainViewId="appMenu-mainView" descriptionheightworkaround="true">
     <panelview id="appMenu-mainView" class="PanelUI-subView">
       <vbox class="panel-subview-body">
         <vbox id="appMenu-addon-banners"/>
         <toolbarbutton class="panel-banner-item"
                        label-update-available="&updateAvailable.panelUI.label;"
                        label-update-manual="&updateManual.panelUI.label;"
                        label-update-restart="&updateRestart.panelUI.label2;"
                        oncommand="PanelUI._onBannerItemSelected(event)"
--- a/browser/components/customizableui/test/browser_876944_customize_mode_create_destroy.js
+++ b/browser/components/customizableui/test/browser_876944_customize_mode_create_destroy.js
@@ -27,19 +27,17 @@ add_task(async function testWrapUnwrap()
 
 // Creating and destroying a widget should correctly deal with panel placeholders
 add_task(async function testPanelPlaceholders() {
   let panel = document.getElementById(CustomizableUI.AREA_PANEL);
   // The value of expectedPlaceholders depends on the default palette layout.
   // Bug 1229236 is for these tests to be smarter so the test doesn't need to
   // change when the default placements change.
   let expectedPlaceholders = 1;
-  if (isInDevEdition()) {
-    expectedPlaceholders += 1;
-  } else if (isInNightly()) {
+  if (isInNightly()) {
     expectedPlaceholders += 2;
   }
   is(panel.querySelectorAll(".panel-customization-placeholder").length, expectedPlaceholders, "The number of placeholders should be correct.");
   CustomizableUI.createWidget({id: kTestWidget2, label: "Pretty label", tooltiptext: "Pretty tooltip", defaultArea: CustomizableUI.AREA_PANEL});
   let elem = document.getElementById(kTestWidget2);
   let wrapper = document.getElementById("wrapper-" + kTestWidget2);
   ok(elem, "There should be an item");
   ok(wrapper, "There should be a wrapper");
--- a/browser/components/customizableui/test/browser_880382_drag_wide_widgets_in_panel.js
+++ b/browser/components/customizableui/test/browser_880382_drag_wide_widgets_in_panel.js
@@ -361,24 +361,24 @@ add_task(async function editControlsToPa
                              "find-button",
                              "preferences-button",
                              "add-ons-button",
                              "edit-controls",
                              "developer-button",
                              "sync-button",
                             ];
   removeNonReleaseButtons(placementsAfterMove);
-  if (isInNightly()) {
+  if (isNotReleaseOrBeta()) {
     CustomizableUI.removeWidgetFromArea("webcompat-reporter-button");
   }
   simulateItemDrag(editControls, panel);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterMove);
   let zoomControls = document.getElementById("zoom-controls");
   simulateItemDrag(editControls, zoomControls);
-  if (isInNightly()) {
+  if (isNotReleaseOrBeta()) {
     CustomizableUI.addWidgetToArea("webcompat-reporter-button", CustomizableUI.AREA_PANEL);
   }
   ok(CustomizableUI.inDefaultState, "Should still be in default state.");
 });
 
 // Dragging the edit-controls to the customization-palette and
 // back should work.
 add_task(async function() {
--- a/browser/components/customizableui/test/browser_overflow_use_subviews.js
+++ b/browser/components/customizableui/test/browser_overflow_use_subviews.js
@@ -15,16 +15,20 @@ registerCleanupFunction(async function()
  * re-anchored panels. If we ever remove the developer widget, please
  * replace this test with another subview - don't remove it.
  */
 add_task(async function check_developer_subview_in_overflow() {
   kOverflowPanel.setAttribute("animate", "false");
   gOriginalWidth = window.outerWidth;
 
   CustomizableUI.addWidgetToArea("developer-button", CustomizableUI.AREA_NAVBAR);
+  if (isNotReleaseOrBeta()) {
+    CustomizableUI.addWidgetToArea("webcompat-reporter-button", CustomizableUI.AREA_NAVBAR);
+  }
+
 
   let navbar = document.getElementById(CustomizableUI.AREA_NAVBAR);
   ok(!navbar.hasAttribute("overflowing"), "Should start with a non-overflowing toolbar.");
   window.resizeTo(400, window.outerHeight);
 
   await waitForCondition(() => navbar.hasAttribute("overflowing"));
 
   let chevron = document.getElementById("nav-bar-overflow-button");
--- a/browser/components/customizableui/test/head.js
+++ b/browser/components/customizableui/test/head.js
@@ -114,39 +114,39 @@ function resetCustomization() {
   return CustomizableUI.reset();
 }
 
 function isInDevEdition() {
   return AppConstants.MOZ_DEV_EDITION;
 }
 
 function isInNightly() {
-  return AppConstants.NIGHTLY_BUILD;
+  return AppConstants.NIGHTLY_BUILD && !AppConstants.MOZ_DEV_EDITION;
+}
+
+function isNotReleaseOrBeta() {
+  return !AppConstants.RELEASE_OR_BETA;
 }
 
 function removeNonReleaseButtons(areaPanelPlacements) {
   if (isInDevEdition() && areaPanelPlacements.includes("developer-button")) {
     areaPanelPlacements.splice(areaPanelPlacements.indexOf("developer-button"), 1);
   }
-
-  if (!isInNightly() && areaPanelPlacements.includes("webcompat-reporter-button")) {
-    areaPanelPlacements.splice(areaPanelPlacements.indexOf("webcompat-reporter-button"), 1);
-  }
 }
 
 function removeNonOriginalButtons() {
   CustomizableUI.removeWidgetFromArea("sync-button");
-  if (isInNightly()) {
+  if (isNotReleaseOrBeta()) {
     CustomizableUI.removeWidgetFromArea("webcompat-reporter-button");
   }
 }
 
 function restoreNonOriginalButtons() {
   CustomizableUI.addWidgetToArea("sync-button", CustomizableUI.AREA_PANEL);
-  if (isInNightly()) {
+  if (isNotReleaseOrBeta()) {
     CustomizableUI.addWidgetToArea("webcompat-reporter-button", CustomizableUI.AREA_PANEL);
   }
 }
 
 function assertAreaPlacements(areaId, expectedPlacements) {
   let actualPlacements = getAreaWidgetIds(areaId);
   placementArraysEqual(areaId, actualPlacements, expectedPlacements);
 }
--- a/browser/components/extensions/moz.build
+++ b/browser/components/extensions/moz.build
@@ -22,17 +22,9 @@ EXTRA_JS_MODULES += [
 DIRS += ['schemas']
 
 BROWSER_CHROME_MANIFESTS += [
     'test/browser/browser-remote.ini',
     'test/browser/browser.ini',
 ]
 
 MOCHITEST_MANIFESTS += ['test/mochitest/mochitest.ini']
-
-if CONFIG['OS_ARCH'] != 'Darwin':
-    XPCSHELL_TESTS_MANIFESTS += [
-        'test/xpcshell/xpcshell-remote.ini',
-    ]
-
-XPCSHELL_TESTS_MANIFESTS += [
-    'test/xpcshell/xpcshell.ini',
-]
+XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell/xpcshell.ini']
--- a/browser/components/extensions/test/xpcshell/head.js
+++ b/browser/components/extensions/test/xpcshell/head.js
@@ -1,15 +1,14 @@
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 /* exported createHttpServer, promiseConsoleOutput  */
 
-Components.utils.import("resource://gre/modules/Services.jsm");
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
                                   "resource://gre/modules/AppConstants.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Extension",
                                   "resource://gre/modules/Extension.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ExtensionData",
                                   "resource://gre/modules/Extension.jsm");
@@ -20,21 +19,21 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "HttpServer",
                                   "resource://testing-common/httpd.js");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Schemas",
                                   "resource://gre/modules/Schemas.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "Services",
+                                  "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "TestUtils",
                                   "resource://testing-common/TestUtils.jsm");
 
-Services.prefs.setBoolPref("extensions.webextensions.remote", false);
-
 ExtensionTestUtils.init(this);
 
 
 /**
  * Creates a new HttpServer for testing, and begins listening on the
  * specified port. Automatically shuts down the server when the test
  * unit ends.
  *
deleted file mode 100644
--- a/browser/components/extensions/test/xpcshell/head_remote.js
+++ /dev/null
@@ -1,4 +0,0 @@
-"use strict";
-
-Services.prefs.setBoolPref("extensions.webextensions.remote", true);
-Services.prefs.setIntPref("dom.ipc.keepProcessesAlive.extension", 1);
deleted file mode 100644
--- a/browser/components/extensions/test/xpcshell/xpcshell-common.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-[test_ext_bookmarks.js]
-[test_ext_browsingData.js]
-[test_ext_browsingData_cookies_cache.js]
-[test_ext_browsingData_downloads.js]
-[test_ext_browsingData_passwords.js]
-[test_ext_browsingData_settings.js]
-[test_ext_history.js]
-[test_ext_geckoProfiler_control.js]
deleted file mode 100644
--- a/browser/components/extensions/test/xpcshell/xpcshell-remote.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[DEFAULT]
-head = head.js head_remote.js
-firefox-appdir = browser
-tags = webextensions remote-webextensions
-dupe-manifest =
-
-[include:xpcshell-common.ini]
--- a/browser/components/extensions/test/xpcshell/xpcshell.ini
+++ b/browser/components/extensions/test/xpcshell/xpcshell.ini
@@ -1,23 +1,16 @@
 [DEFAULT]
 head = head.js
 firefox-appdir = browser
-tags = webextensions in-process-webextensions
-dupe-manifest =
+tags = webextensions
 
-# This file contains tests which are not affected by multi-process
-# configuration, or do not support out-of-process content or extensions
-# for one reason or another.
-#
-# Tests which are affected by remote content or remote extensions should
-# go in one of:
-#
-#  - xpcshell-common.ini
-#    For tests which should run in all configurations.
-#  - xpcshell-remote.ini
-#    For tests which should only run with both remote extensions and remote content.
-
+[test_ext_bookmarks.js]
+[test_ext_browsingData.js]
+[test_ext_browsingData_cookies_cache.js]
+[test_ext_browsingData_downloads.js]
+[test_ext_browsingData_passwords.js]
+[test_ext_browsingData_settings.js]
+[test_ext_history.js]
 [test_ext_manifest_commands.js]
 [test_ext_manifest_omnibox.js]
 [test_ext_manifest_permissions.js]
-
-[include:xpcshell-common.ini]
+[test_ext_geckoProfiler_control.js]
--- a/browser/components/migration/.eslintrc.js
+++ b/browser/components/migration/.eslintrc.js
@@ -9,17 +9,16 @@ module.exports = {
     "block-scoped-var": "error",
     "comma-dangle": "off",
     "comma-style": ["error", "last"],
     "complexity": ["error", {"max": 21}],
     "dot-notation": "error",
     "indent": ["error", 2, {"SwitchCase": 1, "ArrayExpression": "first", "ObjectExpression": "first"}],
     "max-nested-callbacks": ["error", 3],
     "new-parens": "error",
-    "no-array-constructor": "error",
     "no-control-regex": "error",
     "no-extend-native": "error",
     "no-fallthrough": ["error", { "commentPattern": ".*[Ii]ntentional(?:ly)?\\s+fall(?:ing)?[\\s-]*through.*" }],
     "no-multi-str": "error",
     "no-return-assign": "error",
     "no-sequences": "error",
     "no-shadow": "error",
     "no-throw-literal": "error",
--- a/browser/components/originattributes/moz.build
+++ b/browser/components/originattributes/moz.build
@@ -8,9 +8,9 @@ BROWSER_CHROME_MANIFESTS += [
     'test/browser/browser.ini',
 ]
 
 MOCHITEST_MANIFESTS += [
     'test/mochitest/mochitest.ini'
 ]
 
 with Files('**'):
-    BUG_COMPONENT = ('Firefox', 'OriginAttributes')
+    BUG_COMPONENT = ('Core', 'DOM: Security')
--- a/browser/components/places/PlacesUIUtils.jsm
+++ b/browser/components/places/PlacesUIUtils.jsm
@@ -948,17 +948,21 @@ this.PlacesUIUtils = {
                                              null, "chrome,dialog=no,all", args);
       return;
     }
 
     var loadInBackground = where == "tabshifted" ? true : false;
     // For consistency, we want all the bookmarks to open in new tabs, instead
     // of having one of them replace the currently focused tab.  Hence we call
     // loadTabs with aReplace set to false.
-    browserWindow.gBrowser.loadTabs(urls, loadInBackground, false);
+    browserWindow.gBrowser.loadTabs(urls, {
+      inBackground: loadInBackground,
+      replace: false,
+      triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
+    });
   },
 
   openLiveMarkNodesInTabs:
   function PUIU_openLiveMarkNodesInTabs(aNode, aEvent, aView) {
     let window = aView.ownerWindow;
 
     PlacesUtils.livemarks.getLivemark({id: aNode.itemId})
       .then(aLivemark => {
--- a/browser/components/places/tests/browser/browser_drag_bookmarks_on_toolbar.js
+++ b/browser/components/places/tests/browser/browser_drag_bookmarks_on_toolbar.js
@@ -160,17 +160,17 @@ var gTests = [
         function() {
           info("Dragging right");
           synthesizeDragWithDirection(element, expectedData, dragDirections.RIGHT,
             function() {
               info("Dragging up");
               synthesizeDragWithDirection(element, expectedData, dragDirections.UP,
                 function() {
                   info("Dragging down");
-                  synthesizeDragWithDirection(element, new Array(), dragDirections.DOWN,
+                  synthesizeDragWithDirection(element, [], dragDirections.DOWN,
                     function() {
                       // Cleanup.
                       PlacesUtils.bookmarks.removeItem(folderId);
                       nextTest();
                     });
                 });
             });
         });
@@ -240,9 +240,8 @@ function test() {
 
   // Uncollapse the personal toolbar if needed.
   if (wasCollapsed) {
     promiseSetToolbarVisibility(toolbar, true).then(nextTest);
   } else {
     nextTest();
   }
 }
-
--- a/browser/components/places/tests/browser/browser_views_liveupdate.js
+++ b/browser/components/places/tests/browser/browser_views_liveupdate.js
@@ -465,10 +465,10 @@ function getViewsForFolder(aFolderId) {
   switch (rootId) {
     case PlacesUtils.toolbarFolderId:
       return ["toolbar", "sidebar"]
     case PlacesUtils.bookmarksMenuFolderId:
       return ["menu", "sidebar"]
     case PlacesUtils.unfiledBookmarksFolderId:
       return ["sidebar"]
   }
-  return new Array();
+  return [];
 }
--- a/browser/components/preferences/applicationManager.xul
+++ b/browser/components/preferences/applicationManager.xul
@@ -17,17 +17,17 @@
         style="&appManager.style;"
         persist="screenX screenY">
 
   <script type="application/javascript"
           src="chrome://browser/content/utilityOverlay.js"/>
   <script type="application/javascript"
           src="chrome://browser/content/preferences/applicationManager.js"/>
   <script type="application/javascript"
-          src="chrome://browser/content/preferences/in-content/applications.js"/>
+          src="chrome://browser/content/preferences/in-content-new/applications.js"/>
 
   <commandset id="appManagerCommandSet">
     <command id="cmd_remove"
              oncommand="gAppManagerDialog.remove();"
              disabled="true"/>
   </commandset>
 
   <keyset id="appManagerKeyset">
copy from browser/components/preferences/in-content/advanced.js
copy to browser/components/preferences/in-content-new/advanced.js
copy from browser/components/preferences/in-content/advanced.xul
copy to browser/components/preferences/in-content-new/advanced.xul
--- a/browser/components/preferences/in-content/advanced.xul
+++ b/browser/components/preferences/in-content-new/advanced.xul
@@ -4,17 +4,17 @@
 
 <!-- Advanced panel -->
 
 #ifdef MOZ_UPDATER
   <script type="application/javascript" src="chrome://browser/content/aboutDialog-appUpdater.js"/>
 #endif
 
 <script type="application/javascript"
-        src="chrome://browser/content/preferences/in-content/advanced.js"/>
+        src="chrome://browser/content/preferences/in-content-new/advanced.js"/>
 
 <preferences id="advancedPreferences" hidden="true" data-category="paneAdvanced">
   <preference id="browser.preferences.advanced.selectedTabIndex"
               name="browser.preferences.advanced.selectedTabIndex"
               type="int"/>
 
 <!-- Update tab -->
 #ifdef MOZ_UPDATER
copy from browser/components/preferences/in-content/applications.js
copy to browser/components/preferences/in-content-new/applications.js
copy from browser/components/preferences/in-content/applications.xul
copy to browser/components/preferences/in-content-new/applications.xul
--- a/browser/components/preferences/in-content/applications.xul
+++ b/browser/components/preferences/in-content-new/applications.xul
@@ -1,16 +1,16 @@
 # 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/.
 
 <!-- Applications panel -->
 
 <script type="application/javascript"
-        src="chrome://browser/content/preferences/in-content/applications.js"/>
+        src="chrome://browser/content/preferences/in-content-new/applications.js"/>
 
 <preferences id="feedsPreferences" hidden="true" data-category="paneApplications">
   <preference id="browser.feeds.handler"
               name="browser.feeds.handler"
               type="string"/>
   <preference id="browser.feeds.handler.default"
               name="browser.feeds.handler.default"
               type="string"/>
copy from browser/components/preferences/in-content/containers.js
copy to browser/components/preferences/in-content-new/containers.js
copy from browser/components/preferences/in-content/containers.xul
copy to browser/components/preferences/in-content-new/containers.xul
--- a/browser/components/preferences/in-content/containers.xul
+++ b/browser/components/preferences/in-content-new/containers.xul
@@ -1,16 +1,16 @@
 # 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/.
 
 <!-- Containers panel -->
 
 <script type="application/javascript"
-        src="chrome://browser/content/preferences/in-content/containers.js"/>
+        src="chrome://browser/content/preferences/in-content-new/containers.js"/>
 
 <preferences id="containerPreferences" hidden="true" data-category="paneContainer">
   <!-- Containers -->
   <preference id="privacy.userContext.enabled"
               name="privacy.userContext.enabled"
               type="bool"/>
 
 </preferences>
rename from browser/components/preferences/in-content/findInPage.js
rename to browser/components/preferences/in-content-new/findInPage.js
copy from browser/components/preferences/in-content/jar.mn
copy to browser/components/preferences/in-content-new/jar.mn
--- a/browser/components/preferences/in-content/jar.mn
+++ b/browser/components/preferences/in-content-new/jar.mn
@@ -1,16 +1,16 @@
 # 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/.
 
 browser.jar:
-   content/browser/preferences/in-content/preferences.js
-*  content/browser/preferences/in-content/preferences.xul
-   content/browser/preferences/in-content/subdialogs.js
+   content/browser/preferences/in-content-new/preferences.js
+*  content/browser/preferences/in-content-new/preferences.xul
+   content/browser/preferences/in-content-new/subdialogs.js
 
-   content/browser/preferences/in-content/main.js
-   content/browser/preferences/in-content/privacy.js
-   content/browser/preferences/in-content/containers.js
-   content/browser/preferences/in-content/advanced.js
-   content/browser/preferences/in-content/applications.js
-   content/browser/preferences/in-content/sync.js
-   content/browser/preferences/in-content/findInPage.js
+   content/browser/preferences/in-content-new/main.js
+   content/browser/preferences/in-content-new/privacy.js
+   content/browser/preferences/in-content-new/containers.js
+   content/browser/preferences/in-content-new/advanced.js
+   content/browser/preferences/in-content-new/applications.js
+   content/browser/preferences/in-content-new/sync.js
+   content/browser/preferences/in-content-new/findInPage.js
copy from browser/components/preferences/in-content/main.js
copy to browser/components/preferences/in-content-new/main.js
copy from browser/components/preferences/in-content/main.xul
copy to browser/components/preferences/in-content-new/main.xul
--- a/browser/components/preferences/in-content/main.xul
+++ b/browser/components/preferences/in-content-new/main.xul
@@ -1,16 +1,16 @@
 # 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/.
 
 <!-- General panel -->
 
 <script type="application/javascript"
-        src="chrome://browser/content/preferences/in-content/main.js"/>
+        src="chrome://browser/content/preferences/in-content-new/main.js"/>
 
 <script type="application/javascript"
         src="chrome://mozapps/content/preferences/fontbuilder.js"/>
 
 <stringbundle id="engineManagerBundle" src="chrome://browser/locale/engineManager.properties"/>
 
 <stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences.properties"/>
 
copy from browser/components/preferences/in-content/moz.build
copy to browser/components/preferences/in-content-new/moz.build
copy from browser/components/preferences/in-content/preferences.js
copy to browser/components/preferences/in-content-new/preferences.js
copy from browser/components/preferences/in-content/preferences.xul
copy to browser/components/preferences/in-content-new/preferences.xul
--- a/browser/components/preferences/in-content/preferences.xul
+++ b/browser/components/preferences/in-content-new/preferences.xul
@@ -3,22 +3,22 @@
    - 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/. -->
 
 <?xml-stylesheet href="chrome://global/skin/global.css"?>
 
 <?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?>
 <?xml-stylesheet href="chrome://global/skin/in-content/common.css"?>
 <?xml-stylesheet
-  href="chrome://browser/skin/preferences/in-content/preferences.css"?>
+  href="chrome://browser/skin/preferences/in-content-new/preferences.css"?>
 <?xml-stylesheet
   href="chrome://browser/content/preferences/handlers.css"?>
 <?xml-stylesheet href="chrome://browser/skin/preferences/applications.css"?>
-<?xml-stylesheet href="chrome://browser/skin/preferences/in-content/search.css"?>
-<?xml-stylesheet href="chrome://browser/skin/preferences/in-content/containers.css"?>
+<?xml-stylesheet href="chrome://browser/skin/preferences/in-content-new/search.css"?>
+<?xml-stylesheet href="chrome://browser/skin/preferences/in-content-new/containers.css"?>
 
 <!DOCTYPE page [
 <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
 <!ENTITY % globalPreferencesDTD SYSTEM "chrome://global/locale/preferences.dtd">
 <!ENTITY % preferencesDTD SYSTEM
   "chrome://browser/locale/preferences/preferences.dtd">
 <!ENTITY % selectBookmarkDTD SYSTEM
   "chrome://browser/locale/preferences/selectBookmark.dtd">
@@ -90,24 +90,24 @@
       disablefastfind="true"
 #ifdef USE_WIN_TITLE_STYLE
       title="&prefWindow.titleWin;">
 #else
       title="&prefWindow.title;">
 #endif
 
   <html:link rel="shortcut icon"
-              href="chrome://browser/skin/preferences/in-content/favicon.ico"/>
+              href="chrome://browser/skin/preferences/in-content-new/favicon.ico"/>
 
   <script type="application/javascript"
           src="chrome://browser/content/utilityOverlay.js"/>
   <script type="application/javascript"
-          src="chrome://browser/content/preferences/in-content/preferences.js"/>
-  <script src="chrome://browser/content/preferences/in-content/findInPage.js"/>
-  <script src="chrome://browser/content/preferences/in-content/subdialogs.js"/>
+          src="chrome://browser/content/preferences/in-content-new/preferences.js"/>
+  <script src="chrome://browser/content/preferences/in-content-new/findInPage.js"/>
+  <script src="chrome://browser/content/preferences/in-content-new/subdialogs.js"/>
 
   <stringbundle id="bundleBrand"
                 src="chrome://branding/locale/brand.properties"/>
   <stringbundle id="bundlePreferences"
                 src="chrome://browser/locale/preferences/preferences.properties"/>
   <stringbundle id="pkiBundle"
                 src="chrome://pippki/locale/pippki.properties"/>
   <stringbundle id="browserBundle"
copy from browser/components/preferences/in-content/privacy.js
copy to browser/components/preferences/in-content-new/privacy.js
copy from browser/components/preferences/in-content/privacy.xul
copy to browser/components/preferences/in-content-new/privacy.xul
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content-new/privacy.xul
@@ -1,16 +1,16 @@
 # 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/.
 
 <!-- Privacy panel -->
 
 <script type="application/javascript"
-        src="chrome://browser/content/preferences/in-content/privacy.js"/>
+        src="chrome://browser/content/preferences/in-content-new/privacy.js"/>
 
 <preferences id="privacyPreferences" hidden="true" data-category="panePrivacy">
 
   <!-- Tracking -->
   <preference id="privacy.trackingprotection.enabled"
               name="privacy.trackingprotection.enabled"
               type="bool"/>
   <preference id="privacy.trackingprotection.pbmode.enabled"
rename from browser/components/preferences/in-content/searchResults.xul
rename to browser/components/preferences/in-content-new/searchResults.xul
copy from browser/components/preferences/in-content/subdialogs.js
copy to browser/components/preferences/in-content-new/subdialogs.js
--- a/browser/components/preferences/in-content/subdialogs.js
+++ b/browser/components/preferences/in-content-new/subdialogs.js
@@ -13,18 +13,18 @@ var gSubDialog = {
   _isClosing: false,
   _frame: null,
   _overlay: null,
   _box: null,
   _openedURL: null,
   _injectedStyleSheets: [
     "chrome://browser/skin/preferences/preferences.css",
     "chrome://global/skin/in-content/common.css",
-    "chrome://browser/skin/preferences/in-content/preferences.css",
-    "chrome://browser/skin/preferences/in-content/dialog.css",
+    "chrome://browser/skin/preferences/in-content-new/preferences.css",
+    "chrome://browser/skin/preferences/in-content-new/dialog.css",
   ],
   _resizeObserver: null,
 
   init() {
     this._frame = document.getElementById("dialogFrame");
     this._overlay = document.getElementById("dialogOverlay");
     this._box = document.getElementById("dialogBox");
     this._closeButton = document.getElementById("dialogClose");
copy from browser/components/preferences/in-content/sync.js
copy to browser/components/preferences/in-content-new/sync.js
copy from browser/components/preferences/in-content/sync.xul
copy to browser/components/preferences/in-content-new/sync.xul
--- a/browser/components/preferences/in-content/sync.xul
+++ b/browser/components/preferences/in-content-new/sync.xul
@@ -21,17 +21,17 @@
               name="services.sync.engine.prefs"
               type="bool"/>
   <preference id="engine.passwords"
               name="services.sync.engine.passwords"
               type="bool"/>
 </preferences>
 
 <script type="application/javascript"
-        src="chrome://browser/content/preferences/in-content/sync.js"/>
+        src="chrome://browser/content/preferences/in-content-new/sync.js"/>
 
 <hbox id="header-sync"
       class="header"
       hidden="true"
       data-category="paneSync">
   <label class="header-name" flex="1">&paneSync1.title;</label>
 </hbox>
 
copy from browser/components/preferences/in-content/tests/.eslintrc.js
copy to browser/components/preferences/in-content-new/tests/.eslintrc.js
copy from browser/components/preferences/in-content/tests/browser.ini
copy to browser/components/preferences/in-content-new/tests/browser.ini
copy from browser/components/preferences/in-content/tests/browser_advanced_update.js
copy to browser/components/preferences/in-content-new/tests/browser_advanced_update.js
copy from browser/components/preferences/in-content/tests/browser_applications_selection.js
copy to browser/components/preferences/in-content-new/tests/browser_applications_selection.js
copy from browser/components/preferences/in-content/tests/browser_basic_rebuild_fonts_test.js
copy to browser/components/preferences/in-content-new/tests/browser_basic_rebuild_fonts_test.js
copy from browser/components/preferences/in-content/tests/browser_bug1018066_resetScrollPosition.js
copy to browser/components/preferences/in-content-new/tests/browser_bug1018066_resetScrollPosition.js
copy from browser/components/preferences/in-content/tests/browser_bug1020245_openPreferences_to_paneContent.js
copy to browser/components/preferences/in-content-new/tests/browser_bug1020245_openPreferences_to_paneContent.js
copy from browser/components/preferences/in-content/tests/browser_bug1184989_prevent_scrolling_when_preferences_flipped.js
copy to browser/components/preferences/in-content-new/tests/browser_bug1184989_prevent_scrolling_when_preferences_flipped.js
copy from browser/components/preferences/in-content/tests/browser_bug1184989_prevent_scrolling_when_preferences_flipped.xul
copy to browser/components/preferences/in-content-new/tests/browser_bug1184989_prevent_scrolling_when_preferences_flipped.xul
copy from browser/components/preferences/in-content/tests/browser_bug410900.js
copy to browser/components/preferences/in-content-new/tests/browser_bug410900.js
copy from browser/components/preferences/in-content/tests/browser_bug705422.js
copy to browser/components/preferences/in-content-new/tests/browser_bug705422.js
copy from browser/components/preferences/in-content/tests/browser_bug731866.js
copy to browser/components/preferences/in-content-new/tests/browser_bug731866.js
copy from browser/components/preferences/in-content/tests/browser_bug795764_cachedisabled.js
copy to browser/components/preferences/in-content-new/tests/browser_bug795764_cachedisabled.js
copy from browser/components/preferences/in-content/tests/browser_change_app_handler.js
copy to browser/components/preferences/in-content-new/tests/browser_change_app_handler.js
rename from browser/components/preferences/in-content/tests/browser_checkspelling.js
rename to browser/components/preferences/in-content-new/tests/browser_checkspelling.js
copy from browser/components/preferences/in-content/tests/browser_connection.js
copy to browser/components/preferences/in-content-new/tests/browser_connection.js
copy from browser/components/preferences/in-content/tests/browser_connection_bug388287.js
copy to browser/components/preferences/in-content-new/tests/browser_connection_bug388287.js
copy from browser/components/preferences/in-content/tests/browser_cookies_exceptions.js
copy to browser/components/preferences/in-content-new/tests/browser_cookies_exceptions.js
copy from browser/components/preferences/in-content/tests/browser_defaultbrowser_alwayscheck.js
copy to browser/components/preferences/in-content-new/tests/browser_defaultbrowser_alwayscheck.js
rename from browser/components/preferences/in-content/tests/browser_engines.js
rename to browser/components/preferences/in-content-new/tests/browser_engines.js
copy from browser/components/preferences/in-content/tests/browser_healthreport.js
copy to browser/components/preferences/in-content-new/tests/browser_healthreport.js
copy from browser/components/preferences/in-content/tests/browser_homepages_filter_aboutpreferences.js
copy to browser/components/preferences/in-content-new/tests/browser_homepages_filter_aboutpreferences.js
rename from browser/components/preferences/in-content/tests/browser_layersacceleration.js
rename to browser/components/preferences/in-content-new/tests/browser_layersacceleration.js
rename from browser/components/preferences/in-content/tests/browser_masterpassword.js
rename to browser/components/preferences/in-content-new/tests/browser_masterpassword.js
copy from browser/components/preferences/in-content/tests/browser_notifications_do_not_disturb.js
copy to browser/components/preferences/in-content-new/tests/browser_notifications_do_not_disturb.js
copy from browser/components/preferences/in-content/tests/browser_performance.js
copy to browser/components/preferences/in-content-new/tests/browser_performance.js
copy from browser/components/preferences/in-content/tests/browser_permissions_urlFieldHidden.js
copy to browser/components/preferences/in-content-new/tests/browser_permissions_urlFieldHidden.js
copy from browser/components/preferences/in-content/tests/browser_privacypane_1.js
copy to browser/components/preferences/in-content-new/tests/browser_privacypane_1.js
copy from browser/components/preferences/in-content/tests/browser_privacypane_3.js
copy to browser/components/preferences/in-content-new/tests/browser_privacypane_3.js
copy from browser/components/preferences/in-content/tests/browser_privacypane_4.js
copy to browser/components/preferences/in-content-new/tests/browser_privacypane_4.js
copy from browser/components/preferences/in-content/tests/browser_privacypane_5.js
copy to browser/components/preferences/in-content-new/tests/browser_privacypane_5.js
copy from browser/components/preferences/in-content/tests/browser_privacypane_8.js
copy to browser/components/preferences/in-content-new/tests/browser_privacypane_8.js
copy from browser/components/preferences/in-content/tests/browser_proxy_backup.js
copy to browser/components/preferences/in-content-new/tests/browser_proxy_backup.js
copy from browser/components/preferences/in-content/tests/browser_sanitizeOnShutdown_prefLocked.js
copy to browser/components/preferences/in-content-new/tests/browser_sanitizeOnShutdown_prefLocked.js
rename from browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_1.js
rename to browser/components/preferences/in-content-new/tests/browser_search_subdialogs_within_preferences_1.js
rename from browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_2.js
rename to browser/components/preferences/in-content-new/tests/browser_search_subdialogs_within_preferences_2.js
rename from browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_3.js
rename to browser/components/preferences/in-content-new/tests/browser_search_subdialogs_within_preferences_3.js
rename from browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_4.js
rename to browser/components/preferences/in-content-new/tests/browser_search_subdialogs_within_preferences_4.js
rename from browser/components/preferences/in-content/tests/browser_search_within_preferences.js
rename to browser/components/preferences/in-content-new/tests/browser_search_within_preferences.js
copy from browser/components/preferences/in-content/tests/browser_searchsuggestions.js
copy to browser/components/preferences/in-content-new/tests/browser_searchsuggestions.js
copy from browser/components/preferences/in-content/tests/browser_security.js
copy to browser/components/preferences/in-content-new/tests/browser_security.js
rename from browser/components/preferences/in-content/tests/browser_siteData.js
rename to browser/components/preferences/in-content-new/tests/browser_siteData.js
--- a/browser/components/preferences/in-content/tests/browser_siteData.js
+++ b/browser/components/preferences/in-content-new/tests/browser_siteData.js
@@ -6,20 +6,20 @@
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 /* import-globals-from ../../../../../testing/modules/sinon-1.16.1.js */
 Services.scriptloader.loadSubScript("resource://testing-common/sinon-1.16.1.js");
 
 const TEST_QUOTA_USAGE_HOST = "example.com";
 const TEST_QUOTA_USAGE_ORIGIN = "https://" + TEST_QUOTA_USAGE_HOST;
-const TEST_QUOTA_USAGE_URL = TEST_QUOTA_USAGE_ORIGIN + "/browser/browser/components/preferences/in-content/tests/site_data_test.html";
+const TEST_QUOTA_USAGE_URL = TEST_QUOTA_USAGE_ORIGIN + "/browser/browser/components/preferences/in-content-new/tests/site_data_test.html";
 const TEST_OFFLINE_HOST = "example.org";
 const TEST_OFFLINE_ORIGIN = "https://" + TEST_OFFLINE_HOST;
-const TEST_OFFLINE_URL = TEST_OFFLINE_ORIGIN + "/browser/browser/components/preferences/in-content/tests/offline/offline.html";
+const TEST_OFFLINE_URL = TEST_OFFLINE_ORIGIN + "/browser/browser/components/preferences/in-content-new/tests/offline/offline.html";
 const REMOVE_DIALOG_URL = "chrome://browser/content/preferences/siteDataRemoveSelected.xul";
 
 const { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
 const { DownloadUtils } = Cu.import("resource://gre/modules/DownloadUtils.jsm", {});
 const { SiteDataManager } = Cu.import("resource:///modules/SiteDataManager.jsm", {});
 const { OfflineAppCacheHelper } = Cu.import("resource:///modules/offlineAppCache.jsm", {});
 
 const mockOfflineAppCacheHelper = {
rename from browser/components/preferences/in-content/tests/browser_siteData2.js
rename to browser/components/preferences/in-content-new/tests/browser_siteData2.js
copy from browser/components/preferences/in-content/tests/browser_subdialogs.js
copy to browser/components/preferences/in-content-new/tests/browser_subdialogs.js
copy from browser/components/preferences/in-content/tests/browser_telemetry.js
copy to browser/components/preferences/in-content-new/tests/browser_telemetry.js
copy from browser/components/preferences/in-content/tests/head.js
copy to browser/components/preferences/in-content-new/tests/head.js
copy from browser/components/preferences/in-content/tests/offline/manifest.appcache
copy to browser/components/preferences/in-content-new/tests/offline/manifest.appcache
copy from browser/components/preferences/in-content/tests/offline/offline.html
copy to browser/components/preferences/in-content-new/tests/offline/offline.html
copy from browser/components/preferences/in-content/tests/privacypane_tests_perwindow.js
copy to browser/components/preferences/in-content-new/tests/privacypane_tests_perwindow.js
copy from browser/components/preferences/in-content/tests/site_data_test.html
copy to browser/components/preferences/in-content-new/tests/site_data_test.html
copy from browser/components/preferences/in-content/tests/subdialog.xul
copy to browser/components/preferences/in-content-new/tests/subdialog.xul
copy from browser/components/preferences/in-content/tests/subdialog2.xul
copy to browser/components/preferences/in-content-new/tests/subdialog2.xul
deleted file mode 100644
--- a/browser/components/preferences/in-content-old/advanced.js
+++ /dev/null
@@ -1,835 +0,0 @@
-/* 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/. */
-
-/* import-globals-from preferences.js */
-
-// Load DownloadUtils module for convertByteUnits
-Components.utils.import("resource://gre/modules/DownloadUtils.jsm");
-Components.utils.import("resource://gre/modules/LoadContextInfo.jsm");
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "SiteDataManager",
-                                  "resource:///modules/SiteDataManager.jsm");
-
-const PREF_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled";
-
-var gAdvancedPane = {
-  _inited: false,
-
-  /**
-   * Brings the appropriate tab to the front and initializes various bits of UI.
-   */
-  init() {
-    function setEventListener(aId, aEventType, aCallback) {
-      document.getElementById(aId)
-              .addEventListener(aEventType, aCallback.bind(gAdvancedPane));
-    }
-
-    this._inited = true;
-    var advancedPrefs = document.getElementById("advancedPrefs");
-
-    var preference = document.getElementById("browser.preferences.advanced.selectedTabIndex");
-    if (preference.value !== null)
-        advancedPrefs.selectedIndex = preference.value;
-
-    if (AppConstants.MOZ_UPDATER) {
-      let onUnload = () => {
-        window.removeEventListener("unload", onUnload);
-        Services.prefs.removeObserver("app.update.", this);
-      };
-      window.addEventListener("unload", onUnload);
-      Services.prefs.addObserver("app.update.", this);
-      this.updateReadPrefs();
-    }
-    if (AppConstants.MOZ_CRASHREPORTER) {
-      this.initSubmitCrashes();
-    }
-    this.initTelemetry();
-    if (AppConstants.MOZ_TELEMETRY_REPORTING) {
-      this.initSubmitHealthReport();
-    }
-    this.updateOnScreenKeyboardVisibility();
-    this.updateCacheSizeInputField();
-    this.updateActualCacheSize();
-
-    if (Services.prefs.getBoolPref("browser.storageManager.enabled")) {
-      Services.obs.addObserver(this, "sitedatamanager:sites-updated");
-      Services.obs.addObserver(this, "sitedatamanager:updating-sites");
-      let unload = () => {
-        window.removeEventListener("unload", unload);
-        Services.obs.removeObserver(this, "sitedatamanager:sites-updated");
-        Services.obs.removeObserver(this, "sitedatamanager:updating-sites");
-      };
-      window.addEventListener("unload", unload);
-      SiteDataManager.updateSites();
-      setEventListener("clearSiteDataButton", "command",
-                       gAdvancedPane.clearSiteData);
-      setEventListener("siteDataSettings", "command",
-                       gAdvancedPane.showSiteDataSettings);
-
-      let url = Services.urlFormatter.formatURLPref("app.support.baseURL") + "storage-permissions";
-      document.getElementById("siteDataLearnMoreLink").setAttribute("href", url);
-      let siteDataGroup = document.getElementById("siteDataGroup");
-      siteDataGroup.hidden = false;
-    }
-
-    setEventListener("layers.acceleration.disabled", "change",
-                     gAdvancedPane.updateHardwareAcceleration);
-    setEventListener("advancedPrefs", "select",
-                     gAdvancedPane.tabSelectionChanged);
-    if (AppConstants.MOZ_TELEMETRY_REPORTING) {
-      setEventListener("submitHealthReportBox", "command",
-                       gAdvancedPane.updateSubmitHealthReport);
-    }
-
-    setEventListener("connectionSettings", "command",
-                     gAdvancedPane.showConnections);
-    setEventListener("clearCacheButton", "command",
-                     gAdvancedPane.clearCache);
-    if (AppConstants.MOZ_UPDATER) {
-      setEventListener("updateRadioGroup", "command",
-                       gAdvancedPane.updateWritePrefs);
-      setEventListener("showUpdateHistory", "command",
-                       gAdvancedPane.showUpdates);
-    }
-    setEventListener("viewCertificatesButton", "command",
-                     gAdvancedPane.showCertificates);
-    setEventListener("viewSecurityDevicesButton", "command",
-                     gAdvancedPane.showSecurityDevices);
-    setEventListener("cacheSize", "change",
-                     gAdvancedPane.updateCacheSizePref);
-
-    if (Services.prefs.getBoolPref("browser.preferences.offlineGroup.enabled")) {
-      this.updateOfflineApps();
-      this.updateActualAppCacheSize();
-      setEventListener("offlineNotifyExceptions", "command",
-                      gAdvancedPane.showOfflineExceptions);
-      setEventListener("offlineAppsList", "select",
-                      gAdvancedPane.offlineAppSelected);
-      setEventListener("offlineAppsListRemove", "command",
-                      gAdvancedPane.removeOfflineApp);
-      setEventListener("clearOfflineAppCacheButton", "command",
-                      gAdvancedPane.clearOfflineAppCache);
-      let bundlePrefs = document.getElementById("bundlePreferences");
-      document.getElementById("offlineAppsList")
-              .style.height = bundlePrefs.getString("offlineAppsList.height");
-      let offlineGroup = document.getElementById("offlineGroup");
-      offlineGroup.hidden = false;
-    }
-
-    if (AppConstants.MOZ_WIDGET_GTK) {
-      // GTK tabbox' allow the scroll wheel to change the selected tab,
-      // but we don't want this behavior for the in-content preferences.
-      let tabsElement = document.getElementById("tabsElement");
-      tabsElement.addEventListener("DOMMouseScroll", event => {
-        event.stopPropagation();
-      }, true);
-    }
-  },
-
-  /**
-   * Stores the identity of the current tab in preferences so that the selected
-   * tab can be persisted between openings of the preferences window.
-   */
-  tabSelectionChanged() {
-    if (!this._inited)
-      return;
-    var advancedPrefs = document.getElementById("advancedPrefs");
-    var preference = document.getElementById("browser.preferences.advanced.selectedTabIndex");
-
-    // tabSelectionChanged gets called twice due to the selectedIndex being set
-    // by both the selectedItem and selectedPanel callstacks. This guard is used
-    // to prevent double-counting in Telemetry.
-    if (preference.valueFromPreferences != advancedPrefs.selectedIndex) {
-      Services.telemetry
-              .getHistogramById("FX_PREFERENCES_CATEGORY_OPENED")
-              .add(telemetryBucketForCategory("advanced"));
-    }
-
-    preference.valueFromPreferences = advancedPrefs.selectedIndex;
-  },
-
-  // GENERAL TAB
-
-  /*
-   * Preferences:
-   *
-   * accessibility.browsewithcaret
-   * - true enables keyboard navigation and selection within web pages using a
-   *   visible caret, false uses normal keyboard navigation with no caret
-   * accessibility.typeaheadfind
-   * - when set to true, typing outside text areas and input boxes will
-   *   automatically start searching for what's typed within the current
-   *   document; when set to false, no search action happens
-   * ui.osk.enabled
-   * - when set to true, subject to other conditions, we may sometimes invoke
-   *   an on-screen keyboard when a text input is focused.
-   *   (Currently Windows-only, and depending on prefs, may be Windows-8-only)
-   * general.autoScroll
-   * - when set to true, clicking the scroll wheel on the mouse activates a
-   *   mouse mode where moving the mouse down scrolls the document downward with
-   *   speed correlated with the distance of the cursor from the original
-   *   position at which the click occurred (and likewise with movement upward);
-   *   if false, this behavior is disabled
-   * general.smoothScroll
-   * - set to true to enable finer page scrolling than line-by-line on page-up,
-   *   page-down, and other such page movements
-   * layout.spellcheckDefault
-   * - an integer:
-   *     0  disables spellchecking
-   *     1  enables spellchecking, but only for multiline text fields
-   *     2  enables spellchecking for all text fields
-   */
-
-  /**
-   * Stores the original value of the spellchecking preference to enable proper
-   * restoration if unchanged (since we're mapping a tristate onto a checkbox).
-   */
-  _storedSpellCheck: 0,
-
-  /**
-   * Returns true if any spellchecking is enabled and false otherwise, caching
-   * the current value to enable proper pref restoration if the checkbox is
-   * never changed.
-   */
-  readCheckSpelling() {
-    var pref = document.getElementById("layout.spellcheckDefault");
-    this._storedSpellCheck = pref.value;
-
-    return (pref.value != 0);
-  },
-
-  /**
-   * Returns the value of the spellchecking preference represented by UI,
-   * preserving the preference's "hidden" value if the preference is
-   * unchanged and represents a value not strictly allowed in UI.
-   */
-  writeCheckSpelling() {
-    var checkbox = document.getElementById("checkSpelling");
-    if (checkbox.checked) {
-      if (this._storedSpellCheck == 2) {
-        return 2;
-      }
-      return 1;
-    }
-    return 0;
-  },
-
-  /**
-   * readEnableOCSP is used by the preferences UI to determine whether or not
-   * the checkbox for OCSP fetching should be checked (it returns true if it
-   * should be checked and false otherwise). The about:config preference
-   * "security.OCSP.enabled" is an integer rather than a boolean, so it can't be
-   * directly mapped from {true,false} to {checked,unchecked}. The possible
-   * values for "security.OCSP.enabled" are:
-   * 0: fetching is disabled
-   * 1: fetch for all certificates
-   * 2: fetch only for EV certificates
-   * Hence, if "security.OCSP.enabled" is non-zero, the checkbox should be
-   * checked. Otherwise, it should be unchecked.
-   */
-  readEnableOCSP() {
-    var preference = document.getElementById("security.OCSP.enabled");
-    // This is the case if the preference is the default value.
-    if (preference.value === undefined) {
-      return true;
-    }
-    return preference.value != 0;
-  },
-
-  /**
-   * writeEnableOCSP is used by the preferences UI to map the checked/unchecked
-   * state of the OCSP fetching checkbox to the value that the preference
-   * "security.OCSP.enabled" should be set to (it returns that value). See the
-   * readEnableOCSP documentation for more background. We unfortunately don't
-   * have enough information to map from {true,false} to all possible values for
-   * "security.OCSP.enabled", but a reasonable alternative is to map from
-   * {true,false} to {<the default value>,0}. That is, if the box is checked,
-   * "security.OCSP.enabled" will be set to whatever default it should be, given
-   * the platform and channel. If the box is unchecked, the preference will be
-   * set to 0. Obviously this won't work if the default is 0, so we will have to
-   * revisit this if we ever set it to 0.
-   */
-  writeEnableOCSP() {
-    var checkbox = document.getElementById("enableOCSP");
-    var defaults = Services.prefs.getDefaultBranch(null);
-    var defaultValue = defaults.getIntPref("security.OCSP.enabled");
-    return checkbox.checked ? defaultValue : 0;
-  },
-
-  updateHardwareAcceleration() {
-    // Placeholder for restart
-  },
-
-  // DATA CHOICES TAB
-
-  /**
-   * Set up or hide the Learn More links for various data collection options
-   */
-  _setupLearnMoreLink(pref, element) {
-    // set up the Learn More link with the correct URL
-    let url = Services.prefs.getCharPref(pref);
-    let el = document.getElementById(element);
-
-    if (url) {
-      el.setAttribute("href", url);
-    } else {
-      el.setAttribute("hidden", "true");
-    }
-  },
-
-  /**
-   *
-   */
-  initSubmitCrashes() {
-    this._setupLearnMoreLink("toolkit.crashreporter.infoURL",
-                             "crashReporterLearnMore");
-  },
-
-  /**
-   * The preference/checkbox is configured in XUL.
-   *
-   * In all cases, set up the Learn More link sanely.
-   */
-  initTelemetry() {
-    if (AppConstants.MOZ_TELEMETRY_REPORTING) {
-      this._setupLearnMoreLink("toolkit.telemetry.infoURL", "telemetryLearnMore");
-    }
-  },
-
-  /**
-   * Set the status of the telemetry controls based on the input argument.
-   * @param {Boolean} aEnabled False disables the controls, true enables them.
-   */
-  setTelemetrySectionEnabled(aEnabled) {
-    if (AppConstants.MOZ_TELEMETRY_REPORTING) {
-      // If FHR is disabled, additional data sharing should be disabled as well.
-      let disabled = !aEnabled;
-      document.getElementById("submitTelemetryBox").disabled = disabled;
-      if (disabled) {
-        // If we disable FHR, untick the telemetry checkbox.
-        Services.prefs.setBoolPref("toolkit.telemetry.enabled", false);
-      }
-      document.getElementById("telemetryDataDesc").disabled = disabled;
-    }
-  },
-
-  /**
-   * Initialize the health report service reference and checkbox.
-   */
-  initSubmitHealthReport() {
-    if (AppConstants.MOZ_TELEMETRY_REPORTING) {
-      this._setupLearnMoreLink("datareporting.healthreport.infoURL", "FHRLearnMore");
-
-      let checkbox = document.getElementById("submitHealthReportBox");
-
-      if (Services.prefs.prefIsLocked(PREF_UPLOAD_ENABLED)) {
-        checkbox.setAttribute("disabled", "true");
-        return;
-      }
-
-      checkbox.checked = Services.prefs.getBoolPref(PREF_UPLOAD_ENABLED);
-      this.setTelemetrySectionEnabled(checkbox.checked);
-    }
-  },
-
-  /**
-   * Update the health report preference with state from checkbox.
-   */
-  updateSubmitHealthReport() {
-    if (AppConstants.MOZ_TELEMETRY_REPORTING) {
-      let checkbox = document.getElementById("submitHealthReportBox");
-      Services.prefs.setBoolPref(PREF_UPLOAD_ENABLED, checkbox.checked);
-      this.setTelemetrySectionEnabled(checkbox.checked);
-    }
-  },
-
-  updateOnScreenKeyboardVisibility() {
-    if (AppConstants.platform == "win") {
-      let minVersion = Services.prefs.getBoolPref("ui.osk.require_win10") ? 10 : 6.2;
-      if (Services.vc.compare(Services.sysinfo.getProperty("version"), minVersion) >= 0) {
-        document.getElementById("useOnScreenKeyboard").hidden = false;
-      }
-    }
-  },
-
-  // NETWORK TAB
-
-  /*
-   * Preferences:
-   *
-   * browser.cache.disk.capacity
-   * - the size of the browser cache in KB
-   * - Only used if browser.cache.disk.smart_size.enabled is disabled
-   */
-
-  /**
-   * Displays a dialog in which proxy settings may be changed.
-   */
-  showConnections() {
-    gSubDialog.open("chrome://browser/content/preferences/connection.xul");
-  },
-
-  showSiteDataSettings() {
-    gSubDialog.open("chrome://browser/content/preferences/siteDataSettings.xul");
-  },
-
-  toggleSiteData(shouldShow) {
-    let clearButton = document.getElementById("clearSiteDataButton");
-    let settingsButton = document.getElementById("siteDataSettings");
-    clearButton.disabled = !shouldShow;
-    settingsButton.disabled = !shouldShow;
-  },
-
-  updateTotalDataSizeLabel(usage) {
-    let prefStrBundle = document.getElementById("bundlePreferences");
-    let totalSiteDataSizeLabel = document.getElementById("totalSiteDataSize");
-    if (usage < 0) {
-      totalSiteDataSizeLabel.textContent = prefStrBundle.getString("loadingSiteDataSize");
-    } else {
-      let size = DownloadUtils.convertByteUnits(usage);
-      totalSiteDataSizeLabel.textContent = prefStrBundle.getFormattedString("totalSiteDataSize", size);
-    }
-  },
-
-  // Retrieves the amount of space currently used by disk cache
-  updateActualCacheSize() {
-    var actualSizeLabel = document.getElementById("actualDiskCacheSize");
-    var prefStrBundle = document.getElementById("bundlePreferences");
-
-    // Needs to root the observer since cache service keeps only a weak reference.
-    this.observer = {
-      onNetworkCacheDiskConsumption(consumption) {
-        var size = DownloadUtils.convertByteUnits(consumption);
-        // The XBL binding for the string bundle may have been destroyed if
-        // the page was closed before this callback was executed.
-        if (!prefStrBundle.getFormattedString) {
-          return;
-        }
-        actualSizeLabel.value = prefStrBundle.getFormattedString("actualDiskCacheSize", size);
-      },
-
-      QueryInterface: XPCOMUtils.generateQI([
-        Components.interfaces.nsICacheStorageConsumptionObserver,
-        Components.interfaces.nsISupportsWeakReference
-      ])
-    };
-
-    actualSizeLabel.value = prefStrBundle.getString("actualDiskCacheSizeCalculated");
-
-    try {
-      var cacheService =
-        Components.classes["@mozilla.org/netwerk/cache-storage-service;1"]
-                  .getService(Components.interfaces.nsICacheStorageService);
-      cacheService.asyncGetDiskConsumption(this.observer);
-    } catch (e) {}
-  },
-
-  updateCacheSizeUI(smartSizeEnabled) {
-    document.getElementById("useCacheBefore").disabled = smartSizeEnabled;
-    document.getElementById("cacheSize").disabled = smartSizeEnabled;
-    document.getElementById("useCacheAfter").disabled = smartSizeEnabled;
-  },
-
-  readSmartSizeEnabled() {
-    // The smart_size.enabled preference element is inverted="true", so its
-    // value is the opposite of the actual pref value
-    var disabled = document.getElementById("browser.cache.disk.smart_size.enabled").value;
-    this.updateCacheSizeUI(!disabled);
-  },
-
-  /**
-   * Converts the cache size from units of KB to units of MB and stores it in
-   * the textbox element.
-   */
-  updateCacheSizeInputField() {
-    let cacheSizeElem = document.getElementById("cacheSize");
-    let cachePref = document.getElementById("browser.cache.disk.capacity");
-    cacheSizeElem.value = cachePref.value / 1024;
-    if (cachePref.locked)
-      cacheSizeElem.disabled = true;
-  },
-
-  /**
-   * Updates the cache size preference once user enters a new value.
-   * We intentionally do not set preference="browser.cache.disk.capacity"
-   * onto the textbox directly, as that would update the pref at each keypress
-   * not only after the final value is entered.
-   */
-  updateCacheSizePref() {
-    let cacheSizeElem = document.getElementById("cacheSize");
-    let cachePref = document.getElementById("browser.cache.disk.capacity");
-    // Converts the cache size as specified in UI (in MB) to KB.
-    let intValue = parseInt(cacheSizeElem.value, 10);
-    cachePref.value = isNaN(intValue) ? 0 : intValue * 1024;
-  },
-
-  /**
-   * Clears the cache.
-   */
-  clearCache() {
-    try {
-      var cache = Components.classes["@mozilla.org/netwerk/cache-storage-service;1"]
-                            .getService(Components.interfaces.nsICacheStorageService);
-      cache.clear();
-    } catch (ex) {}
-    this.updateActualCacheSize();
-  },
-
-  clearSiteData() {
-    let flags =
-      Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_0 +
-      Services.prompt.BUTTON_TITLE_CANCEL * Services.prompt.BUTTON_POS_1 +
-      Services.prompt.BUTTON_POS_0_DEFAULT;
-    let prefStrBundle = document.getElementById("bundlePreferences");
-    let title = prefStrBundle.getString("clearSiteDataPromptTitle");
-    let text = prefStrBundle.getString("clearSiteDataPromptText");
-    let btn0Label = prefStrBundle.getString("clearSiteDataNow");
-
-    let result = Services.prompt.confirmEx(
-      window, title, text, flags, btn0Label, null, null, null, {});
-    if (result == 0) {
-      SiteDataManager.removeAll();
-    }
-  },
-
-  // Methods for Offline Apps(Appcache)
-
-  /**
-   * Clears the application cache.
-   */
-  clearOfflineAppCache() {
-    Components.utils.import("resource:///modules/offlineAppCache.jsm");
-    OfflineAppCacheHelper.clear();
-
-    this.updateActualAppCacheSize();
-    this.updateOfflineApps();
-  },
-
-  // Retrieves the amount of space currently used by offline cache
-  updateActualAppCacheSize() {
-    var visitor = {
-      onCacheStorageInfo(aEntryCount, aConsumption, aCapacity, aDiskDirectory) {
-        var actualSizeLabel = document.getElementById("actualAppCacheSize");
-        var sizeStrings = DownloadUtils.convertByteUnits(aConsumption);
-        var prefStrBundle = document.getElementById("bundlePreferences");
-        // The XBL binding for the string bundle may have been destroyed if
-        // the page was closed before this callback was executed.
-        if (!prefStrBundle.getFormattedString) {
-          return;
-        }
-        var sizeStr = prefStrBundle.getFormattedString("actualAppCacheSize", sizeStrings);
-        actualSizeLabel.value = sizeStr;
-      }
-    };
-
-    try {
-      var cacheService =
-        Components.classes["@mozilla.org/netwerk/cache-storage-service;1"]
-                  .getService(Components.interfaces.nsICacheStorageService);
-      var storage = cacheService.appCacheStorage(LoadContextInfo.default, null);
-      storage.asyncVisitStorage(visitor, false);
-    } catch (e) {}
-  },
-
-  readOfflineNotify() {
-    var pref = document.getElementById("browser.offline-apps.notify");
-    var button = document.getElementById("offlineNotifyExceptions");
-    button.disabled = !pref.value;
-    return pref.value;
-  },
-
-  showOfflineExceptions() {
-    var bundlePreferences = document.getElementById("bundlePreferences");
-    var params = { blockVisible: false,
-                   sessionVisible: false,
-                   allowVisible: false,
-                   prefilledHost: "",
-                   permissionType: "offline-app",
-                   manageCapability: Components.interfaces.nsIPermissionManager.DENY_ACTION,
-                   windowTitle: bundlePreferences.getString("offlinepermissionstitle"),
-                   introText: bundlePreferences.getString("offlinepermissionstext") };
-    gSubDialog.open("chrome://browser/content/preferences/permissions.xul",
-                    null, params);
-  },
-
-  // XXX: duplicated in browser.js
-  _getOfflineAppUsage(perm, groups) {
-    let cacheService = Cc["@mozilla.org/network/application-cache-service;1"].
-                       getService(Ci.nsIApplicationCacheService);
-    if (!groups) {
-      try {
-        groups = cacheService.getGroups();
-      } catch (ex) {
-        return 0;
-      }
-    }
-
-    let usage = 0;
-    for (let group of groups) {
-      let uri = Services.io.newURI(group);
-      if (perm.matchesURI(uri, true)) {
-        let cache = cacheService.getActiveCache(group);
-        usage += cache.usage;
-      }
-    }
-
-    return usage;
-  },
-
-  /**
-   * Updates the list of offline applications
-   */
-  updateOfflineApps() {
-    var pm = Components.classes["@mozilla.org/permissionmanager;1"]
-                       .getService(Components.interfaces.nsIPermissionManager);
-
-    var list = document.getElementById("offlineAppsList");
-    while (list.firstChild) {
-      list.firstChild.remove();
-    }
-
-    var groups;
-    try {
-      var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"].
-                         getService(Components.interfaces.nsIApplicationCacheService);
-      groups = cacheService.getGroups();
-    } catch (e) {
-      return;
-    }
-
-    var bundle = document.getElementById("bundlePreferences");
-
-    var enumerator = pm.enumerator;
-    while (enumerator.hasMoreElements()) {
-      var perm = enumerator.getNext().QueryInterface(Components.interfaces.nsIPermission);
-      if (perm.type == "offline-app" &&
-          perm.capability != Components.interfaces.nsIPermissionManager.DEFAULT_ACTION &&
-          perm.capability != Components.interfaces.nsIPermissionManager.DENY_ACTION) {
-        var row = document.createElement("listitem");
-        row.id = "";
-        row.className = "offlineapp";
-        row.setAttribute("origin", perm.principal.origin);
-        var converted = DownloadUtils.
-                        convertByteUnits(this._getOfflineAppUsage(perm, groups));
-        row.setAttribute("usage",
-                         bundle.getFormattedString("offlineAppUsage",
-                                                   converted));
-        list.appendChild(row);
-      }
-    }
-  },
-
-  offlineAppSelected() {
-    var removeButton = document.getElementById("offlineAppsListRemove");
-    var list = document.getElementById("offlineAppsList");
-    if (list.selectedItem) {
-      removeButton.setAttribute("disabled", "false");
-    } else {
-      removeButton.setAttribute("disabled", "true");
-    }
-  },
-
-  removeOfflineApp() {
-    var list = document.getElementById("offlineAppsList");
-    var item = list.selectedItem;
-    var origin = item.getAttribute("origin");
-    var principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(origin);
-
-    var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
-                            .getService(Components.interfaces.nsIPromptService);
-    var flags = prompts.BUTTON_TITLE_IS_STRING * prompts.BUTTON_POS_0 +
-                prompts.BUTTON_TITLE_CANCEL * prompts.BUTTON_POS_1;
-
-    var bundle = document.getElementById("bundlePreferences");
-    var title = bundle.getString("offlineAppRemoveTitle");
-    var prompt = bundle.getFormattedString("offlineAppRemovePrompt", [principal.URI.prePath]);
-    var confirm = bundle.getString("offlineAppRemoveConfirm");
-    var result = prompts.confirmEx(window, title, prompt, flags, confirm,
-                                   null, null, null, {});
-    if (result != 0)
-      return;
-
-    // get the permission
-    var pm = Components.classes["@mozilla.org/permissionmanager;1"]
-                       .getService(Components.interfaces.nsIPermissionManager);
-    var perm = pm.getPermissionObject(principal, "offline-app", true);
-    if (perm) {
-      // clear offline cache entries
-      try {
-        var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"].
-                           getService(Components.interfaces.nsIApplicationCacheService);
-        var groups = cacheService.getGroups();
-        for (var i = 0; i < groups.length; i++) {
-          var uri = Services.io.newURI(groups[i]);
-          if (perm.matchesURI(uri, true)) {
-            var cache = cacheService.getActiveCache(groups[i]);
-            cache.discard();
-          }
-        }
-      } catch (e) {}
-
-      pm.removePermission(perm);
-    }
-    list.removeChild(item);
-    gAdvancedPane.offlineAppSelected();
-    this.updateActualAppCacheSize();
-  },
-  // Methods for Offline Apps(Appcache) end
-
-  // UPDATE TAB
-
-  /*
-   * Preferences:
-   *
-   * app.update.enabled
-   * - true if updates to the application are enabled, false otherwise
-   * app.update.auto
-   * - true if updates should be automatically downloaded and installed and
-   * false if the user should be asked what he wants to do when an update is
-   * available
-   * extensions.update.enabled
-   * - true if updates to extensions and themes are enabled, false otherwise
-   * browser.search.update
-   * - true if updates to search engines are enabled, false otherwise
-   */
-
-  /**
-   * Selects the item of the radiogroup based on the pref values and locked
-   * states.
-   *
-   * UI state matrix for update preference conditions
-   *
-   * UI Components:                              Preferences
-   * Radiogroup                                  i   = app.update.enabled
-   *                                             ii  = app.update.auto
-   *
-   * Disabled states:
-   * Element           pref  value  locked  disabled
-   * radiogroup        i     t/f    f       false
-   *                   i     t/f    *t*     *true*
-   *                   ii    t/f    f       false
-   *                   ii    t/f    *t*     *true*
-   */
-  updateReadPrefs() {
-    if (AppConstants.MOZ_UPDATER) {
-      var enabledPref = document.getElementById("app.update.enabled");
-      var autoPref = document.getElementById("app.update.auto");
-      var radiogroup = document.getElementById("updateRadioGroup");
-
-      if (!enabledPref.value)   // Don't care for autoPref.value in this case.
-        radiogroup.value = "manual";    // 3. Never check for updates.
-      else if (autoPref.value)  // enabledPref.value && autoPref.value
-        radiogroup.value = "auto";      // 1. Automatically install updates
-      else                      // enabledPref.value && !autoPref.value
-        radiogroup.value = "checkOnly"; // 2. Check, but let me choose
-
-      var canCheck = Components.classes["@mozilla.org/updates/update-service;1"].
-                       getService(Components.interfaces.nsIApplicationUpdateService).
-                       canCheckForUpdates;
-      // canCheck is false if the enabledPref is false and locked,
-      // or the binary platform or OS version is not known.
-      // A locked pref is sufficient to disable the radiogroup.
-      radiogroup.disabled = !canCheck || enabledPref.locked || autoPref.locked;
-
-      if (AppConstants.MOZ_MAINTENANCE_SERVICE) {
-        // Check to see if the maintenance service is installed.
-        // If it is don't show the preference at all.
-        var installed;
-        try {
-          var wrk = Components.classes["@mozilla.org/windows-registry-key;1"]
-                    .createInstance(Components.interfaces.nsIWindowsRegKey);
-          wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE,
-                   "SOFTWARE\\Mozilla\\MaintenanceService",
-                   wrk.ACCESS_READ | wrk.WOW64_64);
-          installed = wrk.readIntValue("Installed");
-          wrk.close();
-        } catch (e) {
-        }
-        if (installed != 1) {
-          document.getElementById("useService").hidden = true;
-        }
-      }
-    }
-  },
-
-  /**
-   * Sets the pref values based on the selected item of the radiogroup.
-   */
-  updateWritePrefs() {
-    if (AppConstants.MOZ_UPDATER) {
-      var enabledPref = document.getElementById("app.update.enabled");
-      var autoPref = document.getElementById("app.update.auto");
-      var radiogroup = document.getElementById("updateRadioGroup");
-      switch (radiogroup.value) {
-        case "auto":      // 1. Automatically install updates for Desktop only
-          enabledPref.value = true;
-          autoPref.value = true;
-          break;
-        case "checkOnly": // 2. Check, but let me choose
-          enabledPref.value = true;
-          autoPref.value = false;
-          break;
-        case "manual":    // 3. Never check for updates.
-          enabledPref.value = false;
-          autoPref.value = false;
-      }
-    }
-  },
-
-  /**
-   * Displays the history of installed updates.
-   */
-  showUpdates() {
-    gSubDialog.open("chrome://mozapps/content/update/history.xul");
-  },
-
-  // ENCRYPTION TAB
-
-  /*
-   * Preferences:
-   *
-   * security.default_personal_cert
-   * - a string:
-   *     "Select Automatically"   select a certificate automatically when a site
-   *                              requests one
-   *     "Ask Every Time"         present a dialog to the user so he can select
-   *                              the certificate to use on a site which
-   *                              requests one
-   */
-
-  /**
-   * Displays the user's certificates and associated options.
-   */
-  showCertificates() {
-    gSubDialog.open("chrome://pippki/content/certManager.xul");
-  },
-
-  /**
-   * Displays a dialog from which the user can manage his security devices.
-   */
-  showSecurityDevices() {
-    gSubDialog.open("chrome://pippki/content/device_manager.xul");
-  },
-
-  observe(aSubject, aTopic, aData) {
-    switch (aTopic) {
-      case "nsPref:changed":
-        this.updateReadPrefs();
-        break;
-
-      case "sitedatamanager:updating-sites":
-        // While updating, we want to disable this section and display loading message until updated
-        this.toggleSiteData(false);
-        this.updateTotalDataSizeLabel(-1);
-        break;
-
-      case "sitedatamanager:sites-updated":
-        this.toggleSiteData(true);
-        SiteDataManager.getTotalUsage()
-          .then(this.updateTotalDataSizeLabel.bind(this));
-        break;
-    }
-  },
-};
deleted file mode 100644
--- a/browser/components/preferences/in-content-old/advanced.xul
+++ /dev/null
@@ -1,422 +0,0 @@
-# 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/.
-
-<!-- Advanced panel -->
-
-<script type="application/javascript"
-        src="chrome://browser/content/preferences/in-content-old/advanced.js"/>
-
-<preferences id="advancedPreferences" hidden="true" data-category="paneAdvanced">
-  <preference id="browser.preferences.advanced.selectedTabIndex"
-              name="browser.preferences.advanced.selectedTabIndex"
-              type="int"/>
-
-  <!-- General tab -->
-  <preference id="accessibility.browsewithcaret"
-              name="accessibility.browsewithcaret"
-              type="bool"/>
-  <preference id="accessibility.typeaheadfind"
-              name="accessibility.typeaheadfind"
-              type="bool"/>
-  <preference id="accessibility.blockautorefresh"
-              name="accessibility.blockautorefresh"
-              type="bool"/>
-#ifdef XP_WIN
-  <preference id="ui.osk.enabled"
-              name="ui.osk.enabled"
-              type="bool"/>
-#endif
-
-  <preference id="general.autoScroll"
-              name="general.autoScroll"
-              type="bool"/>
-  <preference id="general.smoothScroll"
-              name="general.smoothScroll"
-              type="bool"/>
-  <preference id="layout.spellcheckDefault"
-              name="layout.spellcheckDefault"
-              type="int"/>
-
-#ifdef MOZ_TELEMETRY_REPORTING
-  <preference id="toolkit.telemetry.enabled"
-              name="toolkit.telemetry.enabled"
-              type="bool"/>
-#endif
-
-  <!-- Data Choices tab -->
-#ifdef MOZ_CRASHREPORTER
-  <preference id="browser.crashReports.unsubmittedCheck.autoSubmit"
-              name="browser.crashReports.unsubmittedCheck.autoSubmit"
-              type="bool"/>
-#endif
-
-  <!-- Network tab -->
-  <preference id="browser.cache.disk.capacity"
-              name="browser.cache.disk.capacity"
-              type="int"/>
-  <preference id="browser.offline-apps.notify"
-              name="browser.offline-apps.notify"
-              type="bool"/>
-
-  <preference id="browser.cache.disk.smart_size.enabled"
-              name="browser.cache.disk.smart_size.enabled"
-              inverted="true"
-              type="bool"/>
-
- <!-- Update tab -->
-#ifdef MOZ_UPDATER
-  <preference id="app.update.enabled"
-              name="app.update.enabled"
-              type="bool"/>
-  <preference id="app.update.auto"
-              name="app.update.auto"
-              type="bool"/>
-
-  <preference id="app.update.disable_button.showUpdateHistory"
-              name="app.update.disable_button.showUpdateHistory"
-              type="bool"/>
-
-#ifdef MOZ_MAINTENANCE_SERVICE
-  <preference id="app.update.service.enabled"
-              name="app.update.service.enabled"
-              type="bool"/>
-#endif
-#endif
-
-  <preference id="browser.search.update"
-              name="browser.search.update"
-              type="bool"/>
-
-  <!-- Certificates tab -->
-  <preference id="security.default_personal_cert"
-              name="security.default_personal_cert"
-              type="string"/>
-
-  <preference id="security.disable_button.openCertManager"
-              name="security.disable_button.openCertManager"
-              type="bool"/>
-
-  <preference id="security.disable_button.openDeviceManager"
-              name="security.disable_button.openDeviceManager"
-              type="bool"/>
-
-  <preference id="security.OCSP.enabled"
-              name="security.OCSP.enabled"
-              type="int"/>
-</preferences>
-
-#ifdef HAVE_SHELL_SERVICE
-  <stringbundle id="bundleShell" src="chrome://browser/locale/shellservice.properties"/>
-  <stringbundle id="bundleBrand" src="chrome://branding/locale/brand.properties"/>
-#endif
-  <stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences-old/preferences.properties"/>
-
-<hbox id="header-advanced"
-      class="header"
-      hidden="true"
-      data-category="paneAdvanced">
-  <label class="header-name" flex="1">&paneAdvanced.title;</label>
-  <html:a class="help-button" target="_blank" aria-label="&helpButton.label;"></html:a>
-</hbox>
-
-<tabbox id="advancedPrefs"
-        handleCtrlTab="false"
-        handleCtrlPageUpDown="false"
-        flex="1"
-        data-category="paneAdvanced"
-        hidden="true">
-
-  <tabs id="tabsElement">
-    <tab id="generalTab" label="&generalTab.label;"/>
-#ifdef MOZ_DATA_REPORTING
-    <tab id="dataChoicesTab" label="&dataChoicesTab.label;"/>
-#endif
-    <tab id="networkTab" label="&networkTab.label;"/>
-    <tab id="updateTab" label="&updateTab.label;"/>
-    <tab id="encryptionTab" label="&certificateTab.label;"/>
-  </tabs>
-
-  <tabpanels flex="1">
-
-    <!-- General -->
-    <tabpanel id="generalPanel" orient="vertical">
-      <!-- Accessibility -->
-      <groupbox id="accessibilityGroup" align="start">
-        <caption><label>&accessibility.label;</label></caption>
-
-#ifdef XP_WIN
-        <checkbox id="useOnScreenKeyboard"
-                  hidden="true"
-                  label="&useOnScreenKeyboard.label;"
-                  accesskey="&useOnScreenKeyboard.accesskey;"
-                  preference="ui.osk.enabled"/>
-#endif
-        <checkbox id="useCursorNavigation"
-                  label="&useCursorNavigation.label;"
-                  accesskey="&useCursorNavigation.accesskey;"
-                  preference="accessibility.browsewithcaret"/>
-        <checkbox id="searchStartTyping"
-                  label="&searchOnStartTyping.label;"
-                  accesskey="&searchOnStartTyping.accesskey;"
-                  preference="accessibility.typeaheadfind"/>
-        <checkbox id="blockAutoRefresh"
-                  label="&blockAutoReload.label;"
-                  accesskey="&blockAutoReload.accesskey;"
-                  preference="accessibility.blockautorefresh"/>
-      </groupbox>
-      <!-- Browsing -->
-      <groupbox id="browsingGroup" align="start">
-        <caption><label>&browsing.label;</label></caption>
-
-        <checkbox id="useAutoScroll"
-                  label="&useAutoScroll.label;"
-                  accesskey="&useAutoScroll.accesskey;"
-                  preference="general.autoScroll"/>
-        <checkbox id="useSmoothScrolling"
-                  label="&useSmoothScrolling.label;"
-                  accesskey="&useSmoothScrolling.accesskey;"
-                  preference="general.smoothScroll"/>
-        <checkbox id="checkSpelling"
-                  label="&checkUserSpelling.label;"
-                  accesskey="&checkUserSpelling.accesskey;"
-                  onsyncfrompreference="return gAdvancedPane.readCheckSpelling();"
-                  onsynctopreference="return gAdvancedPane.writeCheckSpelling();"
-                  preference="layout.spellcheckDefault"/>
-      </groupbox>
-    </tabpanel>
-#ifdef MOZ_DATA_REPORTING
-    <!-- Data Choices -->
-    <tabpanel id="dataChoicesPanel" orient="vertical">
-#ifdef MOZ_TELEMETRY_REPORTING
-      <groupbox>
-        <caption>
-          <checkbox id="submitHealthReportBox" label="&enableHealthReport.label;"
-                    accesskey="&enableHealthReport.accesskey;"/>
-        </caption>
-        <vbox>
-          <hbox class="indent" flex="1">
-            <label flex="1">&healthReportDesc.label;</label>
-            <label id="FHRLearnMore" flex="1"
-                   class="learnMore text-link">&healthReportLearnMore.label;</label>
-          </hbox>
-          <hbox class="indent">
-            <groupbox flex="1">
-              <caption>
-                <checkbox id="submitTelemetryBox" preference="toolkit.telemetry.enabled"
-                          label="&enableTelemetryData.label;"
-                          accesskey="&enableTelemetryData.accesskey;"/>
-              </caption>
-              <hbox class="indent" flex="1">
-                <label id="telemetryDataDesc" flex="1">&telemetryDesc.label;</label>
-                <label id="telemetryLearnMore" flex="1"
-                       class="learnMore text-link">&telemetryLearnMore.label;</label>
-              </hbox>
-            </groupbox>
-          </hbox>
-        </vbox>
-      </groupbox>
-#endif
-#ifdef MOZ_CRASHREPORTER
-      <groupbox>
-        <caption>
-          <checkbox id="automaticallySubmitCrashesBox"
-                    preference="browser.crashReports.unsubmittedCheck.autoSubmit"
-                    label="&alwaysSubmitCrashReports.label;"
-                    accesskey="&alwaysSubmitCrashReports.accesskey;"/>
-        </caption>
-        <hbox class="indent" flex="1">
-          <label flex="1">&crashReporterDesc2.label;</label>
-          <label id="crashReporterLearnMore" flex="1"
-                 class="learnMore text-link">&crashReporterLearnMore.label;</label>
-        </hbox>
-      </groupbox>
-#endif
-    </tabpanel>
-#endif
-
-    <!-- Network -->
-    <tabpanel id="networkPanel" orient="vertical">
-
-      <!-- Connection -->
-      <groupbox id="connectionGroup">
-        <caption><label>&connection.label;</label></caption>
-
-        <hbox align="center">
-          <description flex="1" control="connectionSettings">&connectionDesc.label;</description>
-          <button id="connectionSettings" icon="network" label="&connectionSettings.label;"
-                  accesskey="&connectionSettings.accesskey;"/>
-        </hbox>
-      </groupbox>
-
-      <!-- Cache -->
-      <groupbox id="cacheGroup">
-        <caption><label>&httpCache.label;</label></caption>
-
-        <hbox align="center">
-          <label id="actualDiskCacheSize" flex="1"/>
-          <button id="clearCacheButton" icon="clear"
-                  label="&clearCacheNow.label;" accesskey="&clearCacheNow.accesskey;"/>
-        </hbox>
-        <hbox>
-          <checkbox preference="browser.cache.disk.smart_size.enabled"
-                    id="allowSmartSize"
-                    onsyncfrompreference="return gAdvancedPane.readSmartSizeEnabled();"
-                    label="&overrideSmartCacheSize.label;"
-                    accesskey="&overrideSmartCacheSize.accesskey;"/>
-        </hbox>
-        <hbox align="center" class="indent">
-          <label id="useCacheBefore" control="cacheSize"
-                 accesskey="&limitCacheSizeBefore.accesskey;">
-            &limitCacheSizeBefore.label;
-          </label>
-          <textbox id="cacheSize" type="number" size="4" max="1024"
-                   aria-labelledby="useCacheBefore cacheSize useCacheAfter"/>
-          <label id="useCacheAfter" flex="1">&limitCacheSizeAfter.label;</label>
-        </hbox>
-      </groupbox>
-
-      <!-- Offline apps -->
-      <groupbox id="offlineGroup" hidden="true">
-        <caption><label>&offlineStorage2.label;</label></caption>
-
-        <hbox align="center">
-          <label id="actualAppCacheSize" flex="1"/>
-          <button id="clearOfflineAppCacheButton" icon="clear"
-                  label="&clearOfflineAppCacheNow.label;" accesskey="&clearOfflineAppCacheNow.accesskey;"/>
-        </hbox>
-        <hbox align="center">
-          <checkbox id="offlineNotify"
-                    label="&offlineStorageNotify.label;" accesskey="&offlineStorageNotify.accesskey;"
-                    preference="browser.offline-apps.notify"
-                    onsyncfrompreference="return gAdvancedPane.readOfflineNotify();"/>
-          <spacer flex="1"/>
-          <button id="offlineNotifyExceptions"
-                  label="&offlineStorageNotifyExceptions.label;"
-                  accesskey="&offlineStorageNotifyExceptions.accesskey;"/>
-        </hbox>
-        <hbox>
-          <vbox flex="1">
-            <label id="offlineAppsListLabel">&offlineAppsList2.label;</label>
-            <listbox id="offlineAppsList"
-                    flex="1"
-                    aria-labelledby="offlineAppsListLabel">
-            </listbox>
-          </vbox>
-          <vbox pack="end">
-            <button id="offlineAppsListRemove"
-                    disabled="true"
-                    label="&offlineAppsListRemove.label;"
-                    accesskey="&offlineAppsListRemove.accesskey;"/>
-          </vbox>
-        </hbox>
-      </groupbox>
-
-      <!-- Site Data -->
-      <groupbox id="siteDataGroup" hidden="true">
-        <caption><label>&siteData.label;</label></caption>
-
-        <hbox align="baseline">
-          <label id="totalSiteDataSize"></label>
-          <label id="siteDataLearnMoreLink" class="learnMore text-link" value="&siteDataLearnMoreLink.label;"></label>
-          <spacer flex="1" />
-          <button id="clearSiteDataButton" icon="clear"
-                  label="&clearSiteData.label;" accesskey="&clearSiteData.accesskey;"/>
-        </hbox>
-        <vbox align="end">
-          <button id="siteDataSettings"
-                  label="&siteDataSettings.label;"
-                  accesskey="&siteDataSettings.accesskey;"/>
-        </vbox>
-      </groupbox>
-    </tabpanel>
-
-    <!-- Update -->
-    <tabpanel id="updatePanel" orient="vertical">
-#ifdef MOZ_UPDATER
-      <groupbox id="updateApp" align="start">
-        <caption><label>&updateApplication.label;</label></caption>
-        <radiogroup id="updateRadioGroup" align="start">
-          <radio id="autoDesktop"
-                 value="auto"
-                 label="&updateAuto1.label;"
-                 accesskey="&updateAuto1.accesskey;"/>
-          <radio value="checkOnly"
-                label="&updateCheckChoose.label;"
-                accesskey="&updateCheckChoose.accesskey;"/>
-          <radio value="manual"
-                label="&updateManual.label;"
-                accesskey="&updateManual.accesskey;"/>
-        </radiogroup>
-        <separator class="thin"/>
-        <hbox>
-          <button id="showUpdateHistory"
-                  label="&updateHistory.label;"
-                  accesskey="&updateHistory.accesskey;"
-                  preference="app.update.disable_button.showUpdateHistory"/>
-        </hbox>
-
-#ifdef MOZ_MAINTENANCE_SERVICE
-        <checkbox id="useService"
-                  label="&useService.label;"
-                  accesskey="&useService.accesskey;"
-                  preference="app.update.service.enabled"/>
-#endif
-      </groupbox>
-#endif
-      <groupbox id="updateOthers" align="start">
-        <caption><label>&autoUpdateOthers.label;</label></caption>
-        <checkbox id="enableSearchUpdate"
-                  label="&enableSearchUpdate.label;"
-                  accesskey="&enableSearchUpdate.accesskey;"
-                  preference="browser.search.update"/>
-      </groupbox>
-    </tabpanel>
-
-    <!-- Certificates -->
-    <tabpanel id="encryptionPanel" orient="vertical">
-      <groupbox id="certSelection" align="start">
-        <caption><label>&certPersonal.label;</label></caption>
-        <description id="CertSelectionDesc" control="certSelection">&certPersonal.description;</description>
-
-        <!--
-          The values on these radio buttons may look like l12y issues, but
-          they're not - this preference uses *those strings* as its values.
-          I KID YOU NOT.
-        -->
-        <radiogroup id="certSelection"
-                    preftype="string"
-                    preference="security.default_personal_cert"
-                    aria-labelledby="CertSelectionDesc">
-          <radio label="&selectCerts.auto;"
-                 accesskey="&selectCerts.auto.accesskey;"
-                 value="Select Automatically"/>
-          <radio label="&selectCerts.ask;"
-                 accesskey="&selectCerts.ask.accesskey;"
-                 value="Ask Every Time"/>
-        </radiogroup>
-      </groupbox>
-      <separator/>
-      <checkbox id="enableOCSP"
-                label="&enableOCSP.label;"
-                accesskey="&enableOCSP.accesskey;"
-                onsyncfrompreference="return gAdvancedPane.readEnableOCSP();"
-                onsynctopreference="return gAdvancedPane.writeEnableOCSP();"
-                preference="security.OCSP.enabled"/>
-      <separator/>
-      <hbox>
-        <button id="viewCertificatesButton"
-                flex="1"
-                label="&viewCerts.label;"
-                accesskey="&viewCerts.accesskey;"
-                preference="security.disable_button.openCertManager"/>
-        <button id="viewSecurityDevicesButton"
-                flex="1"
-                label="&viewSecurityDevices.label;"
-                accesskey="&viewSecurityDevices.accesskey;"
-                preference="security.disable_button.openDeviceManager"/>
-        <hbox flex="10"/>
-      </hbox>
-    </tabpanel>
-  </tabpanels>
-</tabbox>
deleted file mode 100644
--- a/browser/components/preferences/in-content-old/applications.js
+++ /dev/null
@@ -1,1897 +0,0 @@
-/* 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/. */
-
-/* import-globals-from preferences.js */
-
-"use strict";
-
-// Constants & Enumeration Values
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/AppConstants.jsm");
-const TYPE_MAYBE_FEED = "application/vnd.mozilla.maybe.feed";
-const TYPE_MAYBE_VIDEO_FEED = "application/vnd.mozilla.maybe.video.feed";
-const TYPE_MAYBE_AUDIO_FEED = "application/vnd.mozilla.maybe.audio.feed";
-const TYPE_PDF = "application/pdf";
-
-const PREF_PDFJS_DISABLED = "pdfjs.disabled";
-const TOPIC_PDFJS_HANDLER_CHANGED = "pdfjs:handlerChanged";
-
-const PREF_DISABLED_PLUGIN_TYPES = "plugin.disable_full_page_plugin_for_types";
-
-// Preferences that affect which entries to show in the list.
-const PREF_SHOW_PLUGINS_IN_LIST = "browser.download.show_plugins_in_list";
-const PREF_HIDE_PLUGINS_WITHOUT_EXTENSIONS =
-  "browser.download.hide_plugins_without_extensions";
-
-/*
- * Preferences where we store handling information about the feed type.
- *
- * browser.feeds.handler
- * - "bookmarks", "reader" (clarified further using the .default preference),
- *   or "ask" -- indicates the default handler being used to process feeds;
- *   "bookmarks" is obsolete; to specify that the handler is bookmarks,
- *   set browser.feeds.handler.default to "bookmarks";
- *
- * browser.feeds.handler.default
- * - "bookmarks", "client" or "web" -- indicates the chosen feed reader used
- *   to display feeds, either transiently (i.e., when the "use as default"
- *   checkbox is unchecked, corresponds to when browser.feeds.handler=="ask")
- *   or more permanently (i.e., the item displayed in the dropdown in Feeds
- *   preferences)
- *
- * browser.feeds.handler.webservice
- * - the URL of the currently selected web service used to read feeds
- *
- * browser.feeds.handlers.application
- * - nsILocalFile, stores the current client-side feed reading app if one has
- *   been chosen
- */
-const PREF_FEED_SELECTED_APP    = "browser.feeds.handlers.application";
-const PREF_FEED_SELECTED_WEB    = "browser.feeds.handlers.webservice";
-const PREF_FEED_SELECTED_ACTION = "browser.feeds.handler";
-const PREF_FEED_SELECTED_READER = "browser.feeds.handler.default";
-
-const PREF_VIDEO_FEED_SELECTED_APP    = "browser.videoFeeds.handlers.application";
-const PREF_VIDEO_FEED_SELECTED_WEB    = "browser.videoFeeds.handlers.webservice";
-const PREF_VIDEO_FEED_SELECTED_ACTION = "browser.videoFeeds.handler";
-const PREF_VIDEO_FEED_SELECTED_READER = "browser.videoFeeds.handler.default";
-
-const PREF_AUDIO_FEED_SELECTED_APP    = "browser.audioFeeds.handlers.application";
-const PREF_AUDIO_FEED_SELECTED_WEB    = "browser.audioFeeds.handlers.webservice";
-const PREF_AUDIO_FEED_SELECTED_ACTION = "browser.audioFeeds.handler";
-const PREF_AUDIO_FEED_SELECTED_READER = "browser.audioFeeds.handler.default";
-
-// The nsHandlerInfoAction enumeration values in nsIHandlerInfo identify
-// the actions the application can take with content of various types.
-// But since nsIHandlerInfo doesn't support plugins, there's no value
-// identifying the "use plugin" action, so we use this constant instead.
-const kActionUsePlugin = 5;
-
-const ICON_URL_APP = AppConstants.platform == "linux" ?
-                     "moz-icon://dummy.exe?size=16" :
-                     "chrome://browser/skin/preferences/application.png";
-
-// For CSS. Can be one of "ask", "save", "plugin" or "feed". If absent, the icon URL
-// was set by us to a custom handler icon and CSS should not try to override it.
-const APP_ICON_ATTR_NAME = "appHandlerIcon";
-
-// Utilities
-
-function getFileDisplayName(file) {
-  if (AppConstants.platform == "win") {
-    if (file instanceof Ci.nsILocalFileWin) {
-      try {
-        return file.getVersionInfoField("FileDescription");
-      } catch (e) {}
-    }
-  }
-  if (AppConstants.platform == "macosx") {
-    if (file instanceof Ci.nsILocalFileMac) {
-      try {
-        return file.bundleDisplayName;
-      } catch (e) {}
-    }
-  }
-  return file.leafName;
-}
-
-function getLocalHandlerApp(aFile) {
-  var localHandlerApp = Cc["@mozilla.org/uriloader/local-handler-app;1"].
-                        createInstance(Ci.nsILocalHandlerApp);
-  localHandlerApp.name = getFileDisplayName(aFile);
-  localHandlerApp.executable = aFile;
-
-  return localHandlerApp;
-}
-
-/**
- * An enumeration of items in a JS array.
- *
- * FIXME: use ArrayConverter once it lands (bug 380839).
- *
- * @constructor
- */
-function ArrayEnumerator(aItems) {
-  this._index = 0;
-  this._contents = aItems;
-}
-
-ArrayEnumerator.prototype = {
-  _index: 0,
-
-  hasMoreElements() {
-    return this._index < this._contents.length;
-  },
-
-  getNext() {
-    return this._contents[this._index++];
-  }
-};
-
-function isFeedType(t) {
-  return t == TYPE_MAYBE_FEED || t == TYPE_MAYBE_VIDEO_FEED || t == TYPE_MAYBE_AUDIO_FEED;
-}
-
-// HandlerInfoWrapper
-
-/**
- * This object wraps nsIHandlerInfo with some additional functionality
- * the Applications prefpane needs to display and allow modification of
- * the list of handled types.
- *
- * We create an instance of this wrapper for each entry we might display
- * in the prefpane, and we compose the instances from various sources,
- * including plugins and the handler service.
- *
- * We don't implement all the original nsIHandlerInfo functionality,
- * just the stuff that the prefpane needs.
- *
- * In theory, all of the custom functionality in this wrapper should get
- * pushed down into nsIHandlerInfo eventually.
- */
-function HandlerInfoWrapper(aType, aHandlerInfo) {
-  this._type = aType;
-  this.wrappedHandlerInfo = aHandlerInfo;
-}
-
-HandlerInfoWrapper.prototype = {
-  // The wrapped nsIHandlerInfo object.  In general, this object is private,
-  // but there are a couple cases where callers access it directly for things
-  // we haven't (yet?) implemented, so we make it a public property.
-  wrappedHandlerInfo: null,
-
-
-  // Convenience Utils
-
-  _handlerSvc: Cc["@mozilla.org/uriloader/handler-service;1"].
-               getService(Ci.nsIHandlerService),
-
-  _prefSvc: Cc["@mozilla.org/preferences-service;1"].
-            getService(Ci.nsIPrefBranch),
-
-  _categoryMgr: Cc["@mozilla.org/categorymanager;1"].
-                getService(Ci.nsICategoryManager),
-
-  element(aID) {
-    return document.getElementById(aID);
-  },
-
-
-  // nsIHandlerInfo
-
-  // The MIME type or protocol scheme.
-  _type: null,
-  get type() {
-    return this._type;
-  },
-
-  get description() {
-    if (this.wrappedHandlerInfo.description)
-      return this.wrappedHandlerInfo.description;
-
-    if (this.primaryExtension) {
-      var extension = this.primaryExtension.toUpperCase();
-      return this.element("bundlePreferences").getFormattedString("fileEnding",
-                                                                  [extension]);
-    }
-
-    return this.type;
-  },
-
-  get preferredApplicationHandler() {
-    return this.wrappedHandlerInfo.preferredApplicationHandler;
-  },
-
-  set preferredApplicationHandler(aNewValue) {
-    this.wrappedHandlerInfo.preferredApplicationHandler = aNewValue;
-
-    // Make sure the preferred handler is in the set of possible handlers.
-    if (aNewValue)
-      this.addPossibleApplicationHandler(aNewValue)
-  },
-
-  get possibleApplicationHandlers() {
-    return this.wrappedHandlerInfo.possibleApplicationHandlers;
-  },
-
-  addPossibleApplicationHandler(aNewHandler) {
-    var possibleApps = this.possibleApplicationHandlers.enumerate();
-    while (possibleApps.hasMoreElements()) {
-      if (possibleApps.getNext().equals(aNewHandler))
-        return;
-    }
-    this.possibleApplicationHandlers.appendElement(aNewHandler);
-  },
-
-  removePossibleApplicationHandler(aHandler) {
-    var defaultApp = this.preferredApplicationHandler;
-    if (defaultApp && aHandler.equals(defaultApp)) {
-      // If the app we remove was the default app, we must make sure
-      // it won't be used anymore
-      this.alwaysAskBeforeHandling = true;
-      this.preferredApplicationHandler = null;
-    }
-
-    var handlers = this.possibleApplicationHandlers;
-    for (var i = 0; i < handlers.length; ++i) {
-      var handler = handlers.queryElementAt(i, Ci.nsIHandlerApp);
-      if (handler.equals(aHandler)) {
-        handlers.removeElementAt(i);
-        break;
-      }
-    }
-  },
-
-  get hasDefaultHandler() {
-    return this.wrappedHandlerInfo.hasDefaultHandler;
-  },
-
-  get defaultDescription() {
-    return this.wrappedHandlerInfo.defaultDescription;
-  },
-
-  // What to do with content of this type.
-  get preferredAction() {
-    // If we have an enabled plugin, then the action is to use that plugin.
-    if (this.pluginName && !this.isDisabledPluginType)
-      return kActionUsePlugin;
-
-    // If the action is to use a helper app, but we don't have a preferred
-    // handler app, then switch to using the system default, if any; otherwise
-    // fall back to saving to disk, which is the default action in nsMIMEInfo.
-    // Note: "save to disk" is an invalid value for protocol info objects,
-    // but the alwaysAskBeforeHandling getter will detect that situation
-    // and always return true in that case to override this invalid value.
-    if (this.wrappedHandlerInfo.preferredAction == Ci.nsIHandlerInfo.useHelperApp &&
-        !gApplicationsPane.isValidHandlerApp(this.preferredApplicationHandler)) {
-      if (this.wrappedHandlerInfo.hasDefaultHandler)
-        return Ci.nsIHandlerInfo.useSystemDefault;
-      return Ci.nsIHandlerInfo.saveToDisk;
-    }
-
-    return this.wrappedHandlerInfo.preferredAction;
-  },
-
-  set preferredAction(aNewValue) {
-    // If the action is to use the plugin,
-    // we must set the preferred action to "save to disk".
-    // But only if it's not currently the preferred action.
-    if ((aNewValue == kActionUsePlugin) &&
-        (this.preferredAction != Ci.nsIHandlerInfo.saveToDisk)) {
-      aNewValue = Ci.nsIHandlerInfo.saveToDisk;
-    }
-
-    // We don't modify the preferred action if the new action is to use a plugin
-    // because handler info objects don't understand our custom "use plugin"
-    // value.  Also, leaving it untouched means that we can automatically revert
-    // to the old setting if the user ever removes the plugin.
-
-    if (aNewValue != kActionUsePlugin)
-      this.wrappedHandlerInfo.preferredAction = aNewValue;
-  },
-
-  get alwaysAskBeforeHandling() {
-    // If this type is handled only by a plugin, we can't trust the value
-    // in the handler info object, since it'll be a default based on the absence
-    // of any user configuration, and the default in that case is to always ask,
-    // even though we never ask for content handled by a plugin, so special case
-    // plugin-handled types by returning false here.
-    if (this.pluginName && this.handledOnlyByPlugin)
-      return false;
-
-    // If this is a protocol type and the preferred action is "save to disk",
-    // which is invalid for such types, then return true here to override that
-    // action.  This could happen when the preferred action is to use a helper
-    // app, but the preferredApplicationHandler is invalid, and there isn't
-    // a default handler, so the preferredAction getter returns save to disk
-    // instead.
-    if (!(this.wrappedHandlerInfo instanceof Ci.nsIMIMEInfo) &&
-        this.preferredAction == Ci.nsIHandlerInfo.saveToDisk)
-      return true;
-
-    return this.wrappedHandlerInfo.alwaysAskBeforeHandling;
-  },
-
-  set alwaysAskBeforeHandling(aNewValue) {
-    this.wrappedHandlerInfo.alwaysAskBeforeHandling = aNewValue;
-  },
-
-
-  // nsIMIMEInfo
-
-  // The primary file extension associated with this type, if any.
-  //
-  // XXX Plugin objects contain an array of MimeType objects with "suffixes"
-  // properties; if this object has an associated plugin, shouldn't we check
-  // those properties for an extension?
-  get primaryExtension() {
-    try {
-      if (this.wrappedHandlerInfo instanceof Ci.nsIMIMEInfo &&
-          this.wrappedHandlerInfo.primaryExtension)
-        return this.wrappedHandlerInfo.primaryExtension
-    } catch (ex) {}
-
-    return null;
-  },
-
-
-  // Plugin Handling
-
-  // A plugin that can handle this type, if any.
-  //
-  // Note: just because we have one doesn't mean it *will* handle the type.
-  // That depends on whether or not the type is in the list of types for which
-  // plugin handling is disabled.
-  plugin: null,
-
-  // Whether or not this type is only handled by a plugin or is also handled
-  // by some user-configured action as specified in the handler info object.
-  //
-  // Note: we can't just check if there's a handler info object for this type,
-  // because OS and user configuration is mixed up in the handler info object,
-  // so we always need to retrieve it for the OS info and can't tell whether
-  // it represents only OS-default information or user-configured information.
-  //
-  // FIXME: once handler info records are broken up into OS-provided records
-  // and user-configured records, stop using this boolean flag and simply
-  // check for the presence of a user-configured record to determine whether
-  // or not this type is only handled by a plugin.  Filed as bug 395142.
-  handledOnlyByPlugin: undefined,
-
-  get isDisabledPluginType() {
-    return this._getDisabledPluginTypes().indexOf(this.type) != -1;
-  },
-
-  _getDisabledPluginTypes() {
-    var types = "";
-
-    if (this._prefSvc.prefHasUserValue(PREF_DISABLED_PLUGIN_TYPES))
-      types = this._prefSvc.getCharPref(PREF_DISABLED_PLUGIN_TYPES);
-
-    // Only split if the string isn't empty so we don't end up with an array
-    // containing a single empty string.
-    if (types != "")
-      return types.split(",");
-
-    return [];
-  },
-
-  disablePluginType() {
-    var disabledPluginTypes = this._getDisabledPluginTypes();
-
-    if (disabledPluginTypes.indexOf(this.type) == -1)
-      disabledPluginTypes.push(this.type);
-
-    this._prefSvc.setCharPref(PREF_DISABLED_PLUGIN_TYPES,
-                              disabledPluginTypes.join(","));
-
-    // Update the category manager so existing browser windows update.
-    this._categoryMgr.deleteCategoryEntry("Gecko-Content-Viewers",
-                                          this.type,
-                                          false);
-  },
-
-  enablePluginType() {
-    var disabledPluginTypes = this._getDisabledPluginTypes();
-
-    var type = this.type;
-    disabledPluginTypes = disabledPluginTypes.filter(v => v != type);
-
-    this._prefSvc.setCharPref(PREF_DISABLED_PLUGIN_TYPES,
-                              disabledPluginTypes.join(","));
-
-    // Update the category manager so existing browser windows update.
-    this._categoryMgr.
-      addCategoryEntry("Gecko-Content-Viewers",
-                       this.type,
-                       "@mozilla.org/content/plugin/document-loader-factory;1",
-                       false,
-                       true);
-  },
-
-
-  // Storage
-
-  store() {
-    this._handlerSvc.store(this.wrappedHandlerInfo);
-  },
-
-
-  // Icons
-
-  get smallIcon() {
-    return this._getIcon(16);
-  },
-
-  _getIcon(aSize) {
-    if (this.primaryExtension)
-      return "moz-icon://goat." + this.primaryExtension + "?size=" + aSize;
-
-    if (this.wrappedHandlerInfo instanceof Ci.nsIMIMEInfo)
-      return "moz-icon://goat?size=" + aSize + "&contentType=" + this.type;
-
-    // FIXME: consider returning some generic icon when we can't get a URL for
-    // one (for example in the case of protocol schemes).  Filed as bug 395141.
-    return null;
-  }
-
-};
-
-
-// Feed Handler Info
-
-/**
- * This object implements nsIHandlerInfo for the feed types.  It's a separate
- * object because we currently store handling information for the feed type
- * in a set of preferences rather than the nsIHandlerService-managed datastore.
- *
- * This object inherits from HandlerInfoWrapper in order to get functionality
- * that isn't special to the feed type.
- *
- * XXX Should we inherit from HandlerInfoWrapper?  After all, we override
- * most of that wrapper's properties and methods, and we have to dance around
- * the fact that the wrapper expects to have a wrappedHandlerInfo, which we
- * don't provide.
- */
-
-function FeedHandlerInfo(aMIMEType) {
-  HandlerInfoWrapper.call(this, aMIMEType, null);
-}
-
-FeedHandlerInfo.prototype = {
-  __proto__: HandlerInfoWrapper.prototype,
-
-  // Convenience Utils
-
-  _converterSvc:
-    Cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"].
-    getService(Ci.nsIWebContentConverterService),
-
-  _shellSvc: AppConstants.HAVE_SHELL_SERVICE ? getShellService() : null,
-
-  // nsIHandlerInfo
-
-  get description() {
-    return this.element("bundlePreferences").getString(this._appPrefLabel);
-  },
-
-  get preferredApplicationHandler() {
-    switch (this.element(this._prefSelectedReader).value) {
-      case "client":
-        var file = this.element(this._prefSelectedApp).value;
-        if (file)
-          return getLocalHandlerApp(file);
-
-        return null;
-
-      case "web":
-        var uri = this.element(this._prefSelectedWeb).value;
-        if (!uri)
-          return null;
-        return this._converterSvc.getWebContentHandlerByURI(this.type, uri);
-
-      case "bookmarks":
-      default:
-        // When the pref is set to bookmarks, we handle feeds internally,
-        // we don't forward them to a local or web handler app, so there is
-        // no preferred handler.
-        return null;
-    }
-  },
-
-  set preferredApplicationHandler(aNewValue) {
-    if (aNewValue instanceof Ci.nsILocalHandlerApp) {
-      this.element(this._prefSelectedApp).value = aNewValue.executable;
-      this.element(this._prefSelectedReader).value = "client";
-    } else if (aNewValue instanceof Ci.nsIWebContentHandlerInfo) {
-      this.element(this._prefSelectedWeb).value = aNewValue.uri;
-      this.element(this._prefSelectedReader).value = "web";
-      // Make the web handler be the new "auto handler" for feeds.
-      // Note: we don't have to unregister the auto handler when the user picks
-      // a non-web handler (local app, Live Bookmarks, etc.) because the service
-      // only uses the "auto handler" when the selected reader is a web handler.
-      // We also don't have to unregister it when the user turns on "always ask"
-      // (i.e. preview in browser), since that also overrides the auto handler.
-      this._converterSvc.setAutoHandler(this.type, aNewValue);
-    }
-  },
-
-  _possibleApplicationHandlers: null,
-
-  get possibleApplicationHandlers() {
-    if (this._possibleApplicationHandlers)
-      return this._possibleApplicationHandlers;
-
-    // A minimal implementation of nsIMutableArray.  It only supports the two
-    // methods its callers invoke, namely appendElement and nsIArray::enumerate.
-    this._possibleApplicationHandlers = {
-      _inner: [],
-      _removed: [],
-
-      QueryInterface(aIID) {
-        if (aIID.equals(Ci.nsIMutableArray) ||
-            aIID.equals(Ci.nsIArray) ||
-            aIID.equals(Ci.nsISupports))
-          return this;
-
-        throw Cr.NS_ERROR_NO_INTERFACE;
-      },
-
-      get length() {
-        return this._inner.length;
-      },
-
-      enumerate() {
-        return new ArrayEnumerator(this._inner);
-      },
-
-      appendElement(aHandlerApp, aWeak) {
-        this._inner.push(aHandlerApp);
-      },
-
-      removeElementAt(aIndex) {
-        this._removed.push(this._inner[aIndex]);
-        this._inner.splice(aIndex, 1);
-      },
-
-      queryElementAt(aIndex, aInterface) {
-        return this._inner[aIndex].QueryInterface(aInterface);
-      }
-    };
-
-    // Add the selected local app if it's different from the OS default handler.
-    // Unlike for other types, we can store only one local app at a time for the
-    // feed type, since we store it in a preference that historically stores
-    // only a single path.  But we display all the local apps the user chooses
-    // while the prefpane is open, only dropping the list when the user closes
-    // the prefpane, for maximum usability and consistency with other types.
-    var preferredAppFile = this.element(this._prefSelectedApp).value;
-    if (preferredAppFile) {
-      let preferredApp = getLocalHandlerApp(preferredAppFile);
-      let defaultApp = this._defaultApplicationHandler;
-      if (!defaultApp || !defaultApp.equals(preferredApp))
-        this._possibleApplicationHandlers.appendElement(preferredApp);
-    }
-
-    // Add the registered web handlers.  There can be any number of these.
-    var webHandlers = this._converterSvc.getContentHandlers(this.type);
-    for (let webHandler of webHandlers)
-      this._possibleApplicationHandlers.appendElement(webHandler);
-
-    return this._possibleApplicationHandlers;
-  },
-
-  __defaultApplicationHandler: undefined,
-  get _defaultApplicationHandler() {
-    if (typeof this.__defaultApplicationHandler != "undefined")
-      return this.__defaultApplicationHandler;
-
-    var defaultFeedReader = null;
-    if (AppConstants.HAVE_SHELL_SERVICE) {
-      try {
-        defaultFeedReader = this._shellSvc.defaultFeedReader;
-      } catch (ex) {
-        // no default reader or _shellSvc is null
-      }
-    }
-
-    if (defaultFeedReader) {
-      let handlerApp = Cc["@mozilla.org/uriloader/local-handler-app;1"].
-                       createInstance(Ci.nsIHandlerApp);
-      handlerApp.name = getFileDisplayName(defaultFeedReader);
-      handlerApp.QueryInterface(Ci.nsILocalHandlerApp);
-      handlerApp.executable = defaultFeedReader;
-
-      this.__defaultApplicationHandler = handlerApp;
-    } else {
-      this.__defaultApplicationHandler = null;
-    }
-
-    return this.__defaultApplicationHandler;
-  },
-
-  get hasDefaultHandler() {
-    if (AppConstants.HAVE_SHELL_SERVICE) {
-      try {
-        if (this._shellSvc.defaultFeedReader)
-          return true;
-      } catch (ex) {
-        // no default reader or _shellSvc is null
-      }
-    }
-
-    return false;
-  },
-
-  get defaultDescription() {
-    if (this.hasDefaultHandler)
-      return this._defaultApplicationHandler.name;
-
-    // Should we instead return null?
-    return "";
-  },
-
-  // What to do with content of this type.
-  get preferredAction() {
-    switch (this.element(this._prefSelectedAction).value) {
-
-      case "bookmarks":
-        return Ci.nsIHandlerInfo.handleInternally;
-
-      case "reader": {
-        let preferredApp = this.preferredApplicationHandler;
-        let defaultApp = this._defaultApplicationHandler;
-
-        // If we have a valid preferred app, return useSystemDefault if it's
-        // the default app; otherwise return useHelperApp.
-        if (gApplicationsPane.isValidHandlerApp(preferredApp)) {
-          if (defaultApp && defaultApp.equals(preferredApp))
-            return Ci.nsIHandlerInfo.useSystemDefault;
-
-          return Ci.nsIHandlerInfo.useHelperApp;
-        }
-
-        // The pref is set to "reader", but we don't have a valid preferred app.
-        // What do we do now?  Not sure this is the best option (perhaps we
-        // should direct the user to the default app, if any), but for now let's
-        // direct the user to live bookmarks.
-        return Ci.nsIHandlerInfo.handleInternally;
-      }
-
-      // If the action is "ask", then alwaysAskBeforeHandling will override
-      // the action, so it doesn't matter what we say it is, it just has to be
-      // something that doesn't cause the controller to hide the type.
-      case "ask":
-      default:
-        return Ci.nsIHandlerInfo.handleInternally;
-    }
-  },
-
-  set preferredAction(aNewValue) {
-    switch (aNewValue) {
-
-      case Ci.nsIHandlerInfo.handleInternally:
-        this.element(this._prefSelectedReader).value = "bookmarks";
-        break;
-
-      case Ci.nsIHandlerInfo.useHelperApp:
-        this.element(this._prefSelectedAction).value = "reader";
-        // The controller has already set preferredApplicationHandler
-        // to the new helper app.
-        break;
-
-      case Ci.nsIHandlerInfo.useSystemDefault:
-        this.element(this._prefSelectedAction).value = "reader";
-        this.preferredApplicationHandler = this._defaultApplicationHandler;
-        break;
-    }
-  },
-
-  get alwaysAskBeforeHandling() {
-    return this.element(this._prefSelectedAction).value == "ask";
-  },
-
-  set alwaysAskBeforeHandling(aNewValue) {
-    if (aNewValue == true)
-      this.element(this._prefSelectedAction).value = "ask";
-    else
-      this.element(this._prefSelectedAction).value = "reader";
-  },
-
-  // Whether or not we are currently storing the action selected by the user.
-  // We use this to suppress notification-triggered updates to the list when
-  // we make changes that may spawn such updates, specifically when we change
-  // the action for the feed type, which results in feed preference updates,
-  // which spawn "pref changed" notifications that would otherwise cause us
-  // to rebuild the view unnecessarily.
-  _storingAction: false,
-
-
-  // nsIMIMEInfo
-
-  get primaryExtension() {
-    return "xml";
-  },
-
-
-  // Storage
-
-  // Changes to the preferred action and handler take effect immediately
-  // (we write them out to the preferences right as they happen),
-  // so we when the controller calls store() after modifying the handlers,
-  // the only thing we need to store is the removal of possible handlers
-  // XXX Should we hold off on making the changes until this method gets called?
-  store() {
-    for (let app of this._possibleApplicationHandlers._removed) {
-      if (app instanceof Ci.nsILocalHandlerApp) {
-        let pref = this.element(PREF_FEED_SELECTED_APP);
-        var preferredAppFile = pref.value;
-        if (preferredAppFile) {
-          let preferredApp = getLocalHandlerApp(preferredAppFile);
-          if (app.equals(preferredApp))
-            pref.reset();
-        }
-      } else {
-        app.QueryInterface(Ci.nsIWebContentHandlerInfo);
-        this._converterSvc.removeContentHandler(app.contentType, app.uri);
-      }
-    }
-    this._possibleApplicationHandlers._removed = [];
-  },
-
-
-  // Icons
-
-  get smallIcon() {
-    return this._smallIcon;
-  }
-
-};
-
-var feedHandlerInfo = {
-  __proto__: new FeedHandlerInfo(TYPE_MAYBE_FEED),
-  _prefSelectedApp: PREF_FEED_SELECTED_APP,
-  _prefSelectedWeb: PREF_FEED_SELECTED_WEB,
-  _prefSelectedAction: PREF_FEED_SELECTED_ACTION,
-  _prefSelectedReader: PREF_FEED_SELECTED_READER,
-  _smallIcon: "chrome://browser/skin/feeds/feedIcon16.png",
-  _appPrefLabel: "webFeed"
-}
-
-var videoFeedHandlerInfo = {
-  __proto__: new FeedHandlerInfo(TYPE_MAYBE_VIDEO_FEED),
-  _prefSelectedApp: PREF_VIDEO_FEED_SELECTED_APP,
-  _prefSelectedWeb: PREF_VIDEO_FEED_SELECTED_WEB,
-  _prefSelectedAction: PREF_VIDEO_FEED_SELECTED_ACTION,
-  _prefSelectedReader: PREF_VIDEO_FEED_SELECTED_READER,
-  _smallIcon: "chrome://browser/skin/feeds/videoFeedIcon16.png",
-  _appPrefLabel: "videoPodcastFeed"
-}
-
-var audioFeedHandlerInfo = {
-  __proto__: new FeedHandlerInfo(TYPE_MAYBE_AUDIO_FEED),
-  _prefSelectedApp: PREF_AUDIO_FEED_SELECTED_APP,
-  _prefSelectedWeb: PREF_AUDIO_FEED_SELECTED_WEB,
-  _prefSelectedAction: PREF_AUDIO_FEED_SELECTED_ACTION,
-  _prefSelectedReader: PREF_AUDIO_FEED_SELECTED_READER,
-  _smallIcon: "chrome://browser/skin/feeds/audioFeedIcon16.png",
-  _appPrefLabel: "audioPodcastFeed"
-}
-
-/**
- * InternalHandlerInfoWrapper provides a basic mechanism to create an internal
- * mime type handler that can be enabled/disabled in the applications preference
- * menu.
- */
-function InternalHandlerInfoWrapper(aMIMEType) {
-  var mimeSvc = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService);
-  var handlerInfo = mimeSvc.getFromTypeAndExtension(aMIMEType, null);
-
-  HandlerInfoWrapper.call(this, aMIMEType, handlerInfo);
-}
-
-InternalHandlerInfoWrapper.prototype = {
-  __proto__: HandlerInfoWrapper.prototype,
-
-  // Override store so we so we can notify any code listening for registration
-  // or unregistration of this handler.
-  store() {
-    HandlerInfoWrapper.prototype.store.call(this);
-    Services.obs.notifyObservers(null, this._handlerChanged);
-  },
-
-  get enabled() {
-    throw Cr.NS_ERROR_NOT_IMPLEMENTED;
-  },
-
-  get description() {
-    return this.element("bundlePreferences").getString(this._appPrefLabel);
-  }
-};
-
-var pdfHandlerInfo = {
-  __proto__: new InternalHandlerInfoWrapper(TYPE_PDF),
-  _handlerChanged: TOPIC_PDFJS_HANDLER_CHANGED,
-  _appPrefLabel: "portableDocumentFormat",
-  get enabled() {
-    return !Services.prefs.getBoolPref(PREF_PDFJS_DISABLED);
-  },
-};
-
-
-// Prefpane Controller
-
-var gApplicationsPane = {
-  // The set of types the app knows how to handle.  A hash of HandlerInfoWrapper
-  // objects, indexed by type.
-  _handledTypes: {},
-
-  // The list of types we can show, sorted by the sort column/direction.
-  // An array of HandlerInfoWrapper objects.  We build this list when we first
-  // load the data and then rebuild it when users change a pref that affects
-  // what types we can show or change the sort column/direction.
-  // Note: this isn't necessarily the list of types we *will* show; if the user
-  // provides a filter string, we'll only show the subset of types in this list
-  // that match that string.
-  _visibleTypes: [],
-
-  // A count of the number of times each visible type description appears.
-  // We use these counts to determine whether or not to annotate descriptions
-  // with their types to distinguish duplicate descriptions from each other.
-  // A hash of integer counts, indexed by string description.
-  _visibleTypeDescriptionCount: {},
-
-
-  // Convenience & Performance Shortcuts
-
-  // These get defined by init().
-  _brandShortName: null,
-  _prefsBundle: null,
-  _list: null,
-  _filter: null,
-
-  _prefSvc: Cc["@mozilla.org/preferences-service;1"].
-            getService(Ci.nsIPrefBranch),
-
-  _mimeSvc: Cc["@mozilla.org/mime;1"].
-            getService(Ci.nsIMIMEService),
-
-  _helperAppSvc: Cc["@mozilla.org/uriloader/external-helper-app-service;1"].
-                 getService(Ci.nsIExternalHelperAppService),
-
-  _handlerSvc: Cc["@mozilla.org/uriloader/handler-service;1"].
-               getService(Ci.nsIHandlerService),
-
-  _ioSvc: Cc["@mozilla.org/network/io-service;1"].
-          getService(Ci.nsIIOService),
-
-
-  // Initialization & Destruction
-
-  init() {
-    function setEventListener(aId, aEventType, aCallback) {
-      document.getElementById(aId)
-              .addEventListener(aEventType, aCallback.bind(gApplicationsPane));
-    }
-
-    // Initialize shortcuts to some commonly accessed elements & values.
-    this._brandShortName =
-      document.getElementById("bundleBrand").getString("brandShortName");
-    this._prefsBundle = document.getElementById("bundlePreferences");
-    this._list = document.getElementById("handlersView");
-    this._filter = document.getElementById("filter");
-
-    // Observe preferences that influence what we display so we can rebuild
-    // the view when they change.
-    this._prefSvc.addObserver(PREF_SHOW_PLUGINS_IN_LIST, this);
-    this._prefSvc.addObserver(PREF_HIDE_PLUGINS_WITHOUT_EXTENSIONS, this);
-    this._prefSvc.addObserver(PREF_FEED_SELECTED_APP, this);
-    this._prefSvc.addObserver(PREF_FEED_SELECTED_WEB, this);
-    this._prefSvc.addObserver(PREF_FEED_SELECTED_ACTION, this);
-    this._prefSvc.addObserver(PREF_FEED_SELECTED_READER, this);
-
-    this._prefSvc.addObserver(PREF_VIDEO_FEED_SELECTED_APP, this);
-    this._prefSvc.addObserver(PREF_VIDEO_FEED_SELECTED_WEB, this);
-    this._prefSvc.addObserver(PREF_VIDEO_FEED_SELECTED_ACTION, this);
-    this._prefSvc.addObserver(PREF_VIDEO_FEED_SELECTED_READER, this);
-
-    this._prefSvc.addObserver(PREF_AUDIO_FEED_SELECTED_APP, this);
-    this._prefSvc.addObserver(PREF_AUDIO_FEED_SELECTED_WEB, this);
-    this._prefSvc.addObserver(PREF_AUDIO_FEED_SELECTED_ACTION, this);
-    this._prefSvc.addObserver(PREF_AUDIO_FEED_SELECTED_READER, this);
-
-
-    setEventListener("focusSearch1", "command", gApplicationsPane.focusFilterBox);
-    setEventListener("focusSearch2", "command", gApplicationsPane.focusFilterBox);
-    setEventListener("filter", "command", gApplicationsPane.filter);
-    setEventListener("handlersView", "select",
-      gApplicationsPane.onSelectionChanged);
-    setEventListener("typeColumn", "click", gApplicationsPane.sort);
-    setEventListener("actionColumn", "click", gApplicationsPane.sort);
-
-    // Listen for window unload so we can remove our preference observers.
-    window.addEventListener("unload", this);
-
-    // Figure out how we should be sorting the list.  We persist sort settings
-    // across sessions, so we can't assume the default sort column/direction.
-    // XXX should we be using the XUL sort service instead?
-    if (document.getElementById("actionColumn").hasAttribute("sortDirection")) {
-      this._sortColumn = document.getElementById("actionColumn");
-      // The typeColumn element always has a sortDirection attribute,
-      // either because it was persisted or because the default value
-      // from the xul file was used.  If we are sorting on the other
-      // column, we should remove it.
-      document.getElementById("typeColumn").removeAttribute("sortDirection");
-    } else
-      this._sortColumn = document.getElementById("typeColumn");
-
-    // Load the data and build the list of handlers.
-    // By doing this in a timeout, we let the preferences dialog resize itself
-    // to an appropriate size before we add a bunch of items to the list.
-    // Otherwise, if there are many items, and the Applications prefpane
-    // is the one that gets displayed when the user first opens the dialog,
-    // the dialog might stretch too much in an attempt to fit them all in.
-    // XXX Shouldn't we perhaps just set a max-height on the richlistbox?
-    var _delayedPaneLoad = function(self) {
-      self._loadData();
-      self._rebuildVisibleTypes();
-      self._sortVisibleTypes();
-      self._rebuildView();
-
-      // Notify observers that the UI is now ready
-      Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService).
-      notifyObservers(window, "app-handler-pane-loaded");
-    }
-    setTimeout(_delayedPaneLoad, 0, this);
-  },
-
-  destroy() {
-    window.removeEventListener("unload", this);
-    this._prefSvc.removeObserver(PREF_SHOW_PLUGINS_IN_LIST, this);
-    this._prefSvc.removeObserver(PREF_HIDE_PLUGINS_WITHOUT_EXTENSIONS, this);
-    this._prefSvc.removeObserver(PREF_FEED_SELECTED_APP, this);
-    this._prefSvc.removeObserver(PREF_FEED_SELECTED_WEB, this);
-    this._prefSvc.removeObserver(PREF_FEED_SELECTED_ACTION, this);
-    this._prefSvc.removeObserver(PREF_FEED_SELECTED_READER, this);
-
-    this._prefSvc.removeObserver(PREF_VIDEO_FEED_SELECTED_APP, this);
-    this._prefSvc.removeObserver(PREF_VIDEO_FEED_SELECTED_WEB, this);
-    this._prefSvc.removeObserver(PREF_VIDEO_FEED_SELECTED_ACTION, this);
-    this._prefSvc.removeObserver(PREF_VIDEO_FEED_SELECTED_READER, this);
-
-    this._prefSvc.removeObserver(PREF_AUDIO_FEED_SELECTED_APP, this);
-    this._prefSvc.removeObserver(PREF_AUDIO_FEED_SELECTED_WEB, this);
-    this._prefSvc.removeObserver(PREF_AUDIO_FEED_SELECTED_ACTION, this);
-    this._prefSvc.removeObserver(PREF_AUDIO_FEED_SELECTED_READER, this);
-  },
-
-
-  // nsISupports
-
-  QueryInterface(aIID) {
-    if (aIID.equals(Ci.nsIObserver) ||
-        aIID.equals(Ci.nsIDOMEventListener ||
-        aIID.equals(Ci.nsISupports)))
-      return this;
-
-    throw Cr.NS_ERROR_NO_INTERFACE;
-  },
-
-
-  // nsIObserver
-
-  observe(aSubject, aTopic, aData) {
-    // Rebuild the list when there are changes to preferences that influence
-    // whether or not to show certain entries in the list.
-    if (aTopic == "nsPref:changed" && !this._storingAction) {
-      // These two prefs alter the list of visible types, so we have to rebuild
-      // that list when they change.
-      if (aData == PREF_SHOW_PLUGINS_IN_LIST ||
-          aData == PREF_HIDE_PLUGINS_WITHOUT_EXTENSIONS) {
-        this._rebuildVisibleTypes();
-        this._sortVisibleTypes();
-      }
-
-      // All the prefs we observe can affect what we display, so we rebuild
-      // the view when any of them changes.
-      this._rebuildView();
-    }
-  },
-
-
-  // nsIDOMEventListener
-
-  handleEvent(aEvent) {
-    if (aEvent.type == "unload") {
-      this.destroy();
-    }
-  },
-
-
-  // Composed Model Construction
-
-  _loadData() {
-    this._loadFeedHandler();
-    this._loadInternalHandlers();
-    this._loadPluginHandlers();
-    this._loadApplicationHandlers();
-  },
-
-  _loadFeedHandler() {
-    this._handledTypes[TYPE_MAYBE_FEED] = feedHandlerInfo;
-    feedHandlerInfo.handledOnlyByPlugin = false;
-
-    this._handledTypes[TYPE_MAYBE_VIDEO_FEED] = videoFeedHandlerInfo;
-    videoFeedHandlerInfo.handledOnlyByPlugin = false;
-
-    this._handledTypes[TYPE_MAYBE_AUDIO_FEED] = audioFeedHandlerInfo;
-    audioFeedHandlerInfo.handledOnlyByPlugin = false;
-  },
-
-  /**
-   * Load higher level internal handlers so they can be turned on/off in the
-   * applications menu.
-   */
-  _loadInternalHandlers() {
-    var internalHandlers = [pdfHandlerInfo];
-    for (let internalHandler of internalHandlers) {
-      if (internalHandler.enabled) {
-        this._handledTypes[internalHandler.type] = internalHandler;
-      }
-    }
-  },
-
-  /**
-   * Load the set of handlers defined by plugins.
-   *
-   * Note: if there's more than one plugin for a given MIME type, we assume
-   * the last one is the one that the application will use.  That may not be
-   * correct, but it's how we've been doing it for years.
-   *
-   * Perhaps we should instead query navigator.mimeTypes for the set of types
-   * supported by the application and then get the plugin from each MIME type's
-   * enabledPlugin property.  But if there's a plugin for a type, we need
-   * to know about it even if it isn't enabled, since we're going to give
-   * the user an option to enable it.
-   *
-   * Also note that enabledPlugin does not get updated when
-   * plugin.disable_full_page_plugin_for_types changes, so even if we could use
-   * enabledPlugin to get the plugin that would be used, we'd still need to
-   * check the pref ourselves to find out if it's enabled.
-   */
-  _loadPluginHandlers() {
-    "use strict";
-
-    let mimeTypes = navigator.mimeTypes;
-
-    for (let mimeType of mimeTypes) {
-      let handlerInfoWrapper;
-      if (mimeType.type in this._handledTypes) {
-        handlerInfoWrapper = this._handledTypes[mimeType.type];
-      } else {
-        let wrappedHandlerInfo =
-              this._mimeSvc.getFromTypeAndExtension(mimeType.type, null);
-        handlerInfoWrapper = new HandlerInfoWrapper(mimeType.type, wrappedHandlerInfo);
-        handlerInfoWrapper.handledOnlyByPlugin = true;
-        this._handledTypes[mimeType.type] = handlerInfoWrapper;
-      }
-      handlerInfoWrapper.pluginName = mimeType.enabledPlugin.name;
-    }
-  },
-
-  /**
-   * Load the set of handlers defined by the application datastore.
-   */
-  _loadApplicationHandlers() {
-    var wrappedHandlerInfos = this._handlerSvc.enumerate();
-    while (wrappedHandlerInfos.hasMoreElements()) {
-      let wrappedHandlerInfo =
-        wrappedHandlerInfos.getNext().QueryInterface(Ci.nsIHandlerInfo);
-      let type = wrappedHandlerInfo.type;
-
-      let handlerInfoWrapper;
-      if (type in this._handledTypes)
-        handlerInfoWrapper = this._handledTypes[type];
-      else {
-        handlerInfoWrapper = new HandlerInfoWrapper(type, wrappedHandlerInfo);
-        this._handledTypes[type] = handlerInfoWrapper;
-      }
-
-      handlerInfoWrapper.handledOnlyByPlugin = false;
-    }
-  },
-
-
-  // View Construction
-
-  _rebuildVisibleTypes() {
-    // Reset the list of visible types and the visible type description counts.
-    this._visibleTypes = [];
-    this._visibleTypeDescriptionCount = {};
-
-    // Get the preferences that help determine what types to show.
-    var showPlugins = this._prefSvc.getBoolPref(PREF_SHOW_PLUGINS_IN_LIST);
-    var hidePluginsWithoutExtensions =
-      this._prefSvc.getBoolPref(PREF_HIDE_PLUGINS_WITHOUT_EXTENSIONS);
-
-    for (let type in this._handledTypes) {
-      let handlerInfo = this._handledTypes[type];
-
-      // Hide plugins without associated extensions if so prefed so we don't
-      // show a whole bunch of obscure types handled by plugins on Mac.
-      // Note: though protocol types don't have extensions, we still show them;
-      // the pref is only meant to be applied to MIME types, since plugins are
-      // only associated with MIME types.
-      // FIXME: should we also check the "suffixes" property of the plugin?
-      // Filed as bug 395135.
-      if (hidePluginsWithoutExtensions && handlerInfo.handledOnlyByPlugin &&
-          handlerInfo.wrappedHandlerInfo instanceof Ci.nsIMIMEInfo &&
-          !handlerInfo.primaryExtension)
-        continue;
-
-      // Hide types handled only by plugins if so prefed.
-      if (handlerInfo.handledOnlyByPlugin && !showPlugins)
-        continue;
-
-      // We couldn't find any reason to exclude the type, so include it.
-      this._visibleTypes.push(handlerInfo);
-
-      if (handlerInfo.description in this._visibleTypeDescriptionCount)
-        this._visibleTypeDescriptionCount[handlerInfo.description]++;
-      else
-        this._visibleTypeDescriptionCount[handlerInfo.description] = 1;
-    }
-  },
-
-  _rebuildView() {
-    // Clear the list of entries.
-    while (this._list.childNodes.length > 1)
-      this._list.removeChild(this._list.lastChild);
-
-    var visibleTypes = this._visibleTypes;
-
-    // If the user is filtering the list, then only show matching types.
-    if (this._filter.value)
-      visibleTypes = visibleTypes.filter(this._matchesFilter, this);
-
-    for (let visibleType of visibleTypes) {
-      let item = document.createElement("richlistitem");
-      item.setAttribute("type", visibleType.type);
-      item.setAttribute("typeDescription", this._describeType(visibleType));
-      if (visibleType.smallIcon)
-        item.setAttribute("typeIcon", visibleType.smallIcon);
-      item.setAttribute("actionDescription",
-                        this._describePreferredAction(visibleType));
-
-      if (!this._setIconClassForPreferredAction(visibleType, item)) {
-        item.setAttribute("actionIcon",
-                          this._getIconURLForPreferredAction(visibleType));
-      }
-
-      this._list.appendChild(item);
-    }
-
-    this._selectLastSelectedType();
-  },
-
-  _matchesFilter(aType) {
-    var filterValue = this._filter.value.toLowerCase();
-    return this._describeType(aType).toLowerCase().indexOf(filterValue) != -1 ||
-           this._describePreferredAction(aType).toLowerCase().indexOf(filterValue) != -1;
-  },
-
-  /**
-   * Describe, in a human-readable fashion, the type represented by the given
-   * handler info object.  Normally this is just the description provided by
-   * the info object, but if more than one object presents the same description,
-   * then we annotate the duplicate descriptions with the type itself to help
-   * users distinguish between those types.
-   *
-   * @param aHandlerInfo {nsIHandlerInfo} the type being described
-   * @returns {string} a description of the type
-   */
-  _describeType(aHandlerInfo) {
-    if (this._visibleTypeDescriptionCount[aHandlerInfo.description] > 1)
-      return this._prefsBundle.getFormattedString("typeDescriptionWithType",
-                                                  [aHandlerInfo.description,
-                                                   aHandlerInfo.type]);
-
-    return aHandlerInfo.description;
-  },
-
-  /**
-   * Describe, in a human-readable fashion, the preferred action to take on
-   * the type represented by the given handler info object.
-   *
-   * XXX Should this be part of the HandlerInfoWrapper interface?  It would
-   * violate the separation of model and view, but it might make more sense
-   * nonetheless (f.e. it would make sortTypes easier).
-   *
-   * @param aHandlerInfo {nsIHandlerInfo} the type whose preferred action
-   *                                      is being described
-   * @returns {string} a description of the action
-   */
-  _describePreferredAction(aHandlerInfo) {
-    // alwaysAskBeforeHandling overrides the preferred action, so if that flag
-    // is set, then describe that behavior instead.  For most types, this is
-    // the "alwaysAsk" string, but for the feed type we show something special.
-    if (aHandlerInfo.alwaysAskBeforeHandling) {
-      if (isFeedType(aHandlerInfo.type))
-        return this._prefsBundle.getFormattedString("previewInApp",
-                                                    [this._brandShortName]);
-      return this._prefsBundle.getString("alwaysAsk");
-    }
-
-    switch (aHandlerInfo.preferredAction) {
-      case Ci.nsIHandlerInfo.saveToDisk:
-        return this._prefsBundle.getString("saveFile");
-
-      case Ci.nsIHandlerInfo.useHelperApp:
-        var preferredApp = aHandlerInfo.preferredApplicationHandler;
-        var name;
-        if (preferredApp instanceof Ci.nsILocalHandlerApp)
-          name = getFileDisplayName(preferredApp.executable);
-        else
-          name = preferredApp.name;
-        return this._prefsBundle.getFormattedString("useApp", [name]);
-
-      case Ci.nsIHandlerInfo.handleInternally:
-        // For the feed type, handleInternally means live bookmarks.
-        if (isFeedType(aHandlerInfo.type)) {
-          return this._prefsBundle.getFormattedString("addLiveBookmarksInApp",
-                                                      [this._brandShortName]);
-        }
-
-        if (aHandlerInfo instanceof InternalHandlerInfoWrapper) {
-          return this._prefsBundle.getFormattedString("previewInApp",
-                                                      [this._brandShortName]);
-        }
-
-        // For other types, handleInternally looks like either useHelperApp
-        // or useSystemDefault depending on whether or not there's a preferred
-        // handler app.
-        if (this.isValidHandlerApp(aHandlerInfo.preferredApplicationHandler))
-          return aHandlerInfo.preferredApplicationHandler.name;
-
-        return aHandlerInfo.defaultDescription;
-
-        // XXX Why don't we say the app will handle the type internally?
-        // Is it because the app can't actually do that?  But if that's true,
-        // then why would a preferredAction ever get set to this value
-        // in the first place?
-
-      case Ci.nsIHandlerInfo.useSystemDefault:
-        return this._prefsBundle.getFormattedString("useDefault",
-                                                    [aHandlerInfo.defaultDescription]);
-
-      case kActionUsePlugin:
-        return this._prefsBundle.getFormattedString("usePluginIn",
-                                                    [aHandlerInfo.pluginName,
-                                                     this._brandShortName]);
-      default:
-        throw new Error(`Unexpected preferredAction: ${aHandlerInfo.preferredAction}`);
-    }
-  },
-
-  _selectLastSelectedType() {
-    // If the list is disabled by the pref.downloads.disable_button.edit_actions
-    // preference being locked, then don't select the type, as that would cause
-    // it to appear selected, with a different background and an actions menu
-    // that makes it seem like you can choose an action for the type.
-    if (this._list.disabled)
-      return;
-
-    var lastSelectedType = this._list.getAttribute("lastSelectedType");
-    if (!lastSelectedType)
-      return;
-
-    var item = this._list.getElementsByAttribute("type", lastSelectedType)[0];
-    if (!item)
-      return;
-
-    this._list.selectedItem = item;
-  },
-
-  /**
-   * Whether or not the given handler app is valid.
-   *
-   * @param aHandlerApp {nsIHandlerApp} the handler app in question
-   *
-   * @returns {boolean} whether or not it's valid
-   */
-  isValidHandlerApp(aHandlerApp) {
-    if (!aHandlerApp)
-      return false;
-
-    if (aHandlerApp instanceof Ci.nsILocalHandlerApp)
-      return this._isValidHandlerExecutable(aHandlerApp.executable);
-
-    if (aHandlerApp instanceof Ci.nsIWebHandlerApp)
-      return aHandlerApp.uriTemplate;
-
-    if (aHandlerApp instanceof Ci.nsIWebContentHandlerInfo)
-      return aHandlerApp.uri;
-
-    return false;
-  },
-
-  _isValidHandlerExecutable(aExecutable) {
-    let leafName;
-    if (AppConstants.platform == "win") {
-      leafName = `${AppConstants.MOZ_APP_NAME}.exe`;
-    } else if (AppConstants.platform == "macosx") {
-      leafName = AppConstants.MOZ_MACBUNDLE_NAME;
-    } else {
-      leafName = `${AppConstants.MOZ_APP_NAME}-bin`;
-    }
-    return aExecutable &&
-           aExecutable.exists() &&
-           aExecutable.isExecutable() &&
-// XXXben - we need to compare this with the running instance executable
-//          just don't know how to do that via script...
-// XXXmano TBD: can probably add this to nsIShellService
-           aExecutable.leafName != leafName;
-  },
-
-  /**
-   * Rebuild the actions menu for the selected entry.  Gets called by
-   * the richlistitem constructor when an entry in the list gets selected.
-   */
-  rebuildActionsMenu() {
-    var typeItem = this._list.selectedItem;
-    var handlerInfo = this._handledTypes[typeItem.type];
-    var menu =
-      document.getAnonymousElementByAttribute(typeItem, "class", "actionsMenu");
-    var menuPopup = menu.menupopup;
-
-    // Clear out existing items.
-    while (menuPopup.hasChildNodes())
-      menuPopup.removeChild(menuPopup.lastChild);
-
-    let internalMenuItem;
-    // Add the "Preview in Firefox" option for optional internal handlers.
-    if (handlerInfo instanceof InternalHandlerInfoWrapper) {
-      internalMenuItem = document.createElement("menuitem");
-      internalMenuItem.setAttribute("action", Ci.nsIHandlerInfo.handleInternally);
-      let label = this._prefsBundle.getFormattedString("previewInApp",
-                                                       [this._brandShortName]);
-      internalMenuItem.setAttribute("label", label);
-      internalMenuItem.setAttribute("tooltiptext", label);
-      internalMenuItem.setAttribute(APP_ICON_ATTR_NAME, "ask");
-      menuPopup.appendChild(internalMenuItem);
-    }
-
-    {
-      var askMenuItem = document.createElement("menuitem");
-      askMenuItem.setAttribute("action", Ci.nsIHandlerInfo.alwaysAsk);
-      let label;
-      if (isFeedType(handlerInfo.type))
-        label = this._prefsBundle.getFormattedString("previewInApp",
-                                                     [this._brandShortName]);
-      else
-        label = this._prefsBundle.getString("alwaysAsk");
-      askMenuItem.setAttribute("label", label);
-      askMenuItem.setAttribute("tooltiptext", label);
-      askMenuItem.setAttribute(APP_ICON_ATTR_NAME, "ask");
-      menuPopup.appendChild(askMenuItem);
-    }
-
-    // Create a menu item for saving to disk.
-    // Note: this option isn't available to protocol types, since we don't know
-    // what it means to save a URL having a certain scheme to disk, nor is it
-    // available to feeds, since the feed code doesn't implement the capability.
-    if ((handlerInfo.wrappedHandlerInfo instanceof Ci.nsIMIMEInfo) &&
-        !isFeedType(handlerInfo.type)) {
-      var saveMenuItem = document.createElement("menuitem");
-      saveMenuItem.setAttribute("action", Ci.nsIHandlerInfo.saveToDisk);
-      let label = this._prefsBundle.getString("saveFile");
-      saveMenuItem.setAttribute("label", label);
-      saveMenuItem.setAttribute("tooltiptext", label);
-      saveMenuItem.setAttribute(APP_ICON_ATTR_NAME, "save");
-      menuPopup.appendChild(saveMenuItem);
-    }
-
-    // If this is the feed type, add a Live Bookmarks item.
-    if (isFeedType(handlerInfo.type)) {
-      internalMenuItem = document.createElement("menuitem");
-      internalMenuItem.setAttribute("action", Ci.nsIHandlerInfo.handleInternally);
-      let label = this._prefsBundle.getFormattedString("addLiveBookmarksInApp",
-                                                       [this._brandShortName]);
-      internalMenuItem.setAttribute("label", label);
-      internalMenuItem.setAttribute("tooltiptext", label);
-      internalMenuItem.setAttribute(APP_ICON_ATTR_NAME, "feed");
-      menuPopup.appendChild(internalMenuItem);
-    }
-
-    // Add a separator to distinguish these items from the helper app items
-    // that follow them.
-    let menuseparator = document.createElement("menuseparator");
-    menuPopup.appendChild(menuseparator);
-
-    // Create a menu item for the OS default application, if any.
-    if (handlerInfo.hasDefaultHandler) {
-      var defaultMenuItem = document.createElement("menuitem");
-      defaultMenuItem.setAttribute("action", Ci.nsIHandlerInfo.useSystemDefault);
-      let label = this._prefsBundle.getFormattedString("useDefault",
-                                                       [handlerInfo.defaultDescription]);
-      defaultMenuItem.setAttribute("label", label);
-      defaultMenuItem.setAttribute("tooltiptext", handlerInfo.defaultDescription);
-      defaultMenuItem.setAttribute("image", this._getIconURLForSystemDefault(handlerInfo));
-
-      menuPopup.appendChild(defaultMenuItem);
-    }
-
-    // Create menu items for possible handlers.
-    let preferredApp = handlerInfo.preferredApplicationHandler;
-    let possibleApps = handlerInfo.possibleApplicationHandlers.enumerate();
-    var possibleAppMenuItems = [];
-    while (possibleApps.hasMoreElements()) {
-      let possibleApp = possibleApps.getNext();
-      if (!this.isValidHandlerApp(possibleApp))
-        continue;
-
-      let menuItem = document.createElement("menuitem");
-      menuItem.setAttribute("action", Ci.nsIHandlerInfo.useHelperApp);
-      let label;
-      if (possibleApp instanceof Ci.nsILocalHandlerApp)
-        label = getFileDisplayName(possibleApp.executable);
-      else
-        label = possibleApp.name;
-      label = this._prefsBundle.getFormattedString("useApp", [label]);
-      menuItem.setAttribute("label", label);
-      menuItem.setAttribute("tooltiptext", label);
-      menuItem.setAttribute("image", this._getIconURLForHandlerApp(possibleApp));
-
-      // Attach the handler app object to the menu item so we can use it
-      // to make changes to the datastore when the user selects the item.
-      menuItem.handlerApp = possibleApp;
-
-      menuPopup.appendChild(menuItem);
-      possibleAppMenuItems.push(menuItem);
-    }
-
-    // Create a menu item for the plugin.
-    if (handlerInfo.pluginName) {
-      var pluginMenuItem = document.createElement("menuitem");
-      pluginMenuItem.setAttribute("action", kActionUsePlugin);
-      let label = this._prefsBundle.getFormattedString("usePluginIn",
-                                                       [handlerInfo.pluginName,
-                                                        this._brandShortName]);
-      pluginMenuItem.setAttribute("label", label);
-      pluginMenuItem.setAttribute("tooltiptext", label);
-      pluginMenuItem.setAttribute(APP_ICON_ATTR_NAME, "plugin");
-      menuPopup.appendChild(pluginMenuItem);
-    }
-
-    // Create a menu item for selecting a local application.
-    let canOpenWithOtherApp = true;
-    if (AppConstants.platform == "win") {
-      // On Windows, selecting an application to open another application
-      // would be meaningless so we special case executables.
-      let executableType = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService)
-                                                    .getTypeFromExtension("exe");
-      canOpenWithOtherApp = handlerInfo.type != executableType;
-    }
-    if (canOpenWithOtherApp) {
-      let menuItem = document.createElement("menuitem");
-      menuItem.className = "choose-app-item";
-      menuItem.addEventListener("command", function(e) {
-        gApplicationsPane.chooseApp(e);
-      });
-      let label = this._prefsBundle.getString("useOtherApp");
-      menuItem.setAttribute("label", label);
-      menuItem.setAttribute("tooltiptext", label);
-      menuPopup.appendChild(menuItem);
-    }
-
-    // Create a menu item for managing applications.
-    if (possibleAppMenuItems.length) {
-      let menuItem = document.createElement("menuseparator");
-      menuPopup.appendChild(menuItem);
-      menuItem = document.createElement("menuitem");
-      menuItem.className = "manage-app-item";
-      menuItem.addEventListener("command", function(e) {
-        gApplicationsPane.manageApp(e);
-      });
-      menuItem.setAttribute("label", this._prefsBundle.getString("manageApp"));
-      menuPopup.appendChild(menuItem);
-    }
-
-    // Select the item corresponding to the preferred action.  If the always
-    // ask flag is set, it overrides the preferred action.  Otherwise we pick
-    // the item identified by the preferred action (when the preferred action
-    // is to use a helper app, we have to pick the specific helper app item).
-    if (handlerInfo.alwaysAskBeforeHandling)
-      menu.selectedItem = askMenuItem;
-    else switch (handlerInfo.preferredAction) {
-      case Ci.nsIHandlerInfo.handleInternally:
-        if (internalMenuItem) {
-          menu.selectedItem = internalMenuItem;
-        } else {
-          Cu.reportError("No menu item defined to set!")
-        }
-        break;
-      case Ci.nsIHandlerInfo.useSystemDefault:
-        menu.selectedItem = defaultMenuItem;
-        break;
-      case Ci.nsIHandlerInfo.useHelperApp:
-        if (preferredApp)
-          menu.selectedItem =
-            possibleAppMenuItems.filter(v => v.handlerApp.equals(preferredApp))[0];
-        break;
-      case kActionUsePlugin:
-        menu.selectedItem = pluginMenuItem;
-        break;
-      case Ci.nsIHandlerInfo.saveToDisk:
-        menu.selectedItem = saveMenuItem;
-        break;
-    }
-  },
-
-
-  // Sorting & Filtering
-
-  _sortColumn: null,
-
-  /**
-   * Sort the list when the user clicks on a column header.
-   */
-  sort(event) {
-    var column = event.target;
-
-    // If the user clicked on a new sort column, remove the direction indicator
-    // from the old column.
-    if (this._sortColumn && this._sortColumn != column)
-      this._sortColumn.removeAttribute("sortDirection");
-
-    this._sortColumn = column;
-
-    // Set (or switch) the sort direction indicator.
-    if (column.getAttribute("sortDirection") == "ascending")
-      column.setAttribute("sortDirection", "descending");
-    else
-      column.setAttribute("sortDirection", "ascending");
-
-    this._sortVisibleTypes();
-    this._rebuildView();
-  },
-
-  /**
-   * Sort the list of visible types by the current sort column/direction.
-   */
-  _sortVisibleTypes() {
-    if (!this._sortColumn)
-      return;
-
-    var t = this;
-
-    function sortByType(a, b) {
-      return t._describeType(a).toLowerCase().
-             localeCompare(t._describeType(b).toLowerCase());
-    }
-
-    function sortByAction(a, b) {
-      return t._describePreferredAction(a).toLowerCase().
-             localeCompare(t._describePreferredAction(b).toLowerCase());
-    }
-
-    switch (this._sortColumn.getAttribute("value")) {
-      case "type":
-        this._visibleTypes.sort(sortByType);
-        break;
-      case "action":
-        this._visibleTypes.sort(sortByAction);
-        break;
-    }
-
-    if (this._sortColumn.getAttribute("sortDirection") == "descending")
-      this._visibleTypes.reverse();
-  },
-
-  /**
-   * Filter the list when the user enters a filter term into the filter field.
-   */
-  filter() {
-    this._rebuildView();
-  },
-
-  focusFilterBox() {
-    this._filter.focus();
-    this._filter.select();
-  },
-
-
-  // Changes
-
-  onSelectAction(aActionItem) {
-    this._storingAction = true;
-
-    try {
-      this._storeAction(aActionItem);
-    } finally {
-      this._storingAction = false;
-    }
-  },
-
-  _storeAction(aActionItem) {
-    var typeItem = this._list.selectedItem;
-    var handlerInfo = this._handledTypes[typeItem.type];
-
-    let action = parseInt(aActionItem.getAttribute("action"));
-
-    // Set the plugin state if we're enabling or disabling a plugin.
-    if (action == kActionUsePlugin)
-      handlerInfo.enablePluginType();
-    else if (handlerInfo.pluginName && !handlerInfo.isDisabledPluginType)
-      handlerInfo.disablePluginType();
-
-    // Set the preferred application handler.
-    // We leave the existing preferred app in the list when we set
-    // the preferred action to something other than useHelperApp so that
-    // legacy datastores that don't have the preferred app in the list
-    // of possible apps still include the preferred app in the list of apps
-    // the user can choose to handle the type.
-    if (action == Ci.nsIHandlerInfo.useHelperApp)
-      handlerInfo.preferredApplicationHandler = aActionItem.handlerApp;
-
-    // Set the "always ask" flag.
-    if (action == Ci.nsIHandlerInfo.alwaysAsk)
-      handlerInfo.alwaysAskBeforeHandling = true;
-    else
-      handlerInfo.alwaysAskBeforeHandling = false;
-
-    // Set the preferred action.
-    handlerInfo.preferredAction = action;
-
-    handlerInfo.store();
-
-    // Make sure the handler info object is flagged to indicate that there is
-    // now some user configuration for the type.
-    handlerInfo.handledOnlyByPlugin = false;
-
-    // Update the action label and image to reflect the new preferred action.
-    typeItem.setAttribute("actionDescription",
-                          this._describePreferredAction(handlerInfo));
-    if (!this._setIconClassForPreferredAction(handlerInfo, typeItem)) {
-      typeItem.setAttribute("actionIcon",
-                            this._getIconURLForPreferredAction(handlerInfo));
-    }
-  },
-
-  manageApp(aEvent) {
-    // Don't let the normal "on select action" handler get this event,
-    // as we handle it specially ourselves.
-    aEvent.stopPropagation();
-
-    var typeItem = this._list.selectedItem;
-    var handlerInfo = this._handledTypes[typeItem.type];
-
-    let onComplete = () => {
-      // Rebuild the actions menu so that we revert to the previous selection,
-      // or "Always ask" if the previous default application has been removed
-      this.rebuildActionsMenu();
-
-      // update the richlistitem too. Will be visible when selecting another row
-      typeItem.setAttribute("actionDescription",
-                            this._describePreferredAction(handlerInfo));
-      if (!this._setIconClassForPreferredAction(handlerInfo, typeItem)) {
-        typeItem.setAttribute("actionIcon",
-                              this._getIconURLForPreferredAction(handlerInfo));
-      }
-    };
-
-    gSubDialog.open("chrome://browser/content/preferences/applicationManager.xul",
-                    "resizable=no", handlerInfo, onComplete);
-
-  },
-
-  chooseApp(aEvent) {
-    // Don't let the normal "on select action" handler get this event,
-    // as we handle it specially ourselves.
-    aEvent.stopPropagation();
-
-    var handlerApp;
-    let chooseAppCallback = aHandlerApp => {
-      // Rebuild the actions menu whether the user picked an app or canceled.
-      // If they picked an app, we want to add the app to the menu and select it.
-      // If they canceled, we want to go back to their previous selection.
-      this.rebuildActionsMenu();
-
-      // If the user picked a new app from the menu, select it.
-      if (aHandlerApp) {
-        let typeItem = this._list.selectedItem;
-        let actionsMenu =
-          document.getAnonymousElementByAttribute(typeItem, "class", "actionsMenu");
-        let menuItems = actionsMenu.menupopup.childNodes;
-        for (let i = 0; i < menuItems.length; i++) {
-          let menuItem = menuItems[i];
-          if (menuItem.handlerApp && menuItem.handlerApp.equals(aHandlerApp)) {
-            actionsMenu.selectedIndex = i;
-            this.onSelectAction(menuItem);
-            break;
-          }
-        }
-      }
-    };
-
-    if (AppConstants.platform == "win") {
-      var params = {};
-      var handlerInfo = this._handledTypes[this._list.selectedItem.type];
-
-      if (isFeedType(handlerInfo.type)) {
-        // MIME info will be null, create a temp object.
-        params.mimeInfo = this._mimeSvc.getFromTypeAndExtension(handlerInfo.type,
-                                                   handlerInfo.primaryExtension);
-      } else {
-        params.mimeInfo = handlerInfo.wrappedHandlerInfo;
-      }
-
-      params.title         = this._prefsBundle.getString("fpTitleChooseApp");
-      params.description   = handlerInfo.description;
-      params.filename      = null;
-      params.handlerApp    = null;
-
-      let onAppSelected = () => {
-        if (this.isValidHandlerApp(params.handlerApp)) {
-          handlerApp = params.handlerApp;
-
-          // Add the app to the type's list of possible handlers.
-          handlerInfo.addPossibleApplicationHandler(handlerApp);
-        }
-
-        chooseAppCallback(handlerApp);
-      };
-
-      gSubDialog.open("chrome://global/content/appPicker.xul",
-                      null, params, onAppSelected);
-    } else {
-      let winTitle = this._prefsBundle.getString("fpTitleChooseApp");
-      let fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
-      let fpCallback = aResult => {
-        if (aResult == Ci.nsIFilePicker.returnOK && fp.file &&
-            this._isValidHandlerExecutable(fp.file)) {
-          handlerApp = Cc["@mozilla.org/uriloader/local-handler-app;1"].
-                       createInstance(Ci.nsILocalHandlerApp);
-          handlerApp.name = getFileDisplayName(fp.file);
-          handlerApp.executable = fp.file;
-
-          // Add the app to the type's list of possible handlers.
-          let handler = this._handledTypes[this._list.selectedItem.type];
-          handler.addPossibleApplicationHandler(handlerApp);
-
-          chooseAppCallback(handlerApp);
-        }
-      };
-
-      // Prompt the user to pick an app.  If they pick one, and it's a valid
-      // selection, then add it to the list of possible handlers.
-      fp.init(window, winTitle, Ci.nsIFilePicker.modeOpen);
-      fp.appendFilters(Ci.nsIFilePicker.filterApps);
-      fp.open(fpCallback);
-    }
-  },
-
-  // Mark which item in the list was last selected so we can reselect it
-  // when we rebuild the list or when the user returns to the prefpane.
-  onSelectionChanged() {
-    if (this._list.selectedItem)
-      this._list.setAttribute("lastSelectedType",
-                              this._list.selectedItem.getAttribute("type"));
-  },
-
-  _setIconClassForPreferredAction(aHandlerInfo, aElement) {
-    // If this returns true, the attribute that CSS sniffs for was set to something
-    // so you shouldn't manually set an icon URI.
-    // This removes the existing actionIcon attribute if any, even if returning false.
-    aElement.removeAttribute("actionIcon");
-
-    if (aHandlerInfo.alwaysAskBeforeHandling) {
-      aElement.setAttribute(APP_ICON_ATTR_NAME, "ask");
-      return true;
-    }
-
-    switch (aHandlerInfo.preferredAction) {
-      case Ci.nsIHandlerInfo.saveToDisk:
-        aElement.setAttribute(APP_ICON_ATTR_NAME, "save");
-        return true;
-
-      case Ci.nsIHandlerInfo.handleInternally:
-        if (isFeedType(aHandlerInfo.type)) {
-          aElement.setAttribute(APP_ICON_ATTR_NAME, "feed");
-          return true;
-        } else if (aHandlerInfo instanceof InternalHandlerInfoWrapper) {
-          aElement.setAttribute(APP_ICON_ATTR_NAME, "ask");
-          return true;
-        }
-        break;
-
-      case kActionUsePlugin:
-        aElement.setAttribute(APP_ICON_ATTR_NAME, "plugin");
-        return true;
-    }
-    aElement.removeAttribute(APP_ICON_ATTR_NAME);
-    return false;
-  },
-
-  _getIconURLForPreferredAction(aHandlerInfo) {
-    switch (aHandlerInfo.preferredAction) {
-      case Ci.nsIHandlerInfo.useSystemDefault:
-        return this._getIconURLForSystemDefault(aHandlerInfo);
-
-      case Ci.nsIHandlerInfo.useHelperApp:
-        let preferredApp = aHandlerInfo.preferredApplicationHandler;
-        if (this.isValidHandlerApp(preferredApp))
-          return this._getIconURLForHandlerApp(preferredApp);
-        // Explicit fall-through
-
-      // This should never happen, but if preferredAction is set to some weird
-      // value, then fall back to the generic application icon.
-      default:
-        return ICON_URL_APP;
-    }
-  },
-
-  _getIconURLForHandlerApp(aHandlerApp) {
-    if (aHandlerApp instanceof Ci.nsILocalHandlerApp)
-      return this._getIconURLForFile(aHandlerApp.executable);
-
-    if (aHandlerApp instanceof Ci.nsIWebHandlerApp)
-      return this._getIconURLForWebApp(aHandlerApp.uriTemplate);
-
-    if (aHandlerApp instanceof Ci.nsIWebContentHandlerInfo)
-      return this._getIconURLForWebApp(aHandlerApp.uri)
-
-    // We know nothing about other kinds of handler apps.
-    return "";
-  },
-
-  _getIconURLForFile(aFile) {
-    var fph = this._ioSvc.getProtocolHandler("file").
-              QueryInterface(Ci.nsIFileProtocolHandler);
-    var urlSpec = fph.getURLSpecFromFile(aFile);
-
-    return "moz-icon://" + urlSpec + "?size=16";
-  },
-
-  _getIconURLForWebApp(aWebAppURITemplate) {
-    var uri = this._ioSvc.newURI(aWebAppURITemplate);
-
-    // Unfortunately we can't use the favicon service to get the favicon,
-    // because the service looks in the annotations table for a record with
-    // the exact URL we give it, and users won't have such records for URLs
-    // they don't visit, and users won't visit the web app's URL template,
-    // they'll only visit URLs derived from that template (i.e. with %s
-    // in the template replaced by the URL of the content being handled).
-
-    if (/^https?$/.test(uri.scheme) && this._prefSvc.getBoolPref("browser.chrome.favicons"))
-      return uri.prePath + "/favicon.ico";
-
-    return "";
-  },
-
-  _getIconURLForSystemDefault(aHandlerInfo) {
-    // Handler info objects for MIME types on some OSes implement a property bag
-    // interface from which we can get an icon for the default app, so if we're
-    // dealing with a MIME type on one of those OSes, then try to get the icon.
-    if ("wrappedHandlerInfo" in aHandlerInfo) {
-      let wrappedHandlerInfo = aHandlerInfo.wrappedHandlerInfo;
-
-      if (wrappedHandlerInfo instanceof Ci.nsIMIMEInfo &&
-          wrappedHandlerInfo instanceof Ci.nsIPropertyBag) {
-        try {
-          let url = wrappedHandlerInfo.getProperty("defaultApplicationIconURL");
-          if (url)
-            return url + "?size=16";
-        } catch (ex) {}
-      }
-    }
-
-    // If this isn't a MIME type object on an OS that supports retrieving
-    // the icon, or if we couldn't retrieve the icon for some other reason,
-    // then use a generic icon.
-    return ICON_URL_APP;
-  }
-
-};
deleted file mode 100644
--- a/browser/components/preferences/in-content-old/applications.xul
+++ /dev/null
@@ -1,95 +0,0 @@
-# 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/.
-
-<!-- Applications panel -->
-
-<script type="application/javascript"
-        src="chrome://browser/content/preferences/in-content-old/applications.js"/>
-
-<preferences id="feedsPreferences" hidden="true" data-category="paneApplications">
-  <preference id="browser.feeds.handler"
-              name="browser.feeds.handler"
-              type="string"/>
-  <preference id="browser.feeds.handler.default"
-              name="browser.feeds.handler.default"
-              type="string"/>
-  <preference id="browser.feeds.handlers.application"
-              name="browser.feeds.handlers.application"
-              type="file"/>
-  <preference id="browser.feeds.handlers.webservice"
-              name="browser.feeds.handlers.webservice"
-              type="string"/>
-
-  <preference id="browser.videoFeeds.handler"
-              name="browser.videoFeeds.handler"
-              type="string"/>
-  <preference id="browser.videoFeeds.handler.default"
-              name="browser.videoFeeds.handler.default"
-              type="string"/>
-  <preference id="browser.videoFeeds.handlers.application"
-              name="browser.videoFeeds.handlers.application"
-              type="file"/>
-  <preference id="browser.videoFeeds.handlers.webservice"
-              name="browser.videoFeeds.handlers.webservice"
-              type="string"/>
-
-  <preference id="browser.audioFeeds.handler"
-              name="browser.audioFeeds.handler"
-              type="string"/>
-  <preference id="browser.audioFeeds.handler.default"
-              name="browser.audioFeeds.handler.default"
-              type="string"/>
-  <preference id="browser.audioFeeds.handlers.application"
-              name="browser.audioFeeds.handlers.application"
-              type="file"/>
-  <preference id="browser.audioFeeds.handlers.webservice"
-              name="browser.audioFeeds.handlers.webservice"
-              type="string"/>
-
-  <preference id="pref.downloads.disable_button.edit_actions"
-              name="pref.downloads.disable_button.edit_actions"
-              type="bool"/>
-</preferences>
-
-<keyset data-category="paneApplications">
-  <!-- Ctrl+f/k focus the search box in the Applications pane.
-       These <key>s have oncommand attributes because of bug 371900. -->
-  <key key="&focusSearch1.key;" modifiers="accel" id="focusSearch1" oncommand=";"/>
-  <key key="&focusSearch2.key;" modifiers="accel" id="focusSearch2" oncommand=";"/>
-</keyset>
-
-<hbox id="header-applications"
-      class="header"
-      hidden="true"
-      data-category="paneApplications">
-  <label class="header-name" flex="1">&paneApplications.title;</label>
-  <html:a class="help-button" target="_blank" aria-label="&helpButton.label;"></html:a>
-</hbox>
-
-<vbox id="applicationsContent"
-      data-category="paneApplications"
-      hidden="true"
-      flex="1">
-  <hbox>
-    <textbox id="filter" flex="1"
-             type="search"
-             placeholder="&filter.emptytext;"
-             aria-controls="handlersView"/>
-  </hbox>
-
-  <separator class="thin"/>
-
-  <richlistbox id="handlersView" orient="vertical" persist="lastSelectedType"
-               preference="pref.downloads.disable_button.edit_actions"
-               flex="1">
-    <listheader equalsize="always">
-        <treecol id="typeColumn" label="&typeColumn.label;" value="type"
-                 accesskey="&typeColumn.accesskey;" persist="sortDirection"
-                 flex="1" sortDirection="ascending"/>
-        <treecol id="actionColumn" label="&actionColumn2.label;" value="action"
-                 accesskey="&actionColumn2.accesskey;" persist="sortDirection"
-                 flex="1"/>
-    </listheader>
-  </richlistbox>
-</vbox>
deleted file mode 100644
--- a/browser/components/preferences/in-content-old/containers.js
+++ /dev/null
@@ -1,99 +0,0 @@
-/* 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/. */
-
-/* import-globals-from preferences.js */
-
-Components.utils.import("resource://gre/modules/AppConstants.jsm");
-Components.utils.import("resource://gre/modules/ContextualIdentityService.jsm");
-
-const containersBundle = Services.strings.createBundle("chrome://browser/locale/preferences-old/containers.properties");
-
-const defaultContainerIcon = "fingerprint";
-const defaultContainerColor = "blue";
-
-let gContainersPane = {
-
-  init() {
-    this._list = document.getElementById("containersView");
-
-    document.getElementById("backContainersLink").addEventListener("click", function() {
-      gotoPref("privacy");
-    });
-
-    this._rebuildView();
-  },
-
-  _rebuildView() {
-    const containers = ContextualIdentityService.getPublicIdentities();
-    while (this._list.firstChild) {
-      this._list.firstChild.remove();
-    }
-    for (let container of containers) {
-      let item = document.createElement("richlistitem");
-      item.setAttribute("containerName", ContextualIdentityService.getUserContextLabel(container.userContextId));
-      item.setAttribute("containerIcon", container.icon);
-      item.setAttribute("containerColor", container.color);
-      item.setAttribute("userContextId", container.userContextId);
-
-      this._list.appendChild(item);
-    }
-  },
-
-  onRemoveClick(button) {
-    let userContextId = parseInt(button.getAttribute("value"), 10);
-
-    let count = ContextualIdentityService.countContainerTabs(userContextId);
-    if (count > 0) {
-      let bundlePreferences = document.getElementById("bundlePreferences");
-
-      let title = bundlePreferences.getString("removeContainerAlertTitle");
-      let message = PluralForm.get(count, bundlePreferences.getString("removeContainerMsg"))
-                              .replace("#S", count)
-      let okButton = bundlePreferences.getString("removeContainerOkButton");
-      let cancelButton = bundlePreferences.getString("removeContainerButton2");
-
-      let buttonFlags = (Ci.nsIPrompt.BUTTON_TITLE_IS_STRING * Ci.nsIPrompt.BUTTON_POS_0) +
-                        (Ci.nsIPrompt.BUTTON_TITLE_IS_STRING * Ci.nsIPrompt.BUTTON_POS_1);
-
-      let rv = Services.prompt.confirmEx(window, title, message, buttonFlags,
-                                         okButton, cancelButton, null, null, {});
-      if (rv != 0) {
-        return;
-      }
-
-      ContextualIdentityService.closeContainerTabs(userContextId);
-    }
-
-    ContextualIdentityService.remove(userContextId);
-    this._rebuildView();
-  },
-
-  onPreferenceClick(button) {
-    this.openPreferenceDialog(button.getAttribute("value"));
-  },
-
-  onAddButtonClick(button) {
-    this.openPreferenceDialog(null);
-  },
-
-  openPreferenceDialog(userContextId) {
-    let identity = {
-      name: "",
-      icon: defaultContainerIcon,
-      color: defaultContainerColor
-    };
-    let title;
-    if (userContextId) {
-      identity = ContextualIdentityService.getPublicIdentityFromId(userContextId);
-      // This is required to get the translation string from defaults
-      identity.name = ContextualIdentityService.getUserContextLabel(identity.userContextId);
-      title = containersBundle.formatStringFromName("containers.updateContainerTitle", [identity.name], 1);
-    }
-
-    const params = { userContextId, identity, windowTitle: title };
-    gSubDialog.open("chrome://browser/content/preferences/containers.xul",
-                     null, params);
-  }
-
-};
deleted file mode 100644
--- a/browser/components/preferences/in-content-old/containers.xul
+++ /dev/null
@@ -1,54 +0,0 @@
-# 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/.
-
-<!-- Containers panel -->
-
-<script type="application/javascript"
-        src="chrome://browser/content/preferences/in-content-old/containers.js"/>
-
-<preferences id="containerPreferences" hidden="true" data-category="paneContainer">
-  <!-- Containers -->
-  <preference id="privacy.userContext.enabled"
-              name="privacy.userContext.enabled"
-              type="bool"/>
-
-</preferences>
-
-<hbox hidden="true"
-      class="container-header-links"
-      data-category="paneContainers">
-  <label class="text-link" id="backContainersLink" value="&backLink.label;" />
-</hbox>
-
-<hbox id="header-containers"
-      class="header"
-      hidden="true"
-      data-category="paneContainers">
-  <label class="header-name" flex="1">&paneContainers.title;</label>
-  <button class="help-button"
-          aria-label="&helpButton.label;"/>
-</hbox>
-
-<!-- Containers -->
-<groupbox id="browserContainersGroup" data-category="paneContainers" hidden="true">
-  <vbox id="browserContainersbox">
-
-    <richlistbox id="containersView" orient="vertical" persist="lastSelectedType"
-                 flex="1">
-      <listheader equalsize="always">
-          <treecol id="typeColumn" value="type"
-                   persist="sortDirection"
-                   flex="1" sortDirection="ascending"/>
-          <treecol id="actionColumn" value="action"
-                   persist="sortDirection"
-                   flex="1"/>
-      </listheader>
-    </richlistbox>
-  </vbox>
-  <vbox>
-    <hbox flex="1">
-      <button onclick="gContainersPane.onAddButtonClick();" accesskey="&addButton.accesskey;" label="&addButton.label;"/>
-    </hbox>
-  </vbox>
-</groupbox>
deleted file mode 100644
--- a/browser/components/preferences/in-content-old/jar.mn
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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/.
-
-browser.jar:
-   content/browser/preferences/in-content-old/preferences.js
-*  content/browser/preferences/in-content-old/preferences.xul
-   content/browser/preferences/in-content-old/subdialogs.js
-
-   content/browser/preferences/in-content-old/main.js
-   content/browser/preferences/in-content-old/privacy.js
-   content/browser/preferences/in-content-old/containers.js
-   content/browser/preferences/in-content-old/advanced.js
-   content/browser/preferences/in-content-old/applications.js
-   content/browser/preferences/in-content-old/content.js
-   content/browser/preferences/in-content-old/sync.js
-   content/browser/preferences/in-content-old/security.js
-   content/browser/preferences/in-content-old/search.js
deleted file mode 100644
--- a/browser/components/preferences/in-content-old/main.js
+++ /dev/null
@@ -1,756 +0,0 @@
-/* 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/. */
-
-/* import-globals-from preferences.js */
-
-Components.utils.import("resource://gre/modules/Downloads.jsm");
-Components.utils.import("resource://gre/modules/FileUtils.jsm");
-Components.utils.import("resource:///modules/ShellService.jsm");
-Components.utils.import("resource:///modules/TransientPrefs.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
-                                  "resource://gre/modules/osfile.jsm");
-
-if (AppConstants.E10S_TESTING_ONLY) {
-  XPCOMUtils.defineLazyModuleGetter(this, "UpdateUtils",
-                                    "resource://gre/modules/UpdateUtils.jsm");
-}
-
-if (AppConstants.MOZ_DEV_EDITION) {
-  XPCOMUtils.defineLazyModuleGetter(this, "fxAccounts",
-                                    "resource://gre/modules/FxAccounts.jsm");
-}
-
-var gMainPane = {
-  /**
-   * Initialization of this.
-   */
-  init() {
-    function setEventListener(aId, aEventType, aCallback) {
-      document.getElementById(aId)
-              .addEventListener(aEventType, aCallback.bind(gMainPane));
-    }
-
-    if (AppConstants.HAVE_SHELL_SERVICE) {
-      this.updateSetDefaultBrowser();
-      if (AppConstants.platform == "win") {
-        // In Windows 8 we launch the control panel since it's the only
-        // way to get all file type association prefs. So we don't know
-        // when the user will select the default.  We refresh here periodically
-        // in case the default changes. On other Windows OS's defaults can also
-        // be set while the prefs are open.
-        window.setInterval(this.updateSetDefaultBrowser.bind(this), 1000);
-      }
-    }
-
-    this.buildContentProcessCountMenuList();
-    this.updateDefaultPerformanceSettingsPref();
-
-    let defaultPerformancePref =
-      document.getElementById("browser.preferences.defaultPerformanceSettings.enabled");
-    defaultPerformancePref.addEventListener("change", () => {
-      this.updatePerformanceSettingsBox();
-    });
-    this.updatePerformanceSettingsBox();
-
-    let performanceSettingsLink = document.getElementById("performanceSettingsLearnMore");
-    let performanceSettingsUrl = Services.urlFormatter.formatURLPref("app.support.baseURL") + "performance";
-    performanceSettingsLink.setAttribute("href", performanceSettingsUrl);
-
-    // set up the "use current page" label-changing listener
-    this._updateUseCurrentButton();
-    window.addEventListener("focus", this._updateUseCurrentButton.bind(this));
-
-    this.updateBrowserStartupLastSession();
-
-    if (AppConstants.platform == "win") {
-      // Functionality for "Show tabs in taskbar" on Windows 7 and up.
-      try {
-        let sysInfo = Cc["@mozilla.org/system-info;1"].
-                      getService(Ci.nsIPropertyBag2);
-        let ver = parseFloat(sysInfo.getProperty("version"));
-        let showTabsInTaskbar = document.getElementById("showTabsInTaskbar");
-        showTabsInTaskbar.hidden = ver < 6.1;
-      } catch (ex) {}
-    }
-
-    // The "closing multiple tabs" and "opening multiple tabs might slow down
-    // &brandShortName;" warnings provide options for not showing these
-    // warnings again. When the user disabled them, we provide checkboxes to
-    // re-enable the warnings.
-    if (!TransientPrefs.prefShouldBeVisible("browser.tabs.warnOnClose"))
-      document.getElementById("warnCloseMultiple").hidden = true;
-    if (!TransientPrefs.prefShouldBeVisible("browser.tabs.warnOnOpen"))
-      document.getElementById("warnOpenMany").hidden = true;
-
-    setEventListener("browser.privatebrowsing.autostart", "change",
-                     gMainPane.updateBrowserStartupLastSession);
-    setEventListener("browser.download.dir", "change",
-                     gMainPane.displayDownloadDirPref);
-    if (AppConstants.HAVE_SHELL_SERVICE) {
-      setEventListener("setDefaultButton", "command",
-                       gMainPane.setDefaultBrowser);
-    }
-    setEventListener("useCurrent", "command",
-                     gMainPane.setHomePageToCurrent);
-    setEventListener("useBookmark", "command",
-                     gMainPane.setHomePageToBookmark);
-    setEventListener("restoreDefaultHomePage", "command",
-                     gMainPane.restoreDefaultHomePage);
-    setEventListener("chooseFolder", "command",
-                     gMainPane.chooseFolder);
-
-    if (AppConstants.E10S_TESTING_ONLY) {
-      setEventListener("e10sAutoStart", "command",
-                       gMainPane.enableE10SChange);
-      let e10sCheckbox = document.getElementById("e10sAutoStart");
-
-      let e10sPref = document.getElementById("browser.tabs.remote.autostart");
-      let e10sTempPref = document.getElementById("e10sTempPref");
-      let e10sForceEnable = document.getElementById("e10sForceEnable");
-
-      let preffedOn = e10sPref.value || e10sTempPref.value || e10sForceEnable.value;
-
-      if (preffedOn) {
-        // The checkbox is checked if e10s is preffed on and enabled.
-        e10sCheckbox.checked = Services.appinfo.browserTabsRemoteAutostart;
-
-        // but if it's force disabled, then the checkbox is disabled.
-        e10sCheckbox.disabled = !Services.appinfo.browserTabsRemoteAutostart;
-      }
-    }
-
-    if (AppConstants.MOZ_DEV_EDITION) {
-      let uAppData = OS.Constants.Path.userApplicationDataDir;
-      let ignoreSeparateProfile = OS.Path.join(uAppData, "ignore-dev-edition-profile");
-
-      setEventListener("separateProfileMode", "command", gMainPane.separateProfileModeChange);
-      let separateProfileModeCheckbox = document.getElementById("separateProfileMode");
-      setEventListener("getStarted", "click", gMainPane.onGetStarted);
-
-      OS.File.stat(ignoreSeparateProfile).then(() => separateProfileModeCheckbox.checked = false,
-                                               () => separateProfileModeCheckbox.checked = true);
-
-      fxAccounts.getSignedInUser().then(data => {
-        document.getElementById("getStarted").selectedIndex = data ? 1 : 0;
-      });
-    }
-
-    // Notify observers that the UI is now ready
-    Components.classes["@mozilla.org/observer-service;1"]
-              .getService(Components.interfaces.nsIObserverService)
-              .notifyObservers(window, "main-pane-loaded");
-  },
-
-  enableE10SChange() {
-    if (AppConstants.E10S_TESTING_ONLY) {
-      let e10sCheckbox = document.getElementById("e10sAutoStart");
-      let e10sPref = document.getElementById("browser.tabs.remote.autostart");
-      let e10sTempPref = document.getElementById("e10sTempPref");
-
-      let prefsToChange;
-      if (e10sCheckbox.checked) {
-        // Enabling e10s autostart
-        prefsToChange = [e10sPref];
-      } else {
-        // Disabling e10s autostart
-        prefsToChange = [e10sPref];
-        if (e10sTempPref.value) {
-         prefsToChange.push(e10sTempPref);
-        }
-      }
-
-      let buttonIndex = confirmRestartPrompt(e10sCheckbox.checked, 0,
-                                             true, false);
-      if (buttonIndex == CONFIRM_RESTART_PROMPT_RESTART_NOW) {
-        for (let prefToChange of prefsToChange) {
-          prefToChange.value = e10sCheckbox.checked;
-        }
-
-        Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
-      }
-
-      // Revert the checkbox in case we didn't quit
-      e10sCheckbox.checked = e10sPref.value || e10sTempPref.value;
-    }
-  },
-
-  separateProfileModeChange() {
-    if (AppConstants.MOZ_DEV_EDITION) {
-      function quitApp() {
-        Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestartNotSameProfile);
-      }
-      function revertCheckbox(error) {
-        separateProfileModeCheckbox.checked = !separateProfileModeCheckbox.checked;
-        if (error) {
-          Cu.reportError("Failed to toggle separate profile mode: " + error);
-        }
-      }
-      function createOrRemoveSpecialDevEditionFile(onSuccess) {
-        let uAppData = OS.Constants.Path.userApplicationDataDir;
-        let ignoreSeparateProfile = OS.Path.join(uAppData, "ignore-dev-edition-profile");
-
-        if (separateProfileModeCheckbox.checked) {
-          OS.File.remove(ignoreSeparateProfile).then(onSuccess, revertCheckbox);
-        } else {
-          OS.File.writeAtomic(ignoreSeparateProfile, new Uint8Array()).then(onSuccess, revertCheckbox);
-        }
-      }
-
-      let separateProfileModeCheckbox = document.getElementById("separateProfileMode");
-      let button_index = confirmRestartPrompt(separateProfileModeCheckbox.checked,
-                                              0, false, true);
-      switch (button_index) {
-        case CONFIRM_RESTART_PROMPT_CANCEL:
-          revertCheckbox();
-          return;
-        case CONFIRM_RESTART_PROMPT_RESTART_NOW:
-          const Cc = Components.classes, Ci = Components.interfaces;
-          let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"]
-                             .createInstance(Ci.nsISupportsPRBool);
-          Services.obs.notifyObservers(cancelQuit, "quit-application-requested",
-                                        "restart");
-          if (!cancelQuit.data) {
-            createOrRemoveSpecialDevEditionFile(quitApp);
-            return;
-          }
-
-          // Revert the checkbox in case we didn't quit
-          revertCheckbox();
-          return;
-        case CONFIRM_RESTART_PROMPT_RESTART_LATER:
-          createOrRemoveSpecialDevEditionFile();
-      }
-    }
-  },
-
-  onGetStarted(aEvent) {
-    if (AppConstants.MOZ_DEV_EDITION) {
-      const Cc = Components.classes, Ci = Components.interfaces;
-      let wm = Cc["@mozilla.org/appshell/window-mediator;1"]
-                  .getService(Ci.nsIWindowMediator);
-      let win = wm.getMostRecentWindow("navigator:browser");
-
-      fxAccounts.getSignedInUser().then(data => {
-        if (win) {
-          if (data) {
-            // We have a user, open Sync preferences in the same tab
-            win.openUILinkIn("about:preferences#sync", "current");
-            return;
-          }
-          let accountsTab = win.gBrowser.addTab("about:accounts?action=signin&entrypoint=dev-edition-setup");
-          win.gBrowser.selectedTab = accountsTab;
-        }
-      });
-    }
-  },
-
-  // HOME PAGE
-
-  /*
-   * Preferences:
-   *
-   * browser.startup.homepage
-   * - the user's home page, as a string; if the home page is a set of tabs,
-   *   this will be those URLs separated by the pipe character "|"
-   * browser.startup.page
-   * - what page(s) to show when the user starts the application, as an integer:
-   *
-   *     0: a blank page
-   *     1: the home page (as set by the browser.startup.homepage pref)
-   *     2: the last page the user visited (DEPRECATED)
-   *     3: windows and tabs from the last session (a.k.a. session restore)
-   *
-   *   The deprecated option is not exposed in UI; however, if the user has it
-   *   selected and doesn't change the UI for this preference, the deprecated
-   *   option is preserved.
-   */
-
-  syncFromHomePref() {
-    let homePref = document.getElementById("browser.startup.homepage");
-
-    // If the pref is set to about:home or about:newtab, set the value to ""
-    // to show the placeholder text (about:home title) rather than
-    // exposing those URLs to users.
-    let defaultBranch = Services.prefs.getDefaultBranch("");
-    let defaultValue = defaultBranch.getComplexValue("browser.startup.homepage",
-                                                     Ci.nsIPrefLocalizedString).data;
-    let currentValue = homePref.value.toLowerCase();
-    if (currentValue == "about:home" ||
-        (currentValue == defaultValue && currentValue == "about:newtab")) {
-      return "";
-    }
-
-    // If the pref is actually "", show about:blank.  The actual home page
-    // loading code treats them the same, and we don't want the placeholder text
-    // to be shown.
-    if (homePref.value == "")
-      return "about:blank";
-
-    // Otherwise, show the actual pref value.
-    return undefined;
-  },
-
-  syncToHomePref(value) {
-    // If the value is "", use about:home.
-    if (value == "")
-      return "about:home";
-
-    // Otherwise, use the actual textbox value.
-    return undefined;
-  },
-
-  /**
-   * Sets the home page to the current displayed page (or frontmost tab, if the
-   * most recent browser window contains multiple tabs), updating preference
-   * window UI to reflect this.
-   */
-  setHomePageToCurrent() {
-    let homePage = document.getElementById("browser.startup.homepage");
-    let tabs = this._getTabsForHomePage();
-    function getTabURI(t) {
-      return t.linkedBrowser.currentURI.spec;
-    }
-
-    // FIXME Bug 244192: using dangerous "|" joiner!
-    if (tabs.length)
-      homePage.value = tabs.map(getTabURI).join("|");
-  },
-
-  /**
-   * Displays a dialog in which the user can select a bookmark to use as home
-   * page.  If the user selects a bookmark, that bookmark's name is displayed in
-   * UI and the bookmark's address is stored to the home page preference.
-   */
-  setHomePageToBookmark() {
-    var rv = { urls: null, names: null };
-    gSubDialog.open("chrome://browser/content/preferences/selectBookmark.xul",
-                    "resizable=yes, modal=yes", rv,
-                    this._setHomePageToBookmarkClosed.bind(this, rv));
-  },
-
-  _setHomePageToBookmarkClosed(rv, aEvent) {
-    if (aEvent.detail.button != "accept")
-      return;
-    if (rv.urls && rv.names) {
-      var homePage = document.getElementById("browser.startup.homepage");
-
-      // XXX still using dangerous "|" joiner!
-      homePage.value = rv.urls.join("|");
-    }
-  },
-
-  /**
-   * Switches the "Use Current Page" button between its singular and plural
-   * forms.
-   */
-  _updateUseCurrentButton() {
-    let useCurrent = document.getElementById("useCurrent");
-
-
-    let tabs = this._getTabsForHomePage();
-
-    if (tabs.length > 1)
-      useCurrent.label = useCurrent.getAttribute("label2");
-    else
-      useCurrent.label = useCurrent.getAttribute("label1");
-
-    // In this case, the button's disabled state is set by preferences.xml.
-    let prefName = "pref.browser.homepage.disable_button.current_page";
-    if (document.getElementById(prefName).locked)
-      return;
-
-    useCurrent.disabled = !tabs.length
-  },
-
-  _getTabsForHomePage() {
-    var win;
-    var tabs = [];
-
-    const Cc = Components.classes, Ci = Components.interfaces;
-    var wm = Cc["@mozilla.org/appshell/window-mediator;1"]
-                .getService(Ci.nsIWindowMediator);
-    win = wm.getMostRecentWindow("navigator:browser");
-
-    if (win && win.document.documentElement
-                  .getAttribute("windowtype") == "navigator:browser") {
-      // We should only include visible & non-pinned tabs
-
-      tabs = win.gBrowser.visibleTabs.slice(win.gBrowser._numPinnedTabs);
-      tabs = tabs.filter(this.isNotAboutPreferences);
-    }
-
-    return tabs;
-  },
-
-  /**
-   * Check to see if a tab is not about:preferences
-   */
-  isNotAboutPreferences(aElement, aIndex, aArray) {
-    return !aElement.linkedBrowser.currentURI.spec.startsWith("about:preferences");
-  },
-
-  /**
-   * Restores the default home page as the user's home page.
-   */
-  restoreDefaultHomePage() {
-    var homePage = document.getElementById("browser.startup.homepage");
-    homePage.value = homePage.defaultValue;
-  },
-
-  updateDefaultPerformanceSettingsPref() {
-    let defaultPerformancePref =
-      document.getElementById("browser.preferences.defaultPerformanceSettings.enabled");
-    let processCountPref = document.getElementById("dom.ipc.processCount");
-    let accelerationPref = document.getElementById("layers.acceleration.disabled");
-    if (processCountPref.value != processCountPref.defaultValue ||
-        accelerationPref.value != accelerationPref.defaultValue) {
-      defaultPerformancePref.value = false;
-    }
-  },
-
-  updatePerformanceSettingsBox() {
-    let defaultPerformancePref =
-      document.getElementById("browser.preferences.defaultPerformanceSettings.enabled");
-    let performanceSettings = document.getElementById("performanceSettings");
-    if (defaultPerformancePref.value) {
-      let processCountPref = document.getElementById("dom.ipc.processCount");
-      let accelerationPref = document.getElementById("layers.acceleration.disabled");
-      processCountPref.value = processCountPref.defaultValue;
-      accelerationPref.value = accelerationPref.defaultValue;
-      performanceSettings.hidden = true;
-    } else {
-      performanceSettings.hidden = false;
-    }
-  },
-
-  buildContentProcessCountMenuList() {
-    let processCountPref = document.getElementById("dom.ipc.processCount");
-    let bundlePreferences = document.getElementById("bundlePreferences");
-    let label = bundlePreferences.getFormattedString("defaultContentProcessCount",
-      [processCountPref.defaultValue]);
-    let contentProcessCount =
-      document.querySelector(`#contentProcessCount > menupopup >
-                              menuitem[value="${processCountPref.defaultValue}"]`);
-    contentProcessCount.label = label;
-  },
-
-  // DOWNLOADS
-
-  /*
-   * Preferences:
-   *
-   * browser.download.useDownloadDir - bool
-   *   True - Save files directly to the folder configured via the
-   *   browser.download.folderList preference.
-   *   False - Always ask the user where to save a file and default to
-   *   browser.download.lastDir when displaying a folder picker dialog.
-   * browser.download.dir - local file handle
-   *   A local folder the user may have selected for downloaded files to be
-   *   saved. Migration of other browser settings may also set this path.
-   *   This folder is enabled when folderList equals 2.
-   * browser.download.lastDir - local file handle
-   *   May contain the last folder path accessed when the user browsed
-   *   via the file save-as dialog. (see contentAreaUtils.js)
-   * browser.download.folderList - int
-   *   Indicates the location users wish to save downloaded files too.
-   *   It is also used to display special file labels when the default
-   *   download location is either the Desktop or the Downloads folder.
-   *   Values:
-   *     0 - The desktop is the default download location.
-   *     1 - The system's downloads folder is the default download location.
-   *     2 - The default download location is elsewhere as specified in
-   *         browser.download.dir.
-   * browser.download.downloadDir
-   *   deprecated.
-   * browser.download.defaultFolder
-   *   deprecated.
-   */
-
-  /**
-   * Enables/disables the folder field and Browse button based on whether a
-   * default download directory is being used.
-   */
-  readUseDownloadDir() {
-    var downloadFolder = document.getElementById("downloadFolder");
-    var chooseFolder = document.getElementById("chooseFolder");
-    var preference = document.getElementById("browser.download.useDownloadDir");
-    downloadFolder.disabled = !preference.value || preference.locked;
-    chooseFolder.disabled = !preference.value || preference.locked;
-
-    // don't override the preference's value in UI
-    return undefined;
-  },
-
-  /**
-   * Displays a file picker in which the user can choose the location where
-   * downloads are automatically saved, updating preferences and UI in
-   * response to the choice, if one is made.
-   */
-  chooseFolder() {
-    return this.chooseFolderTask().catch(Components.utils.reportError);
-  },
-  async chooseFolderTask() {
-    let bundlePreferences = document.getElementById("bundlePreferences");
-    let title = bundlePreferences.getString("chooseDownloadFolderTitle");
-    let folderListPref = document.getElementById("browser.download.folderList");
-    let currentDirPref = await this._indexToFolder(folderListPref.value);
-    let defDownloads = await this._indexToFolder(1);
-    let fp = Components.classes["@mozilla.org/filepicker;1"].
-             createInstance(Components.interfaces.nsIFilePicker);
-
-    fp.init(window, title, Components.interfaces.nsIFilePicker.modeGetFolder);
-    fp.appendFilters(Components.interfaces.nsIFilePicker.filterAll);
-    // First try to open what's currently configured
-    if (currentDirPref && currentDirPref.exists()) {
-      fp.displayDirectory = currentDirPref;
-    } else if (defDownloads && defDownloads.exists()) {
-      // Try the system's download dir
-      fp.displayDirectory = defDownloads;
-    } else {
-      // Fall back to Desktop
-      fp.displayDirectory = await this._indexToFolder(0);
-    }
-
-    let result = await new Promise(resolve => fp.open(resolve));
-    if (result != Components.interfaces.nsIFilePicker.returnOK) {
-      return;
-    }
-
-    let downloadDirPref = document.getElementById("browser.download.dir");
-    downloadDirPref.value = fp.file;
-    folderListPref.value = await this._folderToIndex(fp.file);
-    // Note, the real prefs will not be updated yet, so dnld manager's
-    // userDownloadsDirectory may not return the right folder after
-    // this code executes. displayDownloadDirPref will be called on
-    // the assignment above to update the UI.
-  },
-
-  /**
-   * Initializes the download folder display settings based on the user's
-   * preferences.
-   */
-  displayDownloadDirPref() {
-    this.displayDownloadDirPrefTask().catch(Components.utils.reportError);
-
-    // don't override the preference's value in UI
-    return undefined;
-  },
-
-  async displayDownloadDirPrefTask() {
-    var folderListPref = document.getElementById("browser.download.folderList");
-    var bundlePreferences = document.getElementById("bundlePreferences");
-    var downloadFolder = document.getElementById("downloadFolder");
-    var currentDirPref = document.getElementById("browser.download.dir");
-
-    // Used in defining the correct path to the folder icon.
-    var ios = Components.classes["@mozilla.org/network/io-service;1"]
-                        .getService(Components.interfaces.nsIIOService);
-    var fph = ios.getProtocolHandler("file")
-                 .QueryInterface(Components.interfaces.nsIFileProtocolHandler);
-    var iconUrlSpec;
-
-    // Display a 'pretty' label or the path in the UI.
-    if (folderListPref.value == 2) {
-      // Custom path selected and is configured
-      downloadFolder.label = this._getDisplayNameOfFile(currentDirPref.value);
-      iconUrlSpec = fph.getURLSpecFromFile(currentDirPref.value);
-    } else if (folderListPref.value == 1) {
-      // 'Downloads'
-      downloadFolder.label = bundlePreferences.getString("downloadsFolderName");
-      iconUrlSpec = fph.getURLSpecFromFile(await this._indexToFolder(1));
-    } else {
-      // 'Desktop'
-      downloadFolder.label = bundlePreferences.getString("desktopFolderName");
-      iconUrlSpec = fph.getURLSpecFromFile(await this._getDownloadsFolder("Desktop"));
-    }
-    downloadFolder.image = "moz-icon://" + iconUrlSpec + "?size=16";
-  },
-
-  /**
-   * Returns the textual path of a folder in readable form.
-   */
-  _getDisplayNameOfFile(aFolder) {
-    // TODO: would like to add support for 'Downloads on Macintosh HD'
-    //       for OS X users.
-    return aFolder ? aFolder.path : "";
-  },
-
-  /**
-   * Returns the Downloads folder.  If aFolder is "Desktop", then the Downloads
-   * folder returned is the desktop folder; otherwise, it is a folder whose name
-   * indicates that it is a download folder and whose path is as determined by
-   * the XPCOM directory service via the download manager's attribute
-   * defaultDownloadsDirectory.
-   *
-   * @throws if aFolder is not "Desktop" or "Downloads"
-   */
-  async _getDownloadsFolder(aFolder) {
-    switch (aFolder) {
-      case "Desktop":
-        var fileLoc = Components.classes["@mozilla.org/file/directory_service;1"]
-                                    .getService(Components.interfaces.nsIProperties);
-        return fileLoc.get("Desk", Components.interfaces.nsILocalFile);
-      case "Downloads":
-        let downloadsDir = await Downloads.getSystemDownloadsDirectory();
-        return new FileUtils.File(downloadsDir);
-    }
-    throw "ASSERTION FAILED: folder type should be 'Desktop' or 'Downloads'";
-  },
-
-  /**
-   * Determines the type of the given folder.
-   *
-   * @param   aFolder
-   *          the folder whose type is to be determined
-   * @returns integer
-   *          0 if aFolder is the Desktop or is unspecified,
-   *          1 if aFolder is the Downloads folder,
-   *          2 otherwise
-   */
-  async _folderToIndex(aFolder) {
-    if (!aFolder || aFolder.equals(await this._getDownloadsFolder("Desktop")))
-      return 0;
-    else if (aFolder.equals(await this._getDownloadsFolder("Downloads")))
-      return 1;
-    return 2;
-  },
-
-  /**
-   * Converts an integer into the corresponding folder.
-   *
-   * @param   aIndex
-   *          an integer
-   * @returns the Desktop folder if aIndex == 0,
-   *          the Downloads folder if aIndex == 1,
-   *          the folder stored in browser.download.dir
-   */
-  async _indexToFolder(aIndex) {
-    switch (aIndex) {
-      case 0:
-        return await this._getDownloadsFolder("Desktop");
-      case 1:
-        return await this._getDownloadsFolder("Downloads");
-    }
-    var currentDirPref = document.getElementById("browser.download.dir");
-    return currentDirPref.value;
-  },
-
-  /**
-   * Hide/show the "Show my windows and tabs from last time" option based
-   * on the value of the browser.privatebrowsing.autostart pref.
-   */
-  updateBrowserStartupLastSession() {
-    let pbAutoStartPref = document.getElementById("browser.privatebrowsing.autostart");
-    let startupPref = document.getElementById("browser.startup.page");
-    let menu = document.getElementById("browserStartupPage");
-    let option = document.getElementById("browserStartupLastSession");
-    if (pbAutoStartPref.value) {
-      option.setAttribute("disabled", "true");
-      if (option.selected) {
-        menu.selectedItem = document.getElementById("browserStartupHomePage");
-      }
-    } else {
-      option.removeAttribute("disabled");
-      startupPref.updateElements(); // select the correct index in the startup menulist
-    }
-  },
-
-  // TABS
-
-  /*
-   * Preferences:
-   *
-   * browser.link.open_newwindow - int
-   *   Determines where links targeting new windows should open.
-   *   Values:
-   *     1 - Open in the current window or tab.
-   *     2 - Open in a new window.
-   *     3 - Open in a new tab in the most recent window.
-   * browser.tabs.loadInBackground - bool
-   *   True - Whether browser should switch to a new tab opened from a link.
-   * browser.tabs.warnOnClose - bool
-   *   True - If when closing a window with multiple tabs the user is warned and
-   *          allowed to cancel the action, false to just close the window.
-   * browser.tabs.warnOnOpen - bool
-   *   True - Whether the user should be warned when trying to open a lot of
-   *          tabs at once (e.g. a large folder of bookmarks), allowing to
-   *          cancel the action.
-   * browser.taskbar.previews.enable - bool
-   *   True - Tabs are to be shown in Windows 7 taskbar.
-   *   False - Only the window is to be shown in Windows 7 taskbar.
-   */
-
-  /**
-   * Determines where a link which opens a new window will open.
-   *
-   * @returns |true| if such links should be opened in new tabs
-   */
-  readLinkTarget() {
-    var openNewWindow = document.getElementById("browser.link.open_newwindow");
-    return openNewWindow.value != 2;
-  },
-
-  /**
-   * Determines where a link which opens a new window will open.
-   *
-   * @returns 2 if such links should be opened in new windows,
-   *          3 if such links should be opened in new tabs
-   */
-  writeLinkTarget() {
-    var linkTargeting = document.getElementById("linkTargeting");
-    return linkTargeting.checked ? 3 : 2;
-  },
-  /*
-   * Preferences:
-   *
-   * browser.shell.checkDefault
-   * - true if a default-browser check (and prompt to make it so if necessary)
-   *   occurs at startup, false otherwise
-   */
-
-  /**
-   * Show button for setting browser as default browser or information that
-   * browser is already the default browser.
-   */
-  updateSetDefaultBrowser() {
-    if (AppConstants.HAVE_SHELL_SERVICE) {
-      let shellSvc = getShellService();
-      let defaultBrowserBox = document.getElementById("defaultBrowserBox");
-      if (!shellSvc) {
-        defaultBrowserBox.hidden = true;
-        return;
-      }
-      let setDefaultPane = document.getElementById("setDefaultPane");
-      let isDefault = shellSvc.isDefaultBrowser(false, true);
-      setDefaultPane.selectedIndex = isDefault ? 1 : 0;
-      let alwaysCheck = document.getElementById("alwaysCheckDefault");
-      alwaysCheck.disabled = alwaysCheck.disabled ||
-                             isDefault && alwaysCheck.checked;
-    }
-  },
-
-  /**
-   * Set browser as the operating system default browser.
-   */
-  setDefaultBrowser() {
-    if (AppConstants.HAVE_SHELL_SERVICE) {
-      let alwaysCheckPref = document.getElementById("browser.shell.checkDefaultBrowser");
-      alwaysCheckPref.value = true;
-
-      let shellSvc = getShellService();
-      if (!shellSvc)
-        return;
-      try {
-        shellSvc.setDefaultBrowser(true, false);
-      } catch (ex) {
-        Cu.reportError(ex);
-        return;
-      }
-
-      let selectedIndex = shellSvc.isDefaultBrowser(false, true) ? 1 : 0;
-      document.getElementById("setDefaultPane").selectedIndex = selectedIndex;
-    }
-  },
-};
deleted file mode 100644
--- a/browser/components/preferences/in-content-old/main.xul
+++ /dev/null
@@ -1,355 +0,0 @@
-# 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/.
-
-<!-- General panel -->
-
-<script type="application/javascript"
-        src="chrome://browser/content/preferences/in-content-old/main.js"/>
-
-<stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences.properties"/>
-
-<preferences id="mainPreferences" hidden="true" data-category="paneGeneral">
-
-#ifdef E10S_TESTING_ONLY
-    <preference id="browser.tabs.remote.autostart"
-                name="browser.tabs.remote.autostart"
-                type="bool"/>
-    <preference id="e10sTempPref"
-                name="browser.tabs.remote.autostart.2"
-                type="bool"/>
-    <preference id="e10sForceEnable"
-                name="browser.tabs.remote.force-enable"
-                type="bool"/>
-#endif
-
-    <!-- Startup -->
-    <preference id="browser.startup.page"
-                name="browser.startup.page"
-                type="int"/>
-    <preference id="browser.startup.homepage"
-                name="browser.startup.homepage"
-                type="wstring"/>
-
-#ifdef HAVE_SHELL_SERVICE
-    <preference id="browser.shell.checkDefaultBrowser"
-                name="browser.shell.checkDefaultBrowser"
-                type="bool"/>
-
-    <preference id="pref.general.disable_button.default_browser"
-                name="pref.general.disable_button.default_browser"
-                type="bool"/>
-#endif
-
-    <preference id="pref.browser.homepage.disable_button.current_page"
-                name="pref.browser.homepage.disable_button.current_page"
-                type="bool"/>
-    <preference id="pref.browser.homepage.disable_button.bookmark_page"
-                name="pref.browser.homepage.disable_button.bookmark_page"
-                type="bool"/>
-    <preference id="pref.browser.homepage.disable_button.restore_default"
-                name="pref.browser.homepage.disable_button.restore_default"
-                type="bool"/>
-
-    <preference id="browser.privatebrowsing.autostart"
-                name="browser.privatebrowsing.autostart"
-                type="bool"/>
-
-    <!-- Downloads -->
-    <preference id="browser.download.useDownloadDir"
-                name="browser.download.useDownloadDir"
-                type="bool"/>
-
-    <preference id="browser.download.folderList"
-                name="browser.download.folderList"
-                type="int"/>
-    <preference id="browser.download.dir"
-                name="browser.download.dir"
-                type="file"/>
-    <!-- Tab preferences
-    Preferences:
-
-    browser.link.open_newwindow
-        1 opens such links in the most recent window or tab,
-        2 opens such links in a new window,
-        3 opens such links in a new tab
-    browser.tabs.loadInBackground
-    - true if display should switch to a new tab which has been opened from a
-      link, false if display shouldn't switch
-    browser.tabs.warnOnClose
-    - true if when closing a window with multiple tabs the user is warned and
-      allowed to cancel the action, false to just close the window
-    browser.tabs.warnOnOpen
-    - true if the user should be warned if he attempts to open a lot of tabs at
-      once (e.g. a large folder of bookmarks), false otherwise
-    browser.taskbar.previews.enable
-    - true if tabs are to be shown in the Windows 7 taskbar
-    -->
-
-    <preference id="browser.link.open_newwindow"
-                name="browser.link.open_newwindow"
-                type="int"/>
-    <preference id="browser.tabs.loadInBackground"
-                name="browser.tabs.loadInBackground"
-                type="bool"
-                inverted="true"/>
-    <preference id="browser.tabs.warnOnClose"
-                name="browser.tabs.warnOnClose"
-                type="bool"/>
-    <preference id="browser.tabs.warnOnOpen"
-                name="browser.tabs.warnOnOpen"
-                type="bool"/>
-    <preference id="browser.sessionstore.restore_on_demand"
-                name="browser.sessionstore.restore_on_demand"
-                type="bool"/>
-#ifdef XP_WIN
-    <preference id="browser.taskbar.previews.enable"
-                name="browser.taskbar.previews.enable"
-                type="bool"/>
-#endif
-    <preference id="browser.ctrlTab.previews"
-                name="browser.ctrlTab.previews"
-                type="bool"/>
-
-  <preference id="browser.preferences.defaultPerformanceSettings.enabled"
-              name="browser.preferences.defaultPerformanceSettings.enabled"
-              type="bool"/>
-
-  <preference id="dom.ipc.processCount"
-              name="dom.ipc.processCount"
-              type="int"/>
-
-  <preference id="layers.acceleration.disabled"
-              name="layers.acceleration.disabled"
-              type="bool"
-              inverted="true"/>
-</preferences>
-
-<hbox id="header-general"
-      class="header"
-      hidden="true"
-      data-category="paneGeneral">
-  <label class="header-name" flex="1">&paneGeneral.title;</label>
-  <html:a class="help-button" target="_blank" aria-label="&helpButton.label;"></html:a>
-</hbox>
-
-<!-- Startup -->
-<groupbox id="startupGroup"
-          data-category="paneGeneral"
-          hidden="true">
-  <caption><label>&startup.label;</label></caption>
-
-#ifdef MOZ_DEV_EDITION
-  <vbox id="separateProfileBox">
-    <checkbox id="separateProfileMode"
-              label="&separateProfileMode.label;"/>
-    <hbox align="center" class="indent">
-      <label id="useFirefoxSync">&useFirefoxSync.label;</label>
-      <deck id="getStarted">
-        <label class="text-link">&getStarted.notloggedin.label;</label>
-        <label class="text-link">&getStarted.configured.label;</label>
-      </deck>
-    </hbox>
-  </vbox>
-#endif
-
-#ifdef E10S_TESTING_ONLY
-  <checkbox id="e10sAutoStart"
-            label="&e10sEnabled.label;"/>
-#endif
-
-#ifdef HAVE_SHELL_SERVICE
-  <vbox id="defaultBrowserBox">
-    <hbox align="center">
-      <checkbox id="alwaysCheckDefault" preference="browser.shell.checkDefaultBrowser"
-                label="&alwaysCheckDefault2.label;" accesskey="&alwaysCheckDefault2.accesskey;"/>
-    </hbox>
-    <deck id="setDefaultPane">
-      <hbox align="center" class="indent">
-        <label id="isNotDefaultLabel" flex="1">&isNotDefault.label;</label>
-        <button id="setDefaultButton"
-                label="&setAsMyDefaultBrowser2.label;" accesskey="&setAsMyDefaultBrowser2.accesskey;"
-                preference="pref.general.disable_button.default_browser"/>
-      </hbox>
-      <hbox align="center" class="indent">
-        <label id="isDefaultLabel" flex="1">&isDefault.label;</label>
-      </hbox>
-    </deck>
-    <separator class="thin"/>
-  </vbox>
-#endif
-
-  <html:table id="startupTable">
-    <html:tr>
-      <html:td class="label-cell">
-        <label accesskey="&startupPage.accesskey;"
-               control="browserStartupPage">&startupPage.label;</label>
-      </html:td>
-      <html:td class="content-cell">
-        <menulist id="browserStartupPage"
-                  class="content-cell-item"
-                  preference="browser.startup.page">
-          <menupopup>
-          <menuitem label="&startupUserHomePage.label;"
-                    value="1"
-                    id="browserStartupHomePage"/>
-          <menuitem label="&startupBlankPage.label;"
-                    value="0"
-                    id="browserStartupBlank"/>
-          <menuitem label="&startupPrevSession.label;"
-                    value="3"
-                    id="browserStartupLastSession"/>
-          </menupopup>
-        </menulist>
-      </html:td>
-    </html:tr>
-    <html:tr>
-      <html:td class="label-cell">
-        <label accesskey="&homepage.accesskey;"
-               control="browserHomePage">&homepage.label;</label>
-      </html:td>
-      <html:td class="content-cell">
-        <textbox id="browserHomePage"
-                 class="padded uri-element content-cell-item"
-                 type="autocomplete"
-                 autocompletesearch="unifiedcomplete"
-                 onsyncfrompreference="return gMainPane.syncFromHomePref();"
-                 onsynctopreference="return gMainPane.syncToHomePref(this.value);"
-                 placeholder="&abouthome.pageTitle;"
-                 preference="browser.startup.homepage"/>
-      </html:td>
-    </html:tr>
-    <html:tr>
-      <html:td class="label-cell" />
-      <html:td class="content-cell homepage-buttons">
-        <button id="useCurrent"
-                class="content-cell-item"
-                label=""
-                accesskey="&useCurrentPage.accesskey;"
-                label1="&useCurrentPage.label;"
-                label2="&useMultiple.label;"
-                preference="pref.browser.homepage.disable_button.current_page"/>
-        <button id="useBookmark"
-                class="content-cell-item"
-                label="&chooseBookmark.label;"
-                accesskey="&chooseBookmark.accesskey;"
-                preference="pref.browser.homepage.disable_button.bookmark_page"/>
-        <button id="restoreDefaultHomePage"
-                class="content-cell-item"
-                label="&restoreDefault.label;"
-                accesskey="&restoreDefault.accesskey;"
-                preference="pref.browser.homepage.disable_button.restore_default"/>
-      </html:td>
-    </html:tr>
-  </html:table>
-</groupbox>
-
-<!-- Downloads -->
-<groupbox id="downloadsGroup"
-          data-category="paneGeneral"
-          hidden="true">
-  <caption><label>&downloads.label;</label></caption>
-
-  <radiogroup id="saveWhere"
-              preference="browser.download.useDownloadDir"
-              onsyncfrompreference="return gMainPane.readUseDownloadDir();">
-    <hbox id="saveToRow">
-      <radio id="saveTo"
-             value="true"
-             label="&saveTo.label;"
-             accesskey="&saveTo.accesskey;"
-             aria-labelledby="saveTo downloadFolder"/>
-      <filefield id="downloadFolder"
-                 flex="1"
-                 preference="browser.download.folderList"
-                 preference-editable="true"
-                 aria-labelledby="saveTo"
-                 onsyncfrompreference="return gMainPane.displayDownloadDirPref();"/>
-      <button id="chooseFolder"
-#ifdef XP_MACOSX
-              accesskey="&chooseFolderMac.accesskey;"
-              label="&chooseFolderMac.label;"
-#else
-              accesskey="&chooseFolderWin.accesskey;"
-              label="&chooseFolderWin.label;"
-#endif
-      />
-    </hbox>
-    <hbox>
-      <radio id="alwaysAsk"
-             value="false"
-             label="&alwaysAskWhere.label;"
-             accesskey="&alwaysAskWhere.accesskey;"/>
-    </hbox>
-  </radiogroup>
-</groupbox>
-
-<!-- Tab preferences -->
-<groupbox data-category="paneGeneral"
-          hidden="true" align="start">
-    <caption><label>&tabsGroup.label;</label></caption>
-
-    <checkbox id="ctrlTabRecentlyUsedOrder" label="&ctrlTabRecentlyUsedOrder.label;"
-              accesskey="&ctrlTabRecentlyUsedOrder.accesskey;"
-              preference="browser.ctrlTab.previews"/>
-
-    <checkbox id="linkTargeting" label="&newWindowsAsTabs.label;"
-              accesskey="&newWindowsAsTabs.accesskey;"
-              preference="browser.link.open_newwindow"
-              onsyncfrompreference="return gMainPane.readLinkTarget();"
-              onsynctopreference="return gMainPane.writeLinkTarget();"/>
-
-    <checkbox id="warnCloseMultiple" label="&warnOnCloseMultipleTabs.label;"
-              accesskey="&warnOnCloseMultipleTabs.accesskey;"
-              preference="browser.tabs.warnOnClose"/>
-
-    <checkbox id="warnOpenMany" label="&warnOnOpenManyTabs.label;"
-              accesskey="&warnOnOpenManyTabs.accesskey;"
-              preference="browser.tabs.warnOnOpen"/>
-
-    <checkbox id="switchToNewTabs" label="&switchLinksToNewTabs.label;"
-              accesskey="&switchLinksToNewTabs.accesskey;"
-              preference="browser.tabs.loadInBackground"/>
-
-#ifdef XP_WIN
-    <checkbox id="showTabsInTaskbar" label="&showTabsInTaskbar.label;"
-              accesskey="&showTabsInTaskbar.accesskey;"
-              preference="browser.taskbar.previews.enable"/>
-#endif
-</groupbox>
-
-<!-- Performance -->
-<groupbox id="performanceGroup" data-category="paneGeneral" hidden="true">
-  <caption><label>&performance.label;</label></caption>
-
-  <hbox align="center">
-    <checkbox id="useRecommendedPerformanceSettings"
-              label="&useRecommendedPerformanceSettings.label;"
-              accesskey="&useRecommendedPerformanceSettings.accesskey;"
-              preference="browser.preferences.defaultPerformanceSettings.enabled"/>
-    <label id="performanceSettingsLearnMore" class="learnMore text-link">&performanceSettingsLearnMore.label;</label>
-  </hbox>
-  <description class="indent">&useRecommendedPerformanceSettings.description;</description>
-
-  <vbox id="performanceSettings" class="indent" hidden="true">
-    <checkbox id="allowHWAccel"
-              label="&allowHWAccel.label;"
-              accesskey="&allowHWAccel.accesskey;"
-              preference="layers.acceleration.disabled"/>
-    <hbox align="center">
-      <label id="limitContentProcess" accesskey="&limitContentProcessOption.accesskey;" control="contentProcessCount">&limitContentProcessOption.label;</label>
-      <menulist id="contentProcessCount" preference="dom.ipc.processCount">
-        <menupopup>
-          <menuitem label="1" value="1"/>
-          <menuitem label="2" value="2"/>
-          <menuitem label="3" value="3"/>
-          <menuitem label="4" value="4"/>
-          <menuitem label="5" value="5"/>
-          <menuitem label="6" value="6"/>
-          <menuitem label="7" value="7"/>
-        </menupopup>
-      </menulist>
-    </hbox>
-    <description>&limitContentProcessOption.description;</description>
-  </vbox>
-</groupbox>
deleted file mode 100644
--- a/browser/components/preferences/in-content-old/moz.build
+++ /dev/null
@@ -1,13 +0,0 @@
-# -*- 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/.
-
-for var in ('MOZ_APP_NAME', 'MOZ_MACBUNDLE_NAME'):
-    DEFINES[var] = CONFIG[var]
-
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk2', 'gtk3', 'cocoa'):
-    DEFINES['HAVE_SHELL_SERVICE'] = 1
-
-JAR_MANIFESTS += ['jar.mn']
deleted file mode 100644
--- a/browser/components/preferences/in-content-old/preferences.js
+++ /dev/null
@@ -1,313 +0,0 @@
-/* - 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/. */
-
-// Import globals from the files imported by the .xul files.
-/* import-globals-from subdialogs.js */
-/* import-globals-from advanced.js */
-/* import-globals-from main.js */
-/* import-globals-from search.js */
-/* import-globals-from containers.js */
-/* import-globals-from content.js */
-/* import-globals-from privacy.js */
-/* import-globals-from applications.js */
-/* import-globals-from security.js */
-/* import-globals-from sync.js */
-/* import-globals-from ../../../base/content/utilityOverlay.js */
-
-"use strict";
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-var Cr = Components.results;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
-
-var gLastHash = "";
-
-var gCategoryInits = new Map();
-function init_category_if_required(category) {
-  let categoryInfo = gCategoryInits.get(category);
-  if (!categoryInfo) {
-    throw "Unknown in-content prefs category! Can't init " + category;
-  }
-  if (categoryInfo.inited) {
-    return;
-  }
-  categoryInfo.init();
-}
-
-function register_module(categoryName, categoryObject) {
-  gCategoryInits.set(categoryName, {
-    inited: false,
-    init() {
-      categoryObject.init();
-      this.inited = true;
-    }
-  });
-}
-
-document.addEventListener("DOMContentLoaded", init_all, {once: true});
-
-function init_all() {
-  document.documentElement.instantApply = true;
-
-  gSubDialog.init();
-  register_module("paneGeneral", gMainPane);
-  register_module("paneSearch", gSearchPane);
-  register_module("panePrivacy", gPrivacyPane);
-  register_module("paneContainers", gContainersPane);
-  register_module("paneAdvanced", gAdvancedPane);
-  register_module("paneApplications", gApplicationsPane);
-  register_module("paneContent", gContentPane);
-  register_module("paneSync", gSyncPane);
-  register_module("paneSecurity", gSecurityPane);
-
-  let categories = document.getElementById("categories");
-  categories.addEventListener("select", event => gotoPref(event.target.value));
-
-  document.documentElement.addEventListener("keydown", function(event) {
-    if (event.keyCode == KeyEvent.DOM_VK_TAB) {
-      categories.setAttribute("keyboard-navigation", "true");
-    }
-  });
-  categories.addEventListener("mousedown", function() {
-    this.removeAttribute("keyboard-navigation");
-  });
-
-  window.addEventListener("hashchange", onHashChange);
-  gotoPref();
-
-  init_dynamic_padding();
-
-  var initFinished = new CustomEvent("Initialized", {
-    "bubbles": true,
-    "cancelable": true
-  });
-  document.dispatchEvent(initFinished);
-
-  categories = categories.querySelectorAll("richlistitem.category");
-  for (let category of categories) {
-    let name = internalPrefCategoryNameToFriendlyName(category.value);
-    let helpSelector = `#header-${name} > .help-button`;
-    let helpButton = document.querySelector(helpSelector);
-    helpButton.setAttribute("href", getHelpLinkURL(category.getAttribute("helpTopic")));
-  }
-
-  // Wait until initialization of all preferences are complete before
-  // notifying observers that the UI is now ready.
-  Services.obs.notifyObservers(window, "advanced-pane-loaded");
-}
-
-// Make the space above the categories list shrink on low window heights
-function init_dynamic_padding() {
-  let categories = document.getElementById("categories");
-  let catPadding = Number.parseInt(getComputedStyle(categories)
-                                     .getPropertyValue("padding-top"));
-  let fullHeight = categories.lastElementChild.getBoundingClientRect().bottom;
-  let mediaRule = `
-  @media (max-height: ${fullHeight}px) {
-    #categories {
-      padding-top: calc(100vh - ${fullHeight - catPadding}px);
-    }
-  }
-  `;
-  let mediaStyle = document.createElementNS("http://www.w3.org/1999/xhtml", "html:style");
-  mediaStyle.setAttribute("type", "text/css");
-  mediaStyle.appendChild(document.createCDATASection(mediaRule));
-  document.documentElement.appendChild(mediaStyle);
-}
-
-function telemetryBucketForCategory(category) {
-  switch (category) {
-    case "general":
-    case "search":
-    case "content":
-    case "applications":
-    case "privacy":
-    case "security":
-    case "sync":
-      return category;
-    case "advanced":
-      let advancedPaneTabs = document.getElementById("advancedPrefs");
-      switch (advancedPaneTabs.selectedTab.id) {
-        case "generalTab":
-          return "advancedGeneral";
-        case "dataChoicesTab":
-          return "advancedDataChoices";
-        case "networkTab":
-          return "advancedNetwork";
-        case "updateTab":
-          return "advancedUpdates";
-        case "encryptionTab":
-          return "advancedCerts";
-      }
-      // fall-through for unknown.
-    default:
-      return "unknown";
-  }
-}
-
-function onHashChange() {
-  gotoPref();
-}
-
-function gotoPref(aCategory) {
-  let categories = document.getElementById("categories");
-  const kDefaultCategoryInternalName = categories.firstElementChild.value;
-  let hash = document.location.hash;
-  let category = aCategory || hash.substr(1) || kDefaultCategoryInternalName;
-  category = friendlyPrefCategoryNameToInternalName(category);
-
-  // Updating the hash (below) or changing the selected category
-  // will re-enter gotoPref.
-  if (gLastHash == category)
-    return;
-  let item = categories.querySelector(".category[value=" + category + "]");
-  if (!item) {
-    category = kDefaultCategoryInternalName;
-    item = categories.querySelector(".category[value=" + category + "]");
-  }
-
-  try {
-    init_category_if_required(category);
-  } catch (ex) {
-    Cu.reportError("Error initializing preference category " + category + ": " + ex);
-    throw ex;
-  }
-
-  let friendlyName = internalPrefCategoryNameToFriendlyName(category);
-  if (gLastHash || category != kDefaultCategoryInternalName) {
-    document.location.hash = friendlyName;
-  }
-  // Need to set the gLastHash before setting categories.selectedItem since
-  // the categories 'select' event will re-enter the gotoPref codepath.
-  gLastHash = category;
-  categories.selectedItem = item;
-  window.history.replaceState(category, document.title);
-  search(category, "data-category");
-  let mainContent = document.querySelector(".main-content");
-  mainContent.scrollTop = 0;
-
-  Services.telemetry
-          .getHistogramById("FX_PREFERENCES_CATEGORY_OPENED")
-          .add(telemetryBucketForCategory(friendlyName));
-}
-
-function search(aQuery, aAttribute) {
-  let mainPrefPane = document.getElementById("mainPrefPane");
-  let elements = mainPrefPane.children;
-  for (let element of elements) {
-    let attributeValue = element.getAttribute(aAttribute);
-    element.hidden = (attributeValue != aQuery);
-  }
-
-  let keysets = mainPrefPane.getElementsByTagName("keyset");
-  for (let element of keysets) {
-    let attributeValue = element.getAttribute(aAttribute);
-    if (attributeValue == aQuery)
-      element.removeAttribute("disabled");
-    else
-      element.setAttribute("disabled", true);
-  }
-}
-
-function helpButtonCommand() {
-  let pane = history.state;
-  let categories = document.getElementById("categories");
-  let helpTopic = categories.querySelector(".category[value=" + pane + "]")
-                            .getAttribute("helpTopic");
-  openHelpLink(helpTopic);
-}
-
-function friendlyPrefCategoryNameToInternalName(aName) {
-  if (aName.startsWith("pane"))
-    return aName;
-  return "pane" + aName.substring(0, 1).toUpperCase() + aName.substr(1);
-}
-
-// This function is duplicated inside of utilityOverlay.js's openPreferences.
-function internalPrefCategoryNameToFriendlyName(aName) {
-  return (aName || "").replace(/^pane./, function(toReplace) { return toReplace[4].toLowerCase(); });
-}
-
-// Put up a confirm dialog with "ok to restart", "revert without restarting"
-// and "restart later" buttons and returns the index of the button chosen.
-// We can choose not to display the "restart later", or "revert" buttons,
-// altough the later still lets us revert by using the escape key.
-//
-// The constants are useful to interpret the return value of the function.
-const CONFIRM_RESTART_PROMPT_RESTART_NOW = 0;
-const CONFIRM_RESTART_PROMPT_CANCEL = 1;
-const CONFIRM_RESTART_PROMPT_RESTART_LATER = 2;
-function confirmRestartPrompt(aRestartToEnable, aDefaultButtonIndex,
-                              aWantRevertAsCancelButton,
-			      aWantRestartLaterButton) {
-  let brandName = document.getElementById("bundleBrand").getString("brandShortName");
-  let bundle = document.getElementById("bundlePreferences");
-  let msg = bundle.getFormattedString(aRestartToEnable ?
-                                      "featureEnableRequiresRestart" :
-                                      "featureDisableRequiresRestart",
-                                      [brandName]);
-  let title = bundle.getFormattedString("shouldRestartTitle", [brandName]);
-  let prompts = Cc["@mozilla.org/embedcomp/prompt-service;1"].getService(Ci.nsIPromptService);
-
-  // Set up the first (index 0) button:
-  let button0Text = bundle.getFormattedString("okToRestartButton", [brandName]);
-  let buttonFlags = (Services.prompt.BUTTON_POS_0 *
-                     Services.prompt.BUTTON_TITLE_IS_STRING);
-
-
-  // Set up the second (index 1) button:
-  let button1Text = null;
-  if (aWantRevertAsCancelButton) {
-    button1Text = bundle.getString("revertNoRestartButton");
-    buttonFlags += (Services.prompt.BUTTON_POS_1 *
-                    Services.prompt.BUTTON_TITLE_IS_STRING);
-  } else {
-    buttonFlags += (Services.prompt.BUTTON_POS_1 *
-                    Services.prompt.BUTTON_TITLE_CANCEL);
-  }
-
-  // Set up the third (index 2) button:
-  let button2Text = null;
-  if (aWantRestartLaterButton) {
-    button2Text = bundle.getString("restartLater");
-    buttonFlags += (Services.prompt.BUTTON_POS_2 *
-                    Services.prompt.BUTTON_TITLE_IS_STRING);
-  }
-
-  switch (aDefaultButtonIndex) {
-    case 0:
-      buttonFlags += Services.prompt.BUTTON_POS_0_DEFAULT;
-      break;
-    case 1:
-      buttonFlags += Services.prompt.BUTTON_POS_1_DEFAULT;
-      break;
-    case 2:
-      buttonFlags += Services.prompt.BUTTON_POS_2_DEFAULT;
-      break;
-    default:
-      break;
-  }
-
-  let buttonIndex = prompts.confirmEx(window, title, msg, buttonFlags,
-                                      button0Text, button1Text, button2Text,
-                                      null, {});
-
-  // If we have the second confirmation dialog for restart, see if the user
-  // cancels out at that point.
-  if (buttonIndex == CONFIRM_RESTART_PROMPT_RESTART_NOW) {
-    let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"]
-                       .createInstance(Ci.nsISupportsPRBool);
-    Services.obs.notifyObservers(cancelQuit, "quit-application-requested",
-                                  "restart");
-    if (cancelQuit.data) {
-      buttonIndex = CONFIRM_RESTART_PROMPT_CANCEL;
-    }
-  }
-  return buttonIndex;
-}
deleted file mode 100644
--- a/browser/components/preferences/in-content-old/preferences.xul
+++ /dev/null
@@ -1,224 +0,0 @@
-<?xml version="1.0"?>
-<!-- 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/. -->
-
-<?xml-stylesheet href="chrome://global/skin/global.css"?>
-
-<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?>
-<?xml-stylesheet href="chrome://global/skin/in-content/common.css"?>
-<?xml-stylesheet
-  href="chrome://browser/skin/preferences/in-content-old/preferences.css"?>
-<?xml-stylesheet
-  href="chrome://browser/content/preferences/handlers.css"?>
-<?xml-stylesheet href="chrome://browser/skin/preferences/applications.css"?>
-<?xml-stylesheet href="chrome://browser/skin/preferences/in-content-old/search.css"?>
-<?xml-stylesheet href="chrome://browser/skin/preferences/in-content-old/containers.css"?>
-
-<!DOCTYPE page [
-<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
-<!ENTITY % globalPreferencesDTD SYSTEM "chrome://global/locale/preferences.dtd">
-<!ENTITY % preferencesDTD SYSTEM
-  "chrome://browser/locale/preferences-old/preferences.dtd">
-<!ENTITY % privacyDTD SYSTEM "chrome://browser/locale/preferences-old/privacy.dtd">
-<!ENTITY % tabsDTD SYSTEM "chrome://browser/locale/preferences-old/tabs.dtd">
-<!ENTITY % searchDTD SYSTEM "chrome://browser/locale/preferences-old/search.dtd">
-<!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd">
-<!ENTITY % syncDTD SYSTEM "chrome://browser/locale/preferences-old/sync.dtd">
-<!ENTITY % securityDTD SYSTEM
-  "chrome://browser/locale/preferences-old/security.dtd">
-<!ENTITY % containersDTD SYSTEM
-  "chrome://browser/locale/preferences-old/containers.dtd">
-<!ENTITY % sanitizeDTD SYSTEM "chrome://browser/locale/sanitize.dtd">
-<!ENTITY % mainDTD SYSTEM "chrome://browser/locale/preferences-old/main.dtd">
-<!ENTITY % aboutHomeDTD SYSTEM "chrome://browser/locale/aboutHome.dtd">
-<!ENTITY % contentDTD SYSTEM "chrome://browser/locale/preferences-old/content.dtd">
-<!ENTITY % applicationsDTD SYSTEM
-  "chrome://browser/locale/preferences-old/applications.dtd">
-<!ENTITY % advancedDTD SYSTEM
-  "chrome://browser/locale/preferences-old/advanced.dtd">
-%brandDTD;
-%globalPreferencesDTD;
-%preferencesDTD;
-%privacyDTD;
-%tabsDTD;
-%searchDTD;
-%syncBrandDTD;
-%syncDTD;
-%securityDTD;
-%containersDTD;
-%sanitizeDTD;
-%mainDTD;
-%aboutHomeDTD;
-%contentDTD;
-%applicationsDTD;
-%advancedDTD;
-]>
-
-#ifdef XP_WIN
-#define USE_WIN_TITLE_STYLE
-#endif
-
-<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-      xmlns:html="http://www.w3.org/1999/xhtml"
-      disablefastfind="true"
-#ifdef USE_WIN_TITLE_STYLE
-      title="&prefWindow.titleWin;">
-#else
-      title="&prefWindow.title;">
-#endif
-
-  <html:link rel="shortcut icon"
-              href="chrome://browser/skin/preferences/in-content-old/favicon.ico"/>
-
-  <script type="application/javascript"
-          src="chrome://browser/content/utilityOverlay.js"/>
-  <script type="application/javascript"
-          src="chrome://browser/content/preferences/in-content-old/preferences.js"/>
-  <script src="chrome://browser/content/preferences/in-content-old/subdialogs.js"/>
-
-  <stringbundle id="bundleBrand"
-                src="chrome://branding/locale/brand.properties"/>
-  <stringbundle id="bundlePreferences"
-                src="chrome://browser/locale/preferences-old/preferences.properties"/>
-
-  <stringbundleset id="appManagerBundleset">
-    <stringbundle id="appManagerBundle"
-                  src="chrome://browser/locale/preferences/applicationManager.properties"/>
-  </stringbundleset>
-
-  <stack flex="1">
-  <hbox flex="1">
-
-    <!-- category list -->
-    <richlistbox id="categories">
-      <richlistitem id="category-general"
-                    class="category"
-                    value="paneGeneral"
-                    helpTopic="prefs-main"
-                    tooltiptext="&paneGeneral.title;"
-                    align="center">
-        <image class="category-icon"/>
-        <label class="category-name" flex="1">&paneGeneral.title;</label>
-      </richlistitem>
-
-      <richlistitem id="category-search"
-                    class="category"
-                    value="paneSearch"
-                    helpTopic="prefs-search"
-                    tooltiptext="&paneSearch.title;"
-                    align="center">
-        <image class="category-icon"/>
-        <label class="category-name" flex="1">&paneSearch.title;</label>
-      </richlistitem>
-
-      <richlistitem id="category-content"
-                    class="category"
-                    value="paneContent"
-                    helpTopic="prefs-content"
-                    tooltiptext="&paneContent.title;"
-                    align="center">
-        <image class="category-icon"/>
-        <label class="category-name" flex="1">&paneContent.title;</label>
-      </richlistitem>
-
-      <richlistitem id="category-application"
-                    class="category"
-                    value="paneApplications"
-                    helpTopic="prefs-applications"
-                    tooltiptext="&paneApplications.title;"
-                    align="center">
-        <image class="category-icon"/>
-        <label class="category-name" flex="1">&paneApplications.title;</label>
-      </richlistitem>
-
-      <richlistitem id="category-privacy"
-                    class="category"
-                    value="panePrivacy"
-                    helpTopic="prefs-privacy"
-                    tooltiptext="&panePrivacy.title;"
-                    align="center">
-        <image class="category-icon"/>
-        <label class="category-name" flex="1">&panePrivacy.title;</label>
-      </richlistitem>
-
-      <richlistitem id="category-containers"
-                    class="category"
-                    value="paneContainers"
-                    helpTopic="prefs-containers"
-                    hidden="true"/>
-
-      <richlistitem id="category-security"
-                    class="category"
-                    value="paneSecurity"
-                    helpTopic="prefs-security"
-                    tooltiptext="&paneSecurity.title;"
-                    align="center">
-        <image class="category-icon"/>
-        <label class="category-name" flex="1">&paneSecurity.title;</label>
-      </richlistitem>
-
-      <richlistitem id="category-sync"
-                    class="category"
-                    value="paneSync"
-                    helpTopic="prefs-weave"
-                    tooltiptext="&paneSync.title;"
-                    align="center">
-        <image class="category-icon"/>
-        <label class="category-name" flex="1">&paneSync.title;</label>
-      </richlistitem>
-
-      <richlistitem id="category-advanced"
-                    class="category"
-                    value="paneAdvanced"
-                    helpTopic="prefs-advanced-general"
-                    tooltiptext="&paneAdvanced.title;"
-                    align="center">
-        <image class="category-icon"/>
-        <label class="category-name" flex="1">&paneAdvanced.title;</label>
-      </richlistitem>
-    </richlistbox>
-
-    <keyset>
-      <!-- Disable the findbar because it doesn't work properly.
-           Remove this keyset once bug 1094240 ("disablefastfind" attribute
-           broken in e10s mode) is fixed. -->
-      <key key="&focusSearch1.key;" modifiers="accel" id="focusSearch1" oncommand=";"/>
-    </keyset>
-
-    <vbox class="main-content" flex="1">
-      <prefpane id="mainPrefPane">
-#include main.xul
-#include search.xul
-#include privacy.xul
-#include containers.xul
-#include advanced.xul
-#include applications.xul
-#include content.xul
-#include security.xul
-#include sync.xul
-      </prefpane>
-    </vbox>
-
-  </hbox>
-
-    <vbox id="dialogOverlay" align="center" pack="center">
-      <groupbox id="dialogBox"
-                orient="vertical"
-                pack="end"
-                role="dialog"
-                aria-labelledby="dialogTitle">
-        <caption flex="1" align="center">
-          <label id="dialogTitle" flex="1"></label>
-          <button id="dialogClose"
-                  class="close-icon"
-                  aria-label="&preferencesCloseButton.label;"/>
-        </caption>
-        <browser id="dialogFrame"
-                 name="dialogFrame"
-                 autoscroll="false"
-                 disablehistory="true"/>
-      </groupbox>
-    </vbox>
-  </stack>
-</page>
deleted file mode 100644
--- a/browser/components/preferences/in-content-old/privacy.js
+++ /dev/null
@@ -1,696 +0,0 @@
-/* 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/. */
-
-/* import-globals-from preferences.js */
-
-Components.utils.import("resource://gre/modules/AppConstants.jsm");
-Components.utils.import("resource://gre/modules/PluralForm.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
-                                  "resource://gre/modules/ContextualIdentityService.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
-                                  "resource://gre/modules/PluralForm.jsm");
-
-var gPrivacyPane = {
-
-  /**
-   * Whether the use has selected the auto-start private browsing mode in the UI.
-   */
-  _autoStartPrivateBrowsing: false,
-
-  /**
-   * Whether the prompt to restart Firefox should appear when changing the autostart pref.
-   */
-  _shouldPromptForRestart: true,
-
-  /**
-   * Show the Tracking Protection UI depending on the
-   * privacy.trackingprotection.ui.enabled pref, and linkify its Learn More link
-   */
-  _initTrackingProtection() {
-    if (!Services.prefs.getBoolPref("privacy.trackingprotection.ui.enabled")) {
-      return;
-    }
-
-    let link = document.getElementById("trackingProtectionLearnMore");
-    let url = Services.urlFormatter.formatURLPref("app.support.baseURL") + "tracking-protection";
-    link.setAttribute("href", url);
-
-    this.trackingProtectionReadPrefs();
-
-    document.getElementById("trackingprotectionbox").hidden = false;
-    document.getElementById("trackingprotectionpbmbox").hidden = true;
-  },
-
-  /**
-   * Linkify the Learn More link of the Private Browsing Mode Tracking
-   * Protection UI.
-   */
-  _initTrackingProtectionPBM() {
-    let link = document.getElementById("trackingProtectionPBMLearnMore");
-    let url = Services.urlFormatter.formatURLPref("app.support.baseURL") + "tracking-protection-pbm";
-    link.setAttribute("href", url);
-  },
-
-  /**
-   * Initialize autocomplete to ensure prefs are in sync.
-   */
-  _initAutocomplete() {
-    Components.classes["@mozilla.org/autocomplete/search;1?name=unifiedcomplete"]
-              .getService(Components.interfaces.mozIPlacesAutoComplete);
-  },
-
-  /**
-   * Show the Containers UI depending on the privacy.userContext.ui.enabled pref.
-   */
-  _initBrowserContainers() {
-    if (!Services.prefs.getBoolPref("privacy.userContext.ui.enabled")) {
-      return;
-    }
-
-    let link = document.getElementById("browserContainersLearnMore");
-    link.href = Services.urlFormatter.formatURLPref("app.support.baseURL") + "containers";
-
-    document.getElementById("browserContainersbox").hidden = false;
-
-    document.getElementById("browserContainersCheckbox").checked =
-      Services.prefs.getBoolPref("privacy.userContext.enabled");
-  },
-
-  _checkBrowserContainers(event) {
-    let checkbox = document.getElementById("browserContainersCheckbox");
-    if (checkbox.checked) {
-      Services.prefs.setBoolPref("privacy.userContext.enabled", true);
-      return;
-    }
-
-    let count = ContextualIdentityService.countContainerTabs();
-    if (count == 0) {
-      Services.prefs.setBoolPref("privacy.userContext.enabled", false);
-      return;
-    }
-
-    let bundlePreferences = document.getElementById("bundlePreferences");
-
-    let title = bundlePreferences.getString("disableContainersAlertTitle");
-    let message = PluralForm.get(count, bundlePreferences.getString("disableContainersMsg"))
-                            .replace("#S", count)
-    let okButton = PluralForm.get(count, bundlePreferences.getString("disableContainersOkButton"))
-                             .replace("#S", count)
-    let cancelButton = bundlePreferences.getString("disableContainersButton2");
-
-    let buttonFlags = (Ci.nsIPrompt.BUTTON_TITLE_IS_STRING * Ci.nsIPrompt.BUTTON_POS_0) +
-                      (Ci.nsIPrompt.BUTTON_TITLE_IS_STRING * Ci.nsIPrompt.BUTTON_POS_1);
-
-    let rv = Services.prompt.confirmEx(window, title, message, buttonFlags,
-                                       okButton, cancelButton, null, null, {});
-    if (rv == 0) {
-      ContextualIdentityService.closeContainerTabs();
-      Services.prefs.setBoolPref("privacy.userContext.enabled", false);
-      return;
-    }
-
-    checkbox.checked = true;
-  },
-
-  /**
-   * Sets up the UI for the number of days of history to keep, and updates the
-   * label of the "Clear Now..." button.
-   */
-  init() {
-    function setEventListener(aId, aEventType, aCallback) {
-      document.getElementById(aId)
-              .addEventListener(aEventType, aCallback.bind(gPrivacyPane));
-    }
-
-    this._updateSanitizeSettingsButton();
-    this.initializeHistoryMode();
-    this.updateHistoryModePane();
-    this.updatePrivacyMicroControls();
-    this.initAutoStartPrivateBrowsingReverter();
-    this._initTrackingProtection();
-    this._initTrackingProtectionPBM();
-    this._initAutocomplete();
-    this._initBrowserContainers();
-
-    setEventListener("privacy.sanitize.sanitizeOnShutdown", "change",
-                     gPrivacyPane._updateSanitizeSettingsButton);
-    setEventListener("browser.privatebrowsing.autostart", "change",
-                     gPrivacyPane.updatePrivacyMicroControls);
-    setEventListener("historyMode", "command", function() {
-      gPrivacyPane.updateHistoryModePane();
-      gPrivacyPane.updateHistoryModePrefs();
-      gPrivacyPane.updatePrivacyMicroControls();
-      gPrivacyPane.updateAutostart();
-    });
-    setEventListener("historyRememberClear", "click", function() {
-      gPrivacyPane.clearPrivateDataNow(false);
-      return false;
-    });
-    setEventListener("historyRememberCookies", "click", function() {
-      gPrivacyPane.showCookies();
-      return false;
-    });
-    setEventListener("historyDontRememberClear", "click", function() {
-      gPrivacyPane.clearPrivateDataNow(true);
-      return false;
-    });
-    setEventListener("doNotTrackSettings", "click", function() {
-      gPrivacyPane.showDoNotTrackSettings();
-      return false;
-    });
-    setEventListener("privateBrowsingAutoStart", "command",
-                     gPrivacyPane.updateAutostart);
-    setEventListener("cookieExceptions", "command",
-                     gPrivacyPane.showCookieExceptions);
-    setEventListener("showCookiesButton", "command",
-                     gPrivacyPane.showCookies);
-    setEventListener("clearDataSettings", "command",
-                     gPrivacyPane.showClearPrivateDataSettings);
-    setEventListener("trackingProtectionRadioGroup", "command",
-                     gPrivacyPane.trackingProtectionWritePrefs);
-    setEventListener("trackingProtectionExceptions", "command",
-                     gPrivacyPane.showTrackingProtectionExceptions);
-    setEventListener("changeBlockList", "command",
-                     gPrivacyPane.showBlockLists);
-    setEventListener("changeBlockListPBM", "command",
-                     gPrivacyPane.showBlockLists);
-    setEventListener("browserContainersCheckbox", "command",
-                     gPrivacyPane._checkBrowserContainers);
-    setEventListener("browserContainersSettings", "command",
-                     gPrivacyPane.showContainerSettings);
-  },
-
-  // TRACKING PROTECTION MODE
-
-  /**
-   * Selects the right item of the Tracking Protection radiogroup.
-   */
-  trackingProtectionReadPrefs() {
-    let enabledPref = document.getElementById("privacy.trackingprotection.enabled");
-    let pbmPref = document.getElementById("privacy.trackingprotection.pbmode.enabled");
-    let radiogroup = document.getElementById("trackingProtectionRadioGroup");
-
-    // Global enable takes precedence over enabled in Private Browsing.
-    if (enabledPref.value) {
-      radiogroup.value = "always";
-    } else if (pbmPref.value) {
-      radiogroup.value = "private";
-    } else {
-      radiogroup.value = "never";
-    }
-  },
-
-  /**
-   * Sets the pref values based on the selected item of the radiogroup.
-   */
-  trackingProtectionWritePrefs() {
-    let enabledPref = document.getElementById("privacy.trackingprotection.enabled");
-    let pbmPref = document.getElementById("privacy.trackingprotection.pbmode.enabled");
-    let radiogroup = document.getElementById("trackingProtectionRadioGroup");
-
-    switch (radiogroup.value) {
-      case "always":
-        enabledPref.value = true;
-        pbmPref.value = true;
-        break;
-      case "private":
-        enabledPref.value = false;
-        pbmPref.value = true;
-        break;
-      case "never":
-        enabledPref.value = false;
-        pbmPref.value = false;
-        break;
-    }
-  },
-
-  // HISTORY MODE
-
-  /**
-   * The list of preferences which affect the initial history mode settings.
-   * If the auto start private browsing mode pref is active, the initial
-   * history mode would be set to "Don't remember anything".
-   * If ALL of these preferences are set to the values that correspond
-   * to keeping some part of history, and the auto-start
-   * private browsing mode is not active, the initial history mode would be
-   * set to "Remember everything".
-   * Otherwise, the initial history mode would be set to "Custom".
-   *
-   * Extensions adding their own preferences can set values here if needed.
-   */
-  prefsForKeepingHistory: {
-    "places.history.enabled": true, // History is enabled
-    "browser.formfill.enable": true, // Form information is saved
-    "network.cookie.cookieBehavior": 0, // All cookies are enabled
-    "network.cookie.lifetimePolicy": 0, // Cookies use supplied lifetime
-    "privacy.sanitize.sanitizeOnShutdown": false, // Private date is NOT cleared on shutdown
-  },
-
-  /**
-   * The list of control IDs which are dependent on the auto-start private
-   * browsing setting, such that in "Custom" mode they would be disabled if
-   * the auto-start private browsing checkbox is checked, and enabled otherwise.
-   *
-   * Extensions adding their own controls can append their IDs to this array if needed.
-   */
-  dependentControls: [
-    "rememberHistory",
-    "rememberForms",
-    "keepUntil",
-    "keepCookiesUntil",
-    "alwaysClear",
-    "clearDataSettings"
-  ],
-
-  /**
-   * Check whether preferences values are set to keep history
-   *
-   * @param aPrefs an array of pref names to check for
-   * @returns boolean true if all of the prefs are set to keep history,
-   *                  false otherwise
-   */
-  _checkHistoryValues(aPrefs) {
-    for (let pref of Object.keys(aPrefs)) {
-      if (document.getElementById(pref).value != aPrefs[pref])
-        return false;
-    }
-    return true;
-  },
-
-  /**
-   * Initialize the history mode menulist based on the privacy preferences