Merge m-c to cedar
authorJames Graham <james@hoppipolla.co.uk>
Wed, 26 Aug 2015 19:44:30 +0100
changeset 326839 bb78c7bdb3b66e629000bf8fd097941fb3571222
parent 326838 92b8b2a04e7f8b5bd07b1f23e608df5fe49ba58b (current diff)
parent 288070 fea87cbeaa6b64510dff835549ed906fe405d558 (diff)
child 326840 5b71933e8cd6e3ff9e8cb03e8221260d7b5cc39b
push id10169
push userdminor@mozilla.com
push dateThu, 28 Jan 2016 13:10:48 +0000
milestone43.0a1
Merge m-c to cedar
CLOBBER
browser/base/content/test/plugins/browser_pluginplaypreview.js
browser/base/content/test/plugins/browser_pluginplaypreview2.js
browser/base/content/test/plugins/browser_pluginplaypreview3.js
browser/base/content/test/plugins/plugin_test_w_src.html
browser/components/customizableui/test/browser_940107_home_button_in_bookmarks_toolbar.js
browser/components/loop/test/shared/vendor/sinon-1.15.0.js
browser/components/translation/test/browser_translation_fhr.js
browser/components/translation/test/unit/test_healthreport.js
browser/devtools/performance/test/browser_markers-cycle-collection.js
browser/devtools/performance/test/browser_markers-gc.js
browser/devtools/performance/test/browser_markers-parse-html.js
browser/devtools/performance/test/browser_markers-styles.js
browser/devtools/performance/test/browser_markers-timestamp.js
browser/devtools/performance/test/doc_force_cc.html
browser/devtools/performance/test/doc_force_gc.html
browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_05.js
browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_06.js
browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_07.js
browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_08.js
browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_clear.js
browser/devtools/styleinspector/test/browser_ruleview_search-filter_11.js
browser/devtools/styleinspector/test/browser_ruleview_search-filter_12.js
browser/devtools/styleinspector/test/browser_ruleview_search-filter_13.js
browser/devtools/styleinspector/test/browser_ruleview_search-filter_14.js
browser/devtools/styleinspector/test/browser_ruleview_search-filter_15.js
browser/devtools/styleinspector/test/browser_ruleview_search-filter_16.js
browser/devtools/styleinspector/test/browser_ruleview_search-filter_clear.js
browser/themes/linux/devtools/floating-scrollbars-light.css
browser/themes/linux/devtools/floating-scrollbars.css
browser/themes/linux/devtools/netmonitor.css
browser/themes/linux/devtools/webconsole.css
browser/themes/linux/devtools/webconsole_networkpanel.css
browser/themes/linux/devtools/widgets.css
browser/themes/linux/places/star-icons.png
browser/themes/linux/tabbrowser/tab-separator.png
browser/themes/osx/devtools/floating-scrollbars-light.css
browser/themes/osx/devtools/floating-scrollbars.css
browser/themes/osx/devtools/netmonitor.css
browser/themes/osx/devtools/webconsole.css
browser/themes/osx/devtools/webconsole_networkpanel.css
browser/themes/osx/devtools/widgets.css
browser/themes/osx/places/star-icons.png
browser/themes/osx/places/star-icons@2x.png
browser/themes/osx/tabbrowser/tab-separator.png
browser/themes/osx/tabbrowser/tab-separator@2x.png
browser/themes/shared/devtools/netmonitor.inc.css
browser/themes/shared/devtools/webconsole.inc.css
browser/themes/shared/devtools/widgets.inc.css
browser/themes/windows/devtools/floating-scrollbars-light.css
browser/themes/windows/devtools/floating-scrollbars.css
browser/themes/windows/devtools/netmonitor.css
browser/themes/windows/devtools/webconsole.css
browser/themes/windows/devtools/webconsole_networkpanel.css
browser/themes/windows/devtools/widgets.css
browser/themes/windows/tabbrowser/tab-separator-XP.png
browser/themes/windows/tabbrowser/tab-separator-luna-blue.png
browser/themes/windows/tabbrowser/tab-separator.png
dom/apps/TrustedHostedAppsUtils.jsm
dom/apps/tests/chrome.ini
dom/apps/tests/file_trusted_app.template.webapp
dom/apps/tests/test_tha_utils.html
dom/bluetooth/BluetoothCommon.h
dom/bluetooth/BluetoothInterface.cpp
dom/bluetooth/BluetoothInterface.h
dom/bluetooth/BluetoothUtils.cpp
dom/media/AudioSink.cpp
dom/media/AudioSink.h
dom/media/MozPromise.h
dom/media/StateMirroring.h
dom/media/StateWatching.h
dom/messagechannel/tests/test_messageChannel_pref.html
dom/plugins/base/nsPluginPlayPreviewInfo.cpp
dom/plugins/base/nsPluginPlayPreviewInfo.h
dom/push/PushService.jsm
js/src/jit-test/tests/arguments/rest-disallow-arguments.js
js/src/jit-test/tests/arrow-functions/bug889158.js
layout/base/nsRefreshDriver.cpp
memory/jemalloc/0001-Dont-overwrite-VERSION-on-a-git-repository.patch
memory/jemalloc/0002-Move-variable-declaration-to-the-top-its-block-for-M.patch
memory/jemalloc/0003-Add-a-isblank-definition-for-MSVC-2013.patch
memory/jemalloc/0004-Implement-stats.bookkeeping.patch
memory/jemalloc/0005-Bug-1121314-Avoid-needing-the-arena-in-chunk_alloc_d.patch
memory/jemalloc/0006-Make-opt.lg_dirty_mult-work-as-documented.patch
memory/jemalloc/0007-Preserve-LastError-when-calling-TlsGetValue.patch
memory/jemalloc/0008-Make-without-export-actually-work.patch
memory/jemalloc/src/bin/pprof
memory/jemalloc/src/include/msvc_compat/C99/inttypes.h
memory/mozalloc/msvc_throw_wrapper.cpp
memory/mozalloc/msvc_throw_wrapper.h
mobile/android/base/gfx/GeckoLayerClient.java
mobile/android/base/gfx/LayerMarginsAnimator.java
mobile/android/base/resources/color-large-v11/action_bar_menu_item_colors.xml
mobile/android/base/widget/GeckoSwipeRefreshLayout.java
mobile/android/themes/core/images/addons-32.png
mobile/android/themes/core/images/arrowleft-16.png
mobile/android/themes/core/images/arrowright-16.png
mobile/android/themes/core/images/default-app-icon.png
mobile/android/themes/core/images/errorpage-larry-black.png
mobile/android/themes/core/images/errorpage-larry-white.png
python/psutil/test/README
python/psutil/test/__init__.py
security/manager/ssl/tests/unit/test_keysize/ee_prime256v1_256-int_prime256v1_256-root_secp224r1_224.der
security/manager/ssl/tests/unit/test_keysize/ee_prime256v1_256-int_prime256v1_256-root_secp256k1_256.der
security/manager/ssl/tests/unit/test_keysize/ee_prime256v1_256-int_rsa_1016-root_prime256v1_256.der
security/manager/ssl/tests/unit/test_keysize/ee_prime256v1_256-int_secp224r1_224-root_prime256v1_256.der
security/manager/ssl/tests/unit/test_keysize/ee_rsa_1016-int_rsa_1024-root_rsa_1024.der
security/manager/ssl/tests/unit/test_keysize/ee_rsa_1024-int_rsa_1016-root_rsa_1024.der
security/manager/ssl/tests/unit/test_keysize/ee_rsa_1024-int_rsa_1024-root_rsa_1016.der
security/manager/ssl/tests/unit/test_keysize/ee_rsa_1024-int_rsa_1024-root_rsa_1024.der
security/manager/ssl/tests/unit/test_keysize/ee_secp224r1_224-int_prime256v1_256-root_prime256v1_256.der
security/manager/ssl/tests/unit/test_keysize/ee_secp224r1_224-int_prime256v1_256-root_rsa_2048.der
security/manager/ssl/tests/unit/test_keysize/ee_secp256k1_256-int_prime256v1_256-root_prime256v1_256.der
security/manager/ssl/tests/unit/test_keysize/ee_secp384r1_384-int_prime256v1_256-root_rsa_2048.der
security/manager/ssl/tests/unit/test_keysize/ee_secp521r1_521-int_secp384r1_384-root_prime256v1_256.der
security/manager/ssl/tests/unit/test_keysize/generate.py
security/manager/ssl/tests/unit/test_keysize/int_prime256v1_256-root_prime256v1_256.der
security/manager/ssl/tests/unit/test_keysize/int_prime256v1_256-root_rsa_2048.der
security/manager/ssl/tests/unit/test_keysize/int_prime256v1_256-root_secp224r1_224.der
security/manager/ssl/tests/unit/test_keysize/int_prime256v1_256-root_secp256k1_256.der
security/manager/ssl/tests/unit/test_keysize/int_rsa_1016-root_prime256v1_256.der
security/manager/ssl/tests/unit/test_keysize/int_rsa_1016-root_rsa_1024.der
security/manager/ssl/tests/unit/test_keysize/int_rsa_1024-root_rsa_1016.der
security/manager/ssl/tests/unit/test_keysize/int_rsa_1024-root_rsa_1024.der
security/manager/ssl/tests/unit/test_keysize/int_secp224r1_224-root_prime256v1_256.der
security/manager/ssl/tests/unit/test_keysize/int_secp384r1_384-root_prime256v1_256.der
security/manager/ssl/tests/unit/test_keysize/root_prime256v1_256.der
security/manager/ssl/tests/unit/test_keysize/root_rsa_1016.der
security/manager/ssl/tests/unit/test_keysize/root_rsa_1024.der
security/manager/ssl/tests/unit/test_keysize/root_rsa_2048.der
security/manager/ssl/tests/unit/test_keysize/root_secp224r1_224.der
security/manager/ssl/tests/unit/test_keysize/root_secp256k1_256.der
security/manager/ssl/tests/unit/test_name_constraints/NameConstraints.dcissallowed.cert
security/manager/ssl/tests/unit/test_name_constraints/NameConstraints.dcissblocked.cert
security/manager/ssl/tests/unit/test_name_constraints/ca-nc-perm-foo.com.der
security/manager/ssl/tests/unit/test_name_constraints/ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.com-a.a.us-b.a.us-int-c-us-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.com-a.a.us-b.a.us-int-ca-nc-perm-foo.com.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.com-a.a.us-b.a.us-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.com-a.a.us-b.a.us-int-nc-excl-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.com-a.a.us-b.a.us-int-nc-foo.com-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.com-a.a.us-b.a.us-int-nc-foo.com-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.com-a.a.us-b.a.us-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.com-a.a.us-b.a.us-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.com-a.a.us-b.a.us-int-nc-perm-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.com-a.a.us-b.a.us-int-nc-perm-foo.com_c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.com-int-c-us-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.com-int-ca-nc-perm-foo.com.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.com-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.com-int-nc-excl-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.com-int-nc-foo.com-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.com-int-nc-foo.com-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.com-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.com-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.com-int-nc-perm-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.com-int-nc-perm-foo.com_c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.org-int-c-us-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.org-int-ca-nc-perm-foo.com.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.org-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.org-int-nc-excl-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.org-int-nc-foo.com-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.org-int-nc-foo.com-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.org-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.org-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.org-int-nc-perm-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-alt-foo.org-int-nc-perm-foo.com_c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-int-c-us-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-int-ca-nc-perm-foo.com.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-int-nc-excl-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-int-nc-foo.com-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-int-nc-foo.com-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-int-nc-perm-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com-int-nc-perm-foo.com_c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.com-a.a.us-b.a.us-int-c-us-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.com-a.a.us-b.a.us-int-ca-nc-perm-foo.com.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.com-a.a.us-b.a.us-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.com-a.a.us-b.a.us-int-nc-excl-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.com-a.a.us-b.a.us-int-nc-foo.com-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.com-a.a.us-b.a.us-int-nc-foo.com-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.com-a.a.us-b.a.us-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.com-a.a.us-b.a.us-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.com-a.a.us-b.a.us-int-nc-perm-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.com-a.a.us-b.a.us-int-nc-perm-foo.com_c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.com-int-c-us-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.com-int-ca-nc-perm-foo.com.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.com-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.com-int-nc-excl-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.com-int-nc-foo.com-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.com-int-nc-foo.com-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.com-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.com-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.com-int-nc-perm-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.com-int-nc-perm-foo.com_c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.org-int-c-us-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.org-int-ca-nc-perm-foo.com.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.org-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.org-int-nc-excl-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.org-int-nc-foo.com-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.org-int-nc-foo.com-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.org-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.org-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.org-int-nc-perm-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-alt-foo.org-int-nc-perm-foo.com_c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-int-c-us-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-int-ca-nc-perm-foo.com.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-int-nc-excl-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-int-nc-foo.com-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-int-nc-foo.com-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-int-nc-perm-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.com_o-bar_c-us-int-nc-perm-foo.com_c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-alt-foo.com-int-c-us-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-alt-foo.com-int-ca-nc-perm-foo.com.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-alt-foo.com-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-alt-foo.com-int-nc-excl-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-alt-foo.com-int-nc-foo.com-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-alt-foo.com-int-nc-foo.com-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-alt-foo.com-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-alt-foo.com-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-alt-foo.com-int-nc-perm-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-alt-foo.com-int-nc-perm-foo.com_c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-alt-foo.org-int-c-us-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-alt-foo.org-int-ca-nc-perm-foo.com.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-alt-foo.org-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-alt-foo.org-int-nc-excl-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-alt-foo.org-int-nc-foo.com-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-alt-foo.org-int-nc-foo.com-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-alt-foo.org-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-alt-foo.org-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-alt-foo.org-int-nc-perm-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-alt-foo.org-int-nc-perm-foo.com_c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-int-c-us-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-int-ca-nc-perm-foo.com.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-int-nc-excl-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-int-nc-foo.com-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-int-nc-foo.com-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-int-nc-perm-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org-int-nc-perm-foo.com_c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-alt-foo.com-int-c-us-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-alt-foo.com-int-ca-nc-perm-foo.com.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-alt-foo.com-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-alt-foo.com-int-nc-excl-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-alt-foo.com-int-nc-foo.com-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-alt-foo.com-int-nc-foo.com-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-alt-foo.com-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-alt-foo.com-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-alt-foo.com-int-nc-perm-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-alt-foo.com-int-nc-perm-foo.com_c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-alt-foo.org-int-c-us-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-alt-foo.org-int-ca-nc-perm-foo.com.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-alt-foo.org-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-alt-foo.org-int-nc-excl-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-alt-foo.org-int-nc-foo.com-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-alt-foo.org-int-nc-foo.com-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-alt-foo.org-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-alt-foo.org-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-alt-foo.org-int-nc-perm-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-alt-foo.org-int-nc-perm-foo.com_c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-int-c-us-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-int-ca-nc-perm-foo.com.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-int-nc-excl-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-int-nc-foo.com-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-int-nc-foo.com-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-int-nc-perm-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/cn-www.foo.org_o-bar_c-us-int-nc-perm-foo.com_c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/dcisscopy.der
security/manager/ssl/tests/unit/test_name_constraints/int-c-us-int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/int-ca-nc-perm-foo.com.der
security/manager/ssl/tests/unit/test_name_constraints/int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/int-nc-excl-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/int-nc-foo.com-int-nc-c-us-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/int-nc-foo.com-int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/int-nc-foo.com_a.us.der
security/manager/ssl/tests/unit/test_name_constraints/int-nc-perm-c-uk-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/int-nc-perm-foo.com-ca-nc.der
security/manager/ssl/tests/unit/test_name_constraints/int-nc-perm-foo.com_c-us-ca-nc.der
testing/config/mozharness/android_arm_4_3_config.py
testing/config/mozharness/android_arm_config.py
testing/config/mozharness/android_panda_config.py
testing/config/mozharness/android_x86_config.py
testing/config/mozharness/b2g_desktop_config.py
testing/config/mozharness/b2g_emulator_config.py
testing/config/mozharness/linux_config.py
testing/config/mozharness/mac_config.py
testing/config/mozharness/marionette.py
testing/config/mozharness/taskcluster_linux_config.py
testing/config/mozharness/try_arguments.py
testing/config/mozharness/web_platform_tests_config.py
testing/config/mozharness/windows_config.py
testing/docker/desktop-build/configs/disable_signing.py
testing/docker/desktop-build/configs/platform_supports_post_upload_to_latest.py
testing/mochitest/mach_commands.py
testing/mochitest/runtests.py
testing/mozharness/configs/generic_releng_config.py
testing/web-platform/meta/battery-status/battery-interface-idlharness.html.ini
testing/web-platform/meta/battery-status/battery-promise.html.ini
testing/web-platform/meta/html/semantics/embedded-content/the-img-element/relevant-mutations.html.ini
testing/web-platform/meta/media-source/URL-createObjectURL-revoke.html.ini
testing/web-platform/meta/media-source/mediasource-appendwindow.html.ini
testing/web-platform/meta/media-source/mediasource-closed.html.ini
testing/web-platform/meta/media-source/mediasource-config-change-webm-a-bitrate.html.ini
testing/web-platform/meta/media-source/mediasource-config-change-webm-av-audio-bitrate.html.ini
testing/web-platform/meta/media-source/mediasource-config-change-webm-av-framesize.html.ini
testing/web-platform/meta/media-source/mediasource-config-change-webm-av-video-bitrate.html.ini
testing/web-platform/meta/media-source/mediasource-config-change-webm-v-bitrate.html.ini
testing/web-platform/meta/media-source/mediasource-config-change-webm-v-framerate.html.ini
testing/web-platform/meta/media-source/mediasource-config-change-webm-v-framesize.html.ini
testing/web-platform/meta/media-source/mediasource-duration-boundaryconditions.html.ini
testing/web-platform/meta/media-source/mediasource-endofstream-invaliderror.html.ini
testing/web-platform/meta/media-source/mediasource-getvideoplaybackquality.html.ini
testing/web-platform/meta/media-source/mediasource-is-type-supported.html.ini
testing/web-platform/meta/media-source/mediasource-multiple-attach.html.ini
testing/web-platform/meta/media-source/mediasource-play.html.ini
testing/web-platform/meta/media-source/mediasource-removesourcebuffer.html.ini
testing/web-platform/meta/media-source/mediasource-sourcebuffer-mode.html.ini
testing/web-platform/meta/media-source/mediasource-sourcebufferlist.html.ini
testing/web-platform/meta/media-source/mediasource-timestamp-offset.html.ini
testing/web-platform/meta/screen-orientation/orientation-api.html.ini
testing/web-platform/meta/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/message-event.html.ini
testing/web-platform/mozilla/meta/service-workers/service-worker/controller-on-reload.https.html.ini
testing/web-platform/mozilla/meta/service-workers/service-worker/extendable-event-async-waituntil.https.html.ini
testing/web-platform/mozilla/meta/service-workers/service-worker/extendable-event-waituntil.https.html.ini
testing/web-platform/mozilla/meta/service-workers/service-worker/getregistration.https.html.ini
testing/web-platform/mozilla/meta/service-workers/service-worker/install-event-type.https.html.ini
testing/web-platform/mozilla/meta/service-workers/service-worker/registration-iframe.https.html.ini
testing/web-platform/mozilla/meta/service-workers/service-worker/registration.https.html.ini
testing/web-platform/mozilla/meta/service-workers/service-worker/waiting.https.html.ini
toolkit/components/perfmonitoring/tests/xpcshell/test_compartments.js
toolkit/components/perfmonitoring/tests/xpcshell/xpcshell.ini
toolkit/devtools/server/tests/mochitest/chrome.ini
toolkit/devtools/webconsole/test/chrome.ini
toolkit/themes/osx/global/toolbar/toolbar-background-inactive.png
toolkit/themes/osx/global/toolbar/toolbar-background.gif
tools/rb/find-leakers.pl
widget/nsIGfxInfo2.idl
--- a/CLOBBER
+++ b/CLOBBER
@@ -17,10 +17,10 @@
 #
 # Modifying this file will now automatically clobber the buildbot machines \o/
 #
 
 # Are you updating CLOBBER because you think it's needed for your WebIDL
 # changes to stick? As of bug 928195, this shouldn't be necessary! Please
 # don't change CLOBBER for WebIDL changes any more.
 
-Bug 1179909 - Android's build system apparently doesn't pick up the removal of
-a Cpptest from the moz.build file and errors out trying to run it anyway.
+Bug 1195388 - Moving location of generated R.java files requires a
+clobber.
\ No newline at end of file
--- a/accessible/atk/AccessibleWrap.cpp
+++ b/accessible/atk/AccessibleWrap.cpp
@@ -817,22 +817,30 @@ getParentCB(AtkObject *aAtkObj)
     atk_object_set_parent(aAtkObj, atkParent);
 
   return aAtkObj->accessible_parent;
 }
 
 gint
 getChildCountCB(AtkObject *aAtkObj)
 {
-    AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
-    if (!accWrap || nsAccUtils::MustPrune(accWrap)) {
-        return 0;
+  if (AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj)) {
+    if (nsAccUtils::MustPrune(accWrap)) {
+      return 0;
     }
 
     return static_cast<gint>(accWrap->EmbeddedChildCount());
+  }
+
+  ProxyAccessible* proxy = GetProxy(aAtkObj);
+  if (proxy && !proxy->MustPruneChildren()) {
+    return proxy->EmbeddedChildCount();
+  }
+
+  return 0;
 }
 
 AtkObject *
 refChildCB(AtkObject *aAtkObj, gint aChildIndex)
 {
   // aChildIndex should not be less than zero
   if (aChildIndex < 0) {
     return nullptr;
@@ -1076,29 +1084,29 @@ static uint16_t
 GetInterfacesForProxy(ProxyAccessible* aProxy, uint32_t aInterfaces)
 {
   uint16_t interfaces = 1 << MAI_INTERFACE_COMPONENT;
   if (aInterfaces & Interfaces::HYPERTEXT)
     interfaces |= (1 << MAI_INTERFACE_HYPERTEXT) | (1 << MAI_INTERFACE_TEXT)
         | (1 << MAI_INTERFACE_EDITABLE_TEXT);
 
   if (aInterfaces & Interfaces::HYPERLINK)
-    interfaces |= MAI_INTERFACE_HYPERLINK_IMPL;
+    interfaces |= 1 << MAI_INTERFACE_HYPERLINK_IMPL;
 
   if (aInterfaces & Interfaces::VALUE)
-    interfaces |= MAI_INTERFACE_VALUE;
+    interfaces |= 1 << MAI_INTERFACE_VALUE;
 
   if (aInterfaces & Interfaces::TABLE)
-    interfaces |= MAI_INTERFACE_TABLE;
+    interfaces |= 1 << MAI_INTERFACE_TABLE;
 
   if (aInterfaces & Interfaces::IMAGE)
-    interfaces |= MAI_INTERFACE_IMAGE;
+    interfaces |= 1 << MAI_INTERFACE_IMAGE;
 
   if (aInterfaces & Interfaces::DOCUMENT)
-    interfaces |= MAI_INTERFACE_DOCUMENT;
+    interfaces |= 1 << MAI_INTERFACE_DOCUMENT;
 
   return interfaces;
 }
 
 void
 a11y::ProxyCreated(ProxyAccessible* aProxy, uint32_t aInterfaces)
 {
   GType type = GetMaiAtkType(GetInterfacesForProxy(aProxy, aInterfaces));
--- a/accessible/base/EventQueue.cpp
+++ b/accessible/base/EventQueue.cpp
@@ -243,22 +243,17 @@ EventQueue::CoalesceReorderEvents(AccEve
     if (!thisEvent->mAccessible->IsDoc() &&
         !thisEvent->mAccessible->IsInDocument()) {
       thisEvent->mEventRule = AccEvent::eDoNotEmit;
       continue;
     }
 
     // Coalesce earlier event of the same target.
     if (thisEvent->mAccessible == aTailEvent->mAccessible) {
-      if (thisEvent->mEventRule == AccEvent::eDoNotEmit) {
-        AccReorderEvent* tailReorder = downcast_accEvent(aTailEvent);
-        tailReorder->DoNotEmitAll();
-      } else {
-        thisEvent->mEventRule = AccEvent::eDoNotEmit;
-      }
+      thisEvent->mEventRule = AccEvent::eDoNotEmit;
 
       return;
     }
 
     // If tailEvent contains thisEvent
     // then
     //   if show or hide of tailEvent contains a grand parent of thisEvent
     //   then ignore thisEvent and its show and hide events
--- a/accessible/base/nsCoreUtils.cpp
+++ b/accessible/base/nsCoreUtils.cpp
@@ -113,43 +113,43 @@ nsCoreUtils::DispatchClickEvent(nsITreeB
   DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, cnvdX, cnvdY,
                      tcContent, tcFrame, presShell, rootWidget);
 
   DispatchMouseEvent(NS_MOUSE_BUTTON_UP, cnvdX, cnvdY,
                      tcContent, tcFrame, presShell, rootWidget);
 }
 
 void
-nsCoreUtils::DispatchMouseEvent(uint32_t aEventType, int32_t aX, int32_t aY,
+nsCoreUtils::DispatchMouseEvent(EventMessage aMessage, int32_t aX, int32_t aY,
                                 nsIContent *aContent, nsIFrame *aFrame,
                                 nsIPresShell *aPresShell, nsIWidget *aRootWidget)
 {
-  WidgetMouseEvent event(true, aEventType, aRootWidget,
+  WidgetMouseEvent event(true, aMessage, aRootWidget,
                          WidgetMouseEvent::eReal, WidgetMouseEvent::eNormal);
 
   event.refPoint = LayoutDeviceIntPoint(aX, aY);
 
   event.clickCount = 1;
   event.button = WidgetMouseEvent::eLeftButton;
   event.time = PR_IntervalNow();
   event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;
 
   nsEventStatus status = nsEventStatus_eIgnore;
   aPresShell->HandleEventWithTarget(&event, aFrame, aContent, &status);
 }
 
 void
-nsCoreUtils::DispatchTouchEvent(uint32_t aEventType, int32_t aX, int32_t aY,
+nsCoreUtils::DispatchTouchEvent(EventMessage aMessage, int32_t aX, int32_t aY,
                                 nsIContent* aContent, nsIFrame* aFrame,
                                 nsIPresShell* aPresShell, nsIWidget* aRootWidget)
 {
   if (!dom::TouchEvent::PrefEnabled())
     return;
 
-  WidgetTouchEvent event(true, aEventType, aRootWidget);
+  WidgetTouchEvent event(true, aMessage, aRootWidget);
 
   event.time = PR_IntervalNow();
 
   // XXX: Touch has an identifier of -1 to hint that it is synthesized.
   nsRefPtr<dom::Touch> t = new dom::Touch(-1, LayoutDeviceIntPoint(aX, aY),
                                           nsIntPoint(1, 1), 0.0f, 1.0f);
   t->SetTarget(aContent);
   event.touches.AppendElement(t);
--- a/accessible/base/nsCoreUtils.h
+++ b/accessible/base/nsCoreUtils.h
@@ -1,16 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsCoreUtils_h_
 #define nsCoreUtils_h_
 
+#include "mozilla/EventForwards.h"
 #include "nsIContent.h"
 #include "nsIDocument.h" // for GetShell()
 #include "nsIPresShell.h"
 
 #include "nsPoint.h"
 #include "nsTArray.h"
 
 class nsRange;
@@ -44,40 +45,42 @@ public:
    */
   static void DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
                                  int32_t aRowIndex, nsITreeColumn *aColumn,
                                  const nsAString& aPseudoElt = EmptyString());
 
   /**
    * Send mouse event to the given element.
    *
-   * @param aEventType   [in] an event type (see BasicEvents.h for constants)
+   * @param aMessage     [in] an event message (see EventForwards.h)
    * @param aX           [in] x coordinate in dev pixels
    * @param aY           [in] y coordinate in dev pixels
    * @param aContent     [in] the element
    * @param aFrame       [in] frame of the element
    * @param aPresShell   [in] the presshell for the element
    * @param aRootWidget  [in] the root widget of the element
    */
-  static void DispatchMouseEvent(uint32_t aEventType, int32_t aX, int32_t aY,
+  static void DispatchMouseEvent(mozilla::EventMessage aMessage,
+                                 int32_t aX, int32_t aY,
                                  nsIContent *aContent, nsIFrame *aFrame,
                                  nsIPresShell *aPresShell, nsIWidget *aRootWidget);
 
   /**
    * Send a touch event with a single touch point to the given element.
    *
-   * @param aEventType   [in] an event type (see BasicEvents.h for constants)
+   * @param aMessage     [in] an event message (see EventForwards.h)
    * @param aX           [in] x coordinate in dev pixels
    * @param aY           [in] y coordinate in dev pixels
    * @param aContent     [in] the element
    * @param aFrame       [in] frame of the element
    * @param aPresShell   [in] the presshell for the element
    * @param aRootWidget  [in] the root widget of the element
    */
-  static void DispatchTouchEvent(uint32_t aEventType, int32_t aX, int32_t aY,
+  static void DispatchTouchEvent(mozilla::EventMessage aMessage,
+                                 int32_t aX, int32_t aY,
                                  nsIContent* aContent, nsIFrame* aFrame,
                                  nsIPresShell* aPresShell, nsIWidget* aRootWidget);
 
   /**
    * Return an accesskey registered on the given element by
    * EventStateManager or 0 if there is no registered accesskey.
    *
    * @param aContent - the given element.
--- a/accessible/generic/ARIAGridAccessible.cpp
+++ b/accessible/generic/ARIAGridAccessible.cpp
@@ -685,16 +685,17 @@ ARIAGridCellAccessible::NativeAttributes
 
   return attributes.forget();
 }
 
 GroupPos
 ARIAGridCellAccessible::GroupPosition()
 {
   int32_t count = 0, index = 0;
-  if (nsCoreUtils::GetUIntAttr(Table()->AsAccessible()->GetContent(),
-                               nsGkAtoms::aria_colcount, &count) &&
+  Accessible* table = Table()->AsAccessible();
+  if (table && nsCoreUtils::GetUIntAttr(table->GetContent(),
+                                        nsGkAtoms::aria_colcount, &count) &&
       nsCoreUtils::GetUIntAttr(mContent, nsGkAtoms::aria_colindex, &index)) {
     return GroupPos(0, index, count);
   }
 
   return GroupPos();
 }
--- a/accessible/html/HTMLTableAccessible.cpp
+++ b/accessible/html/HTMLTableAccessible.cpp
@@ -142,18 +142,19 @@ HTMLTableCellAccessible::NativeAttribute
 
   return attributes.forget();
 }
 
 GroupPos
 HTMLTableCellAccessible::GroupPosition()
 {
   int32_t count = 0, index = 0;
-  if (nsCoreUtils::GetUIntAttr(Table()->AsAccessible()->GetContent(),
-                               nsGkAtoms::aria_colcount, &count) &&
+  Accessible* table = Table()->AsAccessible();
+  if (table && nsCoreUtils::GetUIntAttr(table->GetContent(),
+                                        nsGkAtoms::aria_colcount, &count) &&
       nsCoreUtils::GetUIntAttr(mContent, nsGkAtoms::aria_colindex, &index)) {
     return GroupPos(0, index, count);
   }
 
   return HyperTextAccessibleWrap::GroupPosition();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
--- a/accessible/ipc/DocAccessibleChild.cpp
+++ b/accessible/ipc/DocAccessibleChild.cpp
@@ -1723,16 +1723,32 @@ DocAccessibleChild::RecvTakeFocus(const 
   if (acc) {
     acc->TakeFocus();
   }
 
   return true;
 }
 
 bool
+DocAccessibleChild::RecvEmbeddedChildCount(const uint64_t& aID,
+                                           uint32_t* aCount)
+{
+  *aCount = 0;
+
+  Accessible* acc = IdToAccessible(aID);
+  if (!acc) {
+    return true;
+  }
+
+  *aCount = acc->EmbeddedChildCount();
+
+  return true;
+}
+
+bool
 DocAccessibleChild::RecvIndexOfEmbeddedChild(const uint64_t& aID,
                                              const uint64_t& aChildID,
                                              uint32_t* aChildIdx)
 {
   *aChildIdx = 0;
 
   Accessible* parent = IdToAccessible(aID);
   Accessible* child = IdToAccessible(aChildID);
--- a/accessible/ipc/DocAccessibleChild.h
+++ b/accessible/ipc/DocAccessibleChild.h
@@ -429,16 +429,19 @@ public:
   virtual bool RecvMaxValue(const uint64_t& aID,
                             double* aValue) override;
 
   virtual bool RecvStep(const uint64_t& aID,
                         double* aStep) override;
 
   virtual bool RecvTakeFocus(const uint64_t& aID) override;
 
+  virtual bool RecvEmbeddedChildCount(const uint64_t& aID, uint32_t* aCount)
+    override final;
+
   virtual bool RecvIndexOfEmbeddedChild(const uint64_t& aID,
                                         const uint64_t& aChildID,
                                         uint32_t* aChildIdx) override final;
 
   virtual bool RecvEmbeddedChildAt(const uint64_t& aID, const uint32_t& aIdx,
                                    uint64_t* aChildID) override final;
 
   virtual bool RecvFocusedChild(const uint64_t& aID,
--- a/accessible/ipc/DocAccessibleParent.cpp
+++ b/accessible/ipc/DocAccessibleParent.cpp
@@ -14,17 +14,17 @@ namespace mozilla {
 namespace a11y {
 
 bool
 DocAccessibleParent::RecvShowEvent(const ShowEventData& aData)
 {
   if (mShutdown)
     return true;
 
-  CheckDocTree();
+  MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
 
   if (aData.NewTree().IsEmpty()) {
     NS_ERROR("no children being added");
     return false;
   }
 
   ProxyAccessible* parent = GetAccessible(aData.ID());
 
@@ -45,17 +45,17 @@ DocAccessibleParent::RecvShowEvent(const
   MOZ_ASSERT(consumed == aData.NewTree().Length());
 #ifdef DEBUG
   for (uint32_t i = 0; i < consumed; i++) {
     uint64_t id = aData.NewTree()[i].ID();
     MOZ_ASSERT(mAccessibles.GetEntry(id));
   }
 #endif
 
-  CheckDocTree();
+  MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
 
   return true;
 }
 
 uint32_t
 DocAccessibleParent::AddSubtree(ProxyAccessible* aParent,
                                 const nsTArray<a11y::AccessibleData>& aNewTree,
                                 uint32_t aIdx, uint32_t aIdxInParent)
@@ -99,17 +99,17 @@ DocAccessibleParent::AddSubtree(ProxyAcc
 }
 
 bool
 DocAccessibleParent::RecvHideEvent(const uint64_t& aRootID)
 {
   if (mShutdown)
     return true;
 
-  CheckDocTree();
+  MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
 
   ProxyEntry* rootEntry = mAccessibles.GetEntry(aRootID);
   if (!rootEntry) {
     NS_ERROR("invalid root being removed!");
     return true;
   }
 
   ProxyAccessible* root = rootEntry->mProxy;
@@ -117,17 +117,17 @@ DocAccessibleParent::RecvHideEvent(const
     NS_ERROR("invalid root being removed!");
     return true;
   }
 
   ProxyAccessible* parent = root->Parent();
   parent->RemoveChild(root);
   root->Shutdown();
 
-  CheckDocTree();
+  MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
 
   return true;
 }
 
 bool
 DocAccessibleParent::RecvEvent(const uint64_t& aID, const uint32_t& aEventType)
 {
   ProxyAccessible* proxy = GetAccessible(aID);
@@ -191,22 +191,22 @@ bool
 DocAccessibleParent::RecvBindChildDoc(PDocAccessibleParent* aChildDoc, const uint64_t& aID)
 {
   // One document should never directly be the child of another.
   // We should always have at least an outer doc accessible in between.
   MOZ_ASSERT(aID);
   if (!aID)
     return false;
 
-  CheckDocTree();
+  MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
 
   auto childDoc = static_cast<DocAccessibleParent*>(aChildDoc);
   bool result = AddChildDoc(childDoc, aID, false);
   MOZ_ASSERT(result);
-  CheckDocTree();
+  MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
   return result;
 }
 
 bool
 DocAccessibleParent::AddChildDoc(DocAccessibleParent* aChildDoc,
                                  uint64_t aParentID, bool aCreating)
 {
   // We do not use GetAccessible here because we want to be sure to not get the
@@ -219,17 +219,17 @@ DocAccessibleParent::AddChildDoc(DocAcce
   MOZ_ASSERT(outerDoc);
 
   aChildDoc->mParent = outerDoc;
   outerDoc->SetChildDoc(aChildDoc);
   mChildDocs.AppendElement(aChildDoc);
   aChildDoc->mParentDoc = this;
 
   if (aCreating) {
-    ProxyCreated(aChildDoc, 0);
+    ProxyCreated(aChildDoc, Interfaces::DOCUMENT | Interfaces::HYPERTEXT);
   }
 
   return true;
 }
 
 bool
 DocAccessibleParent::RecvShutdown()
 {
@@ -260,22 +260,26 @@ DocAccessibleParent::Destroy()
   }
   ProxyDestroyed(this);
   if (mParentDoc)
     mParentDoc->RemoveChildDoc(this);
   else if (IsTopLevel())
     GetAccService()->RemoteDocShutdown(this);
 }
 
-void
+bool
 DocAccessibleParent::CheckDocTree() const
 {
   size_t childDocs = mChildDocs.Length();
   for (size_t i = 0; i < childDocs; i++) {
     if (!mChildDocs[i] || mChildDocs[i]->mParentDoc != this)
-      MOZ_CRASH("document tree is broken!");
+      return false;
 
-    mChildDocs[i]->CheckDocTree();
+    if (!mChildDocs[i]->CheckDocTree()) {
+      return false;
+    }
   }
+
+  return true;
 }
 
 } // a11y
 } // mozilla
--- a/accessible/ipc/DocAccessibleParent.h
+++ b/accessible/ipc/DocAccessibleParent.h
@@ -67,17 +67,17 @@ public:
     ParentDoc()->mChildDocs.RemoveElement(this);
     mParentDoc = nullptr;
   }
 
   virtual bool RecvShutdown() override;
   void Destroy();
   virtual void ActorDestroy(ActorDestroyReason aWhy) override
   {
-    CheckDocTree();
+    MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
     if (!mShutdown)
       Destroy();
   }
 
   /*
    * Return the main processes representation of the parent document (if any)
    * of the document this object represents.
    */
@@ -146,17 +146,17 @@ private:
     enum { ALLOW_MEMMOVE = true };
 
     ProxyAccessible* mProxy;
   };
 
   uint32_t AddSubtree(ProxyAccessible* aParent,
                       const nsTArray<AccessibleData>& aNewTree, uint32_t aIdx,
                       uint32_t aIdxInParent);
-  void CheckDocTree() const;
+  MOZ_WARN_UNUSED_RESULT bool CheckDocTree() const;
 
   nsTArray<DocAccessibleParent*> mChildDocs;
   DocAccessibleParent* mParentDoc;
 
   /*
    * Conceptually this is a map from IDs to proxies, but we store the ID in the
    * proxy object so we can't use a real map.
    */
--- a/accessible/ipc/PDocAccessible.ipdl
+++ b/accessible/ipc/PDocAccessible.ipdl
@@ -221,16 +221,17 @@ child:
 
   prio(high) sync CurValue(uint64_t aID) returns(double aValue);
   prio(high) sync SetCurValue(uint64_t aID, double aValue) returns(bool aRetVal);
   prio(high) sync MinValue(uint64_t aID) returns(double aValue);
   prio(high) sync MaxValue(uint64_t aID) returns(double aValue);
   prio(high) sync Step(uint64_t aID) returns(double aStep);
 
   prio(high) sync TakeFocus(uint64_t aID);
+  prio(high) sync EmbeddedChildCount(uint64_t aID) returns(uint32_t aCount);
   prio(high) sync IndexOfEmbeddedChild(uint64_t aID, uint64_t aChildID)
     returns(uint32_t childIdx);
   prio(high) sync EmbeddedChildAt(uint64_t aID, uint32_t aChildIdx)
     returns(uint64_t aChild);
   prio(high) sync FocusedChild(uint64_t aID)
     returns(uint64_t aChild, bool aOk);
   prio(high) sync ChildAtPoint(uint64_t aID, int32_t aX, int32_t aY, uint32_t aWhich)
     returns(uint64_t aChild, bool aOk);
--- a/accessible/ipc/ProxyAccessible.cpp
+++ b/accessible/ipc/ProxyAccessible.cpp
@@ -974,16 +974,24 @@ ProxyAccessible::Step()
 }
 
 void
 ProxyAccessible::TakeFocus()
 {
   unused << mDoc->SendTakeFocus(mID);
 }
 
+uint32_t
+ProxyAccessible::EmbeddedChildCount() const
+{
+  uint32_t count;
+  unused << mDoc->SendEmbeddedChildCount(mID, &count);
+  return count;
+}
+
 int32_t
 ProxyAccessible::IndexOfEmbeddedChild(const ProxyAccessible* aChild)
 {
   uint64_t childID = aChild->mID;
   uint32_t childIdx;
   unused << mDoc->SendIndexOfEmbeddedChild(mID, childID, &childIdx);
   return childIdx;
 }
--- a/accessible/ipc/ProxyAccessible.h
+++ b/accessible/ipc/ProxyAccessible.h
@@ -44,16 +44,17 @@ public:
   void AddChildAt(uint32_t aIdx, ProxyAccessible* aChild)
   { mChildren.InsertElementAt(aIdx, aChild); }
 
   uint32_t ChildrenCount() const { return mChildren.Length(); }
   ProxyAccessible* ChildAt(uint32_t aIdx) const { return mChildren[aIdx]; }
 
   // XXX evaluate if this is fast enough.
   size_t IndexInParent() const { return Parent()->mChildren.IndexOf(this); }
+  uint32_t EmbeddedChildCount() const;
   int32_t IndexOfEmbeddedChild(const ProxyAccessible*);
   ProxyAccessible* EmbeddedChildAt(size_t aChildIdx);
   bool MustPruneChildren() const;
 
   void Shutdown();
 
   void SetChildDoc(DocAccessibleParent*);
 
--- a/accessible/jsat/AccessFu.jsm
+++ b/accessible/jsat/AccessFu.jsm
@@ -129,16 +129,18 @@ this.AccessFu = { // jshint ignore:line
 
     Services.obs.addObserver(this, 'remote-browser-shown', false);
     Services.obs.addObserver(this, 'inprocess-browser-shown', false);
     Services.obs.addObserver(this, 'Accessibility:NextObject', false);
     Services.obs.addObserver(this, 'Accessibility:PreviousObject', false);
     Services.obs.addObserver(this, 'Accessibility:Focus', false);
     Services.obs.addObserver(this, 'Accessibility:ActivateObject', false);
     Services.obs.addObserver(this, 'Accessibility:LongPress', false);
+    Services.obs.addObserver(this, 'Accessibility:ScrollForward', false);
+    Services.obs.addObserver(this, 'Accessibility:ScrollBackward', false);
     Services.obs.addObserver(this, 'Accessibility:MoveByGranularity', false);
     Utils.win.addEventListener('TabOpen', this);
     Utils.win.addEventListener('TabClose', this);
     Utils.win.addEventListener('TabSelect', this);
 
     if (this.readyCallback) {
       this.readyCallback();
       delete this.readyCallback;
@@ -182,16 +184,18 @@ this.AccessFu = { // jshint ignore:line
 
     Services.obs.removeObserver(this, 'remote-browser-shown');
     Services.obs.removeObserver(this, 'inprocess-browser-shown');
     Services.obs.removeObserver(this, 'Accessibility:NextObject');
     Services.obs.removeObserver(this, 'Accessibility:PreviousObject');
     Services.obs.removeObserver(this, 'Accessibility:Focus');
     Services.obs.removeObserver(this, 'Accessibility:ActivateObject');
     Services.obs.removeObserver(this, 'Accessibility:LongPress');
+    Services.obs.removeObserver(this, 'Accessibility:ScrollForward');
+    Services.obs.removeObserver(this, 'Accessibility:ScrollBackward');
     Services.obs.removeObserver(this, 'Accessibility:MoveByGranularity');
 
     delete this._quicknavModesPref;
     delete this._notifyOutputPref;
 
     if (this.doneCallback) {
       this.doneCallback();
       delete this.doneCallback;
@@ -310,16 +314,22 @@ this.AccessFu = { // jshint ignore:line
         this.Input.moveCursor('movePrevious', 'Simple', 'gesture');
         break;
       case 'Accessibility:ActivateObject':
         this.Input.activateCurrent(JSON.parse(aData));
         break;
       case 'Accessibility:LongPress':
         this.Input.sendContextMenuMessage();
         break;
+      case 'Accessibility:ScrollForward':
+        this.Input.androidScroll('forward');
+        break;
+      case 'Accessibility:ScrollBackward':
+        this.Input.androidScroll('backward');
+        break;
       case 'Accessibility:Focus':
         this._focused = JSON.parse(aData);
         if (this._focused) {
           this.autoMove({ forcePresent: true, noOpIfOnScreen: true });
         }
         break;
       case 'Accessibility:MoveByGranularity':
         this.Input.moveByGranularity(JSON.parse(aData));
@@ -832,16 +842,22 @@ var Input = {
   moveCursor: function moveCursor(aAction, aRule, aInputType, aAdjustRange) {
     let mm = Utils.getMessageManager(Utils.CurrentBrowser);
     mm.sendAsyncMessage('AccessFu:MoveCursor',
                         { action: aAction, rule: aRule,
                           origin: 'top', inputType: aInputType,
                           adjustRange: aAdjustRange });
   },
 
+  androidScroll: function androidScroll(aDirection) {
+    let mm = Utils.getMessageManager(Utils.CurrentBrowser);
+    mm.sendAsyncMessage('AccessFu:AndroidScroll',
+                        { direction: aDirection, origin: 'top' });
+  },
+
   moveByGranularity: function moveByGranularity(aDetails) {
     const MOVEMENT_GRANULARITY_PARAGRAPH = 8;
 
     if (!this.editState.editing) {
       if (aDetails.granularity === MOVEMENT_GRANULARITY_PARAGRAPH) {
         this.moveCursor('move' + aDetails.direction, 'Paragraph', 'gesture');
         return;
       }
--- a/accessible/jsat/ContentControl.jsm
+++ b/accessible/jsat/ContentControl.jsm
@@ -33,17 +33,18 @@ this.ContentControl = function ContentCo
 
 this.ContentControl.prototype = {
   messagesOfInterest: ['AccessFu:MoveCursor',
                        'AccessFu:ClearCursor',
                        'AccessFu:MoveToPoint',
                        'AccessFu:AutoMove',
                        'AccessFu:Activate',
                        'AccessFu:MoveCaret',
-                       'AccessFu:MoveByGranularity'],
+                       'AccessFu:MoveByGranularity',
+                       'AccessFu:AndroidScroll'],
 
   start: function cc_start() {
     let cs = this._contentScope.get();
     for (let message of this.messagesOfInterest) {
       cs.addMessageListener(message, this);
     }
     cs.addEventListener('mousemove', this);
   },
@@ -86,16 +87,37 @@ this.ContentControl.prototype = {
         Logger.warning('ContentControl: Unhandled message:', aMessage.name);
       }
     } catch (x) {
       Logger.logException(
         x, 'Error handling message: ' + JSON.stringify(aMessage.json));
     }
   },
 
+  handleAndroidScroll: function cc_handleAndroidScroll(aMessage) {
+    let vc = this.vc;
+    let position = vc.position;
+
+    if (aMessage.json.origin != 'child' && this.sendToChild(vc, aMessage)) {
+      // Forwarded succesfully to child cursor.
+      return;
+    }
+
+    // Counter-intuitive, but scrolling backward (ie. up), actually should
+    // increase range values.
+    if (this.adjustRange(position, aMessage.json.direction === 'backward')) {
+      return;
+    }
+
+    this._contentScope.get().sendAsyncMessage('AccessFu:DoScroll',
+      { bounds: Utils.getBounds(position, true),
+        page: aMessage.json.direction === 'forward' ? 1 : -1,
+        horizontal: false });
+  },
+
   handleMoveCursor: function cc_handleMoveCursor(aMessage) {
     let origin = aMessage.json.origin;
     let action = aMessage.json.action;
     let adjustRange = aMessage.json.adjustRange;
     let vc = this.vc;
 
     if (origin != 'child' && this.sendToChild(vc, aMessage)) {
       // Forwarded succesfully to child cursor.
--- a/accessible/tests/mochitest/jsat/jsatcommon.js
+++ b/accessible/tests/mochitest/jsat/jsatcommon.js
@@ -386,16 +386,30 @@ var ContentMessages = {
         action: 'moveNext',
         inputType: 'gesture',
         rule: (aRule || 'Simple'),
         adjustRange: true
       }
     }
   },
 
+  androidScrollForward: function adjustUp() {
+    return {
+      name: 'AccessFu:AndroidScroll',
+      json: { origin: 'top', direction: 'forward' }
+    };
+  },
+
+  androidScrollBackward: function adjustDown() {
+    return {
+      name: 'AccessFu:AndroidScroll',
+      json: { origin: 'top', direction: 'backward' }
+    };
+  },
+
   focusSelector: function focusSelector(aSelector, aBlur) {
     return {
       name: 'AccessFuTest:Focus',
       json: {
         selector: aSelector,
         blur: aBlur
       }
     };
--- a/accessible/tests/mochitest/jsat/test_content_integration.html
+++ b/accessible/tests/mochitest/jsat/test_content_integration.html
@@ -76,16 +76,18 @@
            new ExpectedSwitchAction(false)],
           [ContentMessages.simpleMovePrevious,
            new ExpectedCursorChange(['apple', {'string': 'pushbutton'}])],
           [ContentMessages.simpleMovePrevious,
            new ExpectedCursorChange(['Home', {'string': 'pushbutton'}])],
           [ContentMessages.simpleMovePrevious,
            new ExpectedCursorChange(['much range', '6', {'string': 'slider'}, 'such app'])],
           [ContentMessages.moveOrAdjustDown(), new ExpectedValueChange('5')],
+          [ContentMessages.androidScrollForward(), new ExpectedValueChange('6')],
+          [ContentMessages.androidScrollBackward(), new ExpectedValueChange('5')],
           [ContentMessages.simpleMovePrevious,
            new ExpectedCursorChange(['much range', {'string': 'label'}])],
           [ContentMessages.simpleMovePrevious,
            new ExpectedCursorChange(['many option', {'string': 'stateChecked'},
             {'string': 'checkbutton'}, {'string': 'listStart'},
             {'string': 'list'}, {'string': 'listItemsCount', 'count': 1}])],
           // uncheck checkbox
           [ContentMessages.activateCurrent(),
--- a/accessible/tests/mochitest/treeupdate/a11y.ini
+++ b/accessible/tests/mochitest/treeupdate/a11y.ini
@@ -3,16 +3,17 @@
 [test_ariadialog.html]
 [test_bug852150.xhtml]
 [test_bug883708.xhtml]
 [test_bug884251.xhtml]
 [test_bug895082.html]
 [test_bug1040735.html]
 [test_bug1100602.html]
 [test_bug1175913.html]
+[test_bug1189277.html]
 [test_canvas.html]
 [test_colorpicker.xul]
 [test_contextmenu.xul]
 [test_cssoverflow.html]
 [test_deck.xul]
 [test_doc.html]
 [test_gencontent.html]
 [test_hidden.html]
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/treeupdate/test_bug1189277.html
@@ -0,0 +1,85 @@
+<html>
+
+<head>
+  <title>Test hide/show events for HTMLListBulletAccessibles on list restyle</title>
+  <link rel="stylesheet" type="text/css"
+        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+
+  <script type="application/javascript"
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+
+  <script type="application/javascript"
+          src="../common.js"></script>
+  <script type="application/javascript"
+          src="../name.js"></script>
+  <script type="application/javascript"
+          src="../events.js"></script>
+
+  <script type="application/javascript">
+    function runTest()
+    {
+      this.containerNode = getNode("outerDiv");
+
+      this.eventSeq = [
+        new invokerChecker(EVENT_HIDE, getNode("child")),
+        new invokerChecker(EVENT_REORDER, this.containerNode),
+        new invokerChecker(EVENT_HIDE, getNode("childDoc")),
+        new invokerChecker(EVENT_SHOW, "newChildDoc")
+      ];
+
+      this.invoke = function runTest_invoke()
+      {
+        this.containerNode.removeChild(getNode("child"));
+
+        var docContainer = getNode("docContainer");
+        var iframe = document.createElement("iframe");
+        iframe.setAttribute("src", "http://example.com");
+        iframe.setAttribute("id", "newChildDoc");
+
+        docContainer.removeChild(getNode("childDoc"));
+        docContainer.appendChild(iframe);
+      }
+
+      this.getID = function runTest_getID()
+      {
+        return "check show events are not incorrectly coalesced";
+      }
+    }
+
+    gA11yEventDumpToConsole = true;
+    var gQueue = null;
+    function doTest()
+    {
+      gQueue = new eventQueue();
+      gQueue.push(new runTest());
+      gQueue.invoke(); // SimpleTest.finish();
+    }
+
+    SimpleTest.waitForExplicitFinish();
+    addA11yLoadEvent(doTest);
+  </script>
+
+</head>
+
+<body>
+
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=1189277"
+     title="content process crash caused by missing show event">
+    Mozilla Bug 1189277
+  </a>
+  <p id="display"></p>
+  <div id="content" style="display: none"></div>
+  <pre id="test">
+  </pre>
+
+  <div id="outerDiv">
+    <div id="child">foo</div>
+    <div id="docContainer">
+      <iframe id="childDoc" src="about:blank">
+      </iframe>
+    </div>
+  </div>
+
+</body>
+</html>
--- a/accessible/windows/ProxyWrappers.h
+++ b/accessible/windows/ProxyWrappers.h
@@ -24,22 +24,26 @@ class ProxyAccessibleWrap : public Acces
   }
 
   virtual void Shutdown() override
   {
     mBits.proxy = nullptr;
   }
 };
 
-class HyperTextProxyAccessibleWrap : public ProxyAccessibleWrap,
-                                     public ia2AccessibleEditableText,
-                                     public ia2AccessibleHypertext
+class HyperTextProxyAccessibleWrap : public HyperTextAccessibleWrap
 {
   HyperTextProxyAccessibleWrap(ProxyAccessible* aProxy) :
-    ProxyAccessibleWrap(aProxy) {}
+    HyperTextAccessibleWrap(nullptr, nullptr)
+  {
+    mType = eProxyType;
+    mBits.proxy = aProxy;
+  }
+
+  virtual void Shutdown() override { mBits.proxy = nullptr; }
 };
 
 template<typename T>
 inline ProxyAccessible*
 HyperTextProxyFor(T* aWrapper)
 {
   static_assert(mozilla::IsBaseOf<IUnknown, T>::value, "only IAccessible* should be passed in");
   auto wrapper = static_cast<HyperTextProxyAccessibleWrap*>(aWrapper);
--- a/accessible/windows/ia2/ia2AccessibleText.cpp
+++ b/accessible/windows/ia2/ia2AccessibleText.cpp
@@ -8,19 +8,26 @@
 #include "ia2AccessibleText.h"
 
 #include "Accessible2.h"
 #include "AccessibleText_i.c"
 
 #include "HyperTextAccessibleWrap.h"
 #include "HyperTextAccessible-inl.h"
 #include "ProxyWrappers.h"
+#include "mozilla/ClearOnShutdown.h"
 
 using namespace mozilla::a11y;
 
+StaticRefPtr<HyperTextAccessibleWrap> ia2AccessibleText::sLastTextChangeAcc;
+StaticAutoPtr<nsString> ia2AccessibleText::sLastTextChangeString;
+uint32_t ia2AccessibleText::sLastTextChangeStart = 0;
+uint32_t ia2AccessibleText::sLastTextChangeEnd = 0;
+bool ia2AccessibleText::sLastTextChangeWasInsert = false;
+
 // IAccessibleText
 
 STDMETHODIMP
 ia2AccessibleText::addSelection(long aStartOffset, long aEndOffset)
 {
   A11Y_TRYBLOCK_BEGIN
 
   if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
@@ -567,31 +574,32 @@ ia2AccessibleText::get_oldText(IA2TextSe
 
 HRESULT
 ia2AccessibleText::GetModifiedText(bool aGetInsertedText,
                                    IA2TextSegment *aText)
 {
   if (!aText)
     return E_INVALIDARG;
 
-  uint32_t startOffset = 0, endOffset = 0;
-  nsAutoString text;
+  if (!sLastTextChangeAcc)
+    return S_OK;
+
+  if (aGetInsertedText != sLastTextChangeWasInsert)
+    return S_OK;
 
-  nsresult rv = GetModifiedText(aGetInsertedText, text,
-                                &startOffset, &endOffset);
-  if (NS_FAILED(rv))
-    return GetHRESULT(rv);
+  if (sLastTextChangeAcc != this)
+    return S_OK;
 
-  aText->start = startOffset;
-  aText->end = endOffset;
+  aText->start = sLastTextChangeStart;
+  aText->end = sLastTextChangeEnd;
 
-  if (text.IsEmpty())
+  if (sLastTextChangeString->IsEmpty())
     return S_FALSE;
 
-  aText->text = ::SysAllocStringLen(text.get(), text.Length());
+  aText->text = ::SysAllocStringLen(sLastTextChangeString->get(), sLastTextChangeString->Length());
   return aText->text ? S_OK : E_OUTOFMEMORY;
 }
 
 AccessibleTextBoundary
 ia2AccessibleText::GetGeckoTextBoundary(enum IA2TextBoundaryType aBoundaryType)
 {
   switch (aBoundaryType) {
     case IA2_TEXT_BOUNDARY_CHAR:
@@ -603,8 +611,29 @@ ia2AccessibleText::GetGeckoTextBoundary(
     //case IA2_TEXT_BOUNDARY_SENTENCE:
     //case IA2_TEXT_BOUNDARY_PARAGRAPH:
       // XXX: not implemented
     default:
       return -1;
   }
 }
 
+void
+ia2AccessibleText::InitTextChangeData()
+{
+  ClearOnShutdown(&sLastTextChangeAcc);
+  ClearOnShutdown(&sLastTextChangeString);
+}
+
+void
+ia2AccessibleText::UpdateTextChangeData(HyperTextAccessibleWrap* aAcc,
+                                        bool aInsert, const nsString& aStr,
+                                        int32_t aStart, uint32_t aLen)
+{
+  if (!sLastTextChangeString)
+    sLastTextChangeString = new nsString();
+
+  sLastTextChangeAcc = aAcc;
+  sLastTextChangeStart = aStart;
+  sLastTextChangeEnd = aStart + aLen;
+  sLastTextChangeWasInsert = aInsert;
+  *sLastTextChangeString = aStr;
+}
--- a/accessible/windows/ia2/ia2AccessibleText.h
+++ b/accessible/windows/ia2/ia2AccessibleText.h
@@ -9,16 +9,17 @@
 #define _ACCESSIBLE_TEXT_H
 
 #include "nsIAccessibleText.h"
 
 #include "AccessibleText.h"
 
 namespace mozilla {
 namespace a11y {
+class HyperTextAccessibleWrap;
 
 class ia2AccessibleText: public IAccessibleText
 {
 public:
 
   // IAccessibleText
   virtual HRESULT STDMETHODCALLTYPE addSelection(
       /* [in] */ long startOffset,
@@ -108,20 +109,27 @@ public:
       /* [in] */ long y);
 
   virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_newText(
       /* [retval][out] */ IA2TextSegment *newText);
 
   virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_oldText(
       /* [retval][out] */ IA2TextSegment *oldText);
 
+  static void InitTextChangeData();
+  static void UpdateTextChangeData(HyperTextAccessibleWrap* aAcc, bool aInsert,
+                                   const nsString& aStr, int32_t aStart,
+                                   uint32_t aLen);
+
 protected:
-  virtual nsresult GetModifiedText(bool aGetInsertedText, nsAString& aText,
-                                   uint32_t *aStartOffset,
-                                   uint32_t *aEndOffset) = 0;
+  static StaticRefPtr<HyperTextAccessibleWrap> sLastTextChangeAcc;
+  static StaticAutoPtr<nsString> sLastTextChangeString;
+  static bool sLastTextChangeWasInsert;
+  static uint32_t sLastTextChangeStart;
+  static uint32_t sLastTextChangeEnd;
 
 private:
   HRESULT GetModifiedText(bool aGetInsertedText, IA2TextSegment *aNewText);
   AccessibleTextBoundary GetGeckoTextBoundary(enum IA2TextBoundaryType coordinateType);
 };
 
 } // namespace a11y
 } // namespace mozilla
--- a/accessible/windows/ia2/moz.build
+++ b/accessible/windows/ia2/moz.build
@@ -42,11 +42,14 @@ LOCAL_INCLUDES += [
     '/accessible/windows',
     '/accessible/windows/msaa',
     '/accessible/xpcom',
     '/accessible/xul',
 ]
 
 FINAL_LIBRARY = 'xul'
 
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
+
 FAIL_ON_WARNINGS = True
 
 include('/ipc/chromium/chromium-config.mozbuild')
--- a/accessible/windows/msaa/HyperTextAccessibleWrap.cpp
+++ b/accessible/windows/msaa/HyperTextAccessibleWrap.cpp
@@ -10,22 +10,16 @@
 
 #include "nsEventShell.h"
 
 #include "mozilla/StaticPtr.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
-StaticRefPtr<Accessible> HyperTextAccessibleWrap::sLastTextChangeAcc;
-StaticAutoPtr<nsString> HyperTextAccessibleWrap::sLastTextChangeString;
-uint32_t HyperTextAccessibleWrap::sLastTextChangeStart = 0;
-uint32_t HyperTextAccessibleWrap::sLastTextChangeEnd = 0;
-bool HyperTextAccessibleWrap::sLastTextChangeWasInsert = false;
-
 NS_IMPL_ISUPPORTS_INHERITED0(HyperTextAccessibleWrap,
                              HyperTextAccessible)
 
 STDMETHODIMP
 HyperTextAccessibleWrap::QueryInterface(REFIID aIID, void** aInstancePtr)
 {
   if (!aInstancePtr)
     return E_FAIL;
@@ -54,49 +48,20 @@ nsresult
 HyperTextAccessibleWrap::HandleAccEvent(AccEvent* aEvent)
 {
   uint32_t eventType = aEvent->GetEventType();
 
   if (eventType == nsIAccessibleEvent::EVENT_TEXT_REMOVED ||
       eventType == nsIAccessibleEvent::EVENT_TEXT_INSERTED) {
     Accessible* accessible = aEvent->GetAccessible();
     if (accessible && accessible->IsHyperText()) {
-      sLastTextChangeAcc = accessible;
-      if (!sLastTextChangeString)
-        sLastTextChangeString = new nsString();
-
       AccTextChangeEvent* event = downcast_accEvent(aEvent);
-      event->GetModifiedText(*sLastTextChangeString);
-      sLastTextChangeStart = event->GetStartOffset();
-      sLastTextChangeEnd = sLastTextChangeStart + event->GetLength();
-      sLastTextChangeWasInsert = event->IsTextInserted();
+        HyperTextAccessibleWrap* text =
+          static_cast<HyperTextAccessibleWrap*>(accessible->AsHyperText());
+      ia2AccessibleText::UpdateTextChangeData(text, event->IsTextInserted(),
+                                              event->ModifiedText(),
+                                              event->GetStartOffset(),
+                                              event->GetLength());
     }
   }
 
   return HyperTextAccessible::HandleAccEvent(aEvent);
 }
-
-nsresult
-HyperTextAccessibleWrap::GetModifiedText(bool aGetInsertedText,
-                                         nsAString& aText,
-                                         uint32_t* aStartOffset,
-                                         uint32_t* aEndOffset)
-{
-  aText.Truncate();
-  *aStartOffset = 0;
-  *aEndOffset = 0;
-
-  if (!sLastTextChangeAcc)
-    return NS_OK;
-
-  if (aGetInsertedText != sLastTextChangeWasInsert)
-    return NS_OK;
-
-  if (sLastTextChangeAcc != this)
-    return NS_OK;
-
-  *aStartOffset = sLastTextChangeStart;
-  *aEndOffset = sLastTextChangeEnd;
-  aText.Append(*sLastTextChangeString);
-
-  return NS_OK;
-}
-
--- a/accessible/windows/msaa/HyperTextAccessibleWrap.h
+++ b/accessible/windows/msaa/HyperTextAccessibleWrap.h
@@ -33,26 +33,14 @@ public:
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
   virtual nsresult HandleAccEvent(AccEvent* aEvent);
 
 protected:
   ~HyperTextAccessibleWrap() {}
-
-  virtual nsresult GetModifiedText(bool aGetInsertedText, nsAString& aText,
-                                   uint32_t *aStartOffset,
-                                   uint32_t *aEndOffset);
-
-  static StaticRefPtr<Accessible> sLastTextChangeAcc;
-  static StaticAutoPtr<nsString> sLastTextChangeString;
-  static bool sLastTextChangeWasInsert;
-  static uint32_t sLastTextChangeStart;
-  static uint32_t sLastTextChangeEnd;
-
-  friend void PlatformInit();
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
--- a/accessible/windows/msaa/Platform.cpp
+++ b/accessible/windows/msaa/Platform.cpp
@@ -4,33 +4,31 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "Platform.h"
 
 #include "AccEvent.h"
 #include "Compatibility.h"
 #include "HyperTextAccessibleWrap.h"
+#include "ia2AccessibleText.h"
 #include "nsWinUtils.h"
 #include "mozilla/a11y/ProxyAccessible.h"
 #include "ProxyWrappers.h"
 
-#include "mozilla/ClearOnShutdown.h"
-
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 void
 a11y::PlatformInit()
 {
   Compatibility::Init();
 
   nsWinUtils::MaybeStartWindowEmulation();
-  ClearOnShutdown(&HyperTextAccessibleWrap::sLastTextChangeAcc);
-  ClearOnShutdown(&HyperTextAccessibleWrap::sLastTextChangeString);
+  ia2AccessibleText::InitTextChangeData();
 }
 
 void
 a11y::PlatformShutdown()
 {
   ::DestroyCaret();
 
   nsWinUtils::ShutdownWindowEmulation();
@@ -69,12 +67,17 @@ a11y::ProxyStateChangeEvent(ProxyAccessi
 }
 
 void
 a11y::ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset)
 {
 }
 
 void
-a11y::ProxyTextChangeEvent(ProxyAccessible*, const nsString&, int32_t, uint32_t,
-                     bool, bool)
+a11y::ProxyTextChangeEvent(ProxyAccessible* aText, const nsString& aStr,
+                           int32_t aStart, uint32_t aLen, bool aInsert, bool)
 {
+  AccessibleWrap* wrapper = WrapperFor(aText);
+  auto text = static_cast<HyperTextAccessibleWrap*>(wrapper->AsHyperText());
+  if (text) {
+    ia2AccessibleText::UpdateTextChangeData(text, aInsert, aStr, aStart, aLen);
+  }
 }
--- a/accessible/windows/msaa/moz.build
+++ b/accessible/windows/msaa/moz.build
@@ -57,9 +57,12 @@ LOCAL_INCLUDES += [
     '/accessible/xul',
     '/dom/base',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
+
 FAIL_ON_WARNINGS = True
--- a/accessible/windows/sdn/moz.build
+++ b/accessible/windows/sdn/moz.build
@@ -16,9 +16,12 @@ LOCAL_INCLUDES += [
     '/accessible/html',
     '/accessible/windows/msaa',
     '/accessible/xpcom',
     '/accessible/xul',
 ]
 
 FINAL_LIBRARY = 'xul'
 
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
+
 FAIL_ON_WARNINGS = True
--- a/addon-sdk/source/test/context-menu/test-helper.js
+++ b/addon-sdk/source/test/context-menu/test-helper.js
@@ -25,17 +25,17 @@ const TEST_DOC_URL = module.uri.replace(
 // This makes it easier to run tests by handling things like opening the menu,
 // opening new windows, making assertions, etc.  Methods on |test| can be called
 // on instances of this class.  Don't forget to call done() to end the test!
 // WARNING: This looks up items in popups by comparing labels, so don't give two
 // items the same label.
 function TestHelper(assert, done) {
   // Methods on the wrapped test can be called on this object.
   for (var prop in assert)
-    this[prop] = () => assert[prop].apply(assert, arguments);
+    this[prop] = (...args) => assert[prop].apply(assert, args);
   this.assert = assert;
   this.end = done;
   this.loaders = [];
   this.browserWindow = getMostRecentBrowserWindow();
   this.overflowThreshValue = require("sdk/preferences/service").
                              get(OVERFLOW_THRESH_PREF, OVERFLOW_THRESH_DEFAULT);
   this.done = this.done.bind(this);
 }
--- a/addon-sdk/source/test/event/helpers.js
+++ b/addon-sdk/source/test/event/helpers.js
@@ -21,17 +21,17 @@ const { defer } = require("sdk/core/prom
  *    A string representing the event type to waiting for.
  * @param {Boolean} [capture]
  *    If `true`, `capture` indicates that the user wishes to initiate capture.
  *
  * @returns {Promise}
  *    A promise resolved once the delay given is passed, or the object
  *    receives the event specified
  */
-const wait = (target, type, capture) => {
+const wait = function(target, type, capture) {
   let { promise, resolve, reject } = defer();
 
   if (!arguments.length) {
     setImmediate(resolve);
   }
   else if (typeof(target) === "number") {
     setTimeout(resolve, target);
   }
@@ -100,9 +100,9 @@ exports.ignoreNew = scenario(function(ou
 exports.FIFO = scenario(function(target, expected, actual) {
   on(target, "data", function($) actual.push($ + "#1"));
   on(target, "data", function($) actual.push($ + "#2"));
   on(target, "data", function($) actual.push($ + "#3"));
 
   return expected.reduce(function(result, value) {
     return result.concat(value + "#1", value + "#2", value + "#3");
   }, []);
-});
\ No newline at end of file
+});
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -347,21 +347,16 @@ pref("image.onload.decode.limit", 24); /
 
 // XXX this isn't a good check for "are touch events supported", but
 // we don't really have a better one at the moment.
 // enable touch events interfaces
 pref("dom.w3c_touch_events.enabled", 1);
 pref("dom.w3c_touch_events.safetyX", 0); // escape borders in units of 1/240"
 pref("dom.w3c_touch_events.safetyY", 120); // escape borders in units of 1/240"
 
-// W3C draft pointer events
-pref("dom.w3c_pointer_events.enabled", false);
-// W3C touch-action css property (related to touch and pointer events)
-pref("layout.css.touch_action.enabled", false);
-
 #ifdef MOZ_SAFE_BROWSING
 // Safe browsing does nothing unless this pref is set
 pref("browser.safebrowsing.enabled", false);
 
 // Prevent loading of pages identified as malware
 pref("browser.safebrowsing.malware.enabled", false);
 
 pref("browser.safebrowsing.debug", false);
@@ -431,18 +426,16 @@ pref("content.ime.strict_policy", true);
 // $ adb shell stop
 // $ adb shell setprop log.redirect-stdio true
 // $ adb shell start
 pref("browser.dom.window.dump.enabled", false);
 
 // Default Content Security Policy to apply to certified apps.
 // If you change this CSP, make sure to update the fast path in nsCSPService.cpp
 pref("security.apps.certified.CSP.default", "default-src * data: blob:; script-src 'self'; object-src 'none'; style-src 'self' 'unsafe-inline' app://theme.gaiamobile.org");
-// Default Content Security Policy to apply to trusted apps.
-pref("security.apps.trusted.CSP.default", "default-src * data: blob:; object-src 'none'; frame-src 'none'");
 
 // handle links targeting new windows
 // 1=current window/tab, 2=new window, 3=new tab in most recent window
 pref("browser.link.open_newwindow", 3);
 
 // 0: no restrictions - divert everything
 // 1: don't divert window.open at all
 // 2: don't divert window.open with features
@@ -600,17 +593,17 @@ pref("b2g.update.download-watchdog-max-r
 pref("app.update.enabled", true);
 pref("app.update.auto", false);
 pref("app.update.silent", false);
 pref("app.update.mode", 0);
 pref("app.update.incompatible.mode", 0);
 pref("app.update.staging.enabled", true);
 pref("app.update.service.enabled", true);
 
-pref("app.update.url", "https://aus4.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%PRODUCT_DEVICE%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
+pref("app.update.url", "https://aus5.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%PRODUCT_DEVICE%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
 pref("app.update.channel", "@MOZ_UPDATE_CHANNEL@");
 
 // Interval at which update manifest is fetched.  In units of seconds.
 pref("app.update.interval", 86400); // 1 day
 // Don't throttle background updates.
 pref("app.update.download.backgroundInterval", 0);
 
 // Retry update socket connections every 30 seconds in the cases of certain kinds of errors
@@ -922,18 +915,16 @@ pref("memory_info_dumper.watch_fifo.dire
 // See ua-update.json.in for the packaged UA override list
 pref("general.useragent.updates.enabled", true);
 pref("general.useragent.updates.url", "https://dynamicua.cdn.mozilla.net/0/%APP_ID%");
 pref("general.useragent.updates.interval", 604800); // 1 week
 pref("general.useragent.updates.retry", 86400); // 1 day
 // Device ID can be composed of letter, numbers, hyphen ("-") and dot (".")
 pref("general.useragent.device_id", "");
 
-// Make <audio> and <video> talk to the AudioChannelService.
-pref("media.useAudioChannelService", true);
 // Add Mozilla AudioChannel APIs.
 pref("media.useAudioChannelAPI", true);
 
 pref("b2g.version", @MOZ_B2G_VERSION@);
 pref("b2g.osName", @MOZ_B2G_OS_NAME@);
 
 // Disable console buffering to save memory.
 pref("consoleservice.buffered", false);
--- a/b2g/app/moz.build
+++ b/b2g/app/moz.build
@@ -70,16 +70,19 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk
 
 DISABLE_STL_WRAPPING = True
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     OS_LIBS += [
         'version',
     ]
 
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
+
 FAIL_ON_WARNINGS = True
 
 JS_PREFERENCE_FILES += [
     'b2g.js',
 ]
 
 DIST_FILES += [
   'ua-update.json.in',
--- a/b2g/chrome/content/devtools/hud.js
+++ b/b2g/chrome/content/devtools/hud.js
@@ -2,16 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 'use strict';
 
 // settings.js loads this file when the HUD setting is enabled.
 
 const DEVELOPER_HUD_LOG_PREFIX = 'DeveloperHUD';
+const CUSTOM_HISTOGRAM_PREFIX = 'DEVTOOLS_HUD_CUSTOM_';
 
 XPCOMUtils.defineLazyGetter(this, 'devtools', function() {
   const {devtools} = Cu.import('resource://gre/modules/devtools/Loader.jsm', {});
   return devtools;
 });
 
 XPCOMUtils.defineLazyGetter(this, 'DebuggerClient', function() {
   return devtools.require('devtools/toolkit/client/main').DebuggerClient;
@@ -30,33 +31,35 @@ XPCOMUtils.defineLazyGetter(this, 'Perfo
 });
 
 XPCOMUtils.defineLazyGetter(this, 'MemoryFront', function() {
   return devtools.require('devtools/server/actors/memory').MemoryFront;
 });
 
 Cu.import('resource://gre/modules/Frames.jsm');
 
-let _telemetryDebug = true;
+let _telemetryDebug = false;
 
 function telemetryDebug(...args) {
   if (_telemetryDebug) {
     args.unshift('[AdvancedTelemetry]');
     console.log(...args);
   }
 }
 
 /**
  * The Developer HUD is an on-device developer tool that displays widgets,
  * showing visual debug information about apps. Each widget corresponds to a
  * metric as tracked by a metric watcher (e.g. consoleWatcher).
  */
 let developerHUD = {
 
   _targets: new Map(),
+  _histograms: new Set(),
+  _customHistograms: new Set(),
   _client: null,
   _conn: null,
   _watchers: [],
   _logging: true,
   _telemetry: false,
 
   /**
    * This method registers a metric watcher that will watch one or more metrics
@@ -270,48 +273,117 @@ Target.prototype = {
   },
 
   /**
    * Tear everything down, including the front-end by sending a message without
    * widgets.
    */
   destroy() {
     delete this.metrics;
-    this._send({});
+    this._send({metric: {skipTelemetry: true}});
   },
 
   _send(data) {
     let frame = this.frame;
 
     shell.sendEvent(frame, 'developer-hud-update', Cu.cloneInto(data, frame));
-    this._sendTelemetryEvent(data.metric);
+    this._logHistogram(data.metric);
+  },
+
+  _getAddonHistogram(item) {
+    let APPNAME_IDX = 3;
+    let HISTNAME_IDX = 4;
+
+    let array = item.split('_');
+    let appName = array[APPNAME_IDX].toUpperCase();
+    let histName = array[HISTNAME_IDX].toUpperCase();
+    return Services.telemetry.getAddonHistogram(appName,
+      CUSTOM_HISTOGRAM_PREFIX + histName);
+  },
+
+  _clearTelemetryData() {
+    developerHUD._histograms.forEach(function(item) {
+      Services.telemetry.getKeyedHistogramById(item).clear();
+    });
+
+    developerHUD._customHistograms.forEach(item => {
+      this._getAddonHistogram(item).clear();
+    });
   },
 
-  _sendTelemetryEvent(metric) {
-    if (!developerHUD._telemetry || !metric || metric.skipTelemetry) {
+  _sendTelemetryData() {
+    if (!developerHUD._telemetry) {
+      return;
+    }
+    telemetryDebug('calling sendTelemetryData');
+    let frame = this.frame;
+    let payload = {
+      keyedHistograms: {},
+      addonHistograms: {}
+    };
+    // Package the hud histograms.
+    developerHUD._histograms.forEach(function(item) {
+      payload.keyedHistograms[item] =
+        Services.telemetry.getKeyedHistogramById(item).snapshot();
+    });
+    // Package the registered hud custom histograms
+    developerHUD._customHistograms.forEach(item => {
+      payload.addonHistograms[item] = this._getAddonHistogram(item).snapshot();
+    });
+
+    shell.sendEvent(frame, 'advanced-telemetry-update', Cu.cloneInto(payload, frame));
+  },
+
+  _logHistogram(metric) {
+    if (!developerHUD._telemetry || metric.skipTelemetry) {
       return;
     }
 
     if (!this.appName) {
       let manifest = this.manifest;
       if (!manifest) {
         return;
       }
       let start = manifest.indexOf('/') + 2;
       let end = manifest.indexOf('.', start);
       this.appName = manifest.substring(start, end).toLowerCase();
     }
 
     metric.appName = this.appName;
 
-    let data = { metric: metric };
-    let frame = this.frame;
-
-    telemetryDebug('sending advanced-telemetry-update with this data: ' + JSON.stringify(data));
-    shell.sendEvent(frame, 'advanced-telemetry-update', Cu.cloneInto(data, frame));
+    let metricName = metric.name.toUpperCase();
+    let metricAppName = metric.appName.toUpperCase();
+    if (!metric.custom) {
+      let keyedMetricName = 'DEVTOOLS_HUD_' + metricName;
+      try {
+        let keyed = Services.telemetry.getKeyedHistogramById(keyedMetricName);
+        if (keyed) {
+          keyed.add(metric.appName, parseInt(metric.value, 10));
+          developerHUD._histograms.add(keyedMetricName);
+        }
+      } catch(err) {
+        console.error('Histogram error is metricname added to histograms.json:'
+          + keyedMetricName);
+      }
+    } else {
+      let histogramName = CUSTOM_HISTOGRAM_PREFIX + metricAppName + '_'
+        + metricName;
+      if (!developerHUD._customHistograms.has(histogramName)) {
+        try {
+          Services.telemetry.registerAddonHistogram(metricAppName,
+            CUSTOM_HISTOGRAM_PREFIX + metricName,
+            Services.telemetry.HISTOGRAM_LINEAR, 1, 10000, 10);
+          developerHUD._customHistograms.add(histogramName);
+        } catch(err) {
+          console.error('Histogram error: ' + err);
+        }
+      }
+      Services.telemetry.getAddonHistogram(metricAppName,
+        CUSTOM_HISTOGRAM_PREFIX + metricName).add(parseInt(metric.value, 10));
+    }
   }
 };
 
 
 /**
  * The Console Watcher tracks the following metrics in apps: reflows, warnings,
  * and errors, with security errors reported separately.
  */
@@ -406,19 +478,19 @@ let consoleWatcher = {
           output += 'Error (';
         }
 
         if (this._security.indexOf(pageError.category) > -1) {
           metric.name = 'security';
 
           // Telemetry sends the security error category not the
           // count of security errors.
-          target._sendTelemetryEvent({
-            name: 'security',
-            value: pageError.category,
+          target._logHistogram({
+            name: 'security_category',
+            value: pageError.category
           });
 
           // Indicate that the 'hud' security metric (the count of security
           // errors) should not be sent as a telemetry metric since the
           // security error category is being sent instead.
           metric.skipTelemetry = true;
         }
 
@@ -462,17 +534,20 @@ let consoleWatcher = {
         metric.interruptible = interruptible;
         let duration = Math.round((end - start) * 100) / 100;
         output += 'Reflow: ' + duration + 'ms';
         if (sourceURL) {
           output += ' ' + this.formatSourceURL(packet);
         }
 
         // Telemetry also records reflow duration.
-        target._sendTelemetryEvent({name: 'reflow-duration', value: Math.round(duration)});
+        target._logHistogram({
+          name: 'reflow_duration',
+          value: Math.round(duration)
+        });
         break;
 
       default:
         return;
     }
 
     if (!this._watching[metric.name]) {
       return;
@@ -508,35 +583,37 @@ let consoleWatcher = {
     }
 
     let telemetryData = logContent.split(separator);
 
     // Positions of the components of a telemetry log entry.
     let TELEMETRY_IDENTIFIER_IDX = 0;
     let NAME_IDX = 1;
     let VALUE_IDX = 2;
-    let CONTEXT_IDX = 3;
 
     if (telemetryData[TELEMETRY_IDENTIFIER_IDX] != 'telemetry' ||
         telemetryData.length < 3 || telemetryData.length > 4) {
       return;
     }
 
     let metric = {
       name: telemetryData[NAME_IDX],
       value: telemetryData[VALUE_IDX]
     };
-
-    // The metric's app name, if a 'context' was provided, is the
-    // specified context appended to the specified app name.
-    if (telemetryData.length === 4) {
-      metric.context = telemetryData[CONTEXT_IDX];
+    if (metric.name == 'MGMT') {
+      if (metric.value == 'TIMETOSHIP') {
+        telemetryDebug('Received a Ship event');
+        target._sendTelemetryData();
+      } else if (metric.value == 'CLEARMETRICS') {
+        target._clearTelemetryData();
+      }
+    } else {
+      metric.custom = true;
+      target._logHistogram(metric);
     }
-
-    target._sendTelemetryEvent(metric);
   }
 };
 developerHUD.registerWatcher(consoleWatcher);
 
 
 let eventLoopLagWatcher = {
   _client: null,
   _fronts: new Map(),
@@ -641,21 +718,21 @@ let performanceEntriesWatcher = {
           let origin = detail.origin;
           origin = origin.substr(0, origin.indexOf('.'));
           if (this._appLaunchName === origin) {
             let time = epoch - this._appLaunchStartTime;
             let eventName = 'app-startup-time-' + name;
 
             // Events based on performance marks are for telemetry only, they are
             // not displayed in the HUD front end.
-            target._sendTelemetryEvent({name: eventName, value: time});
+            target._logHistogram({name: eventName, value: time});
 
             memoryWatcher.front(target).residentUnique().then(value => {
               eventName = 'app-memory-' + name;
-              target._sendTelemetryEvent({name: eventName, value: value});
+              target._logHistogram({name: eventName, value: value});
             }, err => {
               console.error(err);
             });
           }
         }
       }
     });
   },
--- a/b2g/chrome/content/settings.js
+++ b/b2g/chrome/content/settings.js
@@ -570,17 +570,17 @@ let settingsToObserve = {
     defaultValue: 'Firefox OS'
   },
   'devtools.eventlooplag.threshold': 100,
   'devtools.remote.wifi.visible': {
     resetToPref: true
   },
   'dom.mozApps.use_reviewer_certs': false,
   'dom.mozApps.signed_apps_installable_from': 'https://marketplace.firefox.com',
-  'dom.presentation.discovery.enabled': true,
+  'dom.presentation.discovery.enabled': false,
   'dom.presentation.discoverable': false,
   'dom.serviceWorkers.interception.enabled': true,
   'dom.serviceWorkers.testing.enabled': false,
   'gfx.layerscope.enabled': false,
   'layers.draw-borders': false,
   'layers.draw-tile-borders': false,
   'layers.dump': false,
   'layers.enable-tiles': true,
new file mode 100644
--- /dev/null
+++ b/b2g/components/ActivityChannel.jsm
@@ -0,0 +1,58 @@
+/* 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";
+
+const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
+
+Cu.import('resource://gre/modules/XPCOMUtils.jsm');
+
+XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
+                                   "@mozilla.org/childprocessmessagemanager;1",
+                                   "nsIMessageSender");
+
+this.EXPORTED_SYMBOLS = ["ActivityChannel"];
+
+this.ActivityChannel = function(aURI, aLoadInfo, aName, aDetails) {
+  this._activityName = aName;
+  this._activityDetails = aDetails;
+  this.originalURI = aURI;
+  this.URI = aURI;
+  this.loadInfo = aLoadInfo;
+}
+
+this.ActivityChannel.prototype = {
+  originalURI: null,
+  URI: null,
+  owner: null,
+  notificationCallbacks: null,
+  securityInfo: null,
+  contentType: null,
+  contentCharset: null,
+  contentLength: 0,
+  contentDisposition: Ci.nsIChannel.DISPOSITION_INLINE,
+  contentDispositionFilename: null,
+  contentDispositionHeader: null,
+  loadInfo: null,
+
+  open: function() {
+    throw Cr.NS_ERROR_NOT_IMPLEMENTED;
+  },
+
+  open2: function() {
+    throw Cr.NS_ERROR_NOT_IMPLEMENTED;
+  },
+
+  asyncOpen: function(aListener, aContext) {
+    cpmm.sendAsyncMessage(this._activityName, this._activityDetails);
+    // Let the listener cleanup.
+    aListener.onStopRequest(this, aContext, Cr.NS_OK);
+  },
+
+  asyncOpen2: function(aListener) {
+    this.asyncOpen(aListener, null);
+  },
+
+  QueryInterface2: XPCOMUtils.generateQI([Ci.nsIChannel])
+}
--- a/b2g/components/MailtoProtocolHandler.js
+++ b/b2g/components/MailtoProtocolHandler.js
@@ -2,20 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-
-XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
-                                   "@mozilla.org/childprocessmessagemanager;1",
-                                   "nsIMessageSender");
+Cu.import('resource://gre/modules/ActivityChannel.jsm');
 
 function MailtoProtocolHandler() {
 }
 
 MailtoProtocolHandler.prototype = {
 
   scheme: "mailto",
   defaultPort: -1,
@@ -27,21 +24,20 @@ MailtoProtocolHandler.prototype = {
 
   newURI: function Proto_newURI(aSpec, aOriginCharset) {
     let uri = Cc["@mozilla.org/network/simple-uri;1"].createInstance(Ci.nsIURI);
     uri.spec = aSpec;
     return uri;
   },
 
   newChannel2: function Proto_newChannel2(aURI, aLoadInfo) {
-    cpmm.sendAsyncMessage("mail-handler", {
-      URI: aURI.spec,
-      type: "mail" });
-
-    throw Components.results.NS_ERROR_ILLEGAL_VALUE;
+    return new ActivityChannel(aURI, aLoadInfo,
+                               "mail-handler",
+                               { URI: aURI.spec,
+                                 type: "mail" });
   },
 
   newChannel: function Proto_newChannel(aURI) {
     return this.newChannel2(aURI, null);
   },
 
   classID: Components.ID("{50777e53-0331-4366-a191-900999be386c}"),
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler])
--- a/b2g/components/SmsProtocolHandler.js
+++ b/b2g/components/SmsProtocolHandler.js
@@ -11,20 +11,17 @@
 
 "use strict";
 
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 Cu.import('resource://gre/modules/XPCOMUtils.jsm');
 Cu.import("resource:///modules/TelURIParser.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
-                                   "@mozilla.org/childprocessmessagemanager;1",
-                                   "nsIMessageSender");
+Cu.import('resource://gre/modules/ActivityChannel.jsm');
 
 function SmsProtocolHandler() {
 }
 
 SmsProtocolHandler.prototype = {
 
   scheme: "sms",
   defaultPort: -1,
@@ -51,20 +48,21 @@ SmsProtocolHandler.prototype = {
         let [name, value] = aParam.split("=");
         if (name === "body") {
           body = decodeURIComponent(value);
         }
       })
     }
 
     if (number || body) {
-      cpmm.sendAsyncMessage("sms-handler", {
-        number: number || "",
-        type: "websms/sms",
-        body: body });
+      return new ActivityChannel(aURI, aLoadInfo,
+                                 "sms-handler",
+                                 { number: number || "",
+                                   type: "websms/sms",
+                                   body: body });
     }
 
     throw Components.results.NS_ERROR_ILLEGAL_VALUE;
   },
 
   newChannel: function Proto_newChannel(aURI) {
     return this.newChannel2(aURI, null);
   },
--- a/b2g/components/TelProtocolHandler.js
+++ b/b2g/components/TelProtocolHandler.js
@@ -10,20 +10,17 @@
  */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 Cu.import('resource://gre/modules/XPCOMUtils.jsm');
 Cu.import("resource:///modules/TelURIParser.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
-                                   "@mozilla.org/childprocessmessagemanager;1",
-                                   "nsIMessageSender");
+Cu.import('resource://gre/modules/ActivityChannel.jsm');
 
 function TelProtocolHandler() {
 }
 
 TelProtocolHandler.prototype = {
 
   scheme: "tel",
   defaultPort: -1,
@@ -38,19 +35,20 @@ TelProtocolHandler.prototype = {
     uri.spec = aSpec;
     return uri;
   },
 
   newChannel2: function Proto_newChannel(aURI, aLoadInfo) {
     let number = TelURIParser.parseURI('tel', aURI.spec);
 
     if (number) {
-      cpmm.sendAsyncMessage("dial-handler", {
-        number: number,
-        type: "webtelephony/number" });
+      return new ActivityChannel(aURI, aLoadInfo,
+                                 "dial-handler",
+                                 { number: number,
+                                   type: "webtelephony/number" });
     }
 
     throw Components.results.NS_ERROR_ILLEGAL_VALUE;
   },
 
   newChannel: function Proto_newChannel(aURI) {
     return this.newChannel2(aURI, null);
   },
--- a/b2g/components/moz.build
+++ b/b2g/components/moz.build
@@ -46,16 +46,17 @@ EXTRA_PP_COMPONENTS += [
 
 if CONFIG['MOZ_UPDATER']:
     EXTRA_PP_COMPONENTS += [
         'UpdatePrompt.js',
     ]
 
 EXTRA_JS_MODULES += [
     'AboutServiceWorkers.jsm',
+    'ActivityChannel.jsm',
     'AlertsHelper.jsm',
     'Bootstraper.jsm',
     'ContentRequestHelper.jsm',
     'DebuggerActors.js',
     'ErrorPage.jsm',
     'Frames.jsm',
     'FxAccountsMgmtService.jsm',
     'LogCapture.jsm',
--- a/b2g/config/aries/sources.xml
+++ b/b2g/config/aries/sources.xml
@@ -7,28 +7,28 @@
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
-  <project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
+  <project name="platform_build" path="build" remote="b2g" revision="e935894ef5f27e2f04b9e929a45a958e6288a223">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="60489c1ff8c5d1633fc4837d4f8019623d4e1940"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="c1ae9f02f2a9cfb89bf67aeea97e467c41c3362c"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="a6f9a1245d98c51172c15afecb9ade1a6ca511e2"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="6d7ddcc5594d334f926aa2e0546ab5b57b9a1e3c"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="8b880805d454664b3eed11d0f053cdeafa1ff06e"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" revision="a1e239a0bb5cd1d69680bf1075883aa9a7bf2429"/>
   <project groups="linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" path="prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" revision="c7931763d41be602407ed9d71e2c0292c6597e00"/>
   <project groups="linux,x86" name="platform/prebuilts/python/linux-x86/2.7.5" path="prebuilts/python/linux-x86/2.7.5" revision="a32003194f707f66a2d8cdb913ed1869f1926c5d"/>
   <project name="device/common" path="device/common" revision="96d4d2006c4fcb2f19a3fa47ab10cb409faa017b"/>
@@ -105,34 +105,34 @@
   <project name="platform/libcore" path="libcore" revision="baf7d8068dd501cfa338d3a8b1b87216d6ce0571"/>
   <project name="platform/libnativehelper" path="libnativehelper" revision="50c4430e32849530ced32680fd6ee98963b3f7ac"/>
   <project name="platform/ndk" path="ndk" revision="e58ef003be4306bb53a8c11331146f39e4eab31f"/>
   <project name="platform_prebuilts_misc" path="prebuilts/misc" remote="b2g" revision="23404f05422c6bf3c39573325a4f4909167671b4"/>
   <project name="platform/prebuilts/ndk" path="prebuilts/ndk" revision="c792f0bd9fff7aea2887c60bbb3a9bbdb534ffa3"/>
   <project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="6a1bb59af65b6485b1090522f66fac95c3f9e22c"/>
   <project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="69d524e80cdf3981006627c65ac85f3a871238a3"/>
   <project name="platform/prebuilts/tools" path="prebuilts/tools" revision="5a48c04c4bb5f079bc757e29864a42427378e051"/>
-  <project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="58bf825bb7a0aa981237993db731236a1f19c492"/>
+  <project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="b0f9410d2f7111d2fc9b30e2f7bb14dd89af0259"/>
   <project name="platform/system/extras" path="system/extras" revision="576f57b6510de59c08568b53c0fb60588be8689e"/>
-  <project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="3c5405863d2002f665ef2b901abb3853c420129b"/>
+  <project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="34adfb400e031f3dd3353d92413572db5e3a7376"/>
   <project name="platform/system/netd" path="system/netd" revision="a6531f7befb49b1c81bc0de7e51c5482b308e1c5"/>
   <project name="platform/system/security" path="system/security" revision="ee8068b9e7bfb2770635062fc9c2035be2142bd8"/>
   <project name="platform/system/vold" path="system/vold" revision="42fa2a0f14f965970a4b629a176bbd2666edf017"/>
   <project name="platform/external/curl" path="external/curl" revision="e68addd988448959ea8157c5de637346b4180c33"/>
   <project name="platform/external/icu4c" path="external/icu4c" revision="d3ec7428eb276db43b7ed0544e09344a6014806c"/>
   <project name="platform/hardware/libhardware_legacy" path="hardware/libhardware_legacy" revision="76c4bf4bc430a1b8317f2f21ef735867733e50cc"/>
   <project name="platform/system/media" path="system/media" revision="c1332c21c608f4932a6d7e83450411cde53315ef"/>
   <default remote="caf" revision="LNX.LA.3.5.2.1.1" sync-j="4"/>
   <!-- Platform common things -->
   <project name="device-shinano-common" path="device/sony/shinano-common" remote="b2g" revision="df3d2ae4345ca5d32bce717bb7b3dac18a3afa18"/>
   <project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="1bb28abbc215f45220620af5cd60a8ac1be93722"/>
   <project name="device/qcom/common" path="device/qcom/common" revision="2501e5940ba69ece7654ff85611c76ae5bda299c"/>
   <project name="codeaurora_kernel_msm" path="kernel" remote="b2g" revision="d620691cad7aee780018e98159ff03bf99840317"/>
-  <project name="platform/external/bluetooth/bluedroid" path="external/bluetooth/bluedroid" revision="d61fc97258c8b0c362430dd2eb195dcc4d266f14"/>
   <project name="init_sh" path="external/init_sh" remote="b2g" revision="3bdd26e092db9c47c5beb04b4809a35f8f767b8a"/>
+  <project name="platform_external_bluetooth_bluedroid" path="external/bluetooth/bluedroid" remote="b2g" revision="70f536bd97d901b96b94669ae1aa2fd0fb54b258"/>
   <project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="0a01977f34d6e86fe23d6c0ec75e96ba988bbebb"/>
   <project name="platform_external_libnfc-pn547" path="external/libnfc-pn547" remote="b2g" revision="5bb999b84b8adc14f6bea004d523ba258dea8188"/>
   <project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="5b71e40213f650459e95d35b6f14af7e88d8ab62"/>
   <project name="platform_frameworks_av" path="frameworks/av" remote="b2g" revision="a920312eb6299b6cc11f7136254c4b0ba7a663be"/>
   <project name="platform/frameworks/base" path="frameworks/base" revision="da8e6bc53c8bc669da0bb627904d08aa293f2497"/>
   <project name="platform/frameworks/native" path="frameworks/native" revision="a46a9f1ac0ed5662d614c277cbb14eb3f332f365"/>
   <project name="platform/hardware/libhardware" path="hardware/libhardware" revision="7196881a0e9dd7bfbbcf0af64c8064e70f0fa094"/>
   <project name="platform/hardware/broadcom/wlan" path="hardware/broadcom/wlan" revision="15a9b66de9b7d84c7ea63df3a834f095bca9e493"/>
--- a/b2g/config/dolphin/sources.xml
+++ b/b2g/config/dolphin/sources.xml
@@ -7,28 +7,28 @@
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
-  <project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
+  <project name="platform_build" path="build" remote="b2g" revision="e935894ef5f27e2f04b9e929a45a958e6288a223">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="60489c1ff8c5d1633fc4837d4f8019623d4e1940"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="c1ae9f02f2a9cfb89bf67aeea97e467c41c3362c"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="a6f9a1245d98c51172c15afecb9ade1a6ca511e2"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="6d7ddcc5594d334f926aa2e0546ab5b57b9a1e3c"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="8b880805d454664b3eed11d0f053cdeafa1ff06e"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" revision="a1e239a0bb5cd1d69680bf1075883aa9a7bf2429"/>
   <project groups="linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" path="prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" revision="c7931763d41be602407ed9d71e2c0292c6597e00"/>
   <project groups="linux,x86" name="platform/prebuilts/python/linux-x86/2.7.5" path="prebuilts/python/linux-x86/2.7.5" revision="83760d213fb3bec7b4117d266fcfbf6fe2ba14ab"/>
   <project name="device/common" path="device/common" revision="6a2995683de147791e516aae2ccb31fdfbe2ad30"/>
@@ -110,20 +110,20 @@
   <project name="platform/libcore" path="libcore" revision="e195beab082c09217318fc19250caeaf4c1bd800"/>
   <project name="platform/libnativehelper" path="libnativehelper" revision="feeb36c2bd4adfe285f98f5de92e0f3771b2c115"/>
   <project name="platform/ndk" path="ndk" revision="e58ef003be4306bb53a8c11331146f39e4eab31f"/>
   <project name="platform_prebuilts_misc" path="prebuilts/misc" remote="b2g" revision="23404f05422c6bf3c39573325a4f4909167671b4"/>
   <project name="platform/prebuilts/ndk" path="prebuilts/ndk" revision="c792f0bd9fff7aea2887c60bbb3a9bbdb534ffa3"/>
   <project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="6a1bb59af65b6485b1090522f66fac95c3f9e22c"/>
   <project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="cfcef469537869947abb9aa1d656774cc2678d4c"/>
   <project name="platform/prebuilts/tools" path="prebuilts/tools" revision="5a48c04c4bb5f079bc757e29864a42427378e051"/>
-  <project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="58bf825bb7a0aa981237993db731236a1f19c492"/>
+  <project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="b0f9410d2f7111d2fc9b30e2f7bb14dd89af0259"/>
   <project name="platform/system/extras" path="system/extras" revision="10e78a05252b3de785f88c2d0b9ea8a428009c50"/>
   <project name="platform/system/media" path="system/media" revision="188b3e51e0a2ce1e16dc8067edef7be3d2365ad9"/>
-  <project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="3c5405863d2002f665ef2b901abb3853c420129b"/>
+  <project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="34adfb400e031f3dd3353d92413572db5e3a7376"/>
   <project name="platform/system/netd" path="system/netd" revision="3ae56364946d4a5bf5a5f83f12f9a45a30398e33"/>
   <project name="platform/system/security" path="system/security" revision="ee8068b9e7bfb2770635062fc9c2035be2142bd8"/>
   <project name="platform/system/vold" path="system/vold" revision="fe12a9e2268da653d1cd4c39ec89a42211d22f25"/>
   <!--original fetch url was http://sprdsource.spreadtrum.com:8085/b2g/android-->
   <remote fetch="https://git.mozilla.org/external/sprd-aosp" name="sprd-aosp"/>
   <default remote="sprd-aosp" revision="sprdb2g_gonk4.4" sync-j="4"/>
   <!-- Stock Android things -->
   <project name="platform/external/icu4c" path="external/icu4c" revision="2bb01561780583cc37bc667f0ea79f48a122d8a2"/>
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -14,17 +14,17 @@
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="1b0db93fb6b870b03467aff50d6419771ba0d88c">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
-  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="60489c1ff8c5d1633fc4837d4f8019623d4e1940"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="c1ae9f02f2a9cfb89bf67aeea97e467c41c3362c"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="2d58f4b9206b50b8fda0d5036da6f0c62608db7c"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="d70e4bfdcb65e7514de0f9315b74aea1c811678d"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -12,20 +12,20 @@
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="660169a3d7e034a892359e39135e8c2785a6ad6f">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="60489c1ff8c5d1633fc4837d4f8019623d4e1940"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="c1ae9f02f2a9cfb89bf67aeea97e467c41c3362c"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="a6f9a1245d98c51172c15afecb9ade1a6ca511e2"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="6d7ddcc5594d334f926aa2e0546ab5b57b9a1e3c"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="5c45f43419d5582949284eee9cef0c43d866e03b"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="3748b4168e7bd8d46457d4b6786003bc6a5223ce"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="9025e50b9d29b3cabbbb21e1dd94d0d13121a17e"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="b89fda71fcd0fa0cf969310e75be3ea33e048b44"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="2e7d5348f35575870b3c7e567a9a9f6d66f8d6c5"/>
@@ -113,20 +113,20 @@
   <project name="platform/libnativehelper" path="libnativehelper" revision="4792069e90385889b0638e97ae62c67cdf274e22"/>
   <project name="platform/ndk" path="ndk" revision="7666b97bbaf1d645cdd6b4430a367b7a2bb53369"/>
   <project name="platform/prebuilts/misc" path="prebuilts/misc" revision="f6ab40b3257abc07741188fd173ac392575cc8d2"/>
   <project name="platform/prebuilts/ndk" path="prebuilts/ndk" revision="e52099755d0bd3a579130eefe8e58066cc6c0cb6"/>
   <project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="02c32feb2fe97037be0ac4dace3a6a5025ac895d"/>
   <project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="842e33e43a55ea44833b9e23e4d180fa17c843af"/>
   <project name="platform/prebuilts/tools" path="prebuilts/tools" revision="5db24726f0f42124304195a6bdea129039eeeaeb"/>
   <project name="platform/system/bluetooth" path="system/bluetooth" revision="930ae098543881f47eac054677726ee4b998b2f8"/>
-  <project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="58bf825bb7a0aa981237993db731236a1f19c492"/>
+  <project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="b0f9410d2f7111d2fc9b30e2f7bb14dd89af0259"/>
   <project name="platform_system_core" path="system/core" remote="b2g" revision="542d1f59dc331b472307e5bd043101d14d5a3a3e"/>
   <project name="platform/system/extras" path="system/extras" revision="18c1180e848e7ab8691940481f5c1c8d22c37b3e"/>
-  <project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="3c5405863d2002f665ef2b901abb3853c420129b"/>
+  <project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="34adfb400e031f3dd3353d92413572db5e3a7376"/>
   <project name="platform/system/media" path="system/media" revision="d90b836f66bf1d9627886c96f3a2d9c3007fbb80"/>
   <project name="platform/system/netd" path="system/netd" revision="56112dd7b811301b718d0643a82fd5cac9522073"/>
   <project name="platform/system/security" path="system/security" revision="f48ff68fedbcdc12b570b7699745abb6e7574907"/>
   <project name="platform/system/vold" path="system/vold" revision="8de05d4a52b5a91e7336e6baa4592f945a6ddbea"/>
   <default remote="caf" revision="refs/tags/android-4.3_r2.1" sync-j="4"/>
   <!-- Emulator specific things -->
   <project name="android-development" path="development" remote="b2g" revision="dab55669da8f48b6e57df95d5af9f16b4a87b0b1"/>
   <project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/>
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -7,28 +7,28 @@
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
-  <project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
+  <project name="platform_build" path="build" remote="b2g" revision="e935894ef5f27e2f04b9e929a45a958e6288a223">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="60489c1ff8c5d1633fc4837d4f8019623d4e1940"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="c1ae9f02f2a9cfb89bf67aeea97e467c41c3362c"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="a6f9a1245d98c51172c15afecb9ade1a6ca511e2"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="6d7ddcc5594d334f926aa2e0546ab5b57b9a1e3c"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="6e47ff2790f5656b5b074407829ceecf3e6188c4"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="1950e4760fa14688b83cdbb5acaa1af9f82ef434"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" revision="ac6eb97a37035c09fb5ede0852f0881e9aadf9ad"/>
   <project groups="linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" path="prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" revision="737f591c5f95477148d26602c7be56cbea0cdeb9"/>
   <project groups="linux,x86" name="platform/prebuilts/python/linux-x86/2.7.5" path="prebuilts/python/linux-x86/2.7.5" revision="51da9b1981be481b92a59a826d4d78dc73d0989a"/>
   <project name="device/common" path="device/common" revision="798a3664597e6041985feab9aef42e98d458bc3d"/>
@@ -110,31 +110,31 @@
   <project name="platform/libcore" path="libcore" revision="9877ade9617bb0db6e59aa2a54719a9bc92600f3"/>
   <project name="platform/libnativehelper" path="libnativehelper" revision="46c96ace65eb1ccab05bf15b9bf8e53e443039af"/>
   <project name="platform/ndk" path="ndk" revision="cb5519af32ae7b4a9c334913a612462ecd04c5d0"/>
   <project name="platform_prebuilts_misc" path="prebuilts/misc" remote="b2g" revision="23404f05422c6bf3c39573325a4f4909167671b4"/>
   <project name="platform/prebuilts/ndk" path="prebuilts/ndk" revision="6aa61f8557a22039a30b42b7f283996381fd625d"/>
   <project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="6a1bb59af65b6485b1090522f66fac95c3f9e22c"/>
   <project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="b562b01c93de9578d5db537b6a602a38e1aaa0ce"/>
   <project name="platform/prebuilts/tools" path="prebuilts/tools" revision="387f03e815f57d536dd922706db1622bddba8d81"/>
-  <project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="58bf825bb7a0aa981237993db731236a1f19c492"/>
+  <project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="b0f9410d2f7111d2fc9b30e2f7bb14dd89af0259"/>
   <project name="platform/system/extras" path="system/extras" revision="5356165f67f4a81c2ef28671c13697f1657590df"/>
   <project name="platform/system/media" path="system/media" revision="be0e2fe59a8043fa5200f75697df9220a99abe9d"/>
-  <project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="3c5405863d2002f665ef2b901abb3853c420129b"/>
+  <project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="34adfb400e031f3dd3353d92413572db5e3a7376"/>
   <project name="platform/system/netd" path="system/netd" revision="36704b0da24debcab8090156568ac236315036bb"/>
   <project name="platform/system/security" path="system/security" revision="583374f69f531ba68fc3dcbff1f74893d2a96406"/>
   <project name="platform/system/vold" path="system/vold" revision="d4455b8cf361f8353e8aebac15ffd64b4aedd2b9"/>
   <project name="platform/external/icu4c" path="external/icu4c" remote="aosp" revision="b4c6379528887dc25ca9991a535a8d92a61ad6b6"/>
   <project name="platform_frameworks_av" path="frameworks/av" remote="b2g" revision="f313503b5c91aaa6fcf962d4ec9bf260e0c00bf1"/>
   <project name="platform_system_core" path="system/core" remote="b2g" revision="8586f55fe4b015911b48e731b69c592ad82a0807"/>
   <default remote="caf" revision="refs/tags/android-4.4.2_r1" sync-j="4"/>
   <!-- Emulator specific things -->
   <project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="72ffdf71c68a96309212eb13d63560d66db14c9e"/>
-  <project name="device_generic_goldfish" path="device/generic/goldfish" remote="b2g" revision="85f6a2e1e638dbc8b119896e61383e973e764ffd"/>
-  <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="4bebbe8d92368befc31e8b4a99da2d29cc26bfbc"/>
+  <project name="device_generic_goldfish" path="device/generic/goldfish" remote="b2g" revision="8d4018ebd33ac3f1a043b2d54bc578028656a659"/>
+  <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="96f78964a9a317a6c8b494ab71e10e0276d02490"/>
   <project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="f37bd545063039e30a92f2550ae78c0e6e4e2d08"/>
   <project name="platform_external_wpa_supplicant_8" path="external/wpa_supplicant_8" remote="b2g" revision="0c6a6547cd1fd302fa2b0f6e375654df36bf0ec4"/>
-  <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd4fc430da93fad3123f0775791a919568aa0ca2"/>
+  <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="3453472769d6e9b43c84f98b56f8c63afe2b129e"/>
   <project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="5f4b68c799927b6e078f987b12722c3a6ccd4a45"/>
   <project name="platform/development" path="development" revision="5968ff4e13e0d696ad8d972281fc27ae5a12829b"/>
   <project name="android-sdk" path="sdk" remote="b2g" revision="0951179277915335251c5e11d242e4e1a8c2236f"/>
   <project name="darwinstreamingserver" path="system/darwinstreamingserver" remote="b2g" revision="cf85968c7f85e0ec36e72c87ceb4837a943b8af6"/>
 </manifest>
--- a/b2g/config/emulator-l/sources.xml
+++ b/b2g/config/emulator-l/sources.xml
@@ -10,25 +10,25 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="05a36844c1046a1eb07d5b1325f85ed741f961ea">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="60489c1ff8c5d1633fc4837d4f8019623d4e1940"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="c1ae9f02f2a9cfb89bf67aeea97e467c41c3362c"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="a6f9a1245d98c51172c15afecb9ade1a6ca511e2"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="6d7ddcc5594d334f926aa2e0546ab5b57b9a1e3c"/>
   <!-- Stock Android things -->
   <project groups="pdk,linux" name="platform/prebuilts/clang/linux-x86/host/3.5" path="prebuilts/clang/linux-x86/host/3.5" revision="ffc05a232799fe8fcb3e47b7440b52b1fb4244c0"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" path="prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" revision="337e0ef5e40f02a1ae59b90db0548976c70a7226"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" revision="8af5ff6f5dced9eb5a8127459df6c75d24342204"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8" revision="30915518fa7ea07166efedc191a4f40aef516fe7"/>
   <project groups="pdk,linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6" revision="96eee58e3389fb05a835310d6a06a6ba4486097a"/>
   <project groups="pdk,linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8" revision="7c8a46698171aa2e0be09edb43d15a6acf832770"/>
   <project groups="pdk,linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.8" path="prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.8" revision="24b2038be8a636fd4a5d21f0abae1e466b07bcf7"/>
@@ -121,19 +121,19 @@
   <project name="platform/libcore" path="libcore" revision="bdec7d684c083760bef7bc4ba2429cceccaaf7d0"/>
   <project name="platform/libnativehelper" path="libnativehelper" revision="27bcc086236cedd31c056303e255c6d0ea3d4a50"/>
   <project name="platform/ndk" path="ndk" revision="42e85f81cc6c74af145056ee80b06e520cccb9a7"/>
   <project name="platform_prebuilts_misc" path="prebuilts/misc" remote="b2g" revision="f105a2d852c988fb1aa16a1e758ca7f93dd54fe9"/>
   <project name="platform/prebuilts/ndk" path="prebuilts/ndk" revision="1d080491f26dfdfd76d5bbc3e6b40c660e8565af"/>
   <project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="2c0d193349c55337e37196a7f2d5cef37753ed3e"/>
   <project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="61a10cbd19d6b7fc052a8cb92dfa1b37b93754f3"/>
   <project name="platform/prebuilts/tools" path="prebuilts/tools" revision="9e892a67a01671f312c76b0880dedaa6ba478148"/>
-  <project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="58bf825bb7a0aa981237993db731236a1f19c492"/>
+  <project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="b0f9410d2f7111d2fc9b30e2f7bb14dd89af0259"/>
   <project name="platform/system/extras" path="system/extras" revision="47fa016e2248b80aebd5928402c7409f8e0ca64e"/>
-  <project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="3c5405863d2002f665ef2b901abb3853c420129b"/>
+  <project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="34adfb400e031f3dd3353d92413572db5e3a7376"/>
   <project name="platform/system/media" path="system/media" revision="70bfebc66d9c6a4c614a8c7efde90e8e7e1d8641"/>
   <project name="platform/system/netd" path="system/netd" revision="d113f0ceefa9ce29eb3c86e2d23c7417a70b4048"/>
   <project name="platform/system/security" path="system/security" revision="94e1617f6f2bc2286d005e79cffa6bf0721b06b3"/>
   <project name="platform/system/vold" path="system/vold" revision="c065e301e38ea0c241164e2a373e1ecefbeaf2ec"/>
   <project name="platform_frameworks_av" path="frameworks/av" remote="b2g" revision="e372b6a77f71c8f9fbbf6f8adbfa7bf8ef45dc60"/>
   <project name="platform_frameworks_base" path="frameworks/base" remote="b2g" revision="04e26ebdc36ca83f4ee3e9e2082b3fcf04c5b971"/>
   <project name="platform_frameworks_wilhelm" path="frameworks/wilhelm" remote="b2g" revision="0dbf5baafadf6d233c0a29e392fa3293f0121673"/>
   <project name="platform_system_core" path="system/core" remote="b2g" revision="f594bc64eacac490857748b1139ffcb34c856bbd"/>
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -14,17 +14,17 @@
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="1b0db93fb6b870b03467aff50d6419771ba0d88c">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
-  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="60489c1ff8c5d1633fc4837d4f8019623d4e1940"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="c1ae9f02f2a9cfb89bf67aeea97e467c41c3362c"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="2d58f4b9206b50b8fda0d5036da6f0c62608db7c"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="d70e4bfdcb65e7514de0f9315b74aea1c811678d"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
--- a/b2g/config/flame-kk/sources.xml
+++ b/b2g/config/flame-kk/sources.xml
@@ -7,28 +7,28 @@
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
-  <project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
+  <project name="platform_build" path="build" remote="b2g" revision="e935894ef5f27e2f04b9e929a45a958e6288a223">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="60489c1ff8c5d1633fc4837d4f8019623d4e1940"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="c1ae9f02f2a9cfb89bf67aeea97e467c41c3362c"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="a6f9a1245d98c51172c15afecb9ade1a6ca511e2"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="6d7ddcc5594d334f926aa2e0546ab5b57b9a1e3c"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="8b880805d454664b3eed11d0f053cdeafa1ff06e"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" revision="a1e239a0bb5cd1d69680bf1075883aa9a7bf2429"/>
   <project groups="linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" path="prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" revision="c7931763d41be602407ed9d71e2c0292c6597e00"/>
   <project groups="linux,x86" name="platform/prebuilts/python/linux-x86/2.7.5" path="prebuilts/python/linux-x86/2.7.5" revision="a32003194f707f66a2d8cdb913ed1869f1926c5d"/>
   <project name="device/common" path="device/common" revision="96d4d2006c4fcb2f19a3fa47ab10cb409faa017b"/>
@@ -104,19 +104,19 @@
   <project name="platform/libcore" path="libcore" revision="baf7d8068dd501cfa338d3a8b1b87216d6ce0571"/>
   <project name="platform/libnativehelper" path="libnativehelper" revision="50c4430e32849530ced32680fd6ee98963b3f7ac"/>
   <project name="platform/ndk" path="ndk" revision="e58ef003be4306bb53a8c11331146f39e4eab31f"/>
   <project name="platform_prebuilts_misc" path="prebuilts/misc" remote="b2g" revision="23404f05422c6bf3c39573325a4f4909167671b4"/>
   <project name="platform/prebuilts/ndk" path="prebuilts/ndk" revision="c792f0bd9fff7aea2887c60bbb3a9bbdb534ffa3"/>
   <project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="6a1bb59af65b6485b1090522f66fac95c3f9e22c"/>
   <project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="69d524e80cdf3981006627c65ac85f3a871238a3"/>
   <project name="platform/prebuilts/tools" path="prebuilts/tools" revision="5a48c04c4bb5f079bc757e29864a42427378e051"/>
-  <project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="58bf825bb7a0aa981237993db731236a1f19c492"/>
+  <project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="b0f9410d2f7111d2fc9b30e2f7bb14dd89af0259"/>
   <project name="platform/system/extras" path="system/extras" revision="576f57b6510de59c08568b53c0fb60588be8689e"/>
-  <project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="3c5405863d2002f665ef2b901abb3853c420129b"/>
+  <project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="34adfb400e031f3dd3353d92413572db5e3a7376"/>
   <project name="platform/system/netd" path="system/netd" revision="a6531f7befb49b1c81bc0de7e51c5482b308e1c5"/>
   <project name="platform/system/security" path="system/security" revision="ee8068b9e7bfb2770635062fc9c2035be2142bd8"/>
   <project name="platform/system/vold" path="system/vold" revision="42fa2a0f14f965970a4b629a176bbd2666edf017"/>
   <project name="platform/external/curl" path="external/curl" revision="e68addd988448959ea8157c5de637346b4180c33"/>
   <project name="platform/external/icu4c" path="external/icu4c" revision="d3ec7428eb276db43b7ed0544e09344a6014806c"/>
   <project name="platform/hardware/libhardware_legacy" path="hardware/libhardware_legacy" revision="76c4bf4bc430a1b8317f2f21ef735867733e50cc"/>
   <project name="platform/system/media" path="system/media" revision="c1332c21c608f4932a6d7e83450411cde53315ef"/>
   <!--original fetch url was git://github.com/t2m-foxfone/-->
@@ -124,20 +124,20 @@
   <default remote="caf" revision="LNX.LA.3.5.2.1.1" sync-j="4"/>
   <!-- Flame specific things -->
   <project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="1bb28abbc215f45220620af5cd60a8ac1be93722"/>
   <project name="device/qcom/common" path="device/qcom/common" revision="2501e5940ba69ece7654ff85611c76ae5bda299c"/>
   <project name="device-flame" path="device/t2m/flame" remote="b2g" revision="c4779d6da0f85894b1f78f0351b43f2949e8decd"/>
   <project name="codeaurora_kernel_msm" path="kernel" remote="b2g" revision="47aac20dbffea5874cbbbdc6556558855c38dce4"/>
   <project name="kernel_lk" path="bootable/bootloader/lk" remote="b2g" revision="fda40423ffa573dc6cafd3780515010cb2a086be"/>
   <project name="platform_bootable_recovery" path="bootable/recovery" remote="b2g" revision="d5e53ed6f22fa06052351dc03510af9473af01ea"/>
-  <project name="platform/external/bluetooth/bluedroid" path="external/bluetooth/bluedroid" revision="d61fc97258c8b0c362430dd2eb195dcc4d266f14"/>
-  <project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="5b71e40213f650459e95d35b6f14af7e88d8ab62"/>
+  <project name="platform_external_bluetooth_bluedroid" path="external/bluetooth/bluedroid" remote="b2g" revision="70f536bd97d901b96b94669ae1aa2fd0fb54b258"/>
   <project name="platform_external_libnfc-nci" path="external/libnfc-nci" remote="t2m" revision="4186bdecb4dae911b39a8202252cc2310d91b0be"/>
   <project name="platform_external_libnfc-pn547" path="external/libnfc-pn547" remote="b2g" revision="5bb999b84b8adc14f6bea004d523ba258dea8188"/>
+  <project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="5b71e40213f650459e95d35b6f14af7e88d8ab62"/>
   <project name="platform/frameworks/av" path="frameworks/av" revision="65f5144987afff35a932262c0c5fad6ecce0c04a"/>
   <project name="platform/frameworks/base" path="frameworks/base" revision="da8e6bc53c8bc669da0bb627904d08aa293f2497"/>
   <project name="platform/frameworks/native" path="frameworks/native" revision="a46a9f1ac0ed5662d614c277cbb14eb3f332f365"/>
   <project name="platform/hardware/libhardware" path="hardware/libhardware" revision="7196881a0e9dd7bfbbcf0af64c8064e70f0fa094"/>
   <project name="platform/hardware/qcom/audio" path="hardware/qcom/audio" revision="8d7676dfb68ee0cd069affedd5d1e97316a184ba"/>
   <project name="platform/hardware/qcom/camera" path="hardware/qcom/camera" revision="2a1ded216a91bf62a72b1640cf01ab4998f37028"/>
   <project name="hardware_qcom_display" path="hardware/qcom/display" remote="b2g" revision="0eb5fd21d8697136ee4a0166f5e06bff25cc1e8a"/>
   <project name="platform/hardware/qcom/gps" path="hardware/qcom/gps" revision="9883ea57b0668d8f60dba025d4522dfa69a1fbfa"/>
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,9 +1,9 @@
 {
     "git": {
-        "git_revision": "60489c1ff8c5d1633fc4837d4f8019623d4e1940", 
+        "git_revision": "c1ae9f02f2a9cfb89bf67aeea97e467c41c3362c", 
         "remote": "https://git.mozilla.org/releases/gaia.git", 
         "branch": ""
     }, 
-    "revision": "43de6ab8b9790809ac7b4d80bf060a2976a88417", 
+    "revision": "1bd25a1c1736a412cf7a982c0d2010d0cad28fec", 
     "repo_path": "integration/gaia-central"
 }
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -12,20 +12,20 @@
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="660169a3d7e034a892359e39135e8c2785a6ad6f">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="60489c1ff8c5d1633fc4837d4f8019623d4e1940"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="c1ae9f02f2a9cfb89bf67aeea97e467c41c3362c"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="a6f9a1245d98c51172c15afecb9ade1a6ca511e2"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="6d7ddcc5594d334f926aa2e0546ab5b57b9a1e3c"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="5c45f43419d5582949284eee9cef0c43d866e03b"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="3748b4168e7bd8d46457d4b6786003bc6a5223ce"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="9025e50b9d29b3cabbbb21e1dd94d0d13121a17e"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="b89fda71fcd0fa0cf969310e75be3ea33e048b44"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="2e7d5348f35575870b3c7e567a9a9f6d66f8d6c5"/>
@@ -113,20 +113,20 @@
   <project name="platform/libnativehelper" path="libnativehelper" revision="4792069e90385889b0638e97ae62c67cdf274e22"/>
   <project name="platform/ndk" path="ndk" revision="7666b97bbaf1d645cdd6b4430a367b7a2bb53369"/>
   <project name="platform/prebuilts/misc" path="prebuilts/misc" revision="f6ab40b3257abc07741188fd173ac392575cc8d2"/>
   <project name="platform/prebuilts/ndk" path="prebuilts/ndk" revision="e52099755d0bd3a579130eefe8e58066cc6c0cb6"/>
   <project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="02c32feb2fe97037be0ac4dace3a6a5025ac895d"/>
   <project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="842e33e43a55ea44833b9e23e4d180fa17c843af"/>
   <project name="platform/prebuilts/tools" path="prebuilts/tools" revision="5db24726f0f42124304195a6bdea129039eeeaeb"/>
   <project name="platform/system/bluetooth" path="system/bluetooth" revision="930ae098543881f47eac054677726ee4b998b2f8"/>
-  <project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="58bf825bb7a0aa981237993db731236a1f19c492"/>
+  <project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="b0f9410d2f7111d2fc9b30e2f7bb14dd89af0259"/>
   <project name="platform_system_core" path="system/core" remote="b2g" revision="542d1f59dc331b472307e5bd043101d14d5a3a3e"/>
   <project name="platform/system/extras" path="system/extras" revision="18c1180e848e7ab8691940481f5c1c8d22c37b3e"/>
-  <project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="3c5405863d2002f665ef2b901abb3853c420129b"/>
+  <project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="34adfb400e031f3dd3353d92413572db5e3a7376"/>
   <project name="platform/system/media" path="system/media" revision="d90b836f66bf1d9627886c96f3a2d9c3007fbb80"/>
   <project name="platform/system/netd" path="system/netd" revision="56112dd7b811301b718d0643a82fd5cac9522073"/>
   <project name="platform/system/security" path="system/security" revision="f48ff68fedbcdc12b570b7699745abb6e7574907"/>
   <project name="platform/system/vold" path="system/vold" revision="8de05d4a52b5a91e7336e6baa4592f945a6ddbea"/>
   <default remote="caf" revision="refs/tags/android-4.3_r2.1" sync-j="4"/>
   <!-- Nexus 4 specific things -->
   <project name="device-mako" path="device/lge/mako" remote="b2g" revision="78d17f0c117f0c66dd55ee8d5c5dde8ccc93ecba"/>
   <project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/>
--- a/b2g/config/nexus-5-l/sources.xml
+++ b/b2g/config/nexus-5-l/sources.xml
@@ -10,25 +10,25 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="05a36844c1046a1eb07d5b1325f85ed741f961ea">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="60489c1ff8c5d1633fc4837d4f8019623d4e1940"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="c1ae9f02f2a9cfb89bf67aeea97e467c41c3362c"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="a6f9a1245d98c51172c15afecb9ade1a6ca511e2"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="6d7ddcc5594d334f926aa2e0546ab5b57b9a1e3c"/>
   <!-- Stock Android things -->
   <project groups="pdk,linux" name="platform/prebuilts/clang/linux-x86/host/3.5" path="prebuilts/clang/linux-x86/host/3.5" revision="ffc05a232799fe8fcb3e47b7440b52b1fb4244c0"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" path="prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" revision="337e0ef5e40f02a1ae59b90db0548976c70a7226"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" revision="8af5ff6f5dced9eb5a8127459df6c75d24342204"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8" revision="30915518fa7ea07166efedc191a4f40aef516fe7"/>
   <project groups="pdk,linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6" revision="96eee58e3389fb05a835310d6a06a6ba4486097a"/>
   <project groups="pdk,linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8" revision="7c8a46698171aa2e0be09edb43d15a6acf832770"/>
   <project groups="pdk,linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.8" path="prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.8" revision="24b2038be8a636fd4a5d21f0abae1e466b07bcf7"/>
@@ -121,19 +121,19 @@
   <project name="platform/libcore" path="libcore" revision="bdec7d684c083760bef7bc4ba2429cceccaaf7d0"/>
   <project name="platform/libnativehelper" path="libnativehelper" revision="27bcc086236cedd31c056303e255c6d0ea3d4a50"/>
   <project name="platform/ndk" path="ndk" revision="42e85f81cc6c74af145056ee80b06e520cccb9a7"/>
   <project name="platform_prebuilts_misc" path="prebuilts/misc" remote="b2g" revision="f105a2d852c988fb1aa16a1e758ca7f93dd54fe9"/>
   <project name="platform/prebuilts/ndk" path="prebuilts/ndk" revision="1d080491f26dfdfd76d5bbc3e6b40c660e8565af"/>
   <project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="2c0d193349c55337e37196a7f2d5cef37753ed3e"/>
   <project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="61a10cbd19d6b7fc052a8cb92dfa1b37b93754f3"/>
   <project name="platform/prebuilts/tools" path="prebuilts/tools" revision="9e892a67a01671f312c76b0880dedaa6ba478148"/>
-  <project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="58bf825bb7a0aa981237993db731236a1f19c492"/>
+  <project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="b0f9410d2f7111d2fc9b30e2f7bb14dd89af0259"/>
   <project name="platform/system/extras" path="system/extras" revision="47fa016e2248b80aebd5928402c7409f8e0ca64e"/>
-  <project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="3c5405863d2002f665ef2b901abb3853c420129b"/>
+  <project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="34adfb400e031f3dd3353d92413572db5e3a7376"/>
   <project name="platform/system/media" path="system/media" revision="70bfebc66d9c6a4c614a8c7efde90e8e7e1d8641"/>
   <project name="platform/system/netd" path="system/netd" revision="d113f0ceefa9ce29eb3c86e2d23c7417a70b4048"/>
   <project name="platform/system/security" path="system/security" revision="94e1617f6f2bc2286d005e79cffa6bf0721b06b3"/>
   <project name="platform/system/vold" path="system/vold" revision="c065e301e38ea0c241164e2a373e1ecefbeaf2ec"/>
   <project name="platform_frameworks_av" path="frameworks/av" remote="b2g" revision="e372b6a77f71c8f9fbbf6f8adbfa7bf8ef45dc60"/>
   <project name="platform_frameworks_base" path="frameworks/base" remote="b2g" revision="04e26ebdc36ca83f4ee3e9e2082b3fcf04c5b971"/>
   <project name="platform_frameworks_wilhelm" path="frameworks/wilhelm" remote="b2g" revision="0dbf5baafadf6d233c0a29e392fa3293f0121673"/>
   <project name="platform_system_core" path="system/core" remote="b2g" revision="f594bc64eacac490857748b1139ffcb34c856bbd"/>
--- a/b2g/dev/app/mulet.js
+++ b/b2g/dev/app/mulet.js
@@ -13,13 +13,8 @@ pref("browser.sessionstore.resume_from_c
 pref("devtools.toolbox.host", "side");
 pref("devtools.toolbox.sidebar.width", 800);
 
 // Disable e10s as we don't want to run shell.html,
 // nor the system app OOP, but only inner apps
 pref("browser.tabs.remote.autostart", false);
 pref("browser.tabs.remote.autostart.1", false);
 pref("browser.tabs.remote.autostart.2", false);
-
-// W3C draft pointer events
-pref("dom.w3c_pointer_events.enabled", false);
-// W3C touch-action css property (related to touch and pointer events)
-pref("layout.css.touch_action.enabled", false);
--- a/browser/app/moz.build
+++ b/browser/app/moz.build
@@ -79,9 +79,12 @@ DISABLE_STL_WRAPPING = True
 if CONFIG['MOZ_LINKER']:
     OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
 
 if CONFIG['HAVE_CLOCK_MONOTONIC']:
     OS_LIBS += CONFIG['REALTIME_LIBS']
 
 JAR_MANIFESTS += ['jar.mn']
 
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wshadow']
+
 FAIL_ON_WARNINGS = True
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -137,17 +137,17 @@ pref("app.update.badge", false);
 #endif
 // app.update.badgeWaitTime is in branding section
 
 // If set to true, the Update Service will apply updates in the background
 // when it finishes downloading them.
 pref("app.update.staging.enabled", true);
 
 // Update service URL:
-pref("app.update.url", "https://aus4.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
+pref("app.update.url", "https://aus5.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
 // app.update.url.manual is in branding section
 // app.update.url.details is in branding section
 
 // User-settable override to app.update.url for testing purposes.
 //pref("app.update.url.override", "");
 
 // app.update.interval is in branding section
 // app.update.promptWaitTime is in branding section
@@ -484,27 +484,20 @@ pref("general.warnOnAboutConfig",       
 pref("dom.disable_window_open_feature.location",  true);
 // prevent JS from setting status messages
 pref("dom.disable_window_status_change",          true);
 // allow JS to move and resize existing windows
 pref("dom.disable_window_move_resize",            false);
 // prevent JS from monkeying with window focus, etc
 pref("dom.disable_window_flip",                   true);
 
-// Disable touch events on Desktop Firefox by default
-// until they are properly supported (bug 736048)
+// Disable touch events on Desktop Firefox by default until they are properly
+// supported (bug 736048)
 pref("dom.w3c_touch_events.enabled",        0);
 
-#ifdef NIGHTLY_BUILD
-// W3C draft pointer events
-pref("dom.w3c_pointer_events.enabled", true);
-// W3C touch-action css property (related to touch and pointer events)
-pref("layout.css.touch_action.enabled", true);
-#endif
-
 // popups.policy 1=allow,2=reject
 pref("privacy.popups.policy",               1);
 pref("privacy.popups.usecustom",            true);
 pref("privacy.popups.showBrowserMessage",   true);
 
 pref("privacy.item.cookies",                false);
 
 pref("privacy.clearOnShutdown.history",     true);
@@ -1155,24 +1148,16 @@ pref("browser.bookmarks.editDialog.first
 pref("dom.ipc.plugins.flash.disable-protected-mode", false);
 
 // Feature-disable the protected-mode auto-flip
 pref("browser.flash-protected-mode-flip.enable", false);
 
 // Whether we've already flipped protected mode automatically
 pref("browser.flash-protected-mode-flip.done", false);
 
-#ifdef XP_MACOSX
-// On mac, the default pref is per-architecture
-pref("dom.ipc.plugins.enabled.i386", true);
-pref("dom.ipc.plugins.enabled.x86_64", true);
-#else
-pref("dom.ipc.plugins.enabled", true);
-#endif
-
 pref("dom.ipc.shims.enabledWarnings", false);
 
 // Start the browser in e10s mode
 pref("browser.tabs.remote.autostart", false);
 pref("browser.tabs.remote.desktopbehavior", true);
 
 #if defined(XP_WIN) && defined(MOZ_SANDBOX)
 // When this pref is true the Windows process sandbox will set up dummy
@@ -1187,17 +1172,22 @@ pref("security.sandbox.windows.log", fal
 // On windows these levels are:
 // 0 - no sandbox
 // 1 - sandbox with USER_NON_ADMIN access token level
 // 2 - a more strict sandbox, which might cause functionality issues. This now
 //     includes running at low integrity.
 // 3 - the strongest settings we seem to be able to use without breaking
 //     everything, but will probably cause some functionality restrictions
 pref("dom.ipc.plugins.sandbox-level.default", 0);
+#if defined(_AMD64_)
+// The lines in PluginModuleParent.cpp should be changed in line with this.
+pref("dom.ipc.plugins.sandbox-level.flash", 2);
+#else
 pref("dom.ipc.plugins.sandbox-level.flash", 0);
+#endif
 
 #if defined(MOZ_CONTENT_SANDBOX)
 // This controls the strength of the Windows content process sandbox for testing
 // purposes. This will require a restart.
 // On windows these levels are:
 // 0 - sandbox with USER_NON_ADMIN access token level
 // 1 - level 0 plus low integrity
 // 2 - a policy that we can reasonably call an effective sandbox
@@ -1438,29 +1428,33 @@ pref("devtools.debugger.ui.variables-sea
 // Enable the Performance tools
 pref("devtools.performance.enabled", true);
 
 // The default Performance UI settings
 pref("devtools.performance.memory.sample-probability", "0.05");
 // Can't go higher than this without causing internal allocation overflows while
 // serializing the allocations data over the RDP.
 pref("devtools.performance.memory.max-log-length", 125000);
-pref("devtools.performance.timeline.hidden-markers", "[]");
+pref("devtools.performance.timeline.hidden-markers", "[\"Composite\"]");
 pref("devtools.performance.profiler.buffer-size", 10000000);
 pref("devtools.performance.profiler.sample-frequency-khz", 1);
 pref("devtools.performance.ui.invert-call-tree", true);
 pref("devtools.performance.ui.invert-flame-graph", false);
 pref("devtools.performance.ui.flatten-tree-recursion", true);
 pref("devtools.performance.ui.show-platform-data", false);
 pref("devtools.performance.ui.show-idle-blocks", true);
 pref("devtools.performance.ui.enable-memory", false);
 pref("devtools.performance.ui.enable-allocations", false);
 pref("devtools.performance.ui.enable-framerate", true);
 pref("devtools.performance.ui.enable-jit-optimizations", false);
 
+// Temporary pref disabling memory flame views
+// TODO remove once we have flame charts via bug 1148663
+pref("devtools.performance.ui.enable-memory-flame", false);
+
 // Enable experimental options in the UI only in Nightly
 #if defined(NIGHTLY_BUILD)
 pref("devtools.performance.ui.experimental", true);
 #else
 pref("devtools.performance.ui.experimental", false);
 #endif
 
 // The default cache UI setting
@@ -1557,16 +1551,20 @@ pref("devtools.webconsole.filter.error",
 pref("devtools.webconsole.filter.warn", true);
 pref("devtools.webconsole.filter.info", true);
 pref("devtools.webconsole.filter.log", true);
 pref("devtools.webconsole.filter.secerror", true);
 pref("devtools.webconsole.filter.secwarn", true);
 pref("devtools.webconsole.filter.serviceworkers", false);
 pref("devtools.webconsole.filter.sharedworkers", false);
 pref("devtools.webconsole.filter.windowlessworkers", false);
+pref("devtools.webconsole.filter.servererror", false);
+pref("devtools.webconsole.filter.serverwarn", false);
+pref("devtools.webconsole.filter.serverinfo", false);
+pref("devtools.webconsole.filter.serverlog", false);
 
 // Remember the Browser Console filters
 pref("devtools.browserconsole.filter.network", true);
 pref("devtools.browserconsole.filter.networkinfo", false);
 pref("devtools.browserconsole.filter.netwarn", true);
 pref("devtools.browserconsole.filter.netxhr", false);
 pref("devtools.browserconsole.filter.csserror", true);
 pref("devtools.browserconsole.filter.cssparser", false);
@@ -1578,16 +1576,20 @@ pref("devtools.browserconsole.filter.err
 pref("devtools.browserconsole.filter.warn", true);
 pref("devtools.browserconsole.filter.info", true);
 pref("devtools.browserconsole.filter.log", true);
 pref("devtools.browserconsole.filter.secerror", true);
 pref("devtools.browserconsole.filter.secwarn", true);
 pref("devtools.browserconsole.filter.serviceworkers", true);
 pref("devtools.browserconsole.filter.sharedworkers", true);
 pref("devtools.browserconsole.filter.windowlessworkers", true);
+pref("devtools.browserconsole.filter.servererror", false);
+pref("devtools.browserconsole.filter.serverwarn", false);
+pref("devtools.browserconsole.filter.serverinfo", false);
+pref("devtools.browserconsole.filter.serverlog", false);
 
 // Text size in the Web Console. Use 0 for the system default size.
 pref("devtools.webconsole.fontSize", 0);
 
 // Max number of inputs to store in web console history.
 pref("devtools.webconsole.inputHistoryCount", 50);
 
 // Persistent logging: |true| if you want the Web Console to keep all of the
@@ -1684,23 +1686,17 @@ pref("pdfjs.disabled", false);
 pref("pdfjs.firstRun", true);
 // The values of preferredAction and alwaysAskBeforeHandling before pdf.js
 // became the default.
 pref("pdfjs.previousHandler.preferredAction", 0);
 pref("pdfjs.previousHandler.alwaysAskBeforeHandling", false);
 
 // Shumway is only bundled in Nightly.
 #ifdef NIGHTLY_BUILD
-// By default, Shumway (SWF player) is only enabled for whitelisted SWFs on Windows + OS X.
-#ifdef UNIX_BUT_NOT_MAC
 pref("shumway.disabled", true);
-#else
-pref("shumway.disabled", false);
-pref("shumway.swf.whitelist", "http://www.areweflashyet.com/*.swf");
-#endif
 #endif
 
 // The maximum amount of decoded image data we'll willingly keep around (we
 // might keep around more than this, but we'll try to get down to this value).
 // (This is intentionally on the high side; see bug 746055.)
 pref("image.mem.max_decoded_image_kb", 256000);
 
 pref("loop.enabled", true);
@@ -1878,20 +1874,19 @@ pref("experiments.supported", true);
 // Enable GMP support in the addon manager.
 pref("media.gmp-provider.enabled", true);
 
 pref("browser.apps.URL", "https://marketplace.firefox.com/discovery/");
 
 #ifdef NIGHTLY_BUILD
 pref("browser.polaris.enabled", false);
 pref("privacy.trackingprotection.ui.enabled", false);
-pref("privacy.trackingprotection.introURL", "https://support.mozilla.org/kb/tracking-protection-firefox");
 #endif
 pref("privacy.trackingprotection.introCount", 0);
-pref("privacy.trackingprotection.introURL", "https://support.mozilla.org/kb/tracking-protection-firefox");
+pref("privacy.trackingprotection.introURL", "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/tracking-protection-pbm");
 
 #ifndef RELEASE_BUILD
 // At the moment, autostart.2 is used, while autostart.1 is unused.
 // We leave it here set to false to reset users' defaults and allow
 // us to change everybody to true in the future, when desired.
 pref("browser.tabs.remote.autostart.1", false);
 pref("browser.tabs.remote.autostart.2", true);
 #endif
--- a/browser/base/content/browser-addons.js
+++ b/browser/base/content/browser-addons.js
@@ -1,13 +1,39 @@
 # -*- 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/.
 
+// Removes a doorhanger notification if all of the installs it was notifying
+// about have ended in some way.
+function removeNotificationOnEnd(notification, installs) {
+  let count = installs.length;
+
+  function maybeRemove(install) {
+    install.removeListener(this);
+
+    if (--count == 0) {
+      // Check that the notification is still showing
+      let current = PopupNotifications.getNotification(notification.id, notification.browser);
+      if (current === notification)
+        notification.remove();
+    }
+  }
+
+  for (let install of installs) {
+    install.addListener({
+      onDownloadCancelled: maybeRemove,
+      onDownloadFailed: maybeRemove,
+      onInstallFailed: maybeRemove,
+      onInstallEnded: maybeRemove
+    });
+  }
+}
+
 const gXPInstallObserver = {
   _findChildShell: function (aDocShell, aSoughtShell)
   {
     if (aDocShell == aSoughtShell)
       return aDocShell;
 
     var node = aDocShell.QueryInterface(Components.interfaces.nsIDocShellTreeItem);
     for (var i = 0; i < node.childCount; ++i) {
@@ -38,45 +64,55 @@ const gXPInstallObserver = {
       if (pending) {
         pending.push(installInfo);
       } else {
         this.pendingInstalls.set(browser, [installInfo]);
       }
       return;
     }
 
+    let showNextConfirmation = () => {
+      // Make sure the browser is still alive.
+      if (gBrowser.browsers.indexOf(browser) == -1)
+        return;
+
+      let pending = this.pendingInstalls.get(browser);
+      if (pending && pending.length)
+        this.showInstallConfirmation(browser, pending.shift());
+    }
+
+    // If all installs have already been cancelled in some way then just show
+    // the next confirmation
+    if (installInfo.installs.every(i => i.state != AddonManager.STATE_DOWNLOADED)) {
+      showNextConfirmation();
+      return;
+    }
+
     const anchorID = "addons-notification-icon";
 
     // Make notifications persist a minimum of 30 seconds
     var options = {
       displayURI: installInfo.originatingURI,
       timeout: Date.now() + 30000,
     };
 
     let cancelInstallation = () => {
       if (installInfo) {
-        for (let install of installInfo.installs)
-          install.cancel();
+        for (let install of installInfo.installs) {
+          // The notification may have been closed because the add-ons got
+          // cancelled elsewhere, only try to cancel those that are still
+          // pending install.
+          if (install.state != AddonManager.STATE_CANCELLED)
+            install.cancel();
+        }
       }
 
       this.acceptInstallation = null;
 
-      let tab = gBrowser.getTabForBrowser(browser);
-      if (tab)
-        tab.removeEventListener("TabClose", cancelInstallation);
-
-      window.removeEventListener("unload", cancelInstallation);
-
-      // Make sure the browser is still alive.
-      if (gBrowser.browsers.indexOf(browser) == -1)
-        return;
-
-      let pending = this.pendingInstalls.get(browser);
-      if (pending && pending.length)
-        this.showInstallConfirmation(browser, pending.shift());
+      showNextConfirmation();
     };
 
     let unsigned = installInfo.installs.filter(i => i.addon.signedState <= AddonManager.SIGNEDSTATE_MISSING);
     let someUnsigned = unsigned.length > 0 && unsigned.length < installInfo.installs.length;
 
     options.eventCallback = (aEvent) => {
       switch (aEvent) {
         case "removed":
@@ -160,23 +196,23 @@ const gXPInstallObserver = {
     if (height) {
       let notification = document.getElementById("addon-install-confirmation-notification");
       notification.style.minHeight = height + "px";
     }
 
     let tab = gBrowser.getTabForBrowser(browser);
     if (tab) {
       gBrowser.selectedTab = tab;
-      tab.addEventListener("TabClose", cancelInstallation);
     }
 
-    window.addEventListener("unload", cancelInstallation);
+    let popup = PopupNotifications.show(browser, "addon-install-confirmation",
+                                        messageString, anchorID, null, null,
+                                        options);
 
-    PopupNotifications.show(browser, "addon-install-confirmation", messageString,
-                            anchorID, null, null, options);
+    removeNotificationOnEnd(popup, installInfo.installs);
 
     Services.telemetry
             .getHistogramById("SECURITY_UI")
             .add(Ci.nsISecurityUITelemetry.WARNING_CONFIRM_ADDON_INSTALL);
   },
 
   observe: function (aSubject, aTopic, aData)
   {
@@ -217,33 +253,46 @@ const gXPInstallObserver = {
             gPrefService.setBoolPref("xpinstall.enabled", true);
           }
         };
       }
 
       PopupNotifications.show(browser, notificationID, messageString, anchorID,
                               action, null, options);
       break; }
+    case "addon-install-origin-blocked": {
+      messageString = gNavigatorBundle.getFormattedString("xpinstallPromptMessage",
+                        [brandShortName]);
+
+      let secHistogram = Components.classes["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry).getHistogramById("SECURITY_UI");
+      secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_ADDON_ASKING_PREVENTED);
+      let popup = PopupNotifications.show(browser, notificationID,
+                                          messageString, anchorID,
+                                          null, null, options);
+      removeNotificationOnEnd(popup, installInfo.installs);
+      break; }
     case "addon-install-blocked": {
       messageString = gNavigatorBundle.getFormattedString("xpinstallPromptMessage",
                         [brandShortName]);
 
       let secHistogram = Components.classes["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry).getHistogramById("SECURITY_UI");
       action = {
         label: gNavigatorBundle.getString("xpinstallPromptAllowButton"),
         accessKey: gNavigatorBundle.getString("xpinstallPromptAllowButton.accesskey"),
         callback: function() {
           secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_ADDON_ASKING_PREVENTED_CLICK_THROUGH);
           installInfo.install();
         }
       };
 
       secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_ADDON_ASKING_PREVENTED);
-      PopupNotifications.show(browser, notificationID, messageString, anchorID,
-                              action, null, options);
+      let popup = PopupNotifications.show(browser, notificationID,
+                                          messageString, anchorID,
+                                          action, null, options);
+      removeNotificationOnEnd(popup, installInfo.installs);
       break; }
     case "addon-install-started": {
       let needsDownload = function needsDownload(aInstall) {
         return aInstall.state != AddonManager.STATE_DOWNLOADED;
       }
       // If all installs have already been downloaded then there is no need to
       // show the download progress
       if (!installInfo.installs.some(needsDownload))
--- a/browser/base/content/browser-customization.js
+++ b/browser/base/content/browser-customization.js
@@ -47,17 +47,16 @@ let CustomizationHandler = {
     let tabContainer = gBrowser.tabContainer;
     if (tabContainer.getAttribute("overflow") == "true") {
       let tabstrip = tabContainer.mTabstrip;
       tabstrip.ensureElementIsVisible(gBrowser.selectedTab, true);
     }
   },
 
   _customizationChange: function() {
-    gHomeButton.updatePersonalToolbarStyle();
     PlacesToolbarHelper.customizeChange();
   },
 
   _customizationEnding: function(aDetails) {
     // Update global UI elements that may have been added or removed
     if (aDetails.changed) {
       gURLBar = document.getElementById("urlbar");
 
--- a/browser/base/content/browser-fxaccounts.js
+++ b/browser/base/content/browser-fxaccounts.js
@@ -442,34 +442,34 @@ let gFxAccounts = {
       break;
     case "migrate-signup":
     case "migrate-verify":
       // The migration flow calls for the menu item to open sync prefs rather
       // than requesting migration start immediately.
       this.openPreferences();
       break;
     default:
-      this.openAccountsPage(null, { entryPoint: "menupanel" });
+      this.openPreferences();
       break;
     }
 
     PanelUI.hide();
   },
 
   openPreferences: function () {
-    openPreferences("paneSync");
+    openPreferences("paneSync", { urlParams: { entrypoint: "menupanel" } });
   },
 
   openAccountsPage: function (action, urlParams={}) {
-    // An entryPoint param is used for server-side metrics.  If the current tab
+    // An entrypoint param is used for server-side metrics.  If the current tab
     // is UITour, assume that it initiated the call to this method and override
-    // the entryPoint accordingly.
+    // the entrypoint accordingly.
     if (UITour.tourBrowsersByWindow.get(window) &&
         UITour.tourBrowsersByWindow.get(window).has(gBrowser.selectedBrowser)) {
-      urlParams.entryPoint = "uitour";
+      urlParams.entrypoint = "uitour";
     }
     let params = new URLSearchParams();
     if (action) {
       params.set("action", action);
     }
     for (let name in urlParams) {
       if (urlParams[name] !== undefined) {
         params.set(name, urlParams[name]);
@@ -477,17 +477,17 @@ let gFxAccounts = {
     }
     let url = "about:accounts?" + params;
     switchToTabHavingURI(url, true, {
       replaceQueryString: true
     });
   },
 
   openSignInAgainPage: function (entryPoint) {
-    this.openAccountsPage("reauth", { entryPoint: entryPoint });
+    this.openAccountsPage("reauth", { entrypoint: entryPoint });
   },
 };
 
 XPCOMUtils.defineLazyGetter(gFxAccounts, "FxAccountsCommon", function () {
   return Cu.import("resource://gre/modules/FxAccountsCommon.js", {});
 });
 
 XPCOMUtils.defineLazyModuleGetter(gFxAccounts, "fxaMigrator",
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -1348,38 +1348,23 @@ let BookmarkingUI = {
       this.broadcaster.removeAttribute("starred");
       this.broadcaster.setAttribute("buttontooltiptext", "");
     }
     else {
       this.star.removeAttribute("disabled");
       this.broadcaster.removeAttribute("stardisabled");
       this._updateStar();
     }
-    this._updateToolbarStyle();
   },
 
   _updateCustomizationState: function BUI__updateCustomizationState() {
     let placement = CustomizableUI.getPlacementOfWidget(this.BOOKMARK_BUTTON_ID);
     this._currentAreaType = placement && CustomizableUI.getAreaType(placement.area);
   },
 
-  _updateToolbarStyle: function BUI__updateToolbarStyle() {
-    let onPersonalToolbar = false;
-    if (this._currentAreaType == CustomizableUI.TYPE_TOOLBAR) {
-      let personalToolbar = document.getElementById("PersonalToolbar");
-      onPersonalToolbar = this.button.parentNode == personalToolbar ||
-                          this.button.parentNode.parentNode == personalToolbar;
-    }
-
-    if (onPersonalToolbar)
-      this.button.classList.add("bookmark-item");
-    else
-      this.button.classList.remove("bookmark-item");
-  },
-
   _uninitView: function BUI__uninitView() {
     // When an element with a placesView attached is removed and re-inserted,
     // XBL reapplies the binding causing any kind of issues and possible leaks,
     // so kill current view and let popupshowing generate a new one.
     if (this.button._placesView)
       this.button._placesView.uninit();
 
     // We have to do the same thing for the "special" views underneath the
@@ -1432,24 +1417,22 @@ let BookmarkingUI = {
     } else if (usedToUpdateStarState && !this._shouldUpdateStarState()) {
       this._updateStar();
     }
     // If we're moved outside of customize mode, we need to uninit
     // our view so it gets reconstructed.
     if (!this._isCustomizing) {
       this._uninitView();
     }
-    this._updateToolbarStyle();
   },
 
   onCustomizeEnd: function BUI_customizeEnd(aWindow) {
     if (aWindow == window) {
       this._isCustomizing = false;
       this.onToolbarVisibilityChange();
-      this._updateToolbarStyle();
     }
   },
 
   init: function() {
     CustomizableUI.addListener(this);
     this._updateCustomizationState();
   },
 
--- a/browser/base/content/browser-syncui.js
+++ b/browser/base/content/browser-syncui.js
@@ -266,30 +266,22 @@ let gSyncUI = {
    *        Indicates the entrypoint from where this method was called.
    */
 
   openSetup: function SUI_openSetup(wizardType, entryPoint = "syncbutton") {
     let xps = Components.classes["@mozilla.org/weave/service;1"]
                                 .getService(Components.interfaces.nsISupports)
                                 .wrappedJSObject;
     if (xps.fxAccountsEnabled) {
-      fxAccounts.getSignedInUser().then(userData => {
-        if (userData) {
-          this.openPrefs();
-        } else {
-          // If the user is also in an uitour, set the entrypoint to `uitour`
-          if (UITour.tourBrowsersByWindow.get(window) &&
-              UITour.tourBrowsersByWindow.get(window).has(gBrowser.selectedBrowser)) {
-            entryPoint = "uitour";
-          }
-          switchToTabHavingURI("about:accounts?entrypoint=" + entryPoint, true, {
-            replaceQueryString: true
-          });
-        }
-      });
+      // If the user is also in an uitour, set the entrypoint to `uitour`
+      if (UITour.tourBrowsersByWindow.get(window) &&
+          UITour.tourBrowsersByWindow.get(window).has(gBrowser.selectedBrowser)) {
+        entryPoint = "uitour";
+      }
+      this.openPrefs(entryPoint);
     } else {
       let win = Services.wm.getMostRecentWindow("Weave:AccountSetup");
       if (win)
         win.focus();
       else {
         window.openDialog("chrome://browser/content/sync/setup.xul",
                           "weaveSetup", "centerscreen,chrome,resizable=no",
                           wizardType);
@@ -304,18 +296,18 @@ let gSyncUI = {
     let win = Services.wm.getMostRecentWindow("Sync:AddDevice");
     if (win)
       win.focus();
     else
       window.openDialog("chrome://browser/content/sync/addDevice.xul",
                         "syncAddDevice", "centerscreen,chrome,resizable=no");
   },
 
-  openPrefs: function SUI_openPrefs() {
-    openPreferences("paneSync");
+  openPrefs: function (entryPoint) {
+    openPreferences("paneSync", { urlParams: { entrypoint: entryPoint } });
   },
 
   openSignInAgainPage: function (entryPoint = "syncbutton") {
     gFxAccounts.openSignInAgainPage(entryPoint);
   },
 
   // Helpers
   _updateLastSyncTime: function SUI__updateLastSyncTime() {
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -592,18 +592,17 @@ toolbarbutton.bookmark-item {
   /* override default listbox width from xul.css */
   width: auto;
 }
 
 /* The star doesn't make sense as text */
 toolbar[mode="text"] #bookmarks-menu-button > .toolbarbutton-menubutton-button > .toolbarbutton-icon {
   display: -moz-box !important;
 }
-toolbar[mode="text"] #bookmarks-menu-button > .toolbarbutton-menubutton-button > .toolbarbutton-text,
-toolbar[mode="full"] #bookmarks-menu-button.bookmark-item > .toolbarbutton-menubutton-button > .toolbarbutton-text {
+toolbar[mode="text"] #bookmarks-menu-button > .toolbarbutton-menubutton-button > .toolbarbutton-text {
   display: none;
 }
 
 menupopup[emptyplacesresult="true"] > .hide-if-empty-places-result {
   display: none;
 }
 
 menuitem.spell-suggestion {
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -49,18 +49,16 @@ XPCOMUtils.defineLazyServiceGetter(this,
                                    "mozIAsyncFavicons");
 XPCOMUtils.defineLazyServiceGetter(this, "gDNSService",
                                    "@mozilla.org/network/dns-service;1",
                                    "nsIDNSService");
 XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager",
                                   "resource://gre/modules/LightweightThemeManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Pocket",
                                   "resource:///modules/Pocket.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "NewTabURL",
-                                  "resource:///modules/NewTabURL.jsm");
 
 // Can't use XPCOMUtils for these because the scripts try to define the variables
 // on window, and so the defineProperty inside defineLazyGetter fails.
 Object.defineProperty(window, "pktApi", {
   get: function() {
     // Avoid this getter running again:
     delete window.pktApi;
     Services.scriptloader.loadSubScript("chrome://browser/content/pocket/pktApi.js", window);
@@ -1250,16 +1248,17 @@ var gBrowserInit = {
     // Bug 778855 - Perf regression if we do this here. To be addressed in bug 779008.
     setTimeout(function() { SafeBrowsing.init(); }, 2000);
 #endif
 
     Services.obs.addObserver(gSessionHistoryObserver, "browser:purge-session-history", false);
     Services.obs.addObserver(gXPInstallObserver, "addon-install-disabled", false);
     Services.obs.addObserver(gXPInstallObserver, "addon-install-started", false);
     Services.obs.addObserver(gXPInstallObserver, "addon-install-blocked", false);
+    Services.obs.addObserver(gXPInstallObserver, "addon-install-origin-blocked", false);
     Services.obs.addObserver(gXPInstallObserver, "addon-install-failed", false);
     Services.obs.addObserver(gXPInstallObserver, "addon-install-confirmation", false);
     Services.obs.addObserver(gXPInstallObserver, "addon-install-complete", false);
     window.messageManager.addMessageListener("Browser:URIFixup", gKeywordURIFixup);
 
     BrowserOffline.init();
     OfflineApps.init();
     IndexedDBPromptHelper.init();
@@ -1291,17 +1290,16 @@ var gBrowserInit = {
     gBrowser.tabContainer.updateVisibility();
 
     BookmarkingUI.init();
 
     gPrefService.addObserver(gHomeButton.prefDomain, gHomeButton, false);
 
     var homeButton = document.getElementById("home-button");
     gHomeButton.updateTooltip(homeButton);
-    gHomeButton.updatePersonalToolbarStyle(homeButton);
 
     let safeMode = document.getElementById("helpSafeMode");
     if (Services.appinfo.inSafeMode) {
       safeMode.label = safeMode.getAttribute("stoplabel");
       safeMode.accesskey = safeMode.getAttribute("stopaccesskey");
     }
 
     // BiDi UI
@@ -1567,16 +1565,17 @@ var gBrowserInit = {
       gBrowserThumbnails.uninit();
       LoopUI.uninit();
       FullZoom.destroy();
 
       Services.obs.removeObserver(gSessionHistoryObserver, "browser:purge-session-history");
       Services.obs.removeObserver(gXPInstallObserver, "addon-install-disabled");
       Services.obs.removeObserver(gXPInstallObserver, "addon-install-started");
       Services.obs.removeObserver(gXPInstallObserver, "addon-install-blocked");
+      Services.obs.removeObserver(gXPInstallObserver, "addon-install-origin-blocked");
       Services.obs.removeObserver(gXPInstallObserver, "addon-install-failed");
       Services.obs.removeObserver(gXPInstallObserver, "addon-install-confirmation");
       Services.obs.removeObserver(gXPInstallObserver, "addon-install-complete");
       window.messageManager.removeMessageListener("Browser:URIFixup", gKeywordURIFixup);
       window.messageManager.removeMessageListener("Browser:LoadURI", RedirectLoad);
 
       try {
         gPrefService.removeObserver(gHomeButton.prefDomain, gHomeButton);
@@ -2409,17 +2408,17 @@ function BrowserViewSource(browser) {
 // initialTab - name of the initial tab to display, or null for the first tab
 // imageElement - image to load in the Media Tab of the Page Info window; can be null/omitted
 // frameOuterWindowID - the id of the frame that the context menu opened in; can be null/omitted
 function BrowserPageInfo(doc, initialTab, imageElement, frameOuterWindowID) {
   var args = {doc: doc, initialTab: initialTab, imageElement: imageElement,
               frameOuterWindowID: frameOuterWindowID};
   var windows = Services.wm.getEnumerator("Browser:page-info");
 
-  var documentURL = doc ? doc.location : window.gBrowser.selectedBrowser.contentDocumentAsCPOW.location;
+  var documentURL = doc ? doc.location : window.gBrowser.selectedBrowser.currentURI.spec;
 
   // Check for windows matching the url
   while (windows.hasMoreElements()) {
     var currentWindow = windows.getNext();
     if (currentWindow.closed) {
       continue;
     }
     if (currentWindow.document.documentElement.getAttribute("relatedUrl") == documentURL) {
@@ -5383,27 +5382,16 @@ var gHomeButton = {
     if (!url) {
       var configBundle = Services.strings
                                  .createBundle("chrome://branding/locale/browserconfig.properties");
       url = configBundle.GetStringFromName(this.prefDomain);
     }
 
     return url;
   },
-
-  updatePersonalToolbarStyle: function (homeButton)
-  {
-    if (!homeButton)
-      homeButton = document.getElementById("home-button");
-    if (homeButton)
-      homeButton.className = homeButton.parentNode.id == "PersonalToolbar"
-                               || homeButton.parentNode.parentNode.id == "PersonalToolbar" ?
-                             homeButton.className.replace("toolbarbutton-1", "bookmark-item") :
-                             homeButton.className.replace("bookmark-item", "toolbarbutton-1");
-  },
 };
 
 const nodeToTooltipMap = {
   "bookmarks-menu-button": "bookmarksMenuButton.tooltip",
 #ifdef XP_MACOSX
   "print-button": "printButton.tooltip",
 #endif
   "new-window-button": "newWindowButton.tooltip",
@@ -7060,20 +7048,20 @@ var gIdentityHandler = {
     if (isMixedActiveContentLoaded) {
       mixedcontent.push("active-loaded");
     } else if (isMixedActiveContentBlocked) {
       mixedcontent.push("active-blocked");
     }
     mixedcontent = mixedcontent.join(" ");
 
     // We have no specific flags for weak ciphers (yet). If a connection is
-    // broken and we can't detect any mixed active content loaded then it's
-    // a weak cipher.
+    // broken and we can't detect any mixed content loaded then it's a weak
+    // cipher.
     let ciphers = "";
-    if (isBroken && !isMixedActiveContentLoaded) {
+    if (isBroken && !isMixedActiveContentLoaded && !isMixedPassiveContentLoaded) {
       ciphers = "weak";
     }
 
     // Update all elements.
     let elementIDs = [
       "identity-popup",
       "identity-popup-securityView-body",
     ];
@@ -7086,16 +7074,17 @@ var gIdentityHandler = {
       }
     }
 
     for (let id of elementIDs) {
       let element = document.getElementById(id);
       updateAttribute(element, "connection", connection);
       updateAttribute(element, "ciphers", ciphers);
       updateAttribute(element, "mixedcontent", mixedcontent);
+      updateAttribute(element, "isbroken", isBroken);
     }
 
     // Initialize the optional strings to empty values
     let supplemental = "";
     let verifier = "";
     let host = "";
     let owner = "";
 
@@ -7572,16 +7561,26 @@ var TabContextMenu = {
     let bookmarkAllTabs = document.getElementById("context_bookmarkAllTabs");
     bookmarkAllTabs.hidden = this.contextTab.pinned;
     if (!bookmarkAllTabs.hidden)
       PlacesCommandHook.updateBookmarkAllTabsCommand();
 
     // Hide "Move to Group" if it's a pinned tab.
     document.getElementById("context_tabViewMenu").hidden =
       (this.contextTab.pinned || !TabView.firstUseExperienced);
+
+    // Adjust the state of the toggle mute menu item.
+    let toggleMute = document.getElementById("context_toggleMuteTab");
+    if (this.contextTab.hasAttribute("muted")) {
+      toggleMute.label = gNavigatorBundle.getString("unmuteTab.label");
+      toggleMute.accessKey = gNavigatorBundle.getString("unmuteTab.accesskey");
+    } else {
+      toggleMute.label = gNavigatorBundle.getString("muteTab.label");
+      toggleMute.accessKey = gNavigatorBundle.getString("muteTab.accesskey");
+    }
   }
 };
 
 XPCOMUtils.defineLazyModuleGetter(this, "gDevTools",
                                   "resource:///modules/devtools/gDevTools.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "gDevToolsBrowser",
                                   "resource:///modules/devtools/gDevTools.jsm");
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -78,16 +78,17 @@
 #undef FULL_BROWSER_WINDOW
 
   <popupset id="mainPopupSet">
     <menupopup id="tabContextMenu"
                onpopupshowing="if (event.target == this) TabContextMenu.updateContextMenu(this);"
                onpopuphidden="if (event.target == this) TabContextMenu.contextTab = null;">
       <menuitem id="context_reloadTab" label="&reloadTab.label;" accesskey="&reloadTab.accesskey;"
                 oncommand="gBrowser.reloadTab(TabContextMenu.contextTab);"/>
+      <menuitem id="context_toggleMuteTab" oncommand="TabContextMenu.contextTab.toggleMuteAudio();"/>
       <menuseparator/>
       <menuitem id="context_pinTab" label="&pinTab.label;"
                 accesskey="&pinTab.accesskey;"
                 oncommand="gBrowser.pinTab(TabContextMenu.contextTab);"/>
       <menuitem id="context_unpinTab" label="&unpinTab.label;" hidden="true"
                 accesskey="&unpinTab.accesskey;"
                 oncommand="gBrowser.unpinTab(TabContextMenu.contextTab);"/>
       <menu id="context_tabViewMenu" label="&moveToGroup.label;"
@@ -810,17 +811,16 @@
                      align="center" class="chromeclass-toolbar-additional panel-wide-item"
                      cui-areatype="toolbar"
                      flex="100" persist="width" removable="true">
           <searchbar id="searchbar" flex="1"/>
         </toolbaritem>
 
         <toolbarbutton id="bookmarks-menu-button"
                        class="toolbarbutton-1 chromeclass-toolbar-additional"
-                       persist="class"
                        removable="true"
                        type="menu-button"
                        label="&bookmarksMenuButton.label;"
                        tooltip="dynamic-shortcut-tooltip"
                        anchor="dropmarker"
                        ondragenter="PlacesMenuDNDHandler.onDragEnter(event);"
                        ondragover="PlacesMenuDNDHandler.onDragOver(event);"
                        ondragleave="PlacesMenuDNDHandler.onDragLeave(event);"
@@ -934,17 +934,17 @@
                        ondragover="DownloadsIndicatorView.onDragOver(event);"
                        ondragenter="DownloadsIndicatorView.onDragOver(event);"
                        label="&downloads.label;"
                        removable="true"
                        cui-areatype="toolbar"
                        tooltip="dynamic-shortcut-tooltip"/>
 
         <toolbarbutton id="home-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
-                       persist="class" removable="true"
+                       removable="true"
                        label="&homeButton.label;"
                        ondragover="homeButtonObserver.onDragOver(event)"
                        ondragenter="homeButtonObserver.onDragOver(event)"
                        ondrop="homeButtonObserver.onDrop(event)"
                        ondragexit="homeButtonObserver.onDragExit(event)"
                        key="goHome"
                        onclick="BrowserGoHome(event);"
                        cui-areatype="toolbar"
--- a/browser/base/content/content.js
+++ b/browser/base/content/content.js
@@ -9,16 +9,17 @@
 let {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource:///modules/ContentWebRTC.jsm");
 Cu.import("resource:///modules/ContentObservers.jsm");
 Cu.import("resource://gre/modules/InlineSpellChecker.jsm");
 Cu.import("resource://gre/modules/InlineSpellCheckerContent.jsm");
+Cu.import("resource://gre/modules/Task.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
   "resource://gre/modules/BrowserUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ContentLinkHandler",
   "resource:///modules/ContentLinkHandler.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "LoginManagerContent",
   "resource://gre/modules/LoginManagerContent.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "InsecurePasswordUtils",
@@ -33,18 +34,18 @@ XPCOMUtils.defineLazyModuleGetter(this, 
   "resource://gre/modules/PageMetadata.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUIUtils",
   "resource:///modules/PlacesUIUtils.jsm");
 XPCOMUtils.defineLazyGetter(this, "PageMenuChild", function() {
   let tmp = {};
   Cu.import("resource://gre/modules/PageMenu.jsm", tmp);
   return new tmp.PageMenuChild();
 });
-
-XPCOMUtils.defineLazyModuleGetter(this, "Feeds", "resource:///modules/Feeds.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "Feeds",
+  "resource:///modules/Feeds.jsm");
 
 // TabChildGlobal
 var global = this;
 
 // Load the form validation popup handler
 var formSubmitObserver = new FormSubmitObserver(content, this);
 
 addMessageListener("ContextMenu:DoCustomCommand", function(message) {
@@ -844,277 +845,268 @@ addMessageListener("ContextMenu:SetAsDes
       disable = true;
     }
   }
 
   if (disable)
     sendAsyncMessage("ContextMenu:SetAsDesktopBackground:Result", { disable });
 });
 
-let pageInfoListener = {
+let PageInfoListener = {
 
-  init: function(chromeGlobal) {
-    chromeGlobal.addMessageListener("PageInfo:getData", this, false, true);
+  init: function() {
+    addMessageListener("PageInfo:getData", this);
   },
 
   receiveMessage: function(message) {
-    this.imageViewRows = [];
-    this.frameList = [];
-    this.strings = message.data.strings;
+    let strings = message.data.strings;
+    let window;
+    let document;
 
     let frameOuterWindowID = message.data.frameOuterWindowID;
 
     // If inside frame then get the frame's window and document.
     if (frameOuterWindowID) {
-      this.window = Services.wm.getOuterWindowWithId(frameOuterWindowID);
-      this.document = this.window.document;
+      window = Services.wm.getOuterWindowWithId(frameOuterWindowID);
+      document = window.document;
     }
     else {
-      this.document = content.document;
-      this.window = content.window;
+      window = content.window;
+      document = content.document;
     }
 
-    let pageInfoData = {metaViewRows: this.getMetaInfo(), docInfo: this.getDocumentInfo(),
-                        feeds: this.getFeedsInfo(), windowInfo: this.getWindowInfo()};
+    let pageInfoData = {metaViewRows: this.getMetaInfo(document),
+                        docInfo: this.getDocumentInfo(document),
+                        feeds: this.getFeedsInfo(document, strings),
+                        windowInfo: this.getWindowInfo(window)};
     sendAsyncMessage("PageInfo:data", pageInfoData);
 
     // Separate step so page info dialog isn't blank while waiting for this to finish.
-    this.getMediaInfo();
-
-    // Send the message after all the media elements have been walked through.
-    let pageInfoMediaData = {imageViewRows: this.imageViewRows};
-
-    this.imageViewRows = null;
-    this.frameList = null;
-    this.strings = null;
-    this.window = null;
-    this.document = null;
-
-    sendAsyncMessage("PageInfo:mediaData", pageInfoMediaData);
+    this.getMediaInfo(document, window, strings);
   },
 
-  getMetaInfo: function() {
+  getMetaInfo: function(document) {
     let metaViewRows = [];
 
     // Get the meta tags from the page.
-    let metaNodes = this.document.getElementsByTagName("meta");
+    let metaNodes = document.getElementsByTagName("meta");
 
     for (let metaNode of metaNodes) {
       metaViewRows.push([metaNode.name || metaNode.httpEquiv || metaNode.getAttribute("property"),
                         metaNode.content]);
     }
 
     return metaViewRows;
   },
 
-  getWindowInfo: function() {
+  getWindowInfo: function(window) {
     let windowInfo = {};
-    windowInfo.isTopWindow = this.window == this.window.top;
+    windowInfo.isTopWindow = window == window.top;
 
     let hostName = null;
     try {
-      hostName = this.window.location.host;
+      hostName = window.location.host;
     }
     catch (exception) { }
 
     windowInfo.hostName = hostName;
     return windowInfo;
   },
 
-  getDocumentInfo: function() {
+  getDocumentInfo: function(document) {
     let docInfo = {};
-    docInfo.title = this.document.title;
-    docInfo.location = this.document.location.toString();
-    docInfo.referrer = this.document.referrer;
-    docInfo.compatMode = this.document.compatMode;
-    docInfo.contentType = this.document.contentType;
-    docInfo.characterSet = this.document.characterSet;
-    docInfo.lastModified = this.document.lastModified;
+    docInfo.title = document.title;
+    docInfo.location = document.location.toString();
+    docInfo.referrer = document.referrer;
+    docInfo.compatMode = document.compatMode;
+    docInfo.contentType = document.contentType;
+    docInfo.characterSet = document.characterSet;
+    docInfo.lastModified = document.lastModified;
 
     let documentURIObject = {};
-    documentURIObject.spec = this.document.documentURIObject.spec;
-    documentURIObject.originCharset = this.document.documentURIObject.originCharset;
+    documentURIObject.spec = document.documentURIObject.spec;
+    documentURIObject.originCharset = document.documentURIObject.originCharset;
     docInfo.documentURIObject = documentURIObject;
 
     docInfo.isContentWindowPrivate = PrivateBrowsingUtils.isContentWindowPrivate(content);
 
     return docInfo;
   },
 
-  getFeedsInfo: function() {
+  getFeedsInfo: function(document, strings) {
     let feeds = [];
     // Get the feeds from the page.
-    let linkNodes = this.document.getElementsByTagName("link");
+    let linkNodes = document.getElementsByTagName("link");
     let length = linkNodes.length;
     for (let i = 0; i < length; i++) {
       let link = linkNodes[i];
       if (!link.href) {
         continue;
       }
       let rel = link.rel && link.rel.toLowerCase();
       let rels = {};
 
       if (rel) {
         for each (let relVal in rel.split(/\s+/)) {
           rels[relVal] = true;
         }
       }
 
       if (rels.feed || (link.type && rels.alternate && !rels.stylesheet)) {
-        let type = Feeds.isValidFeed(link, this.document.nodePrincipal, "feed" in rels);
+        let type = Feeds.isValidFeed(link, document.nodePrincipal, "feed" in rels);
         if (type) {
-          type = this.strings[type] || this.strings["application/rss+xml"];
+          type = strings[type] || strings["application/rss+xml"];
           feeds.push([link.title, type, link.href]);
         }
       }
     }
     return feeds;
   },
 
   // Only called once to get the media tab's media elements from the content page.
-  // The actual work is done with a TreeWalker that calls doGrab() once for
-  // each element node in the document.
-  getMediaInfo: function()
+  getMediaInfo: function(document, window, strings)
   {
-    this.goThroughFrames(this.document, this.window);
-    this.processFrames();
+    let frameList = this.goThroughFrames(document, window);
+    Task.spawn(() => this.processFrames(document, frameList, strings));
   },
 
-  goThroughFrames: function(aDocument, aWindow)
+  goThroughFrames: function(document, window)
   {
-    this.frameList.push(aDocument);
-    if (aWindow && aWindow.frames.length > 0) {
-      let num = aWindow.frames.length;
+    let frameList = [document];
+    if (window && window.frames.length > 0) {
+      let num = window.frames.length;
       for (let i = 0; i < num; i++) {
-        this.goThroughFrames(aWindow.frames[i].document, aWindow.frames[i]);  // recurse through the frames
+        // Recurse through the frames.
+        frameList.concat(this.goThroughFrames(window.frames[i].document,
+                                              window.frames[i]));
       }
     }
+    return frameList;
   },
 
-  processFrames: function()
+  processFrames: function*(document, frameList, strings)
   {
-    if (this.frameList.length) {
-      let doc = this.frameList[0];
-      let iterator = doc.createTreeWalker(doc, content.NodeFilter.SHOW_ELEMENT, elem => this.grabAll(elem));
-      this.frameList.shift();
-      this.doGrab(iterator);
+    let nodeCount = 0;
+    for (let doc of frameList) {
+      let iterator = doc.createTreeWalker(doc, content.NodeFilter.SHOW_ELEMENT);
+
+      // Goes through all the elements on the doc. imageViewRows takes only the media elements.
+      while (iterator.nextNode()) {
+        let mediaNode = this.getMediaNode(document, strings, iterator.currentNode);
+
+        if (mediaNode) {
+          sendAsyncMessage("PageInfo:mediaData",
+                           {imageViewRow: mediaNode, isComplete: false});
+        }
+
+        if (++nodeCount % 500 == 0) {
+          // setTimeout every 500 elements so we don't keep blocking the content process.
+          yield new Promise(resolve => setTimeout(resolve, 10));
+        }
+      }
     }
+    // Send that page info media fetching has finished.
+    sendAsyncMessage("PageInfo:mediaData", {isComplete: true});
   },
 
-  /**
-   * This function's previous purpose in pageInfo.js was to get loop through 500 elements at a time.
-   * The iterator filter will filter for media elements.
-   * #TODO Bug 1175794: refactor pageInfo.js to receive a media element at a time
-   * from messages and continually update UI.
-   */
-  doGrab: function(iterator)
-  {
-    while (true)
-    {
-      if (!iterator.nextNode()) {
-        this.processFrames();
-        return;
-      }
-    }
-  },
-
-  grabAll: function(elem)
+  getMediaNode: function(document, strings, elem)
   {
     // Check for images defined in CSS (e.g. background, borders), any node may have multiple.
     let computedStyle = elem.ownerDocument.defaultView.getComputedStyle(elem, "");
+    let mediaElement = null;
 
     let addImage = (url, type, alt, elem, isBg) => {
-      let element = this.serializeElementInfo(url, type, alt, elem, isBg);
-      this.imageViewRows.push([url, type, alt, element, isBg]);
+      let element = this.serializeElementInfo(document, url, type, alt, elem, isBg);
+      mediaElement = [url, type, alt, element, isBg];
     };
 
     if (computedStyle) {
       let addImgFunc = (label, val) => {
         if (val.primitiveType == content.CSSPrimitiveValue.CSS_URI) {
-          addImage(val.getStringValue(), label, this.strings.notSet, elem, true);
+          addImage(val.getStringValue(), label, strings.notSet, elem, true);
         }
         else if (val.primitiveType == content.CSSPrimitiveValue.CSS_STRING) {
           // This is for -moz-image-rect.
           // TODO: Reimplement once bug 714757 is fixed.
           let strVal = val.getStringValue();
           if (strVal.search(/^.*url\(\"?/) > -1) {
             let url = strVal.replace(/^.*url\(\"?/,"").replace(/\"?\).*$/,"");
-            addImage(url, label, this.strings.notSet, elem, true);
+            addImage(url, label, strings.notSet, elem, true);
           }
         }
         else if (val.cssValueType == content.CSSValue.CSS_VALUE_LIST) {
           // Recursively resolve multiple nested CSS value lists.
           for (let i = 0; i < val.length; i++) {
             addImgFunc(label, val.item(i));
           }
         }
       };
 
-      addImgFunc(this.strings.mediaBGImg, computedStyle.getPropertyCSSValue("background-image"));
-      addImgFunc(this.strings.mediaBorderImg, computedStyle.getPropertyCSSValue("border-image-source"));
-      addImgFunc(this.strings.mediaListImg, computedStyle.getPropertyCSSValue("list-style-image"));
-      addImgFunc(this.strings.mediaCursor, computedStyle.getPropertyCSSValue("cursor"));
+      addImgFunc(strings.mediaBGImg, computedStyle.getPropertyCSSValue("background-image"));
+      addImgFunc(strings.mediaBorderImg, computedStyle.getPropertyCSSValue("border-image-source"));
+      addImgFunc(strings.mediaListImg, computedStyle.getPropertyCSSValue("list-style-image"));
+      addImgFunc(strings.mediaCursor, computedStyle.getPropertyCSSValue("cursor"));
     }
 
     // One swi^H^H^Hif-else to rule them all.
     if (elem instanceof content.HTMLImageElement) {
-      addImage(elem.src, this.strings.mediaImg,
-               (elem.hasAttribute("alt")) ? elem.alt : this.strings.notSet, elem, false);
+      addImage(elem.src, strings.mediaImg,
+               (elem.hasAttribute("alt")) ? elem.alt : strings.notSet, elem, false);
     }
     else if (elem instanceof content.SVGImageElement) {
       try {
         // Note: makeURLAbsolute will throw if either the baseURI is not a valid URI
         //       or the URI formed from the baseURI and the URL is not a valid URI.
         let href = makeURLAbsolute(elem.baseURI, elem.href.baseVal);
-        addImage(href, this.strings.mediaImg, "", elem, false);
+        addImage(href, strings.mediaImg, "", elem, false);
       } catch (e) { }
     }
     else if (elem instanceof content.HTMLVideoElement) {
-      addImage(elem.currentSrc, this.strings.mediaVideo, "", elem, false);
+      addImage(elem.currentSrc, strings.mediaVideo, "", elem, false);
     }
     else if (elem instanceof content.HTMLAudioElement) {
-      addImage(elem.currentSrc, this.strings.mediaAudio, "", elem, false);
+      addImage(elem.currentSrc, strings.mediaAudio, "", elem, false);
     }
     else if (elem instanceof content.HTMLLinkElement) {
       if (elem.rel && /\bicon\b/i.test(elem.rel)) {
-        addImage(elem.href, this.strings.mediaLink, "", elem, false);
+        addImage(elem.href, strings.mediaLink, "", elem, false);
       }
     }
     else if (elem instanceof content.HTMLInputElement || elem instanceof content.HTMLButtonElement) {
       if (elem.type.toLowerCase() == "image") {
-        addImage(elem.src, this.strings.mediaInput,
-                 (elem.hasAttribute("alt")) ? elem.alt : this.strings.notSet, elem, false);
+        addImage(elem.src, strings.mediaInput,
+                 (elem.hasAttribute("alt")) ? elem.alt : strings.notSet, elem, false);
       }
     }
     else if (elem instanceof content.HTMLObjectElement) {
-      addImage(elem.data, this.strings.mediaObject, this.getValueText(elem), elem, false);
+      addImage(elem.data, strings.mediaObject, this.getValueText(elem), elem, false);
     }
     else if (elem instanceof content.HTMLEmbedElement) {
-      addImage(elem.src, this.strings.mediaEmbed, "", elem, false);
+      addImage(elem.src, strings.mediaEmbed, "", elem, false);
     }
 
-    return content.NodeFilter.FILTER_ACCEPT;
+    return mediaElement;
   },
 
   /**
    * Set up a JSON element object with all the instanceOf and other infomation that
    * makePreview in pageInfo.js uses to figure out how to display the preview.
    */
 
-  serializeElementInfo: function(url, type, alt, item, isBG)
+  serializeElementInfo: function(document, url, type, alt, item, isBG)
   {
     // Interface for image loading content.
     const nsIImageLoadingContent = Components.interfaces.nsIImageLoadingContent;
 
     let result = {};
 
     let imageText;
     if (!isBG &&
         !(item instanceof content.SVGImageElement) &&
-        !(this.document instanceof content.ImageDocument)) {
+        !(document instanceof content.ImageDocument)) {
       imageText = item.title || item.alt;
 
       if (!imageText && !(item instanceof content.HTMLImageElement)) {
         imageText = this.getValueText(item);
       }
     }
 
     result.imageText = imageText;
@@ -1135,17 +1127,17 @@ let pageInfoListener = {
         result.mimeType = imageRequest.mimeType;
         let image = !(imageRequest.imageStatus & imageRequest.STATUS_ERROR) && imageRequest.image;
         if (image) {
           result.numFrames = image.numFrames;
         }
       }
     }
 
-    // if we have a data url, get the MIME type from the url
+    // If we have a data url, get the MIME type from the url.
     if (!result.mimeType && url.startsWith("data:")) {
       let dataMimeType = /^data:(image\/[^;,]+)/i.exec(url);
       if (dataMimeType)
         result.mimeType = dataMimeType[1].toLowerCase();
     }
 
     result.HTMLLinkElement = item instanceof content.HTMLLinkElement;
     result.HTMLInputElement = item instanceof content.HTMLInputElement;
@@ -1235,9 +1227,9 @@ let pageInfoListener = {
   {
     let middleRE = /\s+/g;
     let endRE = /(^\s+)|(\s+$)/g;
 
     text = text.replace(middleRE, " ");
     return text.replace(endRE, "");
   }
 };
-pageInfoListener.init(this);
\ No newline at end of file
+PageInfoListener.init();
\ No newline at end of file
--- a/browser/base/content/newtab/newTab.css
+++ b/browser/base/content/newtab/newTab.css
@@ -208,16 +208,18 @@ input[type=button] {
 
 .newtab-suggested-bounds {
   max-height: 34px; /* 34 / 17 = 2 lines maximum */
 }
 
 .newtab-title {
   left: 0;
   padding: 0 4px;
+  border: 1px solid #FFFFFF;
+  border-radius: 0px 0px 8px 8px;
 }
 
 .newtab-sponsored {
   background-color: #FFFFFF;
   border: 1px solid #E2E2E2;
   border-radius: 3px;
   color: #4A4A4A;
   cursor: pointer;
@@ -335,17 +337,17 @@ input[type=button] {
   opacity: 0.01;
 }
 
 /* SEARCH */
 #newtab-search-container {
   display: -moz-box;
   position: relative;
   -moz-box-pack: center;
-  margin: 15px 0px;
+  margin: 40px 0 15px;
 }
 
 #newtab-search-container[page-disabled] {
   opacity: 0;
   pointer-events: none;
 }
 
 #newtab-search-form {
--- a/browser/base/content/pageinfo/pageInfo.js
+++ b/browser/base/content/pageinfo/pageInfo.js
@@ -359,47 +359,57 @@ function loadPageInfo(frameOuterWindowID
   gStrings["text/xml"]             = gBundle.getString("feedXML");
   gStrings["application/xml"]      = gBundle.getString("feedXML");
   gStrings["application/rdf+xml"]  = gBundle.getString("feedXML");
 
   // Look for pageInfoListener in content.js. Sends message to listener with arguments.
   mm.sendAsyncMessage("PageInfo:getData", {strings: gStrings,
                       frameOuterWindowID: frameOuterWindowID});
 
-  let pageInfoData = null;
+  let pageInfoData;
 
   // Get initial pageInfoData needed to display the general, feeds, permission and security tabs.
   mm.addMessageListener("PageInfo:data", function onmessage(message) {
     mm.removeMessageListener("PageInfo:data", onmessage);
     pageInfoData = message.data;
     let docInfo = pageInfoData.docInfo;
     let windowInfo = pageInfoData.windowInfo;
     let uri = makeURI(docInfo.documentURIObject.spec,
                       docInfo.documentURIObject.originCharset);
     gDocInfo = docInfo;
 
-    var titleFormat = windowInfo.isTopWindow ? "pageInfo.frame.title"
-                                             : "pageInfo.page.title";
+    var titleFormat = windowInfo.isTopWindow ? "pageInfo.page.title"
+                                             : "pageInfo.frame.title";
     document.title = gBundle.getFormattedString(titleFormat, [docInfo.location]);
 
     document.getElementById("main-window").setAttribute("relatedUrl", docInfo.location);
 
     makeGeneralTab(pageInfoData.metaViewRows, docInfo);
     initFeedTab(pageInfoData.feeds);
     onLoadPermission(uri);
     securityOnLoad(uri, windowInfo);
   });
 
   // Get the media elements from content script to setup the media tab.
-  mm.addMessageListener("PageInfo:mediaData", function onmessage(message){
-    mm.removeMessageListener("PageInfo:mediaData", onmessage);
-    makeMediaTab(message.data.imageViewRows);
+  mm.addMessageListener("PageInfo:mediaData", function onmessage(message) {
+    // Page info window was closed.
+    if (window.closed) {
+      mm.removeMessageListener("PageInfo:mediaData", onmessage);
+      return;
+    }
 
-    // Loop through onFinished and execute the functions on it.
-    onFinished.forEach(function(func) { func(pageInfoData); });
+    // The page info media fetching has been completed.
+    if (message.data.isComplete) {
+      mm.removeMessageListener("PageInfo:mediaData", onmessage);
+      onFinished.forEach(function(func) { func(pageInfoData); });
+      return;
+    }
+
+    addImage(message.data.imageViewRow);
+    selectImage();
   });
 
   /* Call registered overlay init functions */
   onLoadRegistry.forEach(function(func) { func(); });
 }
 
 function resetPageInfo(args)
 {
@@ -575,28 +585,20 @@ function makeGeneralTab(metaViewRows, do
       var pageSize = cacheEntry.dataSize;
       var kbSize = formatNumber(Math.round(pageSize / 1024 * 100) / 100);
       sizeText = gBundle.getFormattedString("generalSize", [kbSize, formatNumber(pageSize)]);
     }
     setItemValue("sizetext", sizeText);
   });
 }
 
-function makeMediaTab(imageViewRows)
+function addImage(imageViewRow)
 {
-  // Call addImage passing in the image rows to add to the view on the Media Tab.
-  for (let image of imageViewRows) {
-    let [url, type, alt, elem, isBg] = image;
-    addImage(url, type, alt, elem, isBg);
-  }
-  selectImage();
-}
+  let [url, type, alt, elem, isBg] = imageViewRow;
 
-function addImage(url, type, alt, elem, isBg)
-{
   if (!url)
     return;
 
   if (!gImageHash.hasOwnProperty(url))
     gImageHash[url] = { };
   if (!gImageHash[url].hasOwnProperty(type))
     gImageHash[url][type] = { };
   if (!gImageHash[url][type].hasOwnProperty(alt)) {
--- a/browser/base/content/pageinfo/permissions.js
+++ b/browser/base/content/pageinfo/permissions.js
@@ -183,43 +183,51 @@ function initIndexedDBRow()
 {
   let row = document.getElementById("perm-indexedDB-row");
   let extras = document.getElementById("perm-indexedDB-extras");
 
   row.appendChild(extras);
 
   var quotaManager = Components.classes["@mozilla.org/dom/quota/manager;1"]
                                .getService(nsIQuotaManager);
+  let principal = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
+                            .getService(Components.interfaces.nsIScriptSecurityManager)
+                            .createCodebasePrincipal(gPermURI, {});
   gUsageRequest =
-    quotaManager.getUsageForURI(gPermURI, onIndexedDBUsageCallback);
+    quotaManager.getUsageForPrincipal(principal, onIndexedDBUsageCallback);
 
   var status = document.getElementById("indexedDBStatus");
   var button = document.getElementById("indexedDBClear");
 
   status.value = "";
   status.setAttribute("hidden", "true");
   button.setAttribute("hidden", "true");
 }
 
 function onIndexedDBClear()
 {
+  let principal = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
+                            .getService(Components.interfaces.nsIScriptSecurityManager)
+                            .createCodebasePrincipal(gPermURI, {});
+
   Components.classes["@mozilla.org/dom/quota/manager;1"]
             .getService(nsIQuotaManager)
-            .clearStoragesForURI(gPermURI);
+            .clearStoragesForPrincipal(principal);
 
   Components.classes["@mozilla.org/serviceworkers/manager;1"]
             .getService(Components.interfaces.nsIServiceWorkerManager)
             .removeAndPropagate(gPermURI.host);
 
   SitePermissions.remove(gPermURI, "indexedDB");
   initIndexedDBRow();
 }
 
-function onIndexedDBUsageCallback(uri, usage, fileUsage)
+function onIndexedDBUsageCallback(principal, usage, fileUsage)
 {
+  let uri = principal.URI;
   if (!uri.equals(gPermURI)) {
     throw new Error("Callback received for bad URI: " + uri);
   }
 
   if (usage) {
     if (!("DownloadUtils" in window)) {
       Components.utils.import("resource://gre/modules/DownloadUtils.jsm");
     }
--- a/browser/base/content/tabbrowser.css
+++ b/browser/base/content/tabbrowser.css
@@ -84,11 +84,11 @@ browser[pending] {
 browser[pendingpaint] {
   opacity: 0;
 }
 
 tabbrowser[pendingpaint] {
   background-image: url(chrome://browser/skin/tabbrowser/pendingpaint.png);
   background-repeat: no-repeat;
   background-position: center center;
-  background-color: #fff;
-  opacity: 0.3;
+  background-color: #f9f9f9 !important;
+  background-size: 30px;
 }
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -1203,17 +1203,17 @@
                 let prompts = promptBox.listPrompts();
                 // There might not be any prompts here if the tab was closed
                 // while in an onbeforeunload prompt, which will have
                 // destroyed aforementioned prompt already, so check there's
                 // something to remove, first:
                 if (prompts.length) {
                   // NB: This code assumes that the beforeunload prompt
                   //     is the top-most prompt on the tab.
-                  promptBox.removePrompt(prompts[prompts.length - 1]);
+                  prompts[prompts.length - 1].abortPrompt();
                 }
               }
 
               oldBrowser._urlbarFocused = (gURLBar && gURLBar.focused);
               if (this.isFindBarInitialized(oldTab)) {
                 let findBar = this.getFindBar(oldTab);
                 oldTab._findBarFocused = (!findBar.hidden &&
                   findBar._findField.getAttribute("focused") == "true");
@@ -2562,16 +2562,19 @@
 
             // Unmap old outerWindowIDs.
             this._outerWindowIDBrowserMap.delete(ourBrowser.outerWindowID);
             let remoteBrowser = aOtherBrowser.ownerDocument.defaultView.gBrowser;
             if (remoteBrowser) {
               remoteBrowser._outerWindowIDBrowserMap.delete(aOtherBrowser.outerWindowID);
             }
 
+            aOtherBrowser.docShellIsActive = (ourBrowser == this.selectedBrowser &&
+                                              window.windowState != window.STATE_MINIMIZED);
+
             // Swap the docshells
             ourBrowser.swapDocShells(aOtherBrowser);
 
             if (ourBrowser.isRemoteBrowser) {
               // Switch outerWindowIDs for remote browsers.
               let ourOuterWindowID = ourBrowser._outerWindowID;
               ourBrowser._outerWindowID = aOtherBrowser._outerWindowID;
               aOtherBrowser._outerWindowID = ourOuterWindowID;
@@ -3069,28 +3072,36 @@
 
             tabbrowser: this,  // Reference to gBrowser.
             loadTimer: null,   // TAB_SWITCH_TIMEOUT timer.
             unloadTimer: null, // UNLOAD_DELAY timer.
 
             // Map from tabs to STATE_* (below).
             tabState: new Map(),
 
+            // Keep an exact list of content processes (tabParent) in which
+            // we're actively suppressing the display port. This gives a robust
+            // way to make sure we don't forget to un-suppress.
+            activeSuppressDisplayport: new Set(),
+
             // Set of tabs that might be visible right now. We maintain
             // this set because we can't be sure when a tab is actually
             // drawn. A tab is added to this set when we ask to make it
             // visible. All tabs but the most recently shown tab are
             // removed from the set upon MozAfterPaint.
             maybeVisibleTabs: new Set([this.selectedTab]),
 
             STATE_UNLOADED: 0,
             STATE_LOADING: 1,
             STATE_LOADED: 2,
             STATE_UNLOADING: 3,
 
+            // re-entrancy guard:
+            _processing: false,
+
             getTabState: function(tab) {
               let state = this.tabState.get(tab);
               if (state === undefined) {
                 return this.STATE_UNLOADED;
               }
               return state;
             },
 
@@ -3129,16 +3140,21 @@
               clearTimeout(this.loadTimer);
 
               window.removeEventListener("MozAfterPaint", this);
               window.removeEventListener("MozLayerTreeReady", this);
               window.removeEventListener("MozLayerTreeCleared", this);
               window.removeEventListener("TabRemotenessChange", this);
 
               this.tabbrowser._switcher = null;
+
+              this.activeSuppressDisplayport.forEach(function(tabParent) {
+                tabParent.suppressDisplayport(false);
+              });
+              this.activeSuppressDisplayport.clear();
             },
 
             finish: function() {
               this.log("FINISH");
 
               this.assert(this.tabbrowser._switcher);
               this.assert(this.tabbrowser._switcher === this);
               this.assert(!this.spinnerTab);
@@ -3223,17 +3239,16 @@
                 // This doesn't necessarily exist if we're a new window and haven't switched tabs yet
                 if (this.lastVisibleTab)
                   this.lastVisibleTab._visuallySelected = false;
 
                 this.visibleTab._visuallySelected = true;
               }
 
               this.lastVisibleTab = this.visibleTab;
-
             },
 
             assert: function(cond) {
               if (!cond) {
                 dump("Assertion failure\n" + Error().stack);
                 throw new Error("Assertion failure");
               }
             },
@@ -3428,38 +3443,56 @@
                 return;
               }
 
               this.logState("requestTab " + this.tinfo(tab));
               this.startTabSwitch();
 
               this.requestedTab = tab;
 
+              let browser = this.requestedTab.linkedBrowser;
+              let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
+              if (fl && fl.tabParent && !this.activeSuppressDisplayport.has(fl.tabParent)) {
+                fl.tabParent.suppressDisplayport(true);
+                this.activeSuppressDisplayport.add(fl.tabParent);
+              }
+
               this.preActions();
 
               clearTimeout(this.unloadTimer);
               this.unloadTimer = setTimeout(() => this.onUnloadTimeout(), this.UNLOAD_DELAY);
 
               this.postActions();
             },
 
-            handleEvent: function(event) {
+            handleEvent: function(event, delayed = false) {
+              if (this._processing) {
+                setTimeout(() => this.handleEvent(event, true), 0);
+                return;
+              }
+              if (delayed && this.tabbrowser._switcher != this) {
+                // if we delayed processing this event, we might be out of date, in which
+                // case we drop the delayed events
+                return;
+              }
+              this._processing = true;
               this.preActions();
 
               if (event.type == "MozLayerTreeReady") {
                 this.onLayersReady(event.originalTarget);
               } if (event.type == "MozAfterPaint") {
                 this.onPaint();
               } else if (event.type == "MozLayerTreeCleared") {
                 this.onLayersCleared(event.originalTarget);
               } else if (event.type == "TabRemotenessChange") {
                 this.onRemotenessChange(event.target);
               }
 
               this.postActions();
+              this._processing = false;
             },
 
             /*
              * Telemetry and Profiler related helpers for recording tab switch
              * timing.
              */
 
             startTabSwitch: function () {
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -131,17 +131,16 @@ skip-if = e10s # Bug 1093153 - no about:
 [browser_action_keyword.js]
 [browser_action_keyword_override.js]
 [browser_action_searchengine.js]
 [browser_action_searchengine_alias.js]
 [browser_addKeywordSearch.js]
 [browser_search_favicon.js]
 [browser_alltabslistener.js]
 [browser_audioTabIcon.js]
-skip-if = e10s # Bug 1192449
 [browser_autocomplete_a11y_label.js]
 skip-if = e10s # Bug 1101993 - times out for unknown reasons when run in the dir (works on its own)
 [browser_autocomplete_cursor.js]
 [browser_autocomplete_edit_completed.js]
 [browser_autocomplete_enter_race.js]
 [browser_autocomplete_no_title.js]
 [browser_autocomplete_autoselect.js]
 [browser_autocomplete_oldschool_wrap.js]
--- a/browser/base/content/test/general/browser_audioTabIcon.js
+++ b/browser/base/content/test/general/browser_audioTabIcon.js
@@ -65,35 +65,68 @@ function* test_mute_tab(tab, icon, expec
   EventUtils.synthesizeMouseAtCenter(icon, {button: 0});
   leave_icon(icon);
 
   is(gBrowser.selectedTab, activeTab, "Clicking on mute should not change the currently selected tab");
 
   return mutedPromise;
 }
 
+function get_tab_attributes(tab) {
+  const ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
+  let {attributes} = JSON.parse(ss.getTabState(tab));
+  return attributes;
+}
+
+function* test_muting_using_menu(tab, expectMuted) {
+  // Show the popup menu
+  let contextMenu = document.getElementById("tabContextMenu");
+  let popupShownPromise = BrowserTestUtils.waitForEvent(contextMenu, "popupshown");
+  EventUtils.synthesizeMouseAtCenter(tab, {type: "contextmenu", button: 2});
+  yield popupShownPromise;
+
+  // Check the menu
+  let expectedLabel = expectMuted ? "Unmute Tab" : "Mute Tab";
+  let toggleMute = document.getElementById("context_toggleMuteTab");
+  is(toggleMute.label, expectedLabel, "Correct label expected");
+  is(toggleMute.accessKey, "M", "Correct accessKey expected");
+
+  // Click on the menu and wait for the tab to be muted.
+  let mutedPromise = get_wait_for_mute_promise(tab, !expectMuted);
+  let popupHiddenPromise = BrowserTestUtils.waitForEvent(contextMenu, "popuphidden");
+  EventUtils.synthesizeMouseAtCenter(toggleMute, {});
+  yield popupHiddenPromise;
+  yield mutedPromise;
+}
+
 function* test_playing_icon_on_tab(tab, browser, isPinned) {
   let icon = document.getAnonymousElementByAttribute(tab, "anonid",
                                                      isPinned ? "overlay-icon" : "soundplaying-icon");
 
   yield ContentTask.spawn(browser, {}, function* () {
     let audio = content.document.querySelector("audio");
     audio.play();
   });
 
   yield wait_for_tab_playing_event(tab, true);
 
   yield test_tooltip(icon, "Mute tab");
 
+  ok(!("muted" in get_tab_attributes(tab)), "No muted attribute should be persisted");
+
   yield test_mute_tab(tab, icon, true);
 
+  ok("muted" in get_tab_attributes(tab), "Muted attribute should be persisted");
+
   yield test_tooltip(icon, "Unmute tab");
 
   yield test_mute_tab(tab, icon, false);
 
+  ok(!("muted" in get_tab_attributes(tab)), "No muted attribute should be persisted");
+
   yield test_tooltip(icon, "Mute tab");
 
   yield test_mute_tab(tab, icon, true);
 
   yield ContentTask.spawn(browser, {}, function* () {
     let audio = content.document.querySelector("audio");
     audio.pause();
   });
@@ -103,16 +136,22 @@ function* test_playing_icon_on_tab(tab, 
      !tab.hasAttribute("soundplaying"), "Tab should still be muted but not playing");
 
   yield test_tooltip(icon, "Unmute tab");
 
   yield test_mute_tab(tab, icon, false);
 
   ok(!tab.hasAttribute("muted") &&
      !tab.hasAttribute("soundplaying"), "Tab should not be be muted or playing");
+
+  // Make sure it's possible to mute using the context menu.
+  yield test_muting_using_menu(tab, false);
+
+  // Make sure it's possible to unmute using the context menu.
+  yield test_muting_using_menu(tab, true);
 }
 
 function* test_swapped_browser(oldTab, newBrowser, isPlaying) {
   ok(oldTab.hasAttribute("muted"), "Expected the correct muted attribute on the old tab");
   is(oldTab.hasAttribute("soundplaying"), isPlaying, "Expected the correct soundplaying attribute on the old tab");
 
   let newTab = gBrowser.getTabForBrowser(newBrowser);
   let AttrChangePromise = BrowserTestUtils.waitForEvent(newTab, "TabAttrModified", false, event => {
@@ -156,19 +195,16 @@ function* test_browser_swapping(tab, bro
   yield test_mute_tab(tab, icon, true);
 
   yield BrowserTestUtils.withNewTab({
     gBrowser,
     url: "about:blank",
   }, function*(newBrowser) {
     yield test_swapped_browser(tab, newBrowser, true)
 
-    // FIXME: this is needed to work around bug 1190903.
-    yield new Promise(resolve => setTimeout(resolve, 3000));
-
     // Now, test swapping with a muted but not playing tab.
     // Note that the tab remains muted, so we only need to pause playback.
     tab = gBrowser.getTabForBrowser(newBrowser);
     yield ContentTask.spawn(newBrowser, {}, function* () {
       let audio = content.document.querySelector("audio");
       audio.pause();
     });
 
@@ -346,17 +382,16 @@ function* test_on_browser(browser) {
   } else {
     yield test_browser_swapping(tab, browser);
   }
 }
 
 add_task(function*() {
   yield new Promise((resolve) => {
     SpecialPowers.pushPrefEnv({"set": [
-                                ["media.useAudioChannelService", true],
                                 ["browser.tabs.showAudioPlayingIcon", true],
                               ]}, resolve);
   });
 });
 
 requestLongerTimeout(2);
 add_task(function* test_page() {
   yield BrowserTestUtils.withNewTab({
--- a/browser/base/content/test/general/browser_bug553455.js
+++ b/browser/base/content/test/general/browser_bug553455.js
@@ -189,18 +189,17 @@ function test_disabled_install() {
       }
       catch (e) {
         ok(false, "xpinstall.enabled should be set");
       }
 
       gBrowser.removeTab(gBrowser.selectedTab);
 
       AddonManager.getAllInstalls(function(aInstalls) {
-        is(aInstalls.length, 1, "Should have been one install created");
-        aInstalls[0].cancel();
+        is(aInstalls.length, 0, "Shouldn't be any pending installs");
 
         runNextTest();
       });
     });
 
     // Click on Enable
     EventUtils.synthesizeMouseAtCenter(notification.button, {});
   });
@@ -669,18 +668,20 @@ function test_url() {
           gBrowser.removeTab(gBrowser.selectedTab);
         });
       });
 
       accept_install_dialog();
     });
   });
 
-  gBrowser.selectedTab = gBrowser.addTab();
-  gBrowser.loadURI(TESTROOT + "unsigned.xpi");
+  gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(() => {
+    gBrowser.loadURI(TESTROOT + "unsigned.xpi");
+  });
 },
 
 function test_localfile() {
   // Wait for the install to fail
   Services.obs.addObserver(function() {
     Services.obs.removeObserver(arguments.callee, "addon-install-failed");
 
     // Wait for the browser code to add the failure notification
@@ -698,18 +699,20 @@ function test_localfile() {
 
   var cr = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
                      .getService(Components.interfaces.nsIChromeRegistry);
   try {
     var path = cr.convertChromeURL(makeURI(CHROMEROOT + "corrupt.xpi")).spec;
   } catch (ex) {
     var path = CHROMEROOT + "corrupt.xpi";
   }
-  gBrowser.selectedTab = gBrowser.addTab();
-  gBrowser.loadURI(path);
+  gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(() => {
+    gBrowser.loadURI(path);
+  });
 },
 
 function test_tabclose() {
   if (!Preferences.get("xpinstall.customConfirmationUI", false)) {
     runNextTest();
     return;
   }
 
@@ -727,18 +730,80 @@ function test_tabclose() {
           });
         });
 
         gBrowser.removeTab(gBrowser.selectedTab);
       });
     });
   });
 
+  gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(() => {
+    gBrowser.loadURI(TESTROOT + "unsigned.xpi");
+  });
+},
+
+// Add-ons should be cancelled and the install notification destroyed when
+// navigating to a new origin
+function test_tabnavigate() {
+  if (!Preferences.get("xpinstall.customConfirmationUI", false)) {
+    runNextTest();
+    return;
+  }
+
+  // Wait for the progress notification
+  wait_for_progress_notification(aPanel => {
+    // Wait for the install confirmation dialog
+    wait_for_install_dialog(() => {
+      wait_for_notification_close(() => {
+        AddonManager.getAllInstalls(aInstalls => {
+          is(aInstalls.length, 0, "Should be no pending install");
+
+          Services.perms.remove(makeURI("http://example.com/"), "install");
+          loadPromise.then(() => {
+            gBrowser.removeTab(gBrowser.selectedTab);
+            runNextTest();
+          });
+        });
+      });
+
+      let loadPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+      gBrowser.loadURI("about:blank");
+    });
+  });
+
+  var pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+
+  var triggers = encodeURIComponent(JSON.stringify({
+    "Extension XPI": "unsigned.xpi"
+  }));
   gBrowser.selectedTab = gBrowser.addTab();
-  gBrowser.loadURI(TESTROOT + "unsigned.xpi");
+  gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
+},
+
+function test_urlbar() {
+  wait_for_notification("addon-install-origin-blocked", function(aPanel) {
+    let notification = aPanel.childNodes[0];
+
+    is(notification.button.label, "", "Button to allow install should be hidden.");
+
+    wait_for_notification_close(() => {
+      runNextTest();
+    });
+
+    gBrowser.removeCurrentTab();
+  });
+
+  gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(() => {
+    gURLBar.value = TESTROOT + "unsigned.xpi";
+    gURLBar.focus();
+    EventUtils.synthesizeKey("VK_RETURN", {});
+  });
 },
 
 function test_wronghost() {
   gBrowser.selectedTab = gBrowser.addTab();
   gBrowser.addEventListener("load", function() {
     if (gBrowser.currentURI.spec != TESTROOT2 + "enabled.html")
       return;
 
@@ -865,22 +930,26 @@ function test_renotify_blocked() {
   wait_for_notification("addon-install-blocked", function(aPanel) {
     let notification = aPanel.childNodes[0];
 
     wait_for_notification_close(function () {
       info("Timeouts after this probably mean bug 589954 regressed");
       executeSoon(function () {
         wait_for_notification("addon-install-blocked", function(aPanel) {
           AddonManager.getAllInstalls(function(aInstalls) {
-          is(aInstalls.length, 2, "Should be two pending installs");
-            aInstalls[0].cancel();
-            aInstalls[1].cancel();
+            is(aInstalls.length, 2, "Should be two pending installs");
+
+            wait_for_notification_close(() => {
+              AddonManager.getAllInstalls(function(aInstalls) {
+                is(aInstalls.length, 0, "Should have cancelled the installs");
+                runNextTest();
+              });
+            });
 
             info("Closing browser tab");
-            wait_for_notification_close(runNextTest);
             gBrowser.removeTab(gBrowser.selectedTab);
           });
         });
 
         gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
       });
     });
 
--- a/browser/base/content/test/general/browser_bug822367.js
+++ b/browser/base/content/test/general/browser_bug822367.js
@@ -5,38 +5,33 @@
 
 const PREF_DISPLAY = "security.mixed_content.block_display_content";
 const PREF_ACTIVE = "security.mixed_content.block_active_content";
 
 // We alternate for even and odd test cases to simulate different hosts
 const gHttpTestRoot = "https://example.com/browser/browser/base/content/test/general/";
 const gHttpTestRoot2 = "https://test1.example.com/browser/browser/base/content/test/general/";
 
-var origBlockDisplay;
-var origBlockActive;
 var gTestBrowser = null;
 
 registerCleanupFunction(function() {
   // Set preferences back to their original values
-  Services.prefs.setBoolPref(PREF_DISPLAY, origBlockDisplay);
-  Services.prefs.setBoolPref(PREF_ACTIVE, origBlockActive);
+  Services.prefs.clearUserPref(PREF_DISPLAY);
+  Services.prefs.clearUserPref(PREF_ACTIVE);
 });
 
 function MixedTestsCompleted() {
   gBrowser.removeCurrentTab();
   window.focus();
   finish();
 }
 
 function test() {
   waitForExplicitFinish();
 
-  origBlockDisplay = Services.prefs.getBoolPref(PREF_DISPLAY);
-  origBlockActive = Services.prefs.getBoolPref(PREF_ACTIVE);
-
   Services.prefs.setBoolPref(PREF_DISPLAY, true);
   Services.prefs.setBoolPref(PREF_ACTIVE, true);
 
   var newTab = gBrowser.addTab();
   gBrowser.selectedTab = newTab;
   gTestBrowser = gBrowser.selectedBrowser;
   newTab.linkedBrowser.stop()
 
--- a/browser/base/content/test/general/browser_fullscreen-window-open.js
+++ b/browser/base/content/test/general/browser_fullscreen-window-open.js
@@ -327,17 +327,17 @@ WindowListener.prototype = {
   callback_onSuccess: null,
   callBack_onFinalize: null,
 
   onOpenWindow: function(aXULWindow) {
     Services.wm.removeListener(this);
 
     let domwindow = aXULWindow.QueryInterface(Ci.nsIInterfaceRequestor)
                     .getInterface(Ci.nsIDOMWindow);
-    domwindow.addEventListener("load", function onLoad(aEvent) {
+    let onLoad = aEvent => {
       is(domwindow.document.location.href, this.test_url,
         "Opened Window is expected: "+ this.test_title);
       if (this.callback_onSuccess) {
         this.callback_onSuccess();
       }
 
       domwindow.removeEventListener("load", onLoad, true);
 
@@ -347,15 +347,16 @@ WindowListener.prototype = {
           domwindow.close();
           executeSoon(this.callBack_onFinalize);
         }.bind(this), 3000);
       }
       else {
         domwindow.close();
         executeSoon(this.callBack_onFinalize);
       }
-    }.bind(this), true);
+    };
+    domwindow.addEventListener("load", onLoad, true);
   },
   onCloseWindow: function(aXULWindow) {},
   onWindowTitleChange: function(aXULWindow, aNewTitle) {},
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIWindowMediatorListener,
                                          Ci.nsISupports]),
 };
--- a/browser/base/content/test/general/browser_fxaccounts.js
+++ b/browser/base/content/test/general/browser_fxaccounts.js
@@ -79,19 +79,19 @@ add_task(function* test_nouser() {
   // Check the world - the FxA footer area is visible as it is offering a signin.
   Assert.ok(isFooterVisible())
 
   Assert.equal(panelUILabel.getAttribute("label"), panelUIStatus.getAttribute("defaultlabel"));
   Assert.ok(!panelUIStatus.hasAttribute("tooltiptext"), "no tooltip when signed out");
   Assert.ok(!panelUIFooter.hasAttribute("fxastatus"), "no fxsstatus when signed out");
   Assert.ok(!panelUIFooter.hasAttribute("fxaprofileimage"), "no fxaprofileimage when signed out");
 
-  let promiseOpen = promiseTabOpen("about:accounts?entryPoint=menupanel");
+  let promisePreferencesOpened = promiseObserver("test:browser_fxaccounts:openPreferences");
   panelUIStatus.click();
-  yield promiseOpen;
+  yield promisePreferencesOpened;
 });
 
 /*
 XXX - Bug 1191162 - need a better hawk mock story or this will leak in debug builds.
 
 add_task(function* test_unverifiedUser() {
   let promiseUpdateDone = promiseObserver("test:browser_fxaccounts:updateAppMenuItem");
   yield setSignedInUser(false); // this will fire the observer that does the update.
--- a/browser/base/content/test/general/browser_mixedContentFramesOnHttp.js
+++ b/browser/base/content/test/general/browser_mixedContentFramesOnHttp.js
@@ -35,16 +35,17 @@ function SecStateTests() {
   whenLoaded(gTestBrowser, SecStateTest1);
   gTestBrowser.contentWindow.location = url;
 }
 
 // The http page loads an https frame with an http image.
 function SecStateTest1() {
   // check security state is insecure
   isSecurityState("insecure");
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: false, passiveLoaded: true});
 
   SecStateTestsCompleted();
 }
 
 function whenLoaded(aElement, aCallback) {
   aElement.addEventListener("load", function onLoad() {
     aElement.removeEventListener("load", onLoad, true);
     executeSoon(aCallback);
--- a/browser/base/content/test/general/browser_mixedContentFromOnunload.js
+++ b/browser/base/content/test/general/browser_mixedContentFromOnunload.js
@@ -43,34 +43,36 @@ function SecStateTest1A() {
   let url = gHttpsTestRoot1 + "file_mixedContentFromOnunload_test1.html";
   gTestBrowser.contentWindow.location = url;
 }
 
 function SecStateTest1B() {
   // check security state.  Since current url is https and doesn't have any
   // mixed content resources, we expect it to be secure.
   isSecurityState("secure");
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: false, passiveLoaded: false});
 
   whenLoaded(gTestBrowser, SecStateTest2A);
 
   // change locations and proceed with the second test
   let url = gHttpTestRoot2 + "file_mixedContentFromOnunload.html";
   gTestBrowser.contentWindow.location = url;
 }
 
 // Navigation from an http page to a https page that has mixed display content
-// The http page loads an http image on unload
+// The https page loads an http image on unload
 function SecStateTest2A() {
   whenLoaded(gTestBrowser, SecStateTest2B);
   let url = gHttpsTestRoot2 + "file_mixedContentFromOnunload_test2.html";
   gTestBrowser.contentWindow.location = url;
 }
 
 function SecStateTest2B() {
   isSecurityState("broken");
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: false, passiveLoaded: true});
 
   SecStateTestsCompleted();
 }
 
 function whenLoaded(aElement, aCallback) {
   aElement.addEventListener("load", function onLoad() {
     aElement.removeEventListener("load", onLoad, true);
     executeSoon(aCallback);
--- a/browser/base/content/test/general/browser_mixedcontent_securityflags.js
+++ b/browser/base/content/test/general/browser_mixedcontent_securityflags.js
@@ -1,65 +1,65 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-// The test loads a web page with mixed active and display content
-// on it while the "block mixed content" settings are _on_.
-// It then checks that the mixed content flags have been set correctly.
-// The test then overrides the MCB settings and checks that the flags
-// have been set correctly again.
-// Bug 838396 - Not setting hasMixedDisplayContentLoaded and
-// hasMixedDisplayContentBlocked flag in nsMixedContentBlocker.cpp
+// The test loads a web page with mixed active and mixed display content and
+// makes sure that the mixed content flags on the docshell are set correctly.
+// * Using default about:config prefs (mixed active blocked, mixed display
+//   loaded) we load the page and check the flags.
+// * We change the about:config prefs (mixed active blocked, mixed display
+//   blocked), reload the page, and check the flags again.
+// * We override protection so all mixed content can load and check the
+//   flags again.
 
 const TEST_URI = "https://example.com/browser/browser/base/content/test/general/test-mixedcontent-securityerrors.html";
+const PREF_DISPLAY = "security.mixed_content.block_display_content";
+const PREF_ACTIVE = "security.mixed_content.block_active_content";
 let gTestBrowser = null;
+waitForExplicitFinish();
 
-function test()
-{
-  waitForExplicitFinish();
-  SpecialPowers.pushPrefEnv({"set": [["security.mixed_content.block_active_content", true],
-                            ["security.mixed_content.block_display_content", true]]}, blockMixedContentTest);
-}
+registerCleanupFunction(function() {
+  // Set preferences back to their original values
+  Services.prefs.clearUserPref(PREF_DISPLAY);
+  Services.prefs.clearUserPref(PREF_ACTIVE);
+  gBrowser.removeCurrentTab();
+});
 
-function blockMixedContentTest()
-{
-  gBrowser.selectedTab = gBrowser.addTab(TEST_URI);
-  let tab = gBrowser.selectedTab;
+add_task(function* blockMixedActiveContentTest() {
+  // Turn on mixed active blocking and mixed display loading and load the page.
+  Services.prefs.setBoolPref(PREF_DISPLAY, false);
+  Services.prefs.setBoolPref(PREF_ACTIVE, true);
+
+  let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_URI);
   gTestBrowser = gBrowser.getBrowserForTab(tab);
 
-  gTestBrowser.addEventListener("load", function onLoad(aEvent) {
-    gTestBrowser.removeEventListener(aEvent.type, onLoad, true);
-    is(gTestBrowser.docShell.hasMixedDisplayContentBlocked, true, "hasMixedDisplayContentBlocked flag has been set");
-    is(gTestBrowser.docShell.hasMixedActiveContentBlocked, true, "hasMixedActiveContentBlocked flag has been set");
-    is(gTestBrowser.docShell.hasMixedDisplayContentLoaded, false, "hasMixedDisplayContentLoaded flag has been set");
-    is(gTestBrowser.docShell.hasMixedActiveContentLoaded, false, "hasMixedActiveContentLoaded flag has been set");
-    overrideMCB();
-  }, true);
-}
+  is(gTestBrowser.docShell.hasMixedDisplayContentBlocked, false, "hasMixedDisplayContentBlocked flag has been set");
+  is(gTestBrowser.docShell.hasMixedActiveContentBlocked, true, "hasMixedActiveContentBlocked flag has been set");
+  is(gTestBrowser.docShell.hasMixedDisplayContentLoaded, true, "hasMixedDisplayContentLoaded flag has been set");
+  is(gTestBrowser.docShell.hasMixedActiveContentLoaded, false, "hasMixedActiveContentLoaded flag has been set");
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: true});
+
+  // Turn on mixed active and mixed display blocking and reload the page.
+  Services.prefs.setBoolPref(PREF_DISPLAY, true);
+  Services.prefs.setBoolPref(PREF_ACTIVE, true);
 
-function overrideMCB()
-{
-  // test mixed content flags on load (reload)
-  gTestBrowser.addEventListener("load", mixedContentOverrideTest, true);
+  gBrowser.reload();
+  yield BrowserTestUtils.browserLoaded(gTestBrowser);
 
+  is(gTestBrowser.docShell.hasMixedDisplayContentBlocked, true, "hasMixedDisplayContentBlocked flag has been set");
+  is(gTestBrowser.docShell.hasMixedActiveContentBlocked, true, "hasMixedActiveContentBlocked flag has been set");
+  is(gTestBrowser.docShell.hasMixedDisplayContentLoaded, false, "hasMixedDisplayContentLoaded flag has been set");
+  is(gTestBrowser.docShell.hasMixedActiveContentLoaded, false, "hasMixedActiveContentLoaded flag has been set");
   assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
+});
 
-  // Click on the doorhanger to allow mixed content (and reload page)
+add_task(function* overrideMCB() {
+  // Disable mixed content blocking (reloads page) and retest
   let {gIdentityHandler} = gTestBrowser.ownerGlobal;
   gIdentityHandler.disableMixedContentProtection();
-
-  notification.remove();
-}
-
-function mixedContentOverrideTest()
-{
-  gTestBrowser.removeEventListener("load", mixedContentOverrideTest, true);
+  yield BrowserTestUtils.browserLoaded(gTestBrowser);
 
   is(gTestBrowser.docShell.hasMixedDisplayContentLoaded, true, "hasMixedDisplayContentLoaded flag has not been set");
   is(gTestBrowser.docShell.hasMixedActiveContentLoaded, true, "hasMixedActiveContentLoaded flag has not been set");
   is(gTestBrowser.docShell.hasMixedDisplayContentBlocked, false, "second hasMixedDisplayContentBlocked flag has been set");
   is(gTestBrowser.docShell.hasMixedActiveContentBlocked, false, "second hasMixedActiveContentBlocked flag has been set");
-
   assertMixedContentBlockingState(gTestBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: true});
-
-  gBrowser.removeCurrentTab();
-  finish();
-}
+});
--- a/browser/base/content/test/general/browser_selectpopup.js
+++ b/browser/base/content/test/general/browser_selectpopup.js
@@ -1,31 +1,33 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // This test checks that a <select> with an <optgroup> opens and can be navigated
 // in a child process. This is different than single-process as a <menulist> is used
 // to implement the dropdown list.
 
+const XHTML_DTD = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">';
+
 const PAGECONTENT =
   "<html xmlns='http://www.w3.org/1999/xhtml'>" + 
   "<body onload='gChangeEvents = 0; document.body.firstChild.focus()'><select onchange='gChangeEvents++'>" +
   "  <optgroup label='First Group'>" +
   "    <option value='One'>One</option>" +
   "    <option value='Two'>Two</option>" +
   "  </optgroup>" +
   "  <option value='Three'>Three</option>" +
   "  <optgroup label='Second Group' disabled='true'>" +
   "    <option value='Four'>Four</option>" +
   "    <option value='Five'>Five</option>" +
   "  </optgroup>" +
   "  <option value='Six' disabled='true'>Six</option>" +
   "  <optgroup label='Third Group'>" +
-  "    <option value='Seven'>Seven</option>" +
-  "    <option value='Eight'>Eight</option>" +
+  "    <option value='Seven'>   Seven  </option>" +
+  "    <option value='Eight'>&nbsp;&nbsp;Eight&nbsp;&nbsp;</option>" +
   "  </optgroup></select><input />" +
   "</body></html>";
 
 function openSelectPopup(selectPopup, withMouse)
 {
   let popupShownPromise = BrowserTestUtils.waitForEvent(selectPopup, "popupshown");
 
   if (withMouse) {
@@ -53,21 +55,21 @@ function hideSelectPopup(selectPopup, wi
 
 function getChangeEvents()
 {
   return ContentTask.spawn(gBrowser.selectedBrowser, {}, function() {
     return content.wrappedJSObject.gChangeEvents;
   });
 }
 
-function doSelectTests(contentType)
+function doSelectTests(contentType, dtd)
 {
   let tab = gBrowser.selectedTab = gBrowser.addTab();
   let browser = gBrowser.getBrowserForTab(tab);
-  yield promiseTabLoadEvent(tab, "data:" + contentType + "," + escape(PAGECONTENT));
+  yield promiseTabLoadEvent(tab, "data:" + contentType + "," + escape(dtd + "\n" + PAGECONTENT));
 
   yield SimpleTest.promiseFocus(browser.contentWindow);
 
   let menulist = document.getElementById("ContentSelectDropdown");
   let selectPopup = menulist.menupopup;
 
   yield openSelectPopup(selectPopup);
 
@@ -122,20 +124,22 @@ function doSelectTests(contentType)
   yield openSelectPopup(selectPopup, true);
   EventUtils.synthesizeKey("KEY_ArrowDown", { code: "ArrowDown" });
   yield hideSelectPopup(selectPopup, true);
   is((yield getChangeEvents()), isWindows ? 2 : 1, "Open and close with change - number of change events");
   EventUtils.synthesizeKey("VK_TAB", { });
   EventUtils.synthesizeKey("VK_TAB", { shiftKey: true });
   is((yield getChangeEvents()), isWindows ? 2 : 1, "Tab away from select with change - number of change events");
 
+  is(selectPopup.lastChild.previousSibling.label, "Seven", "Spaces collapsed");
+  is(selectPopup.lastChild.label, "\xA0\xA0Eight\xA0\xA0", "Non-breaking spaces not collapsed");
+
   gBrowser.removeCurrentTab();
 }
 
 add_task(function*() {
-  yield doSelectTests("text/html");
+  yield doSelectTests("text/html", "");
 });
 
 add_task(function*() {
-  yield doSelectTests("application/xhtml+xml");
+  yield doSelectTests("application/xhtml+xml", XHTML_DTD);
 });
 
-
--- a/browser/base/content/test/general/browser_urlbarSearchSuggestionsNotification.js
+++ b/browser/base/content/test/general/browser_urlbarSearchSuggestionsNotification.js
@@ -125,16 +125,28 @@ add_task(function* enable() {
   assertSuggestionsPresent(true);
   gURLBar.blur();
   gURLBar.focus();
   // Suggestions should still be present in a new search of course.
   yield promiseAutocompleteResultPopup("bar");
   assertSuggestionsPresent(true);
 });
 
+add_task(function* privateWindow() {
+  // Since suggestions are disabled in private windows, the notification should
+  // not appear even when suggestions are otherwise enabled.
+  let win = yield BrowserTestUtils.openNewBrowserWindow({ private: true });
+  win.gURLBar.blur();
+  win.gURLBar.focus();
+  yield promiseAutocompleteResultPopup("foo", win);
+  assertVisible(false, win);
+  win.gURLBar.blur();
+  yield BrowserTestUtils.closeWindow(win);
+});
+
 function assertSuggestionsPresent(expectedPresent) {
   let controller = gURLBar.popup.input.controller;
   let matchCount = controller.matchCount;
   let actualPresent = false;
   for (let i = 0; i < matchCount; i++) {
     let url = controller.getValueAt(i);
     let [, type, paramStr] = url.match(/^moz-action:([^,]+),(.*)$/);
     let params = {};
@@ -142,19 +154,19 @@ function assertSuggestionsPresent(expect
       params = JSON.parse(paramStr);
     } catch (err) {}
     let isSuggestion = type == "searchengine" && "searchSuggestion" in params;
     actualPresent = actualPresent || isSuggestion;
   }
   Assert.equal(actualPresent, expectedPresent);
 }
 
-function assertVisible(visible) {
+function assertVisible(visible, win=window) {
   let style =
-    window.getComputedStyle(gURLBar.popup.searchSuggestionsNotification);
+    win.getComputedStyle(win.gURLBar.popup.searchSuggestionsNotification);
   Assert.equal(style.visibility, visible ? "visible" : "collapse");
 }
 
 function promiseTransition() {
   return new Promise(resolve => {
     gURLBar.popup.addEventListener("transitionend", function onEnd() {
       gURLBar.popup.removeEventListener("transitionend", onEnd, true);
       // The urlbar needs to handle the transitionend first, but that happens
--- a/browser/base/content/test/general/head.js
+++ b/browser/base/content/test/general/head.js
@@ -553,18 +553,18 @@ let FullZoomHelper = {
 
   BACK: 0,
   FORWARD: 1,
   navigate: function navigate(direction) {
     return new Promise(resolve => {
       let didPs = false;
       let didZoom = false;
 
-      gBrowser.addEventListener("pageshow", function (event) {
-        gBrowser.removeEventListener("pageshow", arguments.callee, true);
+      gBrowser.addEventListener("pageshow", function listener(event) {
+        gBrowser.removeEventListener("pageshow", listener, true);
         didPs = true;
         if (didZoom)
           resolve();
       }, true);
 
       if (direction == this.BACK)
         gBrowser.goBack();
       else if (direction == this.FORWARD)
@@ -713,19 +713,19 @@ function assertWebRTCIndicatorStatus(exp
     is(menu && !menu.hidden, !!expected, "WebRTC menu should be " + expectedState);
   }
 
   if (!("nsISystemStatusBar" in Ci)) {
     if (!expected) {
       let win = Services.wm.getMostRecentWindow("Browser:WebRTCGlobalIndicator");
       if (win) {
         yield new Promise((resolve, reject) => {
-          win.addEventListener("unload", (e) => {
+          win.addEventListener("unload", function listener(e) {
             if (e.target == win.document) {
-              win.removeEventListener("unload", arguments.callee);
+              win.removeEventListener("unload", listener);
               resolve();
             }
           }, false);
         });
       }
     }
     let indicator = Services.wm.getEnumerator("Browser:WebRTCGlobalIndicator");
     let hasWindow = indicator.hasMoreElements();
@@ -777,49 +777,135 @@ function assertMixedContentBlockingState
     throw new Error("assertMixedContentBlockingState requires a browser and a states object");
   }
 
   let {passiveLoaded,activeLoaded,activeBlocked} = states;
   let {gIdentityHandler} = tabbrowser.ownerGlobal;
   let doc = tabbrowser.ownerDocument;
   let identityBox = gIdentityHandler._identityBox;
   let classList = identityBox.classList;
+  let identityBoxImage = tabbrowser.ownerGlobal.getComputedStyle(doc.getElementById("page-proxy-favicon"), "").
+                         getPropertyValue("list-style-image");
 
-  // Make sure the identity box UI has the correct mixedcontent states
-  is(classList.contains("mixedActiveContent"), activeLoaded,
-      "identityBox has expected class for activeLoaded");
-  is(classList.contains("mixedActiveBlocked"), activeBlocked && !passiveLoaded,
-      "identityBox has expected class for activeBlocked && !passiveLoaded");
-  is(classList.contains("mixedDisplayContent"), passiveLoaded && !activeLoaded,
-     "identityBox has expected class for passiveLoaded && activeLoaded");
-  is(classList.contains("mixedDisplayContentLoadedActiveBlocked"), passiveLoaded && activeBlocked,
-     "identityBox has expected class for passiveLoaded && activeBlocked");
-  is (classList.contains("mixedContent"), activeBlocked || activeLoaded || passiveLoaded,
-     "identityBox is showing no mixed content");
+  let stateSecure = gIdentityHandler._state & Ci.nsIWebProgressListener.STATE_IS_SECURE;
+  let stateBroken = gIdentityHandler._state & Ci.nsIWebProgressListener.STATE_IS_BROKEN;
+  let stateInsecure = gIdentityHandler._state & Ci.nsIWebProgressListener.STATE_IS_INSECURE;
+  let stateActiveBlocked = gIdentityHandler._state & Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT;
+  let stateActiveLoaded = gIdentityHandler._state & Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT;
+  let statePassiveLoaded = gIdentityHandler._state & Ci.nsIWebProgressListener.STATE_LOADED_MIXED_DISPLAY_CONTENT;
+
+  is(activeBlocked, !!stateActiveBlocked, "Expected state for activeBlocked matches UI state");
+  is(activeLoaded, !!stateActiveLoaded, "Expected state for activeLoaded matches UI state");
+  is(passiveLoaded, !!statePassiveLoaded, "Expected state for passiveLoaded matches UI state");
+
+  if (stateInsecure) {
+    // HTTP request, there should be no MCB classes for the identity box and the non secure icon
+    // should always be visible regardless of MCB state.
+    ok(classList.contains("unknownIdentity"), "unknownIdentity on HTTP page");
+    is(identityBoxImage, "url(\"chrome://browser/skin/identity-not-secure.svg\")", "Using 'non-secure' icon");
+
+    ok(!classList.contains("mixedActiveContent"), "No MCB icon on HTTP page");
+    ok(!classList.contains("mixedActiveBlocked"), "No MCB icon on HTTP page");
+    ok(!classList.contains("mixedDisplayContent"), "No MCB icon on HTTP page");
+    ok(!classList.contains("mixedDisplayContentLoadedActiveBlocked"), "No MCB icon on HTTP page");
+    ok(!classList.contains("mixedContent"), "No MCB icon on HTTP page");
+  } else {
+    // Make sure the identity box UI has the correct mixedcontent states and icons
+    is(classList.contains("mixedActiveContent"), activeLoaded,
+        "identityBox has expected class for activeLoaded");
+    is(classList.contains("mixedActiveBlocked"), activeBlocked && !passiveLoaded,
+        "identityBox has expected class for activeBlocked && !passiveLoaded");
+    is(classList.contains("mixedDisplayContent"), passiveLoaded && !(activeLoaded || activeBlocked),
+       "identityBox has expected class for passiveLoaded && !(activeLoaded || activeBlocked)");
+    is(classList.contains("mixedDisplayContentLoadedActiveBlocked"), passiveLoaded && activeBlocked,
+       "identityBox has expected class for passiveLoaded && activeBlocked");
+    is (classList.contains("mixedContent"), activeBlocked || activeLoaded || passiveLoaded,
+       "identityBox has expected class for mixed content");
+
+    if (activeLoaded) {
+      is(identityBoxImage, "url(\"chrome://browser/skin/identity-mixed-active-loaded.svg\")",
+        "Using active loaded icon");
+    }
+    if (activeBlocked && !passiveLoaded) {
+      is(identityBoxImage, "url(\"chrome://browser/skin/identity-mixed-active-blocked.svg\")",
+        "Using active blocked icon");
+    }
+    if (passiveLoaded && !(activeLoaded || activeBlocked)) {
+      is(identityBoxImage, "url(\"chrome://browser/skin/identity-mixed-passive-loaded.svg\")",
+        "Using passive loaded icon");
+    }
+    if (passiveLoaded && activeBlocked) {
+      is(identityBoxImage, "url(\"chrome://browser/skin/identity-mixed-passive-loaded.svg\")",
+        "Using active blocked and passive loaded icon");
+    }
+  }
 
   // Make sure the identity popup has the correct mixedcontent states
   gIdentityHandler._identityBox.click();
   let popupAttr = doc.getElementById("identity-popup").getAttribute("mixedcontent");
   let bodyAttr = doc.getElementById("identity-popup-securityView-body").getAttribute("mixedcontent");
 
-  is(popupAttr.contains("active-loaded"), activeLoaded,
+  is(popupAttr.includes("active-loaded"), activeLoaded,
       "identity-popup has expected attr for activeLoaded");
-  is(bodyAttr.contains("active-loaded"), activeLoaded,
+  is(bodyAttr.includes("active-loaded"), activeLoaded,
       "securityView-body has expected attr for activeLoaded");
 
-  is(popupAttr.contains("active-blocked"), activeBlocked,
+  is(popupAttr.includes("active-blocked"), activeBlocked,
       "identity-popup has expected attr for activeBlocked");
-  is(bodyAttr.contains("active-blocked"), activeBlocked,
+  is(bodyAttr.includes("active-blocked"), activeBlocked,
       "securityView-body has expected attr for activeBlocked");
 
-  is(popupAttr.contains("passive-loaded"), passiveLoaded,
+  is(popupAttr.includes("passive-loaded"), passiveLoaded,
       "identity-popup has expected attr for passiveLoaded");
-  is(bodyAttr.contains("passive-loaded"), passiveLoaded,
+  is(bodyAttr.includes("passive-loaded"), passiveLoaded,
       "securityView-body has expected attr for passiveLoaded");
 
+  // Make sure the correct icon is visible in the Control Center.
+  // This logic is controlled with CSS, so this helps prevent regressions there.
+  let securityView = doc.getElementById("identity-popup-securityView");
+  let securityContent = doc.getElementById("identity-popup-security-content");
+  let securityViewBG = tabbrowser.ownerGlobal.getComputedStyle(securityView, "").
+                       getPropertyValue("background-image");
+  let securityContentBG = tabbrowser.ownerGlobal.getComputedStyle(securityView, "").
+                          getPropertyValue("background-image");
+
+  if (stateInsecure) {
+    is(securityViewBG, "url(\"chrome://browser/skin/controlcenter/conn-not-secure.svg\")",
+      "CC using 'not secure' icon");
+    is(securityContentBG, "url(\"chrome://browser/skin/controlcenter/conn-not-secure.svg\")",
+      "CC using 'not secure' icon");
+  }
+
+  if (stateSecure) {
+    is(securityViewBG, "url(\"chrome://browser/skin/controlcenter/conn-secure.svg\")",
+      "CC using secure icon");
+    is(securityContentBG, "url(\"chrome://browser/skin/controlcenter/conn-secure.svg\")",
+      "CC using secure icon");
+  }
+
+  if (stateBroken) {
+    if (activeLoaded) {
+      is(securityViewBG, "url(\"chrome://browser/skin/controlcenter/mcb-disabled.svg\")",
+        "CC using active loaded icon");
+      is(securityContentBG, "url(\"chrome://browser/skin/controlcenter/mcb-disabled.svg\")",
+        "CC using active loaded icon");
+    } else if (activeBlocked || passiveLoaded) {
+      is(securityViewBG, "url(\"chrome://browser/skin/controlcenter/conn-degraded.svg\")",
+        "CC using degraded icon");
+      is(securityContentBG, "url(\"chrome://browser/skin/controlcenter/conn-degraded.svg\")",
+        "CC using degraded icon");
+    } else {
+      // There is a case here with weak ciphers, but no bc tests are handling this yet.
+      is(securityViewBG, "url(\"chrome://browser/skin/controlcenter/conn-degraded.svg\")",
+        "CC using degraded icon");
+      is(securityContentBG, "url(\"chrome://browser/skin/controlcenter/conn-degraded.svg\")",
+        "CC using degraded icon");
+    }
+  }
+
   gIdentityHandler._identityPopup.hidden = true;
 }
 
 function makeActionURI(action, params) {
   let url = "moz-action:" + action + "," + JSON.stringify(params);
   return NetUtil.newURI(url);
 }
 
--- a/browser/base/content/test/newtab/browser_newtab_bug991111.js
+++ b/browser/base/content/test/newtab/browser_newtab_bug991111.js
@@ -1,19 +1,26 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+const PREF_NEWTAB_ROWS = "browser.newtabpage.rows";
+
 function runTests() {
+  // set max rows to 1, to avoid scroll events by clicking middle button
+  Services.prefs.setIntPref(PREF_NEWTAB_ROWS, 1);
   yield setLinks("-1");
   yield addNewTabPageTab();
+  // we need a second newtab to honor max rows
+  yield addNewTabPageTab();
 
   // Remember if the click handler was triggered
   let cell = getCell(0);
   let clicked = false;
   cell.site.onClick = e => {
     clicked = true;
     executeSoon(TestRunner.next);
   };
 
   // Send a middle-click and make sure it happened
   yield EventUtils.synthesizeMouseAtCenter(cell.node, {button: 1}, getContentWindow());
   ok(clicked, "middle click triggered click listener");
+  Services.prefs.clearUserPref(PREF_NEWTAB_ROWS);
 }
--- a/browser/base/content/test/newtab/browser_newtab_bug998387.js
+++ b/browser/base/content/test/newtab/browser_newtab_bug998387.js
@@ -1,14 +1,20 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+const PREF_NEWTAB_ROWS = "browser.newtabpage.rows";
+
 function runTests() {
+  // set max rows to 1, to avoid scroll events by clicking middle button
+  Services.prefs.setIntPref(PREF_NEWTAB_ROWS, 1);
   yield setLinks("0");
   yield addNewTabPageTab();
+  // we need a second newtab to honor max rows
+  yield addNewTabPageTab();
 
   // Remember if the click handler was triggered
   let {site} = getCell(0);
   let origOnClick = site.onClick;
   let clicked = false;
   site.onClick = e => {
     origOnClick.call(site, e);
     clicked = true;
@@ -17,9 +23,10 @@ function runTests() {
 
   // Send a middle-click and make sure it happened
   let block = getContentDocument().querySelector(".newtab-control-block");
   yield EventUtils.synthesizeMouseAtCenter(block, {button: 1}, getContentWindow());
   ok(clicked, "middle click triggered click listener");
 
   // Make sure the cell didn't actually get blocked
   checkGrid("0");
+  Services.prefs.clearUserPref(PREF_NEWTAB_ROWS);
 }
--- a/browser/base/content/test/newtab/browser_newtab_focus.js
+++ b/browser/base/content/test/newtab/browser_newtab_focus.js
@@ -5,17 +5,18 @@
  * These tests make sure that focusing the 'New Tage Page' works as expected.
  */
 function runTests() {
   // Handle the OSX full keyboard access setting
   Services.prefs.setIntPref("accessibility.tabfocus", 7);
 
   // Focus count in new tab page.
   // 30 = 9 * 3 + 3 = 9 sites, each with link, pin and remove buttons; search
-  // bar; search button; and toggle button.
+  // bar; search button; and toggle button. Additionaly there may or may not be
+  // a scroll bar caused by fix to 1180387, which will eat an extra focus
   let FOCUS_COUNT = 30;
 
   // Create a new tab page.
   yield setLinks("0,1,2,3,4,5,6,7,8");
   setPinnedLinks("");
 
   yield addNewTabPageTab();
   gURLBar.focus();
@@ -37,17 +38,19 @@ function runTests() {
 function countFocus(aExpectedCount) {
   let focusCount = 0;
   let contentDoc = getContentDocument();
 
   window.addEventListener("focus", function onFocus() {
     let focusedElement = document.commandDispatcher.focusedElement;
     if (focusedElement && focusedElement.classList.contains("urlbar-input")) {
       window.removeEventListener("focus", onFocus, true);
-      is(focusCount, aExpectedCount, "Validate focus count in the new tab page.");
+      // account for a potential presence of a scroll bar
+      ok(focusCount == aExpectedCount || focusCount == (aExpectedCount + 1),
+         "Validate focus count in the new tab page.");
       executeSoon(TestRunner.next);
     } else {
       if (focusedElement && focusedElement.ownerDocument == contentDoc &&
           focusedElement instanceof HTMLElement) {
         focusCount++;
       }
       document.commandDispatcher.advanceFocus();
     }
--- a/browser/base/content/test/newtab/head.js
+++ b/browser/base/content/test/newtab/head.js
@@ -582,17 +582,18 @@ function createExternalDropIframe() {
   let doc = getContentDocument();
   let iframe = doc.createElement("iframe");
   iframe.setAttribute("src", url);
   iframe.style.width = "50px";
   iframe.style.height = "50px";
   iframe.style.position = "absolute";
   iframe.style.zIndex = 50;
 
-  let margin = doc.getElementById("newtab-margin-top");
+  // the frame has to be attached to a visible element
+  let margin = doc.getElementById("newtab-search-container");
   margin.appendChild(iframe);
 
   iframe.addEventListener("load", function onLoad() {
     iframe.removeEventListener("load", onLoad);
     executeSoon(() => deferred.resolve(iframe));
   });
 
   return deferred.promise;
--- a/browser/base/content/test/plugins/browser.ini
+++ b/browser/base/content/test/plugins/browser.ini
@@ -29,17 +29,16 @@ support-files =
   plugin_overlayed.html
   plugin_positioned.html
   plugin_small.html
   plugin_small_2.html
   plugin_syncRemoved.html
   plugin_test.html
   plugin_test2.html
   plugin_test3.html
-  plugin_test_w_src.html
   plugin_two_types.html
   plugin_unknown.html
   plugin_crashCommentAndURL.html
   plugin_zoom.html
 
 [browser_bug743421.js]
 [browser_bug744745.js]
 [browser_bug787619.js]
@@ -71,17 +70,11 @@ skip-if = (os == 'win' && os_version == 
 [browser_plugin_reloading.js]
 [browser_blocklist_content.js]
 skip-if = !e10s
 [browser_globalplugin_crashinfobar.js]
 skip-if = !crashreporter
 [browser_pluginCrashCommentAndURL.js]
 skip-if = !crashreporter
 [browser_pageInfo_plugins.js]
-[browser_pluginplaypreview.js]
-skip-if = e10s # bug 1148827
-[browser_pluginplaypreview2.js]
-skip-if = e10s # bug 1148827
-[browser_pluginplaypreview3.js]
-skip-if = e10s # bug 1148827
 [browser_pluginCrashReportNonDeterminism.js]
 skip-if = !crashreporter || os == 'linux' # Bug 1152811
 
deleted file mode 100644
--- a/browser/base/content/test/plugins/browser_pluginplaypreview.js
+++ /dev/null
@@ -1,317 +0,0 @@
-var rootDir = getRootDirectory(gTestPath);
-const gTestRoot = rootDir;
-
-var gTestBrowser = null;
-var gNextTest = null;
-var gNextTestSkip = 0;
-var gPlayPreviewPluginActualEvents = 0;
-var gPlayPreviewPluginExpectedEvents = 1;
-
-var gPlayPreviewRegistration = null;
-
-function registerPlayPreview(mimeType, targetUrl) {
-
-  function StreamConverterFactory() {}
-  StreamConverterFactory.prototype = {
-    QueryInterface: XPCOMUtils.generateQI([Ci.nsIFactory]),
-    _targetConstructor: null,
-
-    register: function register(targetConstructor) {
-      this._targetConstructor = targetConstructor;
-      var proto = targetConstructor.prototype;
-      var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
-      registrar.registerFactory(proto.classID, proto.classDescription,
-                                proto.contractID, this);
-    },
-
-    unregister: function unregister() {
-      var proto = this._targetConstructor.prototype;
-      var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
-      registrar.unregisterFactory(proto.classID, this);
-      this._targetConstructor = null;
-    },
-
-    // nsIFactory
-    createInstance: function createInstance(aOuter, iid) {
-      if (aOuter !== null)
-        throw Cr.NS_ERROR_NO_AGGREGATION;
-      return (new (this._targetConstructor)).QueryInterface(iid);
-    },
-
-    // nsIFactory
-    lockFactory: function lockFactory(lock) {
-      // No longer used as of gecko 1.7.
-      throw Cr.NS_ERROR_NOT_IMPLEMENTED;
-    }
-  };
-
-  function OverlayStreamConverter() {}
-  OverlayStreamConverter.prototype = {
-    QueryInterface: XPCOMUtils.generateQI([
-        Ci.nsISupports,
-        Ci.nsIStreamConverter,
-        Ci.nsIStreamListener,
-        Ci.nsIRequestObserver
-    ]),
-
-    classID: Components.ID('{4c6030f7-e20a-264f-0f9b-ada3a9e97384}'),
-    classDescription: 'overlay-test-data Component',
-    contractID: '@mozilla.org/streamconv;1?from=application/x-moz-playpreview&to=*/*',
-
-    // nsIStreamConverter::convert
-    convert: function(aFromStream, aFromType, aToType, aCtxt) {
-      throw Cr.NS_ERROR_NOT_IMPLEMENTED;
-    },
-
-    // nsIStreamConverter::asyncConvertData
-    asyncConvertData: function(aFromType, aToType, aListener, aCtxt) {
-      var isValidRequest = false;
-      try {
-        var request = aCtxt;
-        request.QueryInterface(Ci.nsIChannel);
-        var spec = request.URI.spec;
-        var expectedSpec = 'data:application/x-moz-playpreview;,' + mimeType;
-        isValidRequest = (spec == expectedSpec);
-      } catch (e) { }
-      if (!isValidRequest)
-        throw Cr.NS_ERROR_NOT_IMPLEMENTED;
-
-      // Store the listener passed to us
-      this.listener = aListener;
-    },
-
-    // nsIStreamListener::onDataAvailable
-    onDataAvailable: function(aRequest, aContext, aInputStream, aOffset, aCount) {
-      // Do nothing since all the data loading is handled by the viewer.
-      ok(false, "onDataAvailable should not be called");
-    },
-
-    // nsIRequestObserver::onStartRequest
-    onStartRequest: function(aRequest, aContext) {
-
-      // Setup the request so we can use it below.
-      aRequest.QueryInterface(Ci.nsIChannel);
-      // Cancel the request so the viewer can handle it.
-      aRequest.cancel(Cr.NS_BINDING_ABORTED);
-
-      // Create a new channel that is viewer loaded as a resource.
-      var ioService = Services.io;
-      var channel = ioService.newChannel2(targetUrl,
-                                          null,
-                                          null,
-                                          null,      // aLoadingNode
-                                          Services.scriptSecurityManager.getSystemPrincipal(),
-                                          null,      // aTriggeringPrincipal
-                                          Ci.nsILoadInfo.SEC_NORMAL,
-                                          Ci.nsIContentPolicy.TYPE_OTHER);
-      channel.asyncOpen(this.listener, aContext);
-    },
-
-    // nsIRequestObserver::onStopRequest
-    onStopRequest: function(aRequest, aContext, aStatusCode) {
-      // Do nothing.
-    }
-  };
-
-  var ph = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
-  ph.registerPlayPreviewMimeType(mimeType, true); // ignoring CTP rules
-
-  var factory = new StreamConverterFactory();
-  factory.register(OverlayStreamConverter);
-
-  return (gPlayPreviewRegistration = {
-    unregister: function() {
-      ph.unregisterPlayPreviewMimeType(mimeType);
-      factory.unregister();
-      gPlayPreviewRegistration = null;
-    }
-  });
-}
-
-function unregisterPlayPreview() {
-  gPlayPreviewRegistration.unregister();
-}
-
-Components.utils.import('resource://gre/modules/XPCOMUtils.jsm');
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-
-function test() {
-  waitForExplicitFinish();
-  registerCleanupFunction(function() {
-    if (gPlayPreviewRegistration)
-      gPlayPreviewRegistration.unregister();
-    Services.prefs.clearUserPref("plugins.click_to_play");
-  });
-
-  var newTab = gBrowser.addTab();
-  gBrowser.selectedTab = newTab;
-  gTestBrowser = gBrowser.selectedBrowser;
-  gTestBrowser.addEventListener("load", pageLoad, true);
-  gTestBrowser.addEventListener("PluginBindingAttached", handleBindingAttached, true, true);
-
-  setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED);
-  registerPlayPreview('application/x-test', 'about:');
-  prepareTest(test1a, gTestRoot + "plugin_test.html", 1);
-}
-
-function finishTest() {
-  gTestBrowser.removeEventListener("load", pageLoad, true);
-  gTestBrowser.removeEventListener("PluginBindingAttached", handleBindingAttached, true, true);
-  gBrowser.removeCurrentTab();
-  window.focus();
-  finish();
-}
-
-function handleBindingAttached(evt) {
-  if (evt.target instanceof Ci.nsIObjectLoadingContent &&
-      evt.target.pluginFallbackType == Ci.nsIObjectLoadingContent.PLUGIN_PLAY_PREVIEW)
-    gPlayPreviewPluginActualEvents++;
-}
-
-function pageLoad() {
-  // The plugin events are async dispatched and can come after the load event
-  // This just allows the events to fire before we then go on to test the states
-
-  // iframe might triggers load event as well, making sure we skip some to let
-  // all iframes on the page be loaded as well
-  if (gNextTestSkip) {
-    gNextTestSkip--;
-    return;
-  }
-  executeSoon(gNextTest);
-}
-
-function prepareTest(nextTest, url, skip) {
-  gNextTest = nextTest;
-  gNextTestSkip = skip;
-  gTestBrowser.contentWindow.location = url;
-}
-
-// Tests a page with normal play preview registration (1/2)
-function test1a() {
-  var notificationBox = gBrowser.getNotificationBox(gTestBrowser);
-  ok(!notificationBox.getNotificationWithValue("blocked-plugins"), "Test 1a, Should not have displayed the blocked plugin notification");
-
-  var pluginInfo = getTestPlugin();
-  ok(pluginInfo, "Should have a test plugin");
-
-  var doc = gTestBrowser.contentDocument;
-  var plugin = doc.getElementById("test");
-  var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
-  is(objLoadingContent.pluginFallbackType, Ci.nsIObjectLoadingContent.PLUGIN_PLAY_PREVIEW, "Test 1a, plugin fallback type should be PLUGIN_PLAY_PREVIEW");
-  ok(!objLoadingContent.activated, "Test 1a, Plugin should not be activated");
-
-  var overlay = doc.getAnonymousElementByAttribute(plugin, "class", "previewPluginContent");
-  ok(overlay, "Test 1a, the overlay div is expected");
-
-  var iframe = overlay.getElementsByClassName("previewPluginContentFrame")[0];
-  ok(iframe && iframe.localName == "iframe", "Test 1a, the overlay iframe is expected");
-  var iframeHref = iframe.contentWindow.location.href;
-  ok(iframeHref == "about:", "Test 1a, the overlay about: content is expected");
-
-  var rect = iframe.getBoundingClientRect();
-  ok(rect.width == 200, "Test 1a, Plugin with id=" + plugin.id + " overlay rect should have 200px width before being replaced by actual plugin");
-  ok(rect.height == 200, "Test 1a, Plugin with id=" + plugin.id + " overlay rect should have 200px height before being replaced by actual plugin");
-
-  var e = overlay.ownerDocument.createEvent("CustomEvent");
-  e.initCustomEvent("MozPlayPlugin", true, true, null);
-  overlay.dispatchEvent(e);
-  var condition = function() objLoadingContent.activated;
-  waitForCondition(condition, test1b, "Test 1a, Waited too long for plugin to stop play preview");
-}
-
-// Tests that activating via MozPlayPlugin through the notification works (part 2/2)
-function test1b() {
-  var plugin = gTestBrowser.contentDocument.getElementById("test");
-  var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
-  ok(objLoadingContent.activated, "Test 1b, Plugin should be activated");
-
-  is(gPlayPreviewPluginActualEvents, gPlayPreviewPluginExpectedEvents,
-     "There should be exactly one PluginPlayPreview event");
-
-  unregisterPlayPreview();
-
-  prepareTest(test2, gTestRoot + "plugin_test.html");
-}
-
-// Tests a page with a working plugin in it -- the mime type was just unregistered.
-function test2() {
-  var plugin = gTestBrowser.contentDocument.getElementById("test");
-  var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
-  ok(objLoadingContent.activated, "Test 2, Plugin should be activated");
-
-  registerPlayPreview('application/x-unknown', 'about:');
-
-  prepareTest(test3, gTestRoot + "plugin_test.html");
-}
-
-// Tests a page with a working plugin in it -- diffent play preview type is reserved.
-function test3() {
-  var plugin = gTestBrowser.contentDocument.getElementById("test");
-  var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
-  ok(objLoadingContent.activated, "Test 3, Plugin should be activated");
-
-  unregisterPlayPreview();
-
-  registerPlayPreview('application/x-test', 'about:');
-  Services.prefs.setBoolPref("plugins.click_to_play", true);
-  setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY);
-  prepareTest(test4a, gTestRoot + "plugin_test.html", 1);
-}
-
-// Test a fallback to the click-to-play
-function test4a() {
-  var doc = gTestBrowser.contentDocument;
-  var plugin = doc.getElementById("test");
-  var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
-  is(objLoadingContent.pluginFallbackType, Ci.nsIObjectLoadingContent.PLUGIN_PLAY_PREVIEW, "Test 4a, plugin fallback type should be PLUGIN_PLAY_PREVIEW");
-  ok(!objLoadingContent.activated, "Test 4a, Plugin should not be activated");
-
-  var overlay = doc.getAnonymousElementByAttribute(plugin, "class", "previewPluginContent");
-  ok(overlay, "Test 4a, the overlay div is expected");
-
-  var e = overlay.ownerDocument.createEvent("CustomEvent");
-  e.initCustomEvent("MozPlayPlugin", true, true, true);
-  overlay.dispatchEvent(e);
-  var condition = function() objLoadingContent.pluginFallbackType == Ci.nsIObjectLoadingContent.PLUGIN_CLICK_TO_PLAY;
-  waitForCondition(condition, test4b, "Test 4a, Waited too long for plugin to stop play preview");
-}
-
-function test4b() {
-  var doc = gTestBrowser.contentDocument;
-  var plugin = doc.getElementById("test");
-  var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
-  ok(objLoadingContent.pluginFallbackType != Ci.nsIObjectLoadingContent.PLUGIN_PLAY_PREVIEW, "Test 4b, plugin fallback type should not be PLUGIN_PLAY_PREVIEW");
-  ok(!objLoadingContent.activated, "Test 4b, Plugin should not be activated");
-
-  prepareTest(test5a, gTestRoot + "plugin_test.html", 1);
-}
-
-// Test a bypass of the click-to-play
-function test5a() {
-  var doc = gTestBrowser.contentDocument;
-  var plugin = doc.getElementById("test");
-  var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
-  is(objLoadingContent.pluginFallbackType, Ci.nsIObjectLoadingContent.PLUGIN_PLAY_PREVIEW, "Test 5a, plugin fallback type should be PLUGIN_PLAY_PREVIEW");
-  ok(!objLoadingContent.activated, "Test 5a, Plugin should not be activated");
-
-  var overlay = doc.getAnonymousElementByAttribute(plugin, "class", "previewPluginContent");
-  ok(overlay, "Test 5a, the overlay div is expected");
-
-  var e = overlay.ownerDocument.createEvent("CustomEvent");
-  e.initCustomEvent("MozPlayPlugin", true, true, false);
-  overlay.dispatchEvent(e);
-  var condition = function() objLoadingContent.activated;
-  waitForCondition(condition, test5b, "Test 5a, Waited too long for plugin to stop play preview");
-}
-
-function test5b() {
-  var doc = gTestBrowser.contentDocument;
-  var plugin = doc.getElementById("test");
-  var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
-  ok(objLoadingContent.activated, "Test 5b, Plugin should be activated");
-
-  finishTest();
-}
-
deleted file mode 100644
--- a/browser/base/content/test/plugins/browser_pluginplaypreview2.js
+++ /dev/null
@@ -1,171 +0,0 @@
-var rootDir = getRootDirectory(gTestPath);
-const gTestRoot = rootDir;
-
-var gTestBrowser = null;
-var gNextTest = null;
-var gNextTestSkip = 0;
-var gPlayPreviewPluginActualEvents = 0;
-var gPlayPreviewPluginExpectedEvents = 1;
-
-var gPlayPreviewRegistration = null;
-
-function registerPlayPreview(mimeType, targetUrl) {
-  var ph = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
-  ph.registerPlayPreviewMimeType(mimeType, false, targetUrl);
-
-  return (gPlayPreviewRegistration = {
-    unregister: function() {
-      ph.unregisterPlayPreviewMimeType(mimeType);
-      gPlayPreviewRegistration = null;
-    }
-  });
-}
-
-function unregisterPlayPreview() {
-  gPlayPreviewRegistration.unregister();
-}
-
-Components.utils.import('resource://gre/modules/XPCOMUtils.jsm');
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-
-function test() {
-  waitForExplicitFinish();
-  registerCleanupFunction(function() {
-    if (gPlayPreviewRegistration)
-      gPlayPreviewRegistration.unregister();
-    Services.prefs.clearUserPref("plugins.click_to_play");
-  });
-
-  var newTab = gBrowser.addTab();
-  gBrowser.selectedTab = newTab;
-  gTestBrowser = gBrowser.selectedBrowser;
-  gTestBrowser.addEventListener("load", pageLoad, true);
-  gTestBrowser.addEventListener("PluginBindingAttached", handleBindingAttached, true, true);
-
-  Services.prefs.setBoolPref("plugins.click_to_play", true);
-  setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY);
-
-  registerPlayPreview('application/x-test', 'about:');
-  prepareTest(test1a, gTestRoot + "plugin_test.html", 1);
-}
-
-function finishTest() {
-  gTestBrowser.removeEventListener("load", pageLoad, true);
-  gTestBrowser.removeEventListener("PluginBindingAttached", handleBindingAttached, true, true);
-  gBrowser.removeCurrentTab();
-  window.focus();
-  finish();
-}
-
-function handleBindingAttached(evt) {
-  if (evt.target instanceof Ci.nsIObjectLoadingContent &&
-      evt.target.pluginFallbackType == Ci.nsIObjectLoadingContent.PLUGIN_PLAY_PREVIEW)
-    gPlayPreviewPluginActualEvents++;
-}
-
-function pageLoad() {
-  // The plugin events are async dispatched and can come after the load event
-  // This just allows the events to fire before we then go on to test the states
-
-  // iframe might triggers load event as well, making sure we skip some to let
-  // all iframes on the page be loaded as well
-  if (gNextTestSkip) {
-    gNextTestSkip--;
-    return;
-  }
-  executeSoon(gNextTest);
-}
-
-function prepareTest(nextTest, url, skip) {
-  gNextTest = nextTest;
-  gNextTestSkip = skip;
-  gTestBrowser.contentWindow.location = url;
-}
-
-// Tests a page with normal play preview registration (1/2)
-function test1a() {
-  var notificationBox = gBrowser.getNotificationBox(gTestBrowser);
-  ok(!notificationBox.getNotificationWithValue("blocked-plugins"), "Test 1a, Should not have displayed the blocked plugin notification");
-
-  var pluginInfo = getTestPlugin();
-  ok(pluginInfo, "Should have a test plugin");
-
-  var doc = gTestBrowser.contentDocument;
-  var plugin = doc.getElementById("test");
-  var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
-  is(objLoadingContent.pluginFallbackType, Ci.nsIObjectLoadingContent.PLUGIN_PLAY_PREVIEW, "Test 1a, plugin fallback type should be PLUGIN_PLAY_PREVIEW");
-  ok(!objLoadingContent.activated, "Test 1a, Plugin should not be activated");
-
-  var overlay = doc.getAnonymousElementByAttribute(plugin, "class", "previewPluginContent");
-  ok(overlay, "Test 1a, the overlay div is expected");
-
-  var iframe = overlay.getElementsByClassName("previewPluginContentFrame")[0];
-  ok(iframe && iframe.localName == "iframe", "Test 1a, the overlay iframe is expected");
-  var iframeHref = iframe.contentWindow.location.href;
-  ok(iframeHref == "about:", "Test 1a, the overlay about: content is expected");
-
-  var rect = iframe.getBoundingClientRect();
-  ok(rect.width == 200, "Test 1a, Plugin with id=" + plugin.id + " overlay rect should have 200px width before being replaced by actual plugin");
-  ok(rect.height == 200, "Test 1a, Plugin with id=" + plugin.id + " overlay rect should have 200px height before being replaced by actual plugin");
-
-  var e = overlay.ownerDocument.createEvent("CustomEvent");
-  e.initCustomEvent("MozPlayPlugin", true, true, null);
-  overlay.dispatchEvent(e);
-  var condition = function() objLoadingContent.activated;
-  waitForCondition(condition, test1b, "Test 1a, Waited too long for plugin to stop play preview");
-}
-
-// Tests that activating via MozPlayPlugin through the notification works (part 2/2)
-function test1b() {
-  var plugin = gTestBrowser.contentDocument.getElementById("test");
-  var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
-  ok(objLoadingContent.activated, "Test 1b, Plugin should be activated");
-
-  is(gPlayPreviewPluginActualEvents, gPlayPreviewPluginExpectedEvents,
-     "There should be exactly one PluginPlayPreview event");
-
-  unregisterPlayPreview();
-
-  prepareTest(test2, gTestRoot + "plugin_test.html");
-}
-
-// Tests a page with a working plugin in it -- the mime type was just unregistered.
-function test2() {
-  var doc = gTestBrowser.contentDocument;
-  var plugin = doc.getElementById("test");
-  var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
-  ok(objLoadingContent.pluginFallbackType != Ci.nsIObjectLoadingContent.PLUGIN_PLAY_PREVIEW, "Test 2, plugin fallback type should not be PLUGIN_PLAY_PREVIEW");
-  ok(!objLoadingContent.activated, "Test 2, Plugin should not be activated");
-
-  registerPlayPreview('application/x-unknown', 'about:');
-
-  prepareTest(test3, gTestRoot + "plugin_test.html");
-}
-
-// Tests a page with a working plugin in it -- diffent play preview type is reserved.
-function test3() {
-  var doc = gTestBrowser.contentDocument;
-  var plugin = doc.getElementById("test");
-  var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
-  ok(objLoadingContent.pluginFallbackType != Ci.nsIObjectLoadingContent.PLUGIN_PLAY_PREVIEW, "Test 3, plugin fallback type should not be PLUGIN_PLAY_PREVIEW");
-  ok(!objLoadingContent.activated, "Test 3, Plugin should not be activated");
-
-  unregisterPlayPreview();
-
-  registerPlayPreview('application/x-test', 'about:');
-  Services.prefs.setBoolPref("plugins.click_to_play", false);
-  var plugin = getTestPlugin();
-  plugin.enabledState = Ci.nsIPluginTag.STATE_ENABLED;
-  prepareTest(test4, gTestRoot + "plugin_test.html");
-}
-
-// Tests a page with a working plugin in it -- click-to-play is off
-function test4() {
-  var plugin = gTestBrowser.contentDocument.getElementById("test");
-  var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
-  ok(objLoadingContent.activated, "Test 4, Plugin should be activated");
-
-  finishTest();
-}
-
deleted file mode 100644
--- a/browser/base/content/test/plugins/browser_pluginplaypreview3.js
+++ /dev/null
@@ -1,130 +0,0 @@
-var rootDir = getRootDirectory(gTestPath);
-const gTestRoot = rootDir;
-
-var gTestBrowser = null;
-var gNextTest = null;
-var gNextTestSkip = 0;
-
-var gPlayPreviewRegistration = null;
-
-var gTestPluginType = 'application/x-test';
-var gTestPluginPreviewUrl = 'about:';
-
-function registerPlayPreview(whitelist) {
-  var ph = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
-  ph.registerPlayPreviewMimeType(gTestPluginType, true,
-                                 gTestPluginPreviewUrl, whitelist);
-
-  return (gPlayPreviewRegistration = {
-    unregister: function() {
-      ph.unregisterPlayPreviewMimeType(gTestPluginType);
-      gPlayPreviewRegistration = null;
-    }
-  });
-}
-
-function unregisterPlayPreview() {
-  gPlayPreviewRegistration.unregister();
-}
-
-Components.utils.import('resource://gre/modules/XPCOMUtils.jsm');
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-
-function test() {
-  waitForExplicitFinish();
-  registerCleanupFunction(function() {
-    if (gPlayPreviewRegistration) {
-      gPlayPreviewRegistration.unregister();
-    }
-  });
-
-  var newTab = gBrowser.addTab();
-  gBrowser.selectedTab = newTab;
-  gTestBrowser = gBrowser.selectedBrowser;
-  gTestBrowser.addEventListener("load", pageLoad, true);
-
-  setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED);
-
-  registerPlayPreview('@*plugin_test.html');
-  prepareTest(test1a, gTestRoot + "plugin_test.html", 1);
-}
-
-function finishTest() {
-  gTestBrowser.removeEventListener("load", pageLoad, true);
-  gBrowser.removeCurrentTab();
-  window.focus();
-  finish();
-}
-
-function pageLoad() {
-  // The plugin events are async dispatched and can come after the load event
-  // This just allows the events to fire before we then go on to test the states
-
-  // iframe might triggers load event as well, making sure we skip some to let
-  // all iframes on the page be loaded as well
-  if (gNextTestSkip) {
-    gNextTestSkip--;
-    return;
-  }
-  executeSoon(gNextTest);
-}
-
-function prepareTest(nextTest, url, skip) {
-  gNextTest = nextTest;
-  gNextTestSkip = skip;
-  gTestBrowser.contentWindow.location = url;
-}
-
-// Tests plugin on a whitelisted page.
-function test1a() {
-  var plugin = gTestBrowser.contentDocument.getElementById("test");
-  var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
-  is(objLoadingContent.pluginFallbackType, Ci.nsIObjectLoadingContent.PLUGIN_PLAY_PREVIEW, "Test 1a, plugin fallback type should be PLUGIN_PLAY_PREVIEW");
-  ok(!objLoadingContent.activated, "Test 1a, Plugin should not be activated");
-
-  unregisterPlayPreview();
-
-  registerPlayPreview('@*plugin_wrong.html');
-  var plugin = getTestPlugin();
-  plugin.enabledState = Ci.nsIPluginTag.STATE_ENABLED;
-  prepareTest(test1b, gTestRoot + "plugin_test.html");
-}
-
-// Tests plugin on a non-whitelisted page.
-function test1b() {
-  var plugin = gTestBrowser.contentDocument.getElementById("test");
-  var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
-  ok(objLoadingContent.activated, "Test 1b, Plugin should be activated");
-
-  unregisterPlayPreview();
-
-  registerPlayPreview('*browser_pluginplaypreview3.js');
-  var plugin = getTestPlugin();
-  plugin.enabledState = Ci.nsIPluginTag.STATE_ENABLED;
-  prepareTest(test2a, gTestRoot + "plugin_test_w_src.html");
-}
-
-// Tests plugin with whitelisted src/data.
-function test2a() {
-  var plugin = gTestBrowser.contentDocument.getElementById("test");
-  var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
-  ok(!objLoadingContent.activated, "Test 2a, Plugin should not be activated");
-
-  unregisterPlayPreview();
-
-  registerPlayPreview('*plugin_test_w_src.html');
-  var plugin = getTestPlugin();
-  plugin.enabledState = Ci.nsIPluginTag.STATE_ENABLED;
-  prepareTest(test2b, gTestRoot + "plugin_test_w_src.html");
-}
-
-// Tests plugin with non-whitelisted src/data.
-function test2b() {
-  var plugin = gTestBrowser.contentDocument.getElementById("test");
-  var objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
-  ok(objLoadingContent.activated, "Test 2b, Plugin should be activated");
-
-  finishTest();
-}
-
deleted file mode 100644
--- a/browser/base/content/test/plugins/plugin_test_w_src.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-</head>
-<body>
-<embed id="test" src="browser_pluginplaypreview3.js" style="width: 200px; height: 200px" type="application/x-test">
-</body>
-</html>
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -927,16 +927,17 @@ file, You can obtain one at http://mozil
 
       <field name="_userMadeSearchSuggestionsChoice"><![CDATA[
         false
       ]]></field>
 
       <property name="shouldShowSearchSuggestionsNotification" readonly="true">
         <getter><![CDATA[
           return !this._userMadeSearchSuggestionsChoice &&
+                 !this.inPrivateContext &&
                  // When _urlbarFocused is true, tabbrowser would close the
                  // popup if it's opened here, so don't show the notification.
                  !gBrowser.selectedBrowser._urlbarFocused &&
                  Services.prefs.getBoolPref("browser.search.suggest.enabled") &&
                  this._prefs.getBoolPref("unifiedcomplete");
         ]]></getter>
       </property>
 
--- a/browser/base/content/utilityOverlay.js
+++ b/browser/base/content/utilityOverlay.js
@@ -527,17 +527,27 @@ function openPreferences(paneID, extraAr
   // This function is duplicated from preferences.js.
   function internalPrefCategoryNameToFriendlyName(aName) {
     return (aName || "").replace(/^pane./, function(toReplace) { return toReplace[4].toLowerCase(); });
   }
 
   if (getBoolPref("browser.preferences.inContent")) {
     let win = Services.wm.getMostRecentWindow("navigator:browser");
     let friendlyCategoryName = internalPrefCategoryNameToFriendlyName(paneID);
-    let preferencesURL = "about:preferences" +
+    let params;
+    if (extraArgs && extraArgs["urlParams"]) {
+      params = new URLSearchParams();
+      let urlParams = extraArgs["urlParams"];
+      for (let name in urlParams) {
+        if (urlParams[name] !== undefined) {
+          params.set(name, urlParams[name]);
+        }
+      }
+    }
+    let preferencesURL = "about:preferences" + (params ? "?" + params : "") +
                          (friendlyCategoryName ? "#" + friendlyCategoryName : "");
     let newLoad = true;
     let browser = null;
     if (!win) {
       const Cc = Components.classes;
       const Ci = Components.interfaces;
       let windowArguments = Cc["@mozilla.org/supports-array;1"]
                               .createInstance(Ci.nsISupportsArray);
--- a/browser/base/moz.build
+++ b/browser/base/moz.build
@@ -22,18 +22,16 @@ BROWSER_CHROME_MANIFESTS += [
     'content/test/popupNotifications/browser.ini',
     'content/test/referrer/browser.ini',
     'content/test/social/browser.ini',
 ]
 
 DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
 DEFINES['MOZ_APP_VERSION_DISPLAY'] = CONFIG['MOZ_APP_VERSION_DISPLAY']
 
-DEFINES['NIGHTLY_BUILD'] = CONFIG['NIGHTLY_BUILD']
-
 DEFINES['APP_LICENSE_BLOCK'] = '%s/content/overrides/app-license.html' % SRCDIR
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk2', 'gtk3', 'cocoa'):
     DEFINES['HAVE_SHELL_SERVICE'] = 1
     DEFINES['CONTEXT_COPY_IMAGE_CONTENTS'] = 1
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'cocoa'):
     DEFINES['CAN_DRAW_IN_TITLEBAR'] = 1
--- a/browser/branding/aurora/pref/firefox-branding.js
+++ b/browser/branding/aurora/pref/firefox-branding.js
@@ -25,11 +25,15 @@ pref("app.update.url.details", "https://
 // without checking for an update.  This assumes that
 // app.update.checkInstallTime is true.
 pref("app.update.checkInstallTime.days", 2);
 
 // Give the user x seconds to reboot before showing a badge on the hamburger
 // button. default=4 days
 pref("app.update.badgeWaitTime", 345600);
 
+// code usage depends on contracts, please contact the Firefox module owner if you have questions
+pref("browser.search.param.yahoo-fr", "moz35");
+pref("browser.search.param.yahoo-fr-ja", "mozff");
+
 // Number of usages of the web console or scratchpad.
 // If this is less than 5, then pasting code into the web console or scratchpad is disabled
 pref("devtools.selfxss.count", 5);
--- a/browser/branding/nightly/pref/firefox-branding.js
+++ b/browser/branding/nightly/pref/firefox-branding.js
@@ -23,11 +23,15 @@ pref("app.update.url.details", "https://
 // without checking for an update.  This assumes that
 // app.update.checkInstallTime is true.
 pref("app.update.checkInstallTime.days", 2);
 
 // Give the user x seconds to reboot before showing a badge on the hamburger
 // button. default=immediately
 pref("app.update.badgeWaitTime", 0);
 
+// code usage depends on contracts, please contact the Firefox module owner if you have questions
+pref("browser.search.param.yahoo-fr", "moz35");
+pref("browser.search.param.yahoo-fr-ja", "mozff");
+
 // Number of usages of the web console or scratchpad.
 // If this is less than 5, then pasting code into the web console or scratchpad is disabled
 pref("devtools.selfxss.count", 5);
--- a/browser/branding/official/pref/firefox-branding.js
+++ b/browser/branding/official/pref/firefox-branding.js
@@ -22,11 +22,15 @@ pref("app.update.url.details", "https://
 // without checking for an update.  This assumes that
 // app.update.checkInstallTime is true.
 pref("app.update.checkInstallTime.days", 63);
 
 // Give the user x seconds to reboot before showing a badge on the hamburger
 // button. default=immediately
 pref("app.update.badgeWaitTime", 0);
 
+// code usage depends on contracts, please contact the Firefox module owner if you have questions
+pref("browser.search.param.yahoo-fr", "moz35");
+pref("browser.search.param.yahoo-fr-ja", "mozff");
+
 // Number of usages of the web console or scratchpad.
 // If this is less than 5, then pasting code into the web console or scratchpad is disabled
 pref("devtools.selfxss.count", 0);
--- a/browser/branding/unofficial/pref/firefox-branding.js
+++ b/browser/branding/unofficial/pref/firefox-branding.js
@@ -22,11 +22,15 @@ pref("app.update.url.details", "https://
 // without checking for an update.  This assumes that
 // app.update.checkInstallTime is true.
 pref("app.update.checkInstallTime.days", 2);
 
 // Give the user x seconds to reboot before showing a badge on the hamburger
 // button. default=immediately
 pref("app.update.badgeWaitTime", 0);
 
+// code usage depends on contracts, please contact the Firefox module owner if you have questions
+pref("browser.search.param.yahoo-fr", "moz35");
+pref("browser.search.param.yahoo-fr-ja", "mozff");
+
 // Number of usages of the web console or scratchpad.
 // If this is less than 5, then pasting code into the web console or scratchpad is disabled
 pref("devtools.selfxss.count", 0);
--- a/browser/components/customizableui/test/browser.ini
+++ b/browser/components/customizableui/test/browser.ini
@@ -55,17 +55,16 @@ skip-if = os == "mac"
 
 [browser_946320_tabs_from_other_computers.js]
 skip-if = os == "linux"
 
 [browser_934951_zoom_in_toolbar.js]
 [browser_938980_navbar_collapsed.js]
 [browser_938995_indefaultstate_nonremovable.js]
 [browser_940013_registerToolbarNode_calls_registerArea.js]
-[browser_940107_home_button_in_bookmarks_toolbar.js]
 [browser_940307_panel_click_closure_handling.js]
 [browser_940946_removable_from_navbar_customizemode.js]
 [browser_941083_invalidate_wrapper_cache_createWidget.js]
 [browser_942581_unregisterArea_keeps_placements.js]
 [browser_943683_migration_test.js]
 [browser_944887_destroyWidget_should_destroy_in_palette.js]
 [browser_945739_showInPrivateBrowsing_customize_mode.js]
 [browser_947914_button_addons.js]
deleted file mode 100644
--- a/browser/components/customizableui/test/browser_940107_home_button_in_bookmarks_toolbar.js
+++ /dev/null
@@ -1,41 +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/. */
-
-"use strict";
-
-// Bug 940107 - Home icon not displayed correctly when in bookmarks toolbar.
-add_task(function() {
-  ok(CustomizableUI.inDefaultState, "Should be in default state when test starts.");
-  let bookmarksToolbar = document.getElementById(CustomizableUI.AREA_BOOKMARKS);
-  bookmarksToolbar.collapsed = false;
-
-  let homeButton = document.getElementById("home-button");
-  ok(homeButton.classList.contains("toolbarbutton-1"), "Home Button should have toolbarbutton-1 when in the nav-bar");
-  ok(!homeButton.classList.contains("bookmark-item"), "Home Button should not be displayed as a bookmarks item");
-
-  yield startCustomizing();
-  CustomizableUI.addWidgetToArea(homeButton.id, CustomizableUI.AREA_BOOKMARKS);
-  yield endCustomizing();
-  ok(homeButton.classList.contains("bookmark-item"), "Home Button should be displayed as a bookmarks item");
-  ok(!homeButton.classList.contains("toolbarbutton-1"), "Home Button should not be displayed as a nav-bar item");
-
-  gCustomizeMode.addToPanel(homeButton);
-  let panelShownPromise = promisePanelShown(window);
-  PanelUI.toggle();
-  yield panelShownPromise;
-
-  ok(homeButton.classList.contains("toolbarbutton-1"), "Home Button should have toolbarbutton-1 when in the panel");
-  ok(!homeButton.classList.contains("bookmark-item"), "Home Button should not be displayed as a bookmarks item");
-
-  gCustomizeMode.addToToolbar(homeButton);
-  let panelHiddenPromise = promisePanelHidden(window);
-  PanelUI.toggle();
-  yield panelHiddenPromise;
-
-  ok(homeButton.classList.contains("toolbarbutton-1"), "Home Button should have toolbarbutton-1 when in the nav-bar");
-  ok(!homeButton.classList.contains("bookmark-item"), "Home Button should not be displayed as a bookmarks item");
-
-  bookmarksToolbar.collapsed = true;
-  CustomizableUI.reset();
-});
--- a/browser/components/customizableui/test/browser_967000_button_sync.js
+++ b/browser/components/customizableui/test/browser_967000_button_sync.js
@@ -40,18 +40,18 @@ function openAboutAccountsFromMenuPanel(
     deferred.resolve();
   }
   gBrowser.selectedBrowser.addEventListener("load", handler, true);
 
   syncButton.click();
   yield deferred.promise;
   newTab = gBrowser.selectedTab;
 
-  is(gBrowser.currentURI.spec, "about:accounts?entrypoint=" + entryPoint,
-    "Firefox Sync page opened with `menupanel` entrypoint");
+  is(gBrowser.currentURI.spec, "about:preferences?entrypoint=" + entryPoint + "#sync",
+    "Firefox Sync preference page opened with `menupanel` entrypoint");
   ok(!isPanelUIOpen(), "The panel closed");
 
   if(isPanelUIOpen()) {
     let panelHidePromise = promisePanelHidden(window);
     PanelUI.hide();
     yield panelHidePromise;
   }
 }
--- a/browser/components/downloads/content/allDownloadsViewOverlay.js
+++ b/browser/components/downloads/content/allDownloadsViewOverlay.js
@@ -104,17 +104,17 @@ HistoryDownload.prototype = {
       // On the other hand, if the download is missing the target file
       // annotation as well, it is just a very old one, and we can assume it
       // succeeded.
       this.succeeded = !this.target.path;
       this.error = this.target.path ? { message: "Unstarted download." } : null;
       this.canceled = false;
 
       // These properties may be updated if the user interface is refreshed.
-      this.exists = false;
+      this.target.exists = false;
       this.target.size = undefined;
     }
   },
 
   /**
    * History downloads are never in progress.
    */
   stopped: true,
--- a/browser/components/loop/.eslintrc
+++ b/browser/components/loop/.eslintrc
@@ -31,16 +31,17 @@
   },
   "rules": {
     // turn off all kinds of stuff that we actually do want, because
     // right now, we're bootstrapping the linting infrastructure.  We'll
     // want to audit these rules, and start turning them on and fixing the
     // problems they find, one at a time.
 
     // Eslint built-in rules are documented at <http://eslint.org/docs/rules/>
+    "block-spacing": [2, "always"],
     "callback-return": 0,         // TBD
     "camelcase": 0,               // TODO: set to 2
     "comma-spacing": 2,
     "computed-property-spacing": [2, "never"],
     "consistent-return": 0,       // TODO: set to 2
     "curly": [2, "all"],
     "dot-location": [2, "property"],
     "eol-last": 2,
--- a/browser/components/loop/.eslintrc-gecko
+++ b/browser/components/loop/.eslintrc-gecko
@@ -57,12 +57,13 @@
   },
   "rules": {
     "arrow-parens": 0,         // TBD
     "arrow-spacing": 2,
     "eqeqeq": 0,               // TBD
     "generator-star-spacing": [2, "after"],
     // We should fix the errors and enable this (set to 2)
     "no-var": 0,
+    "prefer-arrow-callback": 0,// TODO: Set to 2.
     "require-yield": 0,        // TODO: Set to 2.
     "strict": [2, "global"]
   }
 }
--- a/browser/components/loop/content/css/contacts.css
+++ b/browser/components/loop/content/css/contacts.css
@@ -12,27 +12,71 @@ html {
 }
 
 .contact-import-spinner.busy {
   display: inline-block;
   vertical-align: middle;
   -moz-margin-start: 10px;
 }
 
-.content-area input.contact-filter {
-  margin-top: 14px;
-  border-radius: 10000px;
+.contact-filter-container {
+  display: flex;
+  height: 2em;
+}
+
+.contact-filter {
+  margin: 0;
+  -moz-padding-start: 34px;
+  width: 100%;
+  height: 28px;
+  border: 0;
+  border-bottom: 1px solid #ddd;
+  background-image: url("../shared/img/icons-14x14.svg#magnifier");
+  background-position: 10px center;
+  background-size: 14px;
+  background-repeat: no-repeat;
+  color: #999;
+  font-size: 1.2rem;
+  flex: 2 1 auto;
+  align-self: stretch;
+}
+
+html[dir="rtl"] .contact-filter {
+  background-position: right 10px center;
+}
+
+.contact-filter:focus + .clear-search,
+.contact-filter:focus {
+  border-bottom: 1px solid #5cccee;
+  color: #4a4a4a;
+}
+
+.clear-search {
+  width: 34px;
+  height: 28px;
+  border: none;
+  border-bottom: 1px solid #ddd;
+  background-color: #fff;
+  background-image: url("../shared/img/icons-14x14.svg#clear");
+  background-position: center;
+  background-size: 14px;
+  background-repeat: no-repeat;
+  cursor: pointer;
+  flex: 0 1 auto;
+  align-self: stretch;
 }
 
 .contact-list {
   overflow-x: hidden;
   overflow-y: auto;
   /* Space for six contacts, not affected by filtering.  This is enough space
      to show the dropdown menu when there is only one contact. */
   height: 306px;
+  /* Contact list title goes away when searching, needed for spacing. */
+  margin-top: 4px;
 }
 
 .contact-list-title {
   padding: 0 1rem;
   color: #666;
   font-weight: 500;
   font-size: .9em;
 }
@@ -160,16 +204,46 @@ html {
   background-image: url("../shared/img/avatars.svg#green-avatar");
   background-color: #56B397;
 }
 
 .contact > .avatar > img {
   width: 100%;
 }
 
+.contact-list-empty,
+.contact-search-list-empty {
+  background-image: url("../shared/img/empty_contacts.svg");
+  background-repeat: no-repeat;
+  background-position: top center;
+  margin-top: 4rem;
+  padding-top: 10rem;
+  padding-bottom: 5rem;
+  text-align: center;
+  color: #4a4a4a;
+}
+
+.contact-search-list-empty {
+  background-image: url("../shared/img/empty_search.svg");
+}
+
+.panel-text-medium,
+.panel-text-large {
+  margin: 3px;
+  color: #4a4a4a;
+}
+
+.panel-text-medium {
+  font-size: 1.2rem;
+}
+
+.panel-text-large {
+  font-size: 2.2rem;
+}
+
 .contact > .details > .username {
   font-size: 1.3rem;
   line-height: 20px;
   color: #000;
 }
 
 .contact.blocked > .details > .username {
   color: #d74345;
@@ -216,17 +290,17 @@ html {
 
 .icon-contact-video-call {
   padding: 15px;
   width: 16px;
   height: 16px;
   border-radius: 50%;
   background-color: #5bc0a4;
   background-image: url("../shared/img/icons-14x14.svg#video-white");
-  background-size: 16px 16px;
+  background-size: 14px 14px;
 }
 
 .icon-contact-video-call:hover {
   background-color: #47b396;
 }
 
 .icon-contact-video-call:active {
   background-color: #3aa689;
@@ -245,16 +319,17 @@ html {
 }
 
 .contact > .dropdown-menu {
   z-index: 2;
   top: 37px;
   right: 22px;
   bottom: auto;
   left: auto;
+  z-index: 2;
 }
 
 html[dir="rtl"] .contact > .dropdown-menu {
   right: auto;
   left: 22px;
 }
 
 .contact > .dropdown-menu-up {
@@ -280,36 +355,30 @@ html[dir="rtl"] .contact > .dropdown-men
                       Can likely go away if we switched this pane to flexbox model */
   padding-top: 4px; /* Based on spacing in Mockup
                     replaced margin-top
                     See http://stackoverflow.com/questions/6204670/css-clean-solution-to-the-margin-collapse-issue-when-floating-an-element
                     */
 }
 
 .contacts-gravatar-promo {
-  position: relative;
-  border: 1px dashed #c1c1c1;
+  border: 1px solid #5cccee;
   border-radius: 2px;
-  background-color: #fbfbfb;
-  padding: 10px;
-  margin-top: 10px;
+  background-color: #fff;
+  font-size: 1.2rem;
+  margin: 1.5rem;
+  padding: 1.5rem 1rem;
+  position: relative;
 }
 
 .contacts-gravatar-promo > p {
-  margin-top: 2px;
-  margin-bottom: 8px;
-  margin-right: 4px;
+  margin-top: 0;
   word-wrap: break-word;
 }
 
-html[dir="rtl"] .contacts-gravatar-promo > p {
-  margin-right: 0;
-  margin-left: 4px;
-}
-
 .contacts-gravatar-promo > p > a {
   color: #0295df;
   text-decoration: none;
 }
 
 .contacts-gravatar-promo > p > a:hover {
   text-decoration: underline;
 }
@@ -320,33 +389,82 @@ html[dir="rtl"] .contacts-gravatar-promo
   right: 8px;
 }
 
 html[dir="rtl"] .contacts-gravatar-promo > .button-close {
   right: auto;
   left: 8px;
 }
 
+.contacts-gravatar-avatars {
+  height: 50px;
+  margin: 1.5rem auto;
+  text-align: center;
+  width: 200px;
+}
+
+.contacts-gravatar-avatars img {
+  margin: 0 1.5rem;
+  vertical-align: middle;
+  width: 50px;
+}
+
+/* Adjust the Firefox avatar because it has pointy ears. */
+.contacts-gravatar-avatars img:last-child {
+  transform: scale(1.08) translateY(-2px);
+}
+
+.contacts-gravatar-arrow {
+  border-color: #9b9b9b;
+  border-style: solid solid none none;
+  border-width: 2px;
+  display: inline-block;
+  height: 1.5rem;
+  -moz-margin-start: -.75rem;
+  transform: rotateZ(45deg);
+  vertical-align: middle;
+  width: 1.5rem;
+}
+
+html[dir="rtl"] .contacts-gravatar-arrow {
+  transform: rotateZ(225deg);
+}
+
+.contacts-gravatar-buttons {
+  padding: 0 .5rem;
+}
+
 .contact-controls {
   padding: 0 16px;
 }
 
 .contact-controls > .button {
   padding: .5em;
   border: none;
   border-radius: 5px;
 }
 
 .button.primary {
   background: #00A9DC;
   color: #fff;
 }
 
+.button.primary:active,
+.button.primary:hover {
+  background: #5cccee;
+}
+
 .button.secondary {
-  background: #EBEBEB;
+  background: #ebebeb;
+  color: #4D4D4D;
+}
+
+.button.secondary:hover,
+.button.secondary:active {
+  background: #dad6d6;
   color: #4D4D4D;
 }
 
 .contact-controls > .primary {
   flex: 5;
 }
 
 .contact-controls > .secondary {
--- a/browser/components/loop/content/css/panel.css
+++ b/browser/components/loop/content/css/panel.css
@@ -201,45 +201,22 @@ html[dir="rtl"] .tab-view li:nth-child(2
 .content-area {
   padding: .5rem 1rem;
 }
 
 .content-area header {
   font-weight: 700;
 }
 
-#fte-getstarted {
-  padding-top: .5rem;
-  padding-bottom: .5rem;
-}
-
-#fte-title {
-  text-align: center;
-  margin-bottom: .5rem;
-}
-
-#fte-button {
-  width: 50%;
-  display: block;
-  margin-left: auto;
-  margin-right: auto;
-  font-size: 1rem;
-  padding: .5rem 1rem;
-}
-
-#fte-getstarted + #powered-by-wrapper {
-  position: absolute;
-  bottom: 0;
-}
-
 /* Need to remove when these rules when the Beta tag is removed */
 #share-link-header {
   -moz-padding-start: 20px;
 }
-#fte-getstarted + .generate-url > #share-link-header,
+
+.fte-get-started-container + .generate-url > #share-link-header,
 .tab-view + .tab .content-area > .generate-url > #share-link-header {
   /* The header shouldn't be indented if the tabs are present. */
   -moz-padding-start: 0;
 }
 
 .content-area label {
   display: block;
   width: 100%;
@@ -283,16 +260,22 @@ html[dir="rtl"] .tab-view li:nth-child(2
   background-position: top center;
   padding-top: 19%;
   padding-bottom: 3%;
   text-align: center;
   color: #4a4a4a;
   font-weight: lighter;
 }
 
+/* Don't show the empty contacts image if we're showing gravatar promo. */
+.contacts-gravatar-promo ~ .contact-list-empty {
+  background-image: none;
+  padding-top: 3%;
+}
+
 .contact-list-empty {
   padding-top: 27%;
 }
 
 .room-list-empty {
   margin: 5% 15px;
   background-image: url("../shared/img/empty_conversations.svg");
 }
@@ -555,17 +538,17 @@ html[dir="rtl"] .tab-view li:nth-child(2
   line-height: 1.2rem;
   border: none;
 }
 
 .button:hover {
   background-color: #ebebeb;
 }
 
-.button:hover:active {
+.button:active {
   background-color: #ccc;
   color: #fff;
 }
 
 .button.button-accept {
   background-color: #00a9dc;
   color: #fff;
 }
@@ -590,16 +573,22 @@ html[dir="rtl"] .tab-view li:nth-child(2
   color: #000;
 }
 
 .button.button-cancel:disabled {
   background-color: #ebebeb;
   color: #c3c3c3;
 }
 
+.button.button-accept:active {
+  background-color: #3aa689;
+  border-color: #3aa689;
+  color: #fff;
+}
+
 .button-close {
   background-color: transparent;
   background-image: url(../shared/img/icons-10x10.svg#close);
   background-repeat: no-repeat;
   background-size: 8px 8px;
   border: none;
   padding: 0;
   height: 8px;
@@ -666,38 +655,36 @@ html[dir="rtl"] .tab-view li:nth-child(2
   right: 4px;
 }
 
 html[dir="rtl"] .generate-url-spinner {
   left: 4px;
   right: auto;
 }
 
-#fte-button,
 .generate-url .button {
-  background-color: #0096dd;
+  background-color: #00a9dc;
   border-color: #0096dd;
   color: #fff;
 }
 
 .generate-url .button:hover {
   background-color: #008acb;
   border-color: #008acb;
-  color: #fff;
 }
 
 #powered-by,
 .terms-service {
-  color: #888;
-  font-size: .9em;
+  color: #4a4a4a;
+  font-size: 1.1rem;
 }
 
 #powered-by {
   border-top: 1px solid #ccc;
-  padding-top: .5rem;
+  padding-top: 1.5rem;
   text-align: center;
   margin-top: 0;
 }
 
 #powered-by-logo {
   display: inline-block;
   margin-left: 10px;
   margin-right: 10px;
@@ -745,23 +732,25 @@ html[dir="rtl"] .generate-url-spinner {
   }
 
   #powered-by-logo[class^="es-"] {
     background-image: url("../shared/img/movistar@2x.png");
   }
 }
 
 .terms-service {
-  padding-left: 1rem;
-  padding-right: 1rem;
-  padding-bottom: .5rem;
+  padding-left: 5rem;
+  padding-right: 5rem;
+  padding-bottom: 1rem;
+  text-align: center;
 }
 
 .terms-service > a {
   color: #00a9dc;
+  text-decoration: none;
 }
 
 /* DnD menu */
 
 .dnd-status {
   border: 1px solid transparent;
   padding: 2px 4px;
   margin: 0;
@@ -925,8 +914,70 @@ html[dir="rtl"] .settings-menu .dropdown
   display: flex;
 }
 
 .footer .user-identity {
   color: #000;
   font-weight: bold;
   margin: 0;
 }
+
+/* First time use */
+
+.fte-get-started-content {
+  flex: 1;
+  padding: 4.5rem 0 3.4rem;
+  display: flex;
+  flex-direction: column;
+}
+
+.fte-title {
+  flex: 1;
+  margin: 0 44px;
+}
+
+.fte-title > img {
+  width: 100%;
+}
+
+.fte-subheader {
+  text-align: center;
+  font-size: 1.8rem;
+  margin-bottom: 2rem;
+  color: #4a4a4a;
+}
+
+.fte-get-started-content + .powered-by-wrapper {
+  flex: 0;
+}
+
+.fte-get-started-container {
+  height: 100%;
+  width: 100%;
+  min-height: 270px;
+  display: flex;
+  flex-direction: column;
+  flex-wrap: nowrap;
+  justify-content: space-between;
+  align-content: flex-start;
+  align-items: flex-start;
+  background: #fbfbfb;
+}
+
+.fte-get-started-button {
+  border: none;
+  color: #fff;
+  background-color: #00a9dc;
+  border-color: none;
+  line-height: 43px;
+  margin: 0 15px;
+  padding: 0;
+  border-radius: 4px;
+  font-size: 1.4rem;
+  font-weight: bold;
+}
+
+.fte-get-started-button:hover,
+.fte-get-started-button:focus,
+.fte-get-started-button:active {
+  background-color: #5cccee;
+  color: #fff;
+}
--- a/browser/components/loop/content/js/contacts.js
+++ b/browser/components/loop/content/js/contacts.js
@@ -129,21 +129,27 @@ loop.contacts = (function(_, mozL10n) {
       });
       return (
         React.createElement("div", {className: "contacts-gravatar-promo"}, 
           React.createElement(Button, {additionalClass: "button-close", 
                   caption: "", 
                   onClick: this.handleCloseButtonClick}), 
           React.createElement("p", {dangerouslySetInnerHTML: {__html: message}, 
              onClick: this.handleLinkClick}), 
-          React.createElement(ButtonGroup, null, 
-            React.createElement(Button, {caption: mozL10n.get("gravatars_promo_button_nothanks"), 
+          React.createElement("div", {className: "contacts-gravatar-avatars"}, 
+            React.createElement("img", {src: "loop/shared/img/avatars.svg#orange-avatar"}), 
+            React.createElement("span", {className: "contacts-gravatar-arrow"}), 
+            React.createElement("img", {src: "loop/shared/img/firefox-avatar.svg"})
+          ), 
+          React.createElement(ButtonGroup, {additionalClass: "contacts-gravatar-buttons"}, 
+            React.createElement(Button, {additionalClass: "secondary", 
+                    caption: mozL10n.get("gravatars_promo_button_nothanks2"), 
                     onClick: this.handleCloseButtonClick}), 
-            React.createElement(Button, {additionalClass: "button-accept", 
-                    caption: mozL10n.get("gravatars_promo_button_use"), 
+            React.createElement(Button, {additionalClass: "secondary", 
+                    caption: mozL10n.get("gravatars_promo_button_use2"), 
                     onClick: this.handleUseButtonClick})
           )
         )
       );
     }
   });
 
   const ContactDropdown = React.createClass({displayName: "ContactDropdown",
@@ -319,20 +325,19 @@ loop.contacts = (function(_, mozL10n) {
   const ContactsList = React.createClass({displayName: "ContactsList",
     mixins: [
       React.addons.LinkedStateMixin,
       loop.shared.mixins.WindowCloseMixin
     ],
 
     propTypes: {
       mozLoop: React.PropTypes.object.isRequired,
-      notifications: React.PropTypes.instanceOf(
-                     loop.shared.models.NotificationCollection).isRequired,
-      // Callback to handle entry to the add/edit contact form.
-      startForm: React.PropTypes.func.isRequired
+      notifications: React.PropTypes.instanceOf(loop.shared.models.NotificationCollection).isRequired,
+      switchToContactAdd: React.PropTypes.func.isRequired,
+      switchToContactEdit: React.PropTypes.func.isRequired
     },
 
     /**
      * Contacts collection object
      */
     contacts: null,
 
     /**
@@ -408,16 +413,73 @@ loop.contacts = (function(_, mozL10n) {
         });
       });
     },
 
     componentWillUnmount: function() {
       window.removeEventListener("LoopStatusChanged", this._onStatusChanged);
     },
 
+    /*
+     * Filter a user by name, email or phone number.
+     * Takes in an input to filter by and returns a filter function which
+     * expects a contact.
+     *
+     * @returns {Function}
+     */
+    filterContact: function(filter) {
+      return function(contact) {
+        return getPreferred(contact, "name").toLocaleLowerCase().includes(filter) ||
+          getPreferred(contact, "email").value.toLocaleLowerCase().includes(filter) ||
+          getPreferred(contact, "tel").value.toLocaleLowerCase().includes(filter);
+      };
+    },
+
+    /*
+     * Takes all contacts, it groups and filters them before rendering.
+     */
+    _filterContactsList: function() {
+      let shownContacts = _.groupBy(this.contacts, function(contact) {
+        return contact.blocked ? "blocked" : "available";
+      });
+
+      if (this._shouldShowFilter()) {
+        let filter = this.state.filter.trim().toLocaleLowerCase();
+        let filterFn = this.filterContact(filter);
+        if (filter) {
+          if (shownContacts.available) {
+            shownContacts.available = shownContacts.available.filter(filterFn);
+            // Filter can return an empty array.
+            if (!shownContacts.available.length) {
+              shownContacts.available = null;
+            }
+          }
+          if (shownContacts.blocked) {
+            shownContacts.blocked = shownContacts.blocked.filter(filterFn);
+            // Filter can return an empty array.
+            if (!shownContacts.blocked.length) {
+              shownContacts.blocked = null;
+            }
+          }
+        }
+      }
+
+      return shownContacts;
+    },
+
+    /*
+     * Decide to render contacts filter based on the number of contacts.
+     *
+     * @returns {bool}
+     */
+    _shouldShowFilter: function() {
+      return Object.getOwnPropertyNames(this.contacts).length >=
+        MIN_CONTACTS_FOR_FILTERING;
+    },
+
     _onStatusChanged: function() {
       let profile = this.props.mozLoop.userProfile;
       let currUid = this._userProfile ? this._userProfile.uid : null;
       let newUid = profile ? profile.uid : null;
       if (currUid !== newUid) {
         // On profile change (login, logout), reload all contacts.
         this._userProfile = profile;
         // The following will do a forceUpdate() for us.
@@ -464,23 +526,23 @@ loop.contacts = (function(_, mozL10n) {
         this.props.notifications.successL10n("import_contacts_success_message", {
           num: stats.success,
           total: stats.success
         });
       });
     },
 
     handleAddContactButtonClick: function() {
-      this.props.startForm("contacts_add");
+      this.props.switchToContactAdd();
     },
 
     handleContactAction: function(contact, actionName) {
       switch (actionName) {
         case "edit":
-          this.props.startForm("contacts_edit", contact);
+          this.props.switchToContactEdit(contact);
           break;
         case "remove":
           this.props.mozLoop.confirm({
             message: mozL10n.get("confirm_delete_contact_alert"),
             okButton: mozL10n.get("confirm_delete_contact_remove_button"),
             cancelButton: mozL10n.get("confirm_delete_contact_cancel_button")
           }, (error, result) => {
             if (error) {
@@ -526,155 +588,273 @@ loop.contacts = (function(_, mozL10n) {
     },
 
     handleUseGravatar: function() {
       // We got permission to use Gravatar icons now, so we need to redraw the
       // list entirely to show them.
       this.refresh();
     },
 
+    /*
+     * Callback triggered when clicking the `X` from the contacts filter.
+     * Clears the search query.
+     */
+    _handleFilterClear: function() {
+      this.setState({
+        filter: ""
+      });