Merge with mozilla-central
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 25 Sep 2017 12:54:33 +1300
changeset 685656 812dd323181fd1086b91edfb9a6cc5360aa98f29
parent 685655 0cdaa40a397f40a23ace8ef54043daab0b26b962 (current diff)
parent 669596 7e962631ba4298bcefa571008661983d77c3e652 (diff)
child 685657 fb5c244ddf0dbfc1da103676d1018839ade51f77
push id86010
push userbmo:ethlin@mozilla.com
push dateWed, 25 Oct 2017 00:44:42 +0000
milestone58.0a1
Merge with mozilla-central
browser/base/content/defaultthemes/compactdark.icon.svg
browser/base/content/defaultthemes/compactlight.icon.svg
browser/components/places/tests/chrome/test_RecentBookmarksMenuUI.xul
browser/extensions/clicktoplay-rollout/bootstrap.js
browser/extensions/clicktoplay-rollout/install.rdf.in
browser/extensions/clicktoplay-rollout/moz.build
browser/themes/linux/privatebrowsing-mask.png
browser/themes/osx/menu-back.png
browser/themes/osx/privatebrowsing-mask-short.png
browser/themes/osx/privatebrowsing-mask-short@2x.png
browser/themes/osx/privatebrowsing-mask.png
browser/themes/osx/privatebrowsing-mask@2x.png
browser/themes/shared/aboutRights.css
browser/themes/shared/icons/containers.svg
browser/themes/shared/toolbarbuttons.inc.css
browser/themes/windows/menu-back.png
browser/themes/windows/privatebrowsing-mask-tabstrip-win7.png
browser/themes/windows/privatebrowsing-mask-tabstrip.png
browser/themes/windows/privatebrowsing-mask-titlebar-win7-tall.png
browser/themes/windows/privatebrowsing-mask-titlebar-win7.png
browser/themes/windows/privatebrowsing-mask-titlebar.png
devtools/client/inspector/test/browser_inspector_pane-toggle-01.js
devtools/client/inspector/test/browser_inspector_pane-toggle-02.js
devtools/client/inspector/test/browser_inspector_pane-toggle-03.js
devtools/client/inspector/test/browser_inspector_pane-toggle-05.js
devtools/shim/devtools-startup.js
dom/animation/KeyframeEffectReadOnly.cpp
dom/base/Element.cpp
dom/base/crashtests/xhr_abortinprogress.html
dom/interfaces/html/nsIDOMHTMLObjectElement.idl
dom/media/VideoFrameContainer.cpp
dom/plugins/base/nsPluginInstanceOwner.cpp
dom/webauthn/u2f-hid-rs/build.rs
dom/webauthn/u2f-hid-rs/src/runloop.rs
gfx/layers/wr/WebRenderLayerManager.cpp
gfx/thebes/gfxPrefs.h
gfx/webrender/res/cs_clip_border.fs.glsl
gfx/webrender/res/cs_clip_border.vs.glsl
gfx/webrender/res/cs_clip_image.fs.glsl
gfx/webrender/res/cs_clip_image.vs.glsl
gfx/webrender/res/cs_text_run.fs.glsl
gfx/webrender/res/cs_text_run.vs.glsl
gfx/webrender/res/ps_blend.fs.glsl
gfx/webrender/res/ps_blend.vs.glsl
gfx/webrender/res/ps_cache_image.fs.glsl
gfx/webrender/res/ps_cache_image.vs.glsl
intl/locale/DateTimeFormatAndroid.cpp
intl/locale/nsCollationAndroid.cpp
intl/unicharutil/normalization_data.h
intl/unicharutil/nsUnicodeNormalizer_ICU.cpp
intl/unicharutil/tools/MUTTUCData.txt
intl/unicharutil/tools/UCDATAREADME.txt
intl/unicharutil/tools/data/case.dat
intl/unicharutil/tools/data/cmbcl.dat
intl/unicharutil/tools/data/ctype.dat
intl/unicharutil/tools/data/decomp.dat
intl/unicharutil/tools/data/num.dat
intl/unicharutil/tools/format.txt
intl/unicharutil/tools/moz.build
intl/unicharutil/tools/ucgendat.c
intl/unicharutil/ucdata.c
intl/unicharutil/ucdata.h
js/src/wasm/WasmSignalHandlers.cpp
layout/base/GeckoRestyleManager.cpp
layout/base/PresShell.cpp
layout/base/RestyleManager.cpp
layout/base/moz.build
layout/base/nsBidi_ICU.cpp
layout/base/nsBidi_ICU.h
layout/base/nsBidi_noICU.cpp
layout/base/nsBidi_noICU.h
layout/base/nsLayoutUtils.cpp
layout/base/nsLayoutUtils.h
layout/forms/nsButtonFrameRenderer.cpp
layout/forms/nsComboboxControlFrame.cpp
layout/forms/nsFieldSetFrame.cpp
layout/forms/nsHTMLButtonControlFrame.cpp
layout/forms/nsListControlFrame.cpp
layout/forms/nsProgressFrame.cpp
layout/forms/nsRangeFrame.cpp
layout/forms/nsSelectsAreaFrame.cpp
layout/forms/nsTextControlFrame.cpp
layout/forms/nsTextControlFrame.h
layout/generic/ViewportFrame.cpp
layout/generic/nsBackdropFrame.cpp
layout/generic/nsBlockFrame.cpp
layout/generic/nsBlockFrame.h
layout/generic/nsBulletFrame.cpp
layout/generic/nsCanvasFrame.cpp
layout/generic/nsCanvasFrame.h
layout/generic/nsColumnSetFrame.cpp
layout/generic/nsFirstLetterFrame.cpp
layout/generic/nsFlexContainerFrame.cpp
layout/generic/nsFrame.cpp
layout/generic/nsFrameSetFrame.cpp
layout/generic/nsFrameStateBits.h
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsGridContainerFrame.cpp
layout/generic/nsHTMLCanvasFrame.cpp
layout/generic/nsIFrame.h
layout/generic/nsImageFrame.cpp
layout/generic/nsImageFrame.h
layout/generic/nsInlineFrame.cpp
layout/generic/nsPageFrame.cpp
layout/generic/nsPlaceholderFrame.cpp
layout/generic/nsPluginFrame.cpp
layout/generic/nsPluginFrame.h
layout/generic/nsSimplePageSequenceFrame.cpp
layout/generic/nsSubDocumentFrame.cpp
layout/generic/nsTextFrame.cpp
layout/generic/nsTextFrame.h
layout/generic/nsVideoFrame.cpp
layout/ipc/RenderFrameParent.cpp
layout/ipc/RenderFrameParent.h
layout/mathml/nsMathMLContainerFrame.cpp
layout/mathml/nsMathMLSelectedFrame.cpp
layout/mathml/nsMathMLmfencedFrame.cpp
layout/mathml/nsMathMLmoFrame.cpp
layout/mathml/nsMathMLmrootFrame.cpp
layout/mathml/nsMathMLmtableFrame.cpp
layout/painting/FrameLayerBuilder.cpp
layout/painting/nsCSSRendering.cpp
layout/painting/nsCSSRendering.h
layout/painting/nsDisplayList.cpp
layout/painting/nsDisplayList.h
layout/painting/nsImageRenderer.cpp
layout/reftests/border-image/svg-as-border-image-4.html
layout/style/ImageLoader.cpp
layout/svg/SVGFEUnstyledLeafFrame.cpp
layout/svg/SVGGeometryFrame.cpp
layout/svg/SVGTextFrame.cpp
layout/svg/SVGTextFrame.h
layout/svg/nsSVGContainerFrame.cpp
layout/svg/nsSVGEffects.cpp
layout/svg/nsSVGEffects.h
layout/svg/nsSVGForeignObjectFrame.cpp
layout/svg/nsSVGOuterSVGFrame.cpp
layout/svg/nsSVGStopFrame.cpp
layout/svg/nsSVGSwitchFrame.cpp
layout/tables/nsTableCellFrame.cpp
layout/tables/nsTableColFrame.cpp
layout/tables/nsTableColGroupFrame.cpp
layout/tables/nsTableFrame.cpp
layout/tables/nsTableFrame.h
layout/tables/nsTableRowFrame.cpp
layout/tables/nsTableRowGroupFrame.cpp
layout/tables/nsTableWrapperFrame.cpp
layout/tools/reftest/reftest.jsm
layout/xul/nsBoxFrame.cpp
layout/xul/nsImageBoxFrame.cpp
layout/xul/nsImageBoxFrame.h
layout/xul/nsLeafBoxFrame.cpp
layout/xul/nsRootBoxFrame.cpp
layout/xul/nsSliderFrame.cpp
layout/xul/nsSplitterFrame.cpp
layout/xul/nsTextBoxFrame.cpp
layout/xul/tree/nsTreeBodyFrame.cpp
memory/replace/replace/ReplaceMalloc.cpp
memory/replace/replace/moz.build
mobile/android/app/src/photon/res/drawable-hdpi-v11/ic_status_logo.png
mobile/android/app/src/photon/res/drawable-hdpi/ic_qrcode_nm.png
mobile/android/app/src/photon/res/drawable-hdpi/ic_qrcode_pm.png
mobile/android/app/src/photon/res/drawable-xhdpi-v11/ic_status_logo.png
mobile/android/app/src/photon/res/drawable-xhdpi/ic_qrcode_nm.png
mobile/android/app/src/photon/res/drawable-xhdpi/ic_qrcode_pm.png
mobile/android/app/src/photon/res/drawable-xxhdpi-v11/ic_status_logo.png
mobile/android/app/src/photon/res/drawable-xxhdpi/ic_qrcode_nm.png
mobile/android/app/src/photon/res/drawable-xxhdpi/ic_qrcode_pm.png
mobile/android/app/src/photon/res/drawable-xxxhdpi-v11/ic_status_logo.png
mobile/android/app/src/photon/res/drawable-xxxhdpi/ic_qrcode_nm.png
mobile/android/app/src/photon/res/drawable-xxxhdpi/ic_qrcode_pm.png
mobile/android/app/src/photon/res/drawable/ic_qrcode.xml
mobile/android/chrome/content/ActionBarHandler.js
mobile/android/chrome/content/FormAssistant.js
mobile/android/chrome/content/InputWidgetHelper.js
mobile/android/chrome/content/SelectHelper.js
mobile/android/chrome/content/WebrtcUI.js
mobile/android/services/src/main/java/org/mozilla/gecko/sync/DelayedWorkTracker.java
modules/libpref/init/all.js
netwerk/dns/nameprep.c
netwerk/dns/nameprep_template.c
netwerk/dns/nameprepdata.c
servo/components/style/cache.rs
taskcluster/docker/android-build/buildprops.json
taskcluster/docker/android-build/oauth.txt
taskcluster/docker/firefox-snap/distribution.ini
taskcluster/docker/funsize-update-generator/scripts/funsize.py
taskcluster/docker/recipes/install-mercurial.sh
taskcluster/scripts/builder/build-android-dependencies/after.sh
taskcluster/scripts/builder/build-android-dependencies/before.sh
taskcluster/taskgraph/transforms/toolchain.py
testing/talos/talos/tests/perf-reftest/bloom_basic.manifest
testing/talos/talos/tests/perf-reftest/bloom_basic_ref.manifest
testing/web-platform/meta/FileAPI/url/url_createobjecturl_blob.html.ini
testing/web-platform/meta/IndexedDB/keypath-special-identifiers.htm.ini
testing/web-platform/meta/content-security-policy/blink-contrib/object-src-applet-archive-codebase.sub.html.ini
testing/web-platform/meta/content-security-policy/blink-contrib/object-src-applet-archive.sub.html.ini
testing/web-platform/meta/content-security-policy/blink-contrib/object-src-applet-code-codebase.sub.html.ini
testing/web-platform/meta/content-security-policy/blink-contrib/object-src-applet-code.sub.html.ini
testing/web-platform/meta/css-font-display/font-display.html.ini
testing/web-platform/meta/css/CSS2/selectors/attribute-value-selector-002.xht.ini
testing/web-platform/meta/css/css-logical-properties-1/logicalprops-quirklength.html.ini
testing/web-platform/meta/css/css-ui-3/caret-color-020.html.ini
testing/web-platform/meta/css/css-ui-3/text-overflow-006.html.ini
testing/web-platform/meta/css/css-values-3/vh_not_refreshing_on_chrome.html.ini
testing/web-platform/meta/generic-sensor/idlharness.html.ini
testing/web-platform/meta/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-screeny.html.ini
testing/web-platform/meta/html/semantics/scripting-1/the-script-element/script-languages-01.html.ini
testing/web-platform/meta/html/semantics/scripting-1/the-script-element/script-languages-02.html.ini
testing/web-platform/meta/html/webappapis/system-state-and-capabilities/the-navigator-object/content.html.ini
testing/web-platform/meta/html/webappapis/system-state-and-capabilities/the-navigator-object/content/001.xhtml.ini
testing/web-platform/meta/html/webappapis/system-state-and-capabilities/the-navigator-object/content/002.xhtml.ini
testing/web-platform/meta/html/webappapis/system-state-and-capabilities/the-navigator-object/content/003.xhtml.ini
testing/web-platform/meta/html/webappapis/system-state-and-capabilities/the-navigator-object/content/004.xhtml.ini
testing/web-platform/meta/html/webappapis/system-state-and-capabilities/the-navigator-object/content/005.xhtml.ini
testing/web-platform/meta/html/webappapis/system-state-and-capabilities/the-navigator-object/content/006.xhtml.ini
testing/web-platform/meta/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/001.xhtml.ini
testing/web-platform/meta/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/002.xhtml.ini
testing/web-platform/meta/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/003.xhtml.ini
testing/web-platform/meta/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/004.xhtml.ini
testing/web-platform/meta/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/005.xhtml.ini
testing/web-platform/meta/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/006.xhtml.ini
testing/web-platform/meta/payment-request/payment-allowed-by-feature-policy-attribute-redirect-on-load.https.sub.html.ini
testing/web-platform/meta/payment-request/payment-allowed-by-feature-policy-attribute.https.sub.html.ini
testing/web-platform/meta/payment-request/payment-allowed-by-feature-policy.https.sub.html.ini
testing/web-platform/meta/payment-request/payment-default-feature-policy.https.sub.html.ini
testing/web-platform/meta/payment-request/payment-disabled-by-feature-policy.https.sub.html.ini
testing/web-platform/meta/payment-request/payment-request-update-event-constructor.http.html.ini
testing/web-platform/meta/payment-request/payment-request-update-event-constructor.https.html.ini
testing/web-platform/meta/payment-request/payment-request-update-event-updatewith-method.https.html.ini
testing/web-platform/meta/performance-timeline/idlharness.html.ini
testing/web-platform/meta/resource-timing/idlharness.html.ini
testing/web-platform/meta/websockets/constructor/011.html.ini
testing/web-platform/tests/auxclick/OWNERS
testing/web-platform/tests/clipboard/OWNERS
testing/web-platform/tests/content-security-policy/blink-contrib/object-src-applet-archive-codebase.sub.html
testing/web-platform/tests/content-security-policy/blink-contrib/object-src-applet-archive-codebase.sub.html.sub.headers
testing/web-platform/tests/content-security-policy/blink-contrib/object-src-applet-archive.sub.html
testing/web-platform/tests/content-security-policy/blink-contrib/object-src-applet-archive.sub.html.sub.headers
testing/web-platform/tests/content-security-policy/blink-contrib/object-src-applet-code-codebase.sub.html
testing/web-platform/tests/content-security-policy/blink-contrib/object-src-applet-code-codebase.sub.html.sub.headers
testing/web-platform/tests/content-security-policy/blink-contrib/object-src-applet-code.sub.html
testing/web-platform/tests/content-security-policy/blink-contrib/object-src-applet-code.sub.html.sub.headers
testing/web-platform/tests/css-font-display/font-display-ref.html
testing/web-platform/tests/css-font-display/font-display.html
testing/web-platform/tests/css-font-display/resources/slow-ahem-loading.py
testing/web-platform/tests/css/css-grid-1/grid-items/support/100x50-green.png
testing/web-platform/tests/css/css-grid-1/grid-items/support/50x100-green.png
testing/web-platform/tests/css/css-logical-properties-1/OWNERS
testing/web-platform/tests/css/css-logical-properties-1/logicalprops-block-size-vlr.html
testing/web-platform/tests/css/css-logical-properties-1/logicalprops-block-size.html
testing/web-platform/tests/css/css-logical-properties-1/logicalprops-inline-size-vlr.html
testing/web-platform/tests/css/css-logical-properties-1/logicalprops-inline-size.html
testing/web-platform/tests/css/css-logical-properties-1/logicalprops-quirklength.html
testing/web-platform/tests/css/css-logical-properties-1/resources/style-check.js
testing/web-platform/tests/css/css-logical-props-1/cascading-001-ref.html
testing/web-platform/tests/css/css-logical-props-1/cascading-001.html
testing/web-platform/tests/cssom-view/ttwf-scrollintoview.html
testing/web-platform/tests/generic-sensor/idlharness.html
testing/web-platform/tests/hr-time/window-worker-time-origin.html
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-language-type.html
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-languages-01.html
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-languages-02.html
testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content.html
testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/001.xhtml
testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/002.xhtml
testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/003.xhtml
testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/004.xhtml
testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/005.xhtml
testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/006.xhtml
testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/001.xhtml
testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/002.xhtml
testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/003.xhtml
testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/004.xhtml
testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/005.xhtml
testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/006.xhtml
testing/web-platform/tests/input-events/input-events-typing-data-manual.html
testing/web-platform/tests/microdata/conformance-requirements/.gitkeep
testing/web-platform/tests/microdata/converting-html-to-other-formats/.gitkeep
testing/web-platform/tests/microdata/converting-html-to-other-formats/json/.gitkeep
testing/web-platform/tests/microdata/dependencies/.gitkeep
testing/web-platform/tests/microdata/encoding-microdata/.gitkeep
testing/web-platform/tests/microdata/encoding-microdata/associating-names-with-items/.gitkeep
testing/web-platform/tests/microdata/encoding-microdata/items/.gitkeep
testing/web-platform/tests/microdata/encoding-microdata/microdata-and-other-namespaces/.gitkeep
testing/web-platform/tests/microdata/encoding-microdata/names-the-itemprop-attribute/.gitkeep
testing/web-platform/tests/microdata/encoding-microdata/names-the-itemprop-attribute/original-id.json
testing/web-platform/tests/microdata/encoding-microdata/the-microdata-model/.gitkeep
testing/web-platform/tests/microdata/encoding-microdata/values/.gitkeep
testing/web-platform/tests/microdata/iana/.gitkeep
testing/web-platform/tests/microdata/introduction/.gitkeep
testing/web-platform/tests/microdata/introduction/global-identifiers-for-items/.gitkeep
testing/web-platform/tests/microdata/introduction/overview/.gitkeep
testing/web-platform/tests/microdata/introduction/selecting-names-when-defining-vocabularies/.gitkeep
testing/web-platform/tests/microdata/introduction/the-basic-syntax/.gitkeep
testing/web-platform/tests/microdata/introduction/typed-items/.gitkeep
testing/web-platform/tests/microdata/introduction/using-the-microdata-dom-api/.gitkeep
testing/web-platform/tests/microdata/terminology/.gitkeep
testing/web-platform/tests/payment-request/payment-allowed-by-feature-policy-attribute-redirect-on-load.https.sub.html
testing/web-platform/tests/payment-request/payment-allowed-by-feature-policy-attribute.https.sub.html
testing/web-platform/tests/payment-request/payment-allowed-by-feature-policy.https.sub.html
testing/web-platform/tests/payment-request/payment-allowed-by-feature-policy.https.sub.html.headers
testing/web-platform/tests/payment-request/payment-default-feature-policy.https.sub.html
testing/web-platform/tests/payment-request/payment-disabled-by-feature-policy.https.sub.html
testing/web-platform/tests/payment-request/payment-disabled-by-feature-policy.https.sub.html.headers
testing/web-platform/tests/payment-request/payment-request-update-event-constructor.http.html
testing/web-platform/tests/payment-request/payment-request-update-event-constructor.https.html
testing/web-platform/tests/payment-request/payment-request-update-event-updatewith-method.https.html
testing/web-platform/tests/service-workers/service-worker/resources/registration-tests.js
testing/web-platform/tests/webdriver/tests/sessions/new_session/create.py
third_party/python/compare-locales/compare_locales/tests/test_webapps.py
third_party/python/compare-locales/compare_locales/webapps.py
third_party/rust/bit-set/.cargo-checksum.json
third_party/rust/bit-set/.cargo-ok
third_party/rust/bit-set/.travis.yml
third_party/rust/bit-set/Cargo.toml
third_party/rust/bit-set/LICENSE-APACHE
third_party/rust/bit-set/LICENSE-MIT
third_party/rust/bit-set/README.md
third_party/rust/bit-set/deploy-docs.sh
third_party/rust/bit-set/src/lib.rs
third_party/rust/bit-vec/.cargo-checksum.json
third_party/rust/bit-vec/.cargo-ok
third_party/rust/bit-vec/.travis.yml
third_party/rust/bit-vec/Cargo.toml
third_party/rust/bit-vec/LICENSE-APACHE
third_party/rust/bit-vec/LICENSE-MIT
third_party/rust/bit-vec/README.md
third_party/rust/bit-vec/benches/extern.rs
third_party/rust/bit-vec/crusader.sh
third_party/rust/bit-vec/deploy-docs.sh
third_party/rust/bit-vec/src/bench.rs
third_party/rust/bit-vec/src/lib.rs
toolkit/components/extensions/schemas/native_host_manifest.json
toolkit/components/extensions/test/xpcshell/test_native_messaging.js
toolkit/components/payments/content/paymentRequest.css
toolkit/components/payments/content/paymentRequest.js
toolkit/components/payments/content/paymentRequest.xhtml
--- a/.hgtags
+++ b/.hgtags
@@ -130,8 +130,9 @@ d98f20c25feeac4dd7ebbd1c022957df1ef58af4
 465d150bc8be5bbf9f02a8607d4552b6a5e1697c FIREFOX_AURORA_50_BASE
 fc69febcbf6c0dcc4b3dfc7a346d8d348798a65f FIREFOX_AURORA_51_BASE
 1196bf3032e1bce1fb07a01fd9082a767426c5fb FIREFOX_AURORA_52_BASE
 f80dc9fc34680105b714a49b4704bb843f5f7004 FIREFOX_AURORA_53_BASE
 6583496f169cd8a13c531ed16e98e8bf313eda8e FIREFOX_AURORA_54_BASE
 f9605772a0c9098ed1bcaa98089b2c944ed69e9b FIREFOX_BETA_55_BASE
 320642944e42a889db13c6c55b404e32319d4de6 FIREFOX_BETA_56_BASE
 8e818b5e9b6bef0fc1a5c527ecf30b0d56a02f14 FIREFOX_BETA_57_BASE
+f7e9777221a34f9f23c2e4933307eb38b621b679 FIREFOX_NIGHTLY_57_END
--- a/CLOBBER
+++ b/CLOBBER
@@ -17,9 +17,9 @@
 #
 # 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 1399970 / Bug 1399226 - Removed some now-unused icons. Clobbering to avoid `make package` failures, e.g., bug 1399686.
+Merge day clobber
--- a/accessible/base/Logging.cpp
+++ b/accessible/base/Logging.cpp
@@ -681,17 +681,17 @@ logging::Tree(const char* aTitle, const 
 
   nsAutoString level;
   Accessible* root = aRoot;
   do {
     const char* prefix = aPrefixFunc ? aPrefixFunc(aGetTreePrefixData, root) : "";
     printf("%s", NS_ConvertUTF16toUTF8(level).get());
     logging::AccessibleInfo(prefix, root);
     if (root->FirstChild() && !root->FirstChild()->IsDoc()) {
-      level.Append(NS_LITERAL_STRING("  "));
+      level.AppendLiteral(u"  ");
       root = root->FirstChild();
       continue;
     }
     int32_t idxInParent = root != aRoot && root->mParent ?
       root->mParent->mChildren.IndexOf(root) : -1;
     if (idxInParent != -1 &&
         idxInParent < static_cast<int32_t>(root->mParent->mChildren.Length() - 1)) {
       root = root->mParent->mChildren.ElementAt(idxInParent + 1);
@@ -719,17 +719,17 @@ logging::DOMTree(const char* aTitle, con
 {
   logging::MsgBegin(aTitle, "%s", aMsgText);
   nsAutoString level;
   nsINode* root = aDocument->DocumentNode();
   do {
     printf("%s", NS_ConvertUTF16toUTF8(level).get());
     logging::Node("", root);
     if (root->GetFirstChild()) {
-      level.Append(NS_LITERAL_STRING("  "));
+      level.AppendLiteral(u"  ");
       root = root->GetFirstChild();
       continue;
     }
     if (root->GetNextSibling()) {
       root = root->GetNextSibling();
       continue;
     }
     while ((root = root->GetParentNode())) {
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -1302,19 +1302,21 @@ nsAccessibilityService::Init()
     MOZ_ASSERT(contentChild);
     // If we were instantiated by the chrome process, GetMsaaID() will return
     // a non-zero value and we may safely continue with initialization.
     if (!contentChild->GetMsaaID()) {
       // Since we were not instantiated by chrome, we need to synchronously
       // obtain a MSAA content process id.
       contentChild->SendGetA11yContentId();
     }
+
+    gApplicationAccessible = new ApplicationAccessibleWrap();
+#else
+    gApplicationAccessible = new ApplicationAccessible();
 #endif // defined(XP_WIN)
-
-    gApplicationAccessible = new ApplicationAccessible();
   }
 
   NS_ADDREF(gApplicationAccessible); // will release in Shutdown()
   gApplicationAccessible->Init();
 
 #ifdef MOZ_CRASHREPORTER
   CrashReporter::
     AnnotateCrashReport(NS_LITERAL_CSTRING("Accessibility"),
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -1497,17 +1497,17 @@ DocAccessible::DoInitialUpdate()
       if (RefPtr<dom::TabChild> tabChild = dom::TabChild::GetFrom(docShell)) {
         DocAccessibleChild* ipcDoc = new DocAccessibleChild(this, tabChild);
         SetIPCDoc(ipcDoc);
         if (IsRoot()) {
           tabChild->SetTopLevelDocAccessibleChild(ipcDoc);
         }
 
 #if defined(XP_WIN)
-        IAccessibleHolder holder(CreateHolderFromAccessible(this));
+        IAccessibleHolder holder(CreateHolderFromAccessible(WrapNotNull(this)));
         MOZ_DIAGNOSTIC_ASSERT(!holder.IsNull());
         int32_t childID = AccessibleWrap::GetChildIDFor(this);
 #else
         int32_t holder = 0, childID = 0;
 #endif
         tabChild->SendPDocAccessibleConstructor(ipcDoc, nullptr, 0, childID,
                                                 holder);
       }
--- a/accessible/ipc/win/COMPtrTypes.cpp
+++ b/accessible/ipc/win/COMPtrTypes.cpp
@@ -6,41 +6,39 @@
 
 #include "mozilla/a11y/COMPtrTypes.h"
 
 #include "Accessible2_3.h"
 #include "MainThreadUtils.h"
 #include "mozilla/a11y/Accessible.h"
 #include "mozilla/a11y/Platform.h"
 #include "mozilla/a11y/HandlerProvider.h"
+#include "mozilla/Assertions.h"
 #include "mozilla/Move.h"
 #include "mozilla/mscom/MainThreadHandoff.h"
 #include "mozilla/mscom/Utils.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/RefPtr.h"
 #include "nsXULAppAPI.h"
 
 using mozilla::mscom::MainThreadHandoff;
 using mozilla::mscom::ProxyUniquePtr;
 using mozilla::mscom::STAUniquePtr;
 
 namespace mozilla {
 namespace a11y {
 
 IAccessibleHolder
-CreateHolderFromAccessible(Accessible* aAccToWrap)
+CreateHolderFromAccessible(NotNull<Accessible*> aAccToWrap)
 {
-  MOZ_ASSERT(aAccToWrap && NS_IsMainThread());
-  if (!aAccToWrap) {
-    return nullptr;
-  }
+  MOZ_ASSERT(NS_IsMainThread());
 
   STAUniquePtr<IAccessible> iaToProxy;
   aAccToWrap->GetNativeInterface(mscom::getter_AddRefs(iaToProxy));
-  MOZ_ASSERT(iaToProxy);
+  MOZ_DIAGNOSTIC_ASSERT(iaToProxy);
   if (!iaToProxy) {
     return nullptr;
   }
 
   static const bool useHandler =
     Preferences::GetBool("accessibility.handler.enabled", false) &&
     IsHandlerRegistered();
 
@@ -48,17 +46,17 @@ CreateHolderFromAccessible(Accessible* a
   if (useHandler) {
     payload = new HandlerProvider(IID_IAccessible,
                                   mscom::ToInterceptorTargetPtr(iaToProxy));
   }
 
   ProxyUniquePtr<IAccessible> intercepted;
   HRESULT hr = MainThreadHandoff::WrapInterface(Move(iaToProxy), payload,
                                                 (IAccessible**) mscom::getter_AddRefs(intercepted));
-  MOZ_ASSERT(SUCCEEDED(hr));
+  MOZ_DIAGNOSTIC_ASSERT(SUCCEEDED(hr));
   if (FAILED(hr)) {
     return nullptr;
   }
 
   return IAccessibleHolder(Move(intercepted));
 }
 
 IHandlerControlHolder
--- a/accessible/ipc/win/COMPtrTypes.h
+++ b/accessible/ipc/win/COMPtrTypes.h
@@ -4,29 +4,30 @@
  * 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 mozilla_a11y_COMPtrTypes_h
 #define mozilla_a11y_COMPtrTypes_h
 
 #include "mozilla/a11y/AccessibleHandler.h"
 #include "mozilla/mscom/COMPtrHolder.h"
+#include "mozilla/NotNull.h"
 
 #include <oleacc.h>
 
 namespace mozilla {
 namespace a11y {
 
 typedef mozilla::mscom::COMPtrHolder<IAccessible, IID_IAccessible> IAccessibleHolder;
 typedef mozilla::mscom::COMPtrHolder<IDispatch, IID_IDispatch> IDispatchHolder;
 
 class Accessible;
 
 IAccessibleHolder
-CreateHolderFromAccessible(Accessible* aAccToWrap);
+CreateHolderFromAccessible(NotNull<Accessible*> aAccToWrap);
 
 typedef mozilla::mscom::COMPtrHolder<IHandlerControl, IID_IHandlerControl> IHandlerControlHolder;
 
 IHandlerControlHolder
 CreateHolderFromHandlerControl(mscom::ProxyUniquePtr<IHandlerControl> aHandlerControl);
 
 } // namespace a11y
 } // namespace mozilla
--- a/accessible/tests/browser/tree/browser_aria_owns.js
+++ b/accessible/tests/browser/tree/browser_aria_owns.js
@@ -153,16 +153,24 @@ addAccessibleTask(`
     await contentSpawnMutation(browser, NO_MOVE, function() {
       document.getElementById("container").setAttribute("aria-owns", "a c b");
     });
 
     testChildrenIds(containerAcc.firstChild, ["a", "b", "c"]);
   }
 );
 
+// Don't crash if ID in aria-owns does not exist
+addAccessibleTask(`
+  <select id="container" aria-owns="boom" multiple></select>`,
+  async function(browser, accDoc) {
+    ok(true, "Did not crash");
+  }
+);
+
 addAccessibleTask(`
   <ul id="one">
     <li id="a">Test</li>
     <li id="b">Test 2</li>
     <li id="c">Test 3</li>
   </ul>
   <ul id="two"></ul>`,
   async function(browser, accDoc) {
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -216,19 +216,16 @@ pref("browser.eme.ui.enabled", false);
 pref("browser.uitour.enabled", true);
 pref("browser.uitour.loglevel", "Error");
 pref("browser.uitour.requireSecure", true);
 pref("browser.uitour.themeOrigin", "https://addons.mozilla.org/%LOCALE%/firefox/themes/");
 pref("browser.uitour.url", "https://www.mozilla.org/%LOCALE%/firefox/%VERSION%/tour/");
 // How long to show a Hearbeat survey (two hours, in seconds)
 pref("browser.uitour.surveyDuration", 7200);
 
-pref("browser.customizemode.tip0.shown", false);
-pref("browser.customizemode.tip0.learnMoreUrl", "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/customize");
-
 pref("keyword.enabled", true);
 pref("browser.fixup.domainwhitelist.localhost", true);
 
 pref("general.useragent.locale", "@AB_CD@");
 pref("general.skins.selectedSkin", "classic/1.0");
 
 pref("general.smoothScroll", true);
 #ifdef UNIX_BUT_NOT_MAC
@@ -494,30 +491,26 @@ pref("browser.ctrlTab.previews", false);
 pref("browser.bookmarks.autoExportHTML",          false);
 
 // The maximum number of daily bookmark backups to
 // keep in {PROFILEDIR}/bookmarkbackups. Special values:
 // -1: unlimited
 //  0: no backups created (and deletes all existing backups)
 pref("browser.bookmarks.max_backups",             15);
 
-pref("browser.bookmarks.showRecentlyBookmarked",  true);
-
 // Whether menu should close after Ctrl-click, middle-click, etc.
 pref("browser.bookmarks.openInTabClosesMenu", true);
 
 // Scripts & Windows prefs
 pref("dom.disable_open_during_load",              true);
 pref("javascript.options.showInConsole",          true);
 #ifdef DEBUG
 pref("general.warnOnAboutConfig",                 false);
 #endif
 
-pref("jsloader.shareGlobal", true);
-
 // This is the pref to control the location bar, change this to true to
 // force this - this makes the origin of popup windows more obvious to avoid
 // spoofing. We would rather not do it by default because it affects UE for web
 // applications, but without it there isn't a really good way to prevent chrome
 // spoofing, see bug 337344
 pref("dom.disable_window_open_feature.location",  true);
 // prevent JS from setting status messages
 pref("dom.disable_window_status_change",          true);
@@ -675,16 +668,20 @@ pref("network.protocol-handler.expose.ne
 pref("network.protocol-handler.expose.snews", false);
 pref("network.protocol-handler.expose.nntp", false);
 
 pref("accessibility.typeaheadfind", false);
 pref("accessibility.typeaheadfind.timeout", 5000);
 pref("accessibility.typeaheadfind.linksonly", false);
 pref("accessibility.typeaheadfind.flashBar", 1);
 
+// Accessibility indicator preferences such as support URL, enabled flag.
+pref("accessibility.support.url", "https://support.mozilla.org/%LOCALE%/kb/accessibility-services");
+pref("accessibility.indicator.enabled", true);
+
 pref("plugins.click_to_play", true);
 pref("plugins.testmode", false);
 
 // Should plugins that are hidden show the infobar UI?
 pref("plugins.show_infobar", false);
 
 // Should dismissing the hidden plugin infobar suppress it permanently?
 pref("plugins.remember_infobar_dismissal", true);
@@ -692,24 +689,18 @@ pref("plugins.remember_infobar_dismissal
 pref("plugin.default.state", 1);
 
 // Plugins bundled in XPIs are enabled by default.
 pref("plugin.defaultXpi.state", 2);
 
 // Java is Click-to-Activate by default on all channels.
 pref("plugin.state.java", 1);
 
-// Flash is Click-to-Activate by default on Nightly.
-// On other channels, it will be controlled by a
-// rollout system addon.
-#ifdef NIGHTLY_BUILD
+// Flash is Click-to-Activate by default on all channels.
 pref("plugin.state.flash", 1);
-#else
-pref("plugin.state.flash", 2);
-#endif
 
 // Enables the download and use of the flash blocklists.
 pref("plugins.flashBlock.enabled", true);
 
 // Prefer HTML5 video over Flash content, and don't
 // load plugin instances with no src declared.
 // These prefs are documented in details on all.js.
 // With the "follow-ctp" setting, this will only
@@ -1034,17 +1025,21 @@ pref("dom.ipc.plugins.sandbox-level.flas
 #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:
 // See - security/sandbox/win/src/sandboxbroker/sandboxBroker.cpp
 // SetSecurityLevelForContentProcess() for what the different settings mean.
+#if defined(NIGHTLY_BUILD)
 pref("security.sandbox.content.level", 4);
+#else
+pref("security.sandbox.content.level", 3);
+#endif
 
 // This controls the depth of stack trace that is logged when Windows sandbox
 // logging is turned on.  This is only currently available for the content
 // process because the only other sandbox (for GMP) has too strict a policy to
 // allow stack tracing.  This does not require a restart to take effect.
 pref("security.sandbox.windows.log.stackTraceDepth", 0);
 #endif
 
@@ -1087,21 +1082,17 @@ pref("security.sandbox.content.level", 3
 // to whitelist more system calls.
 //
 // So the purpose of this setting is to allow nightly users to disable the
 // sandbox while we fix their problems. This way, they won't have to wait for
 // another nightly release which disables seccomp-bpf again.
 //
 // This setting may not be required anymore once we decide to permanently
 // enable the content sandbox.
-#ifdef NIGHTLY_BUILD
 pref("security.sandbox.content.level", 3);
-#else
-pref("security.sandbox.content.level", 2);
-#endif
 pref("security.sandbox.content.write_path_whitelist", "");
 pref("security.sandbox.content.read_path_whitelist", "");
 pref("security.sandbox.content.syscall_whitelist", "");
 #endif
 
 #if defined(XP_MACOSX) || defined(XP_WIN)
 #if defined(MOZ_SANDBOX) && defined(MOZ_CONTENT_SANDBOX)
 // ID (a UUID when set by gecko) that is used to form the name of a
@@ -1271,16 +1262,18 @@ pref("browser.newtabpage.columns", 5);
 // directory tiles download URL
 pref("browser.newtabpage.directory.source", "https://tiles.services.mozilla.com/v3/links/fetch/%LOCALE%/%CHANNEL%");
 
 // activates Activity Stream
 pref("browser.newtabpage.activity-stream.enabled", true);
 pref("browser.newtabpage.activity-stream.prerender", true);
 pref("browser.newtabpage.activity-stream.aboutHome.enabled", true);
 
+pref("browser.library.activity-stream.enabled", true);
+
 // Enable the DOM fullscreen API.
 pref("full-screen-api.enabled", true);
 
 // Startup Crash Tracking
 // number of startup crashes that can occur before starting into safe mode automatically
 // (this pref has no effect if more than 6 hours have passed since the last crash)
 pref("toolkit.startup.max_resumed_crashes", 3);
 
@@ -1533,16 +1526,17 @@ pref("privacy.userContext.longPressBehav
 #else
 pref("privacy.userContext.enabled", false);
 pref("privacy.userContext.ui.enabled", false);
 pref("privacy.usercontext.about_newtab_segregation.enabled", false);
 
 // 0 disables long press, 1 when clicked, the menu is shown, 2 the menu is shown after X milliseconds.
 pref("privacy.userContext.longPressBehavior", 0);
 #endif
+pref("privacy.userContext.extension", "");
 
 // Start the browser in e10s mode
 pref("browser.tabs.remote.autostart", false);
 pref("browser.tabs.remote.desktopbehavior", true);
 
 #if !defined(RELEASE_OR_BETA) || defined(MOZ_DEV_EDITION)
 // 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
--- a/browser/base/content/aboutNetError.xhtml
+++ b/browser/base/content/aboutNetError.xhtml
@@ -156,23 +156,37 @@
         }
         if (cssClass == "badStsCert") {
           document.getElementById("badStsCertExplanation").removeAttribute("hidden");
         }
       }
 
       function initPage() {
         var err = getErrorCode();
+        // List of error pages with an illustration.
+        let illustratedErrors = [
+          "malformedURI", "dnsNotFound", "connectionFailure", "netInterrupt",
+          "netTimeout", "netReset", "netOffline",
+        ];
+        if (illustratedErrors.includes(err)) {
+          document.body.classList.add("illustrated", err);
+        }
+
         gIsCertError = (err == "nssBadCert");
         // Only worry about captive portals if this is a cert error.
         let showCaptivePortalUI = isCaptive() && gIsCertError;
         if (showCaptivePortalUI) {
           err = "captivePortal";
         }
 
+        let pageTitle = document.getElementById("ept_" + err);
+        if (pageTitle) {
+          document.title = pageTitle.textContent;
+        }
+
         // if it's an unknown error or there's no title or description
         // defined, get the generic message
         var errTitle = document.getElementById("et_" + err);
         var errDesc  = document.getElementById("ed_" + err);
         if (!errTitle || !errDesc) {
           errTitle = document.getElementById("et_generic");
           errDesc  = document.getElementById("ed_generic");
         }
@@ -194,17 +208,17 @@
           return;
         }
         if (gIsCertError) {
           initPageCertError();
           return;
         }
         addAutofocus("errorTryAgain");
 
-        document.body.className = "neterror";
+        document.body.classList.add("neterror");
 
         var ld = document.getElementById("errorLongDesc");
         if (ld) {
         // eslint-disable-next-line no-unsanitized/property
           ld.innerHTML = errDesc.innerHTML;
         }
 
         if (err == "sslv3Used") {
@@ -305,18 +319,16 @@
           }
         }
 
         addDomainErrorLinks();
       }
 
       function initPageCaptivePortal() {
         document.body.className = "captiveportal";
-        document.title = document.getElementById("captivePortalPageTitle").textContent;
-
         document.getElementById("openPortalLoginPageButton")
                 .addEventListener("click", () => {
           let event = new CustomEvent("AboutNetErrorOpenCaptivePortal", {bubbles: true});
           document.dispatchEvent(event);
         });
 
         addAutofocus("openPortalLoginPageButton");
         setupAdvancedButton();
@@ -327,17 +339,16 @@
         // that we can pick up and attempt to reload the original page.
         window.addEventListener("AboutNetErrorCaptivePortalFreed", () => {
           document.location.reload();
         });
       }
 
       function initPageCertError() {
         document.body.className = "certerror";
-        document.title = document.getElementById("certErrorPageTitle").textContent;
         for (let host of document.querySelectorAll(".hostname")) {
           host.textContent = document.location.hostname;
         }
 
         addAutofocus("returnButton");
         setupAdvancedButton();
 
         document.getElementById("learnMoreContainer").style.display = "block";
@@ -505,29 +516,31 @@
         anchorEl.setAttribute("title", text);
         anchorEl.appendChild(document.createTextNode(text));
         el.appendChild(anchorEl);
       }
     ]]></script>
   </head>
 
   <body dir="&locale.dir;">
-    <!-- Contains an alternate page title set on page init for cert errors. -->
-    <div id="certErrorPageTitle" style="display: none;">&certerror.pagetitle1;</div>
-    <div id="captivePortalPageTitle" style="display: none;">&captivePortal.title;</div>
-
     <!-- ERROR ITEM CONTAINER (removed during loading to avoid bug 39098) -->
     <div id="errorContainer">
+      <div id="errorPageTitlesContainer">
+        <span id="ept_nssBadCert">&certerror.pagetitle1;</span>
+        <span id="ept_captivePortal">&captivePortal.title;</span>
+        <span id="ept_dnsNotFound">&dnsNotFound.pageTitle;</span>
+        <span id="ept_malformedURI">&malformedURI.pageTitle;</span>
+      </div>
       <div id="errorTitlesContainer">
         <h1 id="et_generic">&generic.title;</h1>
         <h1 id="et_captivePortal">&captivePortal.title;</h1>
-        <h1 id="et_dnsNotFound">&dnsNotFound.title;</h1>
+        <h1 id="et_dnsNotFound">&dnsNotFound.title1;</h1>
         <h1 id="et_fileNotFound">&fileNotFound.title;</h1>
         <h1 id="et_fileAccessDenied">&fileAccessDenied.title;</h1>
-        <h1 id="et_malformedURI">&malformedURI.title;</h1>
+        <h1 id="et_malformedURI">&malformedURI.title1;</h1>
         <h1 id="et_unknownProtocolFound">&unknownProtocolFound.title;</h1>
         <h1 id="et_connectionFailure">&connectionFailure.title;</h1>
         <h1 id="et_netTimeout">&netTimeout.title;</h1>
         <h1 id="et_redirectLoop">&redirectLoop.title;</h1>
         <h1 id="et_unknownSocketType">&unknownSocketType.title;</h1>
         <h1 id="et_netReset">&netReset.title;</h1>
         <h1 id="et_notCached">&notCached.title;</h1>
         <h1 id="et_netOffline">&netOffline.title;</h1>
@@ -543,20 +556,20 @@
         <h1 id="et_remoteXUL">&remoteXUL.title;</h1>
         <h1 id="et_corruptedContentErrorv2">&corruptedContentErrorv2.title;</h1>
         <h1 id="et_sslv3Used">&sslv3Used.title;</h1>
         <h1 id="et_inadequateSecurityError">&inadequateSecurityError.title;</h1>
       </div>
       <div id="errorDescriptionsContainer">
         <div id="ed_generic">&generic.longDesc;</div>
         <div id="ed_captivePortal">&captivePortal.longDesc2;</div>
-        <div id="ed_dnsNotFound">&dnsNotFound.longDesc;</div>
+        <div id="ed_dnsNotFound">&dnsNotFound.longDesc1;</div>
         <div id="ed_fileNotFound">&fileNotFound.longDesc;</div>
         <div id="ed_fileAccessDenied">&fileAccessDenied.longDesc;</div>
-        <div id="ed_malformedURI">&malformedURI.longDesc;</div>
+        <div id="ed_malformedURI"></div>
         <div id="ed_unknownProtocolFound">&unknownProtocolFound.longDesc;</div>
         <div id="ed_connectionFailure">&connectionFailure.longDesc;</div>
         <div id="ed_netTimeout">&netTimeout.longDesc;</div>
         <div id="ed_redirectLoop">&redirectLoop.longDesc;</div>
         <div id="ed_unknownSocketType">&unknownSocketType.longDesc;</div>
         <div id="ed_netReset">&netReset.longDesc;</div>
         <div id="ed_notCached">&notCached.longDesc;</div>
         <div id="ed_netOffline">&netOffline.longDesc2;</div>
@@ -573,43 +586,45 @@
         <div id="ed_corruptedContentErrorv2">&corruptedContentErrorv2.longDesc;</div>
         <div id="ed_sslv3Used">&sslv3Used.longDesc2;</div>
         <div id="ed_inadequateSecurityError">&inadequateSecurityError.longDesc;</div>
       </div>
     </div>
 
     <!-- PAGE CONTAINER (for styling purposes only) -->
     <div id="errorPageContainer" class="container">
-      <!-- Error Title -->
-      <div class="title">
-        <h1 class="title-text"/>
-      </div>
-
-      <!-- LONG CONTENT (the section most likely to require scrolling) -->
-      <div id="errorLongContent">
-
-        <!-- Short Description -->
-        <div id="errorShortDesc">
-          <p id="errorShortDescText" />
-        </div>
-        <p id="badStsCertExplanation" hidden="true">&certerror.whatShouldIDo.badStsCertExplanation;</p>
-
-        <div id="wrongSystemTimePanel" style="display: none;">
-          &certerror.wrongSystemTime2;
+      <div id="text-container">
+        <!-- Error Title -->
+        <div class="title">
+          <h1 class="title-text"/>
         </div>
 
-        <div id="wrongSystemTimeWithoutReferencePanel" style="display: none;">
-          &certerror.wrongSystemTimeWithoutReference;
-        </div>
+        <!-- LONG CONTENT (the section most likely to require scrolling) -->
+        <div id="errorLongContent">
+
+          <!-- Short Description -->
+          <div id="errorShortDesc">
+            <p id="errorShortDescText" />
+          </div>
+          <p id="badStsCertExplanation" hidden="true">&certerror.whatShouldIDo.badStsCertExplanation;</p>
 
-        <!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
-        <div id="errorLongDesc" />
+          <div id="wrongSystemTimePanel" style="display: none;">
+            &certerror.wrongSystemTime2;
+          </div>
 
-        <div id="learnMoreContainer">
-          <p><a href="https://support.mozilla.org/kb/what-does-your-connection-is-not-secure-mean" id="learnMoreLink" target="new">&errorReporting.learnMore;</a></p>
+          <div id="wrongSystemTimeWithoutReferencePanel" style="display: none;">
+            &certerror.wrongSystemTimeWithoutReference;
+          </div>
+
+          <!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
+          <div id="errorLongDesc" />
+
+          <div id="learnMoreContainer">
+            <p><a href="https://support.mozilla.org/kb/what-does-your-connection-is-not-secure-mean" id="learnMoreLink" target="new">&errorReporting.learnMore;</a></p>
+          </div>
         </div>
 
         <!-- UI for option to report certificate errors to Mozilla. Removed on
              init for other error types .-->
         <div id="certificateErrorReporting">
           <p class="toggle-container-with-text">
             <input type="checkbox" id="automaticallyReportInFuture" role="checkbox" />
             <label for="automaticallyReportInFuture" id="automaticallyReportInFuture">&errorReporting.automatic2;</label>
--- a/browser/base/content/aboutTabCrashed.xhtml
+++ b/browser/base/content/aboutTabCrashed.xhtml
@@ -22,75 +22,77 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
     <link rel="stylesheet" type="text/css" media="all"
           href="chrome://global/skin/in-content/info-pages.css"/>
     <link rel="stylesheet" type="text/css" media="all"
           href="chrome://browser/content/aboutTabCrashed.css"/>
     <link rel="stylesheet" type="text/css" media="all"
           href="chrome://browser/skin/aboutTabCrashed.css"/>
+
+    <title>&tabCrashed.title;</title>
   </head>
 
   <body dir="&locale.dir;">
     <div id="main" class="container" multiple="false">
 
       <div class="title">
         <h1 class="title-text">&tabCrashed.header2;</h1>
       </div>
 
       <div class="offers">
-        <h2>&tabCrashed.offerHelp;</h2>
-        <p id="offerHelpMessageSingle">&tabCrashed.single.offerHelpMessage;</p>
-        <p id="offerHelpMessageMultiple">&tabCrashed.multiple.offerHelpMessage;</p>
+        <h2>&tabCrashed.offerHelp2;</h2>
+        <p id="offerHelpMessageSingle">&tabCrashed.single.offerHelpMessage2;</p>
+        <p id="offerHelpMessageMultiple">&tabCrashed.multiple.offerHelpMessage2;</p>
       </div>
 
       <div id="reportBox">
         <h2>&tabCrashed.requestHelp;</h2>
         <p>&tabCrashed.requestHelpMessage;</p>
 
         <h2>&tabCrashed.requestReport;</h2>
 
         <div class="checkbox-with-label">
           <input type="checkbox" id="sendReport" role="checkbox"/>
-          <label for="sendReport">&tabCrashed.sendReport2;</label>
+          <label for="sendReport">&tabCrashed.sendReport3;</label>
         </div>
 
         <ul id="options">
           <li>
             <textarea id="comments" placeholder="&tabCrashed.commentPlaceholder2;" rows="4"></textarea>
           </li>
 
           <li class="checkbox-with-label">
             <input type="checkbox" id="includeURL" role="checkbox"/>
-            <label for="includeURL">&tabCrashed.includeURL2;</label>
+            <label for="includeURL">&tabCrashed.includeURL3;</label>
           </li>
 
           <li id="requestEmail" hidden="true">
             <div class="checkbox-with-label">
               <input type="checkbox" id="emailMe" role="checkbox"/>
               <label for="emailMe">&tabCrashed.emailMe;</label>
             </div>
             <input type="text" id="email" placeholder="&tabCrashed.emailPlaceholder;"/>
           </li>
         </ul>
 
         <div id="requestAutoSubmit" hidden="true">
           <h2>&tabCrashed.requestAutoSubmit2;</h2>
           <div class="checkbox-with-label">
             <input type="checkbox" id="autoSubmit" role="checkbox"/>
-            <label for="autoSubmit">&tabCrashed.autoSubmit2;</label>
+            <label for="autoSubmit">&tabCrashed.autoSubmit3;</label>
           </div>
         </div>
       </div>
 
       <p id="reportSent">&tabCrashed.reportSent;</p>
 
       <div class="button-container">
         <button id="closeTab">
-          &tabCrashed.closeTab;</button>
+          &tabCrashed.closeTab2;</button>
         <button id="restoreTab" class="primary">
           &tabCrashed.restoreTab;</button>
         <button id="restoreAll" autofocus="true" class="primary">
           &tabCrashed.restoreAll;</button>
       </div>
     </div>
   </body>
   <script type="text/javascript" src="chrome://browser/content/aboutTabCrashed.js"/>
--- a/browser/base/content/blockedSite.xhtml
+++ b/browser/base/content/blockedSite.xhtml
@@ -51,18 +51,19 @@
 
         // If this is a view-source page, then get then real URI of the page
         if (url.startsWith("view-source:"))
           url = url.slice(12);
         return url;
       }
 
       /**
-       * Check whether this warning page should be overridable or whether
-       * the "ignore warning" button should be hidden.
+       * Check whether this warning page is overridable or not, in which case
+       * the "ignore the risk" suggestion in the error description
+       * should not be shown.
        */
       function getOverride() {
         var url = document.documentURI;
         var match = url.match(/&o=1&/);
         return !!match;
       }
 
       /**
@@ -72,16 +73,25 @@
       function getHostString() {
         try {
           return document.location.hostname;
         } catch (e) {
           return getURL();
         }
       }
 
+      function onClickSeeDetails() {
+        let details = document.getElementById("errorDescriptionContainer");
+        if (details.hidden == true) {
+          details.removeAttribute("hidden");
+        } else {
+          details.setAttribute("hidden", "true");
+        }
+      }
+
       function initPage() {
         var error = "";
         switch (getErrorCode()) {
           case "malwareBlocked" :
             error = "malware";
             break;
           case "deceptiveBlocked" :
             error = "phishing";
@@ -98,111 +108,129 @@
 
         var el;
 
         if (error !== "malware") {
           el = document.getElementById("errorTitleText_malware");
           el.remove();
           el = document.getElementById("errorShortDescText_malware");
           el.remove();
-          el = document.getElementById("errorLongDescText_malware");
+          el = document.getElementById("errorLongDesc_malware");
           el.remove();
         }
 
         if (error !== "phishing") {
           el = document.getElementById("errorTitleText_phishing");
           el.remove();
           el = document.getElementById("errorShortDescText_phishing");
           el.remove();
-          el = document.getElementById("errorLongDescText_phishing");
+          el = document.getElementById("errorLongDesc_phishing");
           el.remove();
         }
 
         if (error !== "unwanted") {
           el = document.getElementById("errorTitleText_unwanted");
           el.remove();
           el = document.getElementById("errorShortDescText_unwanted");
           el.remove();
-          el = document.getElementById("errorLongDescText_unwanted");
+          el = document.getElementById("errorLongDesc_unwanted");
           el.remove();
         }
 
         if (error !== "harmful") {
           el = document.getElementById("errorTitleText_harmful");
           el.remove();
           el = document.getElementById("errorShortDescText_harmful");
           el.remove();
+          el = document.getElementById("errorLongDesc_harmful");
+          el.remove();
         }
 
-        // Set sitename if necessary.
-        let sitenameElem = document.getElementById(error + "_sitename");
-        if (sitenameElem) {
-          sitenameElem.textContent = getHostString();
+        // Decide which version of the string should be visible in the error description.
+        if (getOverride()) {
+          document.getElementById(error + "_error_desc_no_override").remove();
+        } else {
+          document.getElementById(error + "_error_desc_override").remove();
         }
 
-        document.title = document.getElementById("errorTitleText_" + error)
-                                 .innerHTML;
+        // Set sitename in error details.
+        let sitenameElem = document.getElementById(error + "_sitename");
+        sitenameElem.setAttribute("class", "sitename");
+        sitenameElem.textContent = getHostString();
+
+        document.title = document.getElementById("errorTitleText_" + error).textContent;
 
-        if (!getOverride()) {
-          var btn = document.getElementById("ignoreWarningButton");
-          if (btn) {
-            btn.remove();
-          }
-        }
-
-        // Inform the test harness that we're done loading the page
-        var event = new CustomEvent("AboutBlockedLoaded", {bubbles: true});
+        // Inform the test harness that we're done loading the page.
+        var event = new CustomEvent("AboutBlockedLoaded",
+          {
+            bubbles: true,
+            detail: {
+              url: this.getURL(),
+              err: error
+            }
+          });
         document.dispatchEvent(event);
       }
     ]]></script>
   </head>
 
   <body dir="&locale.dir;">
     <div id="errorPageContainer" class="container">
 
       <!-- Error Title -->
       <div id="errorTitle" class="title">
-        <h1 class="title-text" id="errorTitleText_phishing">&safeb.blocked.phishingPage.title2;</h1>
-        <h1 class="title-text" id="errorTitleText_malware">&safeb.blocked.malwarePage.title;</h1>
-        <h1 class="title-text" id="errorTitleText_unwanted">&safeb.blocked.unwantedPage.title;</h1>
+        <h1 class="title-text" id="errorTitleText_phishing">&safeb.blocked.phishingPage.title3;</h1>
+        <h1 class="title-text" id="errorTitleText_malware">&safeb.blocked.malwarePage.title2;</h1>
+        <h1 class="title-text" id="errorTitleText_unwanted">&safeb.blocked.unwantedPage.title2;</h1>
         <h1 class="title-text" id="errorTitleText_harmful">&safeb.blocked.harmfulPage.title;</h1>
       </div>
 
       <div id="errorLongContent">
 
         <!-- Short Description -->
         <div id="errorShortDesc">
-          <p id="errorShortDescText_phishing">&safeb.blocked.phishingPage.shortDesc2;</p>
-          <p id="errorShortDescText_malware">&safeb.blocked.malwarePage.shortDesc;</p>
-          <p id="errorShortDescText_unwanted">&safeb.blocked.unwantedPage.shortDesc;</p>
+          <p id="errorShortDescText_phishing">&safeb.blocked.phishingPage.shortDesc3;</p>
+          <p id="errorShortDescText_malware">&safeb.blocked.malwarePage.shortDesc2;</p>
+          <p id="errorShortDescText_unwanted">&safeb.blocked.unwantedPage.shortDesc2;</p>
           <p id="errorShortDescText_harmful">&safeb.blocked.harmfulPage.shortDesc2;</p>
         </div>
 
-        <!-- Long Description -->
-        <div id="errorLongDesc">
-          <p id="errorLongDescText_phishing">&safeb.blocked.phishingPage.longDesc2;</p>
-          <p id="errorLongDescText_malware">&safeb.blocked.malwarePage.longDesc;</p>
-          <p id="errorLongDescText_unwanted">&safeb.blocked.unwantedPage.longDesc;</p>
-        </div>
-
         <!-- Advisory -->
         <div id="advisoryDesc">
-          <p id="advisoryDescText">&safeb.palm.advisory.desc;</p>
+          <p id="advisoryDescText">&safeb.palm.advisory.desc2;</p>
         </div>
 
         <!-- Action buttons -->
         <div id="buttons" class="button-container">
           <!-- Commands handled in browser.js -->
-          <button id="getMeOutButton" class="primary">&safeb.palm.accept.label;</button>
-          <div class="button-spacer"></div>
-          <button id="reportButton">&safeb.palm.reportPage.label;</button>
+          <button id="goBackButton">&safeb.palm.accept.label2;</button>
+          <button id="seeDetailsButton" onclick="onClickSeeDetails();">&safeb.palm.seedetails.label;</button>
         </div>
       </div>
-      <div id="ignoreWarning">
-        <button id="ignoreWarningButton">&safeb.palm.decline.label;</button>
+      <div id="errorDescriptionContainer" hidden="true">
+        <div class="error-description" id="errorLongDesc_phishing">
+          <p id="phishing_error_desc_override">&safeb.blocked.phishingPage.errorDesc.override;</p>
+          <p id="phishing_error_desc_no_override">&safeb.blocked.phishingPage.errorDesc.noOverride;</p>
+          <p id="phishing_learn_more">&safeb.blocked.phishingPage.learnMore;</p>
+        </div>
+        <div class="error-description" id="errorLongDesc_malware">
+          <p id="malware_error_desc_override">&safeb.blocked.malwarePage.errorDesc.override;</p>
+          <p id="malware_error_desc_no_override">&safeb.blocked.malwarePage.errorDesc.noOverride;</p>
+          <p id="malware_learn_more">&safeb.blocked.malwarePage.learnMore;</p>
+        </div>
+        <div class="error-description" id="errorLongDesc_unwanted">
+          <p id="unwanted_error_desc_override">&safeb.blocked.unwantedPage.errorDesc.override;</p>
+          <p id="unwanted_error_desc_no_override">&safeb.blocked.unwantedPage.errorDesc.noOverride;</p>
+          <p id="unwanted_learn_more">&safeb.blocked.unwantedPage.learnMore;</p>
+        </div>
+        <div class="error-description" id="errorLongDesc_harmful">
+          <p id="harmful_error_desc_override">&safeb.blocked.harmfulPage.errorDesc.override;</p>
+          <p id="harmful_error_desc_no_override">&safeb.blocked.harmfulPage.errorDesc.noOverride;</p>
+          <p id="harmful_learn_more">&safeb.blocked.harmfulPage.learnMore;</p>
+        </div>
       </div>
     </div>
     <!--
     - Note: It is important to run the script this way, instead of using
     - an onload handler. This is because error pages are loaded as
     - LOAD_BACKGROUND, which means that onload handlers will not be executed.
     -->
     <script type="application/javascript">
--- a/browser/base/content/browser-menubar.inc
+++ b/browser/base/content/browser-menubar.inc
@@ -420,20 +420,16 @@
                    oncommand="return FeedHandler.subscribeToFeed(null, event);"
                    onclick="checkForMiddleClick(this, event);"/>
       </menu>
       <menuitem id="menu_bookmarkAllTabs"
                 label="&addCurPagesCmd.label;"
                 class="show-only-for-keyboard"
                 command="Browser:BookmarkAllTabs"
                 key="bookmarkAllTabsKb"/>
-      <menuseparator/>
-      <menuitem label="&recentBookmarks.label;"
-                id="menu_recentBookmarks"
-                disabled="true"/>
       <menuseparator id="bookmarksToolbarSeparator"/>
       <menu id="bookmarksToolbarFolderMenu"
             class="menu-iconic bookmark-item"
             label="&personalbarCmd.label;"
             container="true">
         <menupopup id="bookmarksToolbarFolderPopup"
 #ifndef XP_MACOSX
                    placespopup="true"
--- a/browser/base/content/browser-pageActions.js
+++ b/browser/base/content/browser-pageActions.js
@@ -236,27 +236,29 @@ var BrowserPageActions = {
       }
       panelNode.remove();
     }, { once: true });
 
     panelNode.addEventListener("popuphiding", () => {
       if (iframeNode) {
         action.onIframeHiding(iframeNode, panelNode);
       }
+      anchorNode.removeAttribute("open");
     }, { once: true });
 
     if (panelViewNode) {
       action.subview.onPlaced(panelViewNode);
       action.subview.onShowing(panelViewNode);
     }
 
     // Hide the main page action panel before showing the activated-action
     // panel.
     this.panelNode.hidePopup();
     panelNode.openPopup(anchorNode, "bottomcenter topright");
+    anchorNode.setAttribute("open", "true");
 
     if (iframeNode) {
       action.onIframeShown(iframeNode, panelNode);
     }
 
     return panelNode;
   },
 
@@ -588,16 +590,20 @@ var BrowserPageActions = {
   showPanel(event = null) {
     for (let action of PageActions.actions) {
       let buttonNodeID = this._panelButtonNodeIDForActionID(action.id);
       let buttonNode = document.getElementById(buttonNodeID);
       action.onShowingInPanel(buttonNode);
     }
 
     this.panelNode.hidden = false;
+    this.panelNode.addEventListener("popuphiding", () => {
+      this.mainButtonNode.removeAttribute("open");
+    }, {once: true});
+    this.mainButtonNode.setAttribute("open", "true");
     this.panelNode.openPopup(this.mainButtonNode, {
       position: "bottomcenter topright",
       triggerEvent: event,
     });
   },
 
   /**
    * Call this on the contextmenu event.  Note that this is called before
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -330,16 +330,22 @@ var StarUI = {
       }, {"capture": true, "once": true});
     };
     gEditItemOverlay.initPanel({ node: aNode,
                                  onPanelReady,
                                  hiddenRows: ["description", "location",
                                               "loadInSidebar", "keyword"],
                                  focusedElement: "preferred"});
 
+    if (aAnchorElement && aAnchorElement.id == BookmarkingUI.STAR_BOX_ID) {
+      aAnchorElement.setAttribute("open", "true");
+      this.panel.addEventListener("popuphiding", () => {
+        aAnchorElement.removeAttribute("open");
+      });
+    }
     this.panel.openPopup(aAnchorElement, aPosition);
   },
 
   panelShown:
   function SU_panelShown(aEvent) {
     if (aEvent.target == this.panel) {
       if (this._element("editBookmarkPanelContent").hidden) {
         // Note this isn't actually used anymore, we should remove this
@@ -1270,267 +1276,16 @@ var PlacesToolbarHelper = {
       if (this._viewElt._placesView) {
         this._viewElt._placesView.uninit();
       }
       this.init();
     }
   },
 };
 
-var RecentBookmarksMenuUI = {
-  RECENTLY_BOOKMARKED_PREF: "browser.bookmarks.showRecentlyBookmarked",
-  MAX_RESULTS: 5,
-  // This timeout affects how soon the recent menu items are updated when
-  // an onItemRemoved notification is received - when we receive a notification,
-  // we delay updating the UI in case another is received. If one is, then we
-  // we'll restart the wait again. It wants to be more than 16ms (60fps) but
-  // probably less than 100ms.
-  ITEM_REMOVED_TIMEOUT: 40,
-
-  _recentGuids: undefined,
-  _visible: undefined,
-
-  QueryInterface: XPCOMUtils.generateQI([
-    Ci.nsINavBookmarkObserver,
-    Ci.nsIObserver,
-    Ci.nsISupportsWeakReference
-  ]),
-
-  get visible() {
-    return this._visible;
-  },
-
-  /**
-   * Set the visibility of the recently bookmarked menu items.
-   *
-   * @param {Boolean} show Set to true to show the menu items, false otherwise.
-   */
-  set visible(visible) {
-    // If we're not changing anything, bail early so that we're not unnecessarily
-    // doing things we don't need to.
-    if (visible == this._visible) {
-      return;
-    }
-
-    this._visible = visible;
-    Services.prefs.setBoolPref(this.RECENTLY_BOOKMARKED_PREF, visible);
-    this._clearExistingItems();
-
-    if (visible) {
-      this._insertRecentMenuItems();
-    }
-  },
-
-  /**
-   * Observer for observing pref changes.
-   */
-  observe(subject, topic, data) {
-    if (topic == "nsPref:changed" && data == this.RECENTLY_BOOKMARKED_PREF) {
-      this.visible = Services.prefs.getBoolPref(this.RECENTLY_BOOKMARKED_PREF, true);
-    }
-  },
-
-  /**
-   * Initializes the recent bookmarks menu items into a menu.
-   *
-   * @param {menuitem} aHeaderItem A DOM menuitem to insert the recent bookmarks
-   *                               into.
-   * @param {String} aExtraCSSClass Any extra CSS classes to insert onto the recent
-   *                                bookmark menuitems.
-   */
-  init(aHeaderItem, aExtraCSSClass = "") {
-    this.headerItem = aHeaderItem;
-    this.extraCSSClass = aExtraCSSClass;
-    this._recentGuids = new Set();
-
-    // This also displays the initial list if necessary.
-    this.visible = Services.prefs.getBoolPref(this.RECENTLY_BOOKMARKED_PREF, true);
-
-    // Add observers and listeners and remove them again when the menupopup closes.
-
-    let bookmarksMenu = aHeaderItem.parentNode;
-    let placesContextMenu = document.getElementById("placesContext");
-
-    let onPlacesContextMenuShowing = event => {
-      if (event.target == event.currentTarget) {
-        let triggerPopup = event.target.triggerNode;
-        while (triggerPopup && triggerPopup.localName != "menupopup") {
-          triggerPopup = triggerPopup.parentNode;
-        }
-        let shouldHidePrefUI = triggerPopup != bookmarksMenu;
-        this._updatePlacesContextMenu(shouldHidePrefUI);
-      }
-    };
-
-    let onBookmarksMenuHidden = event => {
-      // If hide event is not targeted to the main menu (e.g. hiding a sub-menu),
-      // nothing to do.
-      if (event.target != event.currentTarget) {
-        return;
-      }
-
-      // Cancel any item removed timers.
-      if (this._itemRemovedTimer) {
-        clearTimeout(this._itemRemovedTimer);
-      }
-
-      this._updatePlacesContextMenu(true);
-
-      Services.prefs.removeObserver(this.RECENTLY_BOOKMARKED_PREF, this);
-      PlacesUtils.bookmarks.removeObserver(this);
-      this._recentlyBookmarkedObserver = null;
-      if (placesContextMenu) {
-        placesContextMenu.removeEventListener("popupshowing", onPlacesContextMenuShowing);
-      }
-      bookmarksMenu.removeEventListener("popuphidden", onBookmarksMenuHidden);
-
-      this._visible = undefined;
-      delete this.headerItem;
-      delete this.extraCSSClass;
-    };
-
-    Services.prefs.addObserver(this.RECENTLY_BOOKMARKED_PREF, this, true);
-    PlacesUtils.bookmarks.addObserver(this, true);
-
-    // The context menu doesn't exist in non-browser windows on Mac
-    if (placesContextMenu) {
-      placesContextMenu.addEventListener("popupshowing", onPlacesContextMenuShowing);
-    }
-
-    bookmarksMenu.addEventListener("popuphidden", onBookmarksMenuHidden);
-  },
-
-  /**
-   * Clears existing recent items from the menu and updates the separators
-   * according to this.visible.
-   */
-  _clearExistingItems() {
-    this._recentGuids.clear();
-
-    while (this.headerItem.nextSibling &&
-           this.headerItem.nextSibling.localName == "menuitem") {
-      this.headerItem.nextSibling.remove();
-    }
-
-    let separator = this.headerItem.previousSibling;
-    this.headerItem.hidden = !this.visible;
-    separator.hidden = !this.visible;
-  },
-
-  /**
-   * Inserts recent bookmark items into the menu.
-   */
-  _insertRecentMenuItems() {
-    let separator = this.headerItem.previousSibling;
-    this.headerItem.hidden = !this.visible;
-    separator.hidden = !this.visible;
-
-    let options = PlacesUtils.history.getNewQueryOptions();
-    options.excludeQueries = true;
-    options.queryType = options.QUERY_TYPE_BOOKMARKS;
-    options.sortingMode = options.SORT_BY_DATEADDED_DESCENDING;
-    options.maxResults = this.MAX_RESULTS;
-    let query = PlacesUtils.history.getNewQuery();
-
-    let sh = Cc["@mozilla.org/network/serialization-helper;1"]
-               .getService(Ci.nsISerializationHelper);
-    let loadingPrincipal = sh.serializeToString(document.nodePrincipal);
-
-    let fragment = document.createDocumentFragment();
-    let root = PlacesUtils.history.executeQuery(query, options).root;
-    root.containerOpen = true;
-    for (let i = 0; i < root.childCount; i++) {
-      let node = root.getChild(i);
-      let uri = node.uri;
-      let title = node.title;
-      let icon = node.icon;
-
-      let item =
-        document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
-                                 "menuitem");
-      item.setAttribute("label", title || uri);
-      item.setAttribute("targetURI", uri);
-      item.setAttribute("simulated-places-node", true);
-      item.setAttribute("class", "menuitem-iconic menuitem-with-favicon bookmark-item " +
-                                 this.extraCSSClass);
-      if (icon) {
-        item.setAttribute("image", icon);
-        item.setAttribute("loadingprincipal", loadingPrincipal);
-      }
-      item._placesNode = node;
-      fragment.appendChild(item);
-      this._recentGuids.add(node.bookmarkGuid);
-    }
-    root.containerOpen = false;
-    this.headerItem.parentNode.insertBefore(fragment, this.headerItem.nextSibling);
-  },
-
-  /**
-   * Show the places related context menu for the bookmark items.
-   *
-   * @param {Boolean} shouldHidePrefUI Set to true to hide the UI for switching
-   *                                   the showRecentlyBookmarked pref.
-   */
-  _updatePlacesContextMenu(shouldHidePrefUI = false) {
-    let showItem = document.getElementById("placesContext_showRecentlyBookmarked");
-    // On Mac the menuitem doesn't exist when we're in the Library window context.
-    if (!showItem) {
-      return;
-    }
-    let hideItem = document.getElementById("placesContext_hideRecentlyBookmarked");
-    let separator = document.getElementById("placesContext_recentlyBookmarkedSeparator");
-    let prefEnabled = !shouldHidePrefUI && Services.prefs.getBoolPref(this.RECENTLY_BOOKMARKED_PREF);
-    showItem.hidden = shouldHidePrefUI || prefEnabled;
-    hideItem.hidden = shouldHidePrefUI || !prefEnabled;
-    separator.hidden = shouldHidePrefUI;
-    if (!shouldHidePrefUI) {
-      // Move to the bottom of the menu.
-      separator.parentNode.appendChild(separator);
-      showItem.parentNode.appendChild(showItem);
-      hideItem.parentNode.appendChild(hideItem);
-    }
-  },
-
-  /**
-   * nsINavBookmarkObserver methods.
-   */
-
-  /*
-   * Handles onItemRemoved notifications from the bookmarks service.
-   */
-  onItemRemoved(itemId, parentId, index, itemType, uri, guid) {
-    if (!this.visible) {
-      return;
-    }
-    // Update the menu when a bookmark has been removed.
-    // The native menubar on Mac doesn't support live update, so this is
-    // unlikely to be called there.
-    if (guid && this._recentGuids.has(guid)) {
-      if (this._itemRemovedTimer) {
-        clearTimeout(this._itemRemovedTimer);
-      }
-
-      this._itemRemovedTimer = setTimeout(() => {
-        this._clearExistingItems();
-        this._insertRecentMenuItems();
-      }, this.ITEM_REMOVED_TIMEOUT);
-    }
-  },
-
-  skipTags: true,
-  skipDescendantsOnItemRemoval: false,
-
-  onBeginUpdateBatch() {},
-  onEndUpdateBatch() {},
-  onItemAdded() {},
-  onItemChanged() {},
-  onItemVisited() {},
-  onItemMoved() {},
-}
-
 /**
  * Handles the Library button in the toolbar.
  */
 var LibraryUI = {
   triggerLibraryAnimation(animation) {
     if (!this.hasOwnProperty("COSMETIC_ANIMATIONS_ENABLED")) {
       XPCOMUtils.defineLazyPreferenceGetter(this, "COSMETIC_ANIMATIONS_ENABLED",
         "toolkit.cosmeticAnimations.enabled", true);
@@ -1712,18 +1467,16 @@ var BookmarkingUI = {
       // Don't open a popup in the overflow popup, rather just open the Library.
       event.preventDefault();
       widget.node.removeAttribute("closemenu");
       PlacesCommandHook.showPlacesOrganizer("BookmarksMenu");
       return;
     }
 
     this._initMobileBookmarks(document.getElementById("BMB_mobileBookmarks"));
-    RecentBookmarksMenuUI.init(document.getElementById("BMB_recentBookmarks"),
-                               "subviewbutton");
 
     if (!this._popupNeedsUpdate)
       return;
     this._popupNeedsUpdate = false;
 
     let popup = event.target;
     let getPlacesAnonymousElement =
       aAnonId => document.getAnonymousElementByAttribute(popup.parentNode,
@@ -1949,17 +1702,16 @@ var BookmarkingUI = {
   onMainMenuPopupShowing: function BUI_onMainMenuPopupShowing(event) {
     // Don't handle events for submenus.
     if (event.target != event.currentTarget)
       return;
 
     this.updateBookmarkPageMenuItem();
     PlacesCommandHook.updateBookmarkAllTabsCommand();
     this._initMobileBookmarks(document.getElementById("menu_mobileBookmarks"));
-    RecentBookmarksMenuUI.init(document.getElementById("menu_recentBookmarks"));
   },
 
   _showBookmarkedNotification: function BUI_showBookmarkedNotification() {
     function getCenteringTransformForRects(rectToPosition, referenceRect) {
       let topDiff = referenceRect.top - rectToPosition.top;
       let leftDiff = referenceRect.left - rectToPosition.left;
       let heightDiff = referenceRect.height - rectToPosition.height;
       let widthDiff = referenceRect.width - rectToPosition.width;
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -295,17 +295,18 @@ toolbarpaletteitem {
 %else
 /* On non-OSX, these should be start-aligned */
 #titlebar-buttonbox-container {
   -moz-box-align: start;
 }
 %endif
 
 %if !defined(MOZ_WIDGET_GTK)
-#TabsToolbar > .private-browsing-indicator {
+#TabsToolbar > .private-browsing-indicator,
+#TabsToolbar > .accessibility-indicator {
   -moz-box-ordinal-group: 1000;
 }
 %endif
 
 %ifdef XP_WIN
 #main-window[sizemode="maximized"] #titlebar-buttonbox {
   -moz-appearance: -moz-window-button-box-maximized;
 }
@@ -488,23 +489,29 @@ toolbar:not(#TabsToolbar) > #personal-bo
 /* The reload-button is only disabled temporarily when it becomes visible
    to prevent users from accidentally clicking it. We don't however need
    to show this disabled state, as the flicker that it generates is short
    enough to be visible but not long enough to explain anything to users. */
 #reload-button[disabled]:not(:-moz-window-inactive) > .toolbarbutton-icon {
   opacity: 1 !important;
 }
 
+/* Ensure stop-button and reload-button are displayed correctly when in the overflow menu */
+.widget-overflow-list > #stop-reload-button > .toolbarbutton-1 {
+  -moz-box-flex: 1;
+}
+
 #PanelUI-feeds > .feed-toolbarbutton:-moz-locale-dir(rtl) {
   direction: rtl;
 }
 
 #appMenu_historyMenu > .bookmark-item,
 #appMenu-library-recentlyClosedTabs > .panel-subview-body > .bookmark-item,
 #appMenu-library-recentlyClosedWindows > .panel-subview-body > .bookmark-item,
+#appMenu-library-recentHighlights > .bookmark-item,
 #panelMenu_bookmarksMenu > .bookmark-item {
   max-width: none;
 }
 
 #main-window:-moz-lwtheme {
   background-repeat: no-repeat;
   background-position: top right;
 }
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1354,19 +1354,20 @@ var gBrowserInit = {
     if (!window.toolbar.visible) {
       // adjust browser UI for popups
       gURLBar.setAttribute("readonly", "true");
       gURLBar.setAttribute("enablehistory", "false");
     }
 
     // Misc. inits.
     TabletModeUpdater.init();
-    CombinedStopReload.init();
+    CombinedStopReload.ensureInitialized();
     gPrivateBrowsingUI.init();
     BrowserPageActions.init();
+    gAccessibilityServiceIndicator.init();
 
     if (window.matchMedia("(-moz-os-version: windows-win8)").matches &&
         window.matchMedia("(-moz-windows-default-theme)").matches) {
       let windowFrameColor = new Color(...Cu.import("resource:///modules/Windows8WindowFrameColor.jsm", {})
                                             .Windows8WindowFrameColor.get());
       // Default to black for foreground text.
       if (!windowFrameColor.isContrastRatioAcceptable(new Color(0, 0, 0))) {
         document.documentElement.setAttribute("darkwindowframe", "true");
@@ -1391,16 +1392,18 @@ var gBrowserInit = {
 
       try {
         gBrowser.swapBrowsersAndCloseOther(gBrowser.selectedTab, tabToOpen);
       } catch (e) {
         Cu.reportError(e);
       }
     }
 
+    this._setInitialFocus();
+
     // Wait until chrome is painted before executing code not critical to making the window visible
     this._boundDelayedStartup = this._delayedStartup.bind(this);
     window.addEventListener("MozAfterPaint", this._boundDelayedStartup);
 
     this._loadHandled = true;
   },
 
   _cancelDelayedStartup() {
@@ -1598,17 +1601,17 @@ var gBrowserInit = {
       this._schedulePerWindowIdleTasks();
       document.documentElement.setAttribute("sessionrestored", "true");
     });
 
     Services.obs.notifyObservers(window, "browser-delayed-startup-finished");
     TelemetryTimestamps.add("delayedStartupFinished");
   },
 
-  _handleURIToLoad() {
+  _setInitialFocus() {
     let initiallyFocusedElement = document.commandDispatcher.focusedElement;
 
     let firstBrowserPaintDeferred = {};
     firstBrowserPaintDeferred.promise = new Promise(resolve => {
       firstBrowserPaintDeferred.resolve = resolve;
     });
 
     let mm = window.messageManager;
@@ -1620,16 +1623,41 @@ var gBrowserInit = {
     let initialBrowser = gBrowser.selectedBrowser;
     mm.addMessageListener("Browser:FirstNonBlankPaint",
                           function onFirstNonBlankPaint() {
       mm.removeMessageListener("Browser:FirstNonBlankPaint", onFirstNonBlankPaint);
       initialBrowser.removeAttribute("blank");
     });
 
     this._uriToLoadPromise.then(uriToLoad => {
+      if ((isBlankPageURL(uriToLoad) || uriToLoad == "about:privatebrowsing") &&
+          focusAndSelectUrlBar()) {
+        return;
+      }
+
+      if (gBrowser.selectedBrowser.isRemoteBrowser) {
+        // If the initial browser is remote, in order to optimize for first paint,
+        // we'll defer switching focus to that browser until it has painted.
+        firstBrowserPaintDeferred.promise.then(() => {
+          // If focus didn't move while we were waiting for first paint, we're okay
+          // to move to the browser.
+          if (document.commandDispatcher.focusedElement == initiallyFocusedElement) {
+            gBrowser.selectedBrowser.focus();
+          }
+        });
+      } else {
+        // If the initial browser is not remote, we can focus the browser
+        // immediately with no paint performance impact.
+        gBrowser.selectedBrowser.focus();
+      }
+    });
+  },
+
+  _handleURIToLoad() {
+    this._uriToLoadPromise.then(uriToLoad => {
       if (!uriToLoad || uriToLoad == "about:blank") {
         return;
       }
 
       // We don't check if uriToLoad is a XULElement because this case has
       // already been handled before first paint, and the argument cleared.
       if (uriToLoad instanceof Ci.nsIArray) {
         let count = uriToLoad.length;
@@ -1675,39 +1703,16 @@ var gBrowserInit = {
                 window.arguments[7], !!window.arguments[7], window.arguments[8]);
         window.focus();
       } else {
         // Note: loadOneOrMoreURIs *must not* be called if window.arguments.length >= 3.
         // Such callers expect that window.arguments[0] is handled as a single URI.
         loadOneOrMoreURIs(uriToLoad, Services.scriptSecurityManager.getSystemPrincipal());
       }
     });
-
-    this._uriToLoadPromise.then(uriToLoad => {
-      if ((isBlankPageURL(uriToLoad) || uriToLoad == "about:privatebrowsing") &&
-          focusAndSelectUrlBar()) {
-        return;
-      }
-
-      if (gBrowser.selectedBrowser.isRemoteBrowser) {
-        // If the initial browser is remote, in order to optimize for first paint,
-        // we'll defer switching focus to that browser until it has painted.
-        firstBrowserPaintDeferred.promise.then(() => {
-          // If focus didn't move while we were waiting for first paint, we're okay
-          // to move to the browser.
-          if (document.commandDispatcher.focusedElement == initiallyFocusedElement) {
-            gBrowser.selectedBrowser.focus();
-          }
-        });
-      } else {
-        // If the initial browser is not remote, we can focus the browser
-        // immediately with no paint performance impact.
-        gBrowser.selectedBrowser.focus();
-      }
-    });
   },
 
   /**
    * Use this function as an entry point to schedule tasks that
    * need to run once per window after startup, and can be scheduled
    * by using an idle callback.
    *
    * The functions scheduled here will fire from idle callbacks
@@ -1856,16 +1861,18 @@ var gBrowserInit = {
     TrackingProtection.uninit();
 
     CaptivePortalWatcher.uninit();
 
     SidebarUI.uninit();
 
     DownloadsButton.uninit();
 
+    gAccessibilityServiceIndicator.uninit();
+
     // Now either cancel delayedStartup, or clean up the services initialized from
     // it.
     if (this._boundDelayedStartup) {
       this._cancelDelayedStartup();
     } else {
       if (Win7Features)
         Win7Features.onCloseWindow();
 
@@ -3157,48 +3164,36 @@ var BrowserOnClick = {
       bucketName = "WARNING_UNWANTED_PAGE_";
     } else if (reason === "harmful") {
       sendTelemetry = true;
       bucketName = "WARNING_HARMFUL_PAGE_";
     }
     let secHistogram = Services.telemetry.getHistogramById("URLCLASSIFIER_UI_EVENTS");
     let nsISecTel = Ci.IUrlClassifierUITelemetry;
     bucketName += isTopFrame ? "TOP_" : "FRAME_";
+
     switch (elementId) {
-      case "getMeOutButton":
+      case "goBackButton":
         if (sendTelemetry) {
           secHistogram.add(nsISecTel[bucketName + "GET_ME_OUT_OF_HERE"]);
         }
         getMeOutOfHere();
         break;
-
-      case "reportButton":
-        // This is the "Why is this site blocked" button. We redirect
-        // to the generic page describing phishing/malware protection.
-
-        // We log even if malware/phishing/unwanted info URL couldn't be found:
-        // the measurement is for how many users clicked the WHY BLOCKED button
-        if (sendTelemetry) {
-          secHistogram.add(nsISecTel[bucketName + "WHY_BLOCKED"]);
-        }
-        openHelpLink("phishing-malware", false, "current");
-        break;
-
-      case "ignoreWarningButton":
+      case "ignore_warning_link":
         if (gPrefService.getBoolPref("browser.safebrowsing.allowOverride")) {
           if (sendTelemetry) {
             secHistogram.add(nsISecTel[bucketName + "IGNORE_WARNING"]);
           }
-          this.ignoreWarningButton(reason, blockedInfo);
+          this.ignoreWarningLink(reason, blockedInfo);
         }
         break;
     }
   },
 
-  ignoreWarningButton(reason, blockedInfo) {
+  ignoreWarningLink(reason, blockedInfo) {
     // Allow users to override and continue through to the site,
     // but add a notify bar as a reminder, so that they don't lose
     // track after, e.g., tab switching.
     gBrowser.loadURIWithFlags(gBrowser.currentURI.spec,
                               nsIWebNavigation.LOAD_FLAGS_BYPASS_CLASSIFIER,
                               null, null, null);
 
     Services.perms.add(gBrowser.currentURI, "safe-browsing",
@@ -3701,17 +3696,17 @@ const DOMEventHandler = {
   receiveMessage(aMsg) {
     switch (aMsg.name) {
       case "Link:AddFeed":
         let link = {type: aMsg.data.type, href: aMsg.data.href, title: aMsg.data.title};
         FeedHandler.addFeed(link, aMsg.target);
         break;
 
       case "Link:SetIcon":
-        this.setIcon(aMsg.target, aMsg.data.url, aMsg.data.loadingPrincipal);
+        this.setIcon(aMsg.target, aMsg.data.url, aMsg.data.loadingPrincipal, aMsg.data.requestContextID);
         break;
 
       case "Link:AddSearch":
         this.addSearch(aMsg.target, aMsg.data.engine, aMsg.data.url);
         break;
 
       case "Meta:SetPageInfo":
         this.setPageInfo(aMsg.data);
@@ -3720,25 +3715,25 @@ const DOMEventHandler = {
   },
 
   setPageInfo(aData) {
     const {url, description, previewImageURL} = aData;
     gBrowser.setPageInfo(url, description, previewImageURL);
     return true;
   },
 
-  setIcon(aBrowser, aURL, aLoadingPrincipal) {
+  setIcon(aBrowser, aURL, aLoadingPrincipal, aRequestContextID) {
     if (gBrowser.isFailedIcon(aURL))
       return false;
 
     let tab = gBrowser.getTabForBrowser(aBrowser);
     if (!tab)
       return false;
 
-    gBrowser.setIcon(tab, aURL, aLoadingPrincipal);
+    gBrowser.setIcon(tab, aURL, aLoadingPrincipal, aRequestContextID);
     return true;
   },
 
   addSearch(aBrowser, aEngine, aURL) {
     let tab = gBrowser.getTabForBrowser(aBrowser);
     if (!tab)
       return;
 
@@ -4924,42 +4919,55 @@ var LinkTargetDisplay = {
   _hide() {
     clearTimeout(this._timer);
 
     XULBrowserWindow.updateStatusField();
   }
 };
 
 var CombinedStopReload = {
-  init() {
+  // Try to initialize. Returns whether initialization was successful, which
+  // may mean we had already initialized.
+  ensureInitialized() {
     if (this._initialized)
-      return;
+      return true;
+    if (this._destroyed)
+      return false;
 
     let reload = document.getElementById("reload-button");
     let stop = document.getElementById("stop-button");
-    if (!stop || !reload || reload.nextSibling != stop)
-      return;
+    // It's possible the stop/reload buttons have been moved to the palette.
+    // They may be reinserted later, so we will retry initialization if/when
+    // we get notified of document loads.
+    if (!stop || !reload)
+      return false;
 
     this._initialized = true;
     if (XULBrowserWindow.stopCommand.getAttribute("disabled") != "true")
       reload.setAttribute("displaystop", "true");
     stop.addEventListener("click", this);
     this.reload = reload;
     this.stop = stop;
     this.stopReloadContainer = this.reload.parentNode;
     this.timeWhenSwitchedToStop = 0;
+
+    if (this._shouldStartPrefMonitoring) {
+      this.startAnimationPrefMonitoring();
+    }
+    return true;
   },
 
   uninit() {
+    this._destroyed = true;
+
     if (!this._initialized)
       return;
 
     Services.prefs.removeObserver("toolkit.cosmeticAnimations.enabled", this);
     this._cancelTransition();
-    this._initialized = false;
     this.stop.removeEventListener("click", this);
     this.stopReloadContainer.removeEventListener("animationend", this);
     this.stopReloadContainer = null;
     this.reload = null;
     this.stop = null;
   },
 
   handleEvent(event) {
@@ -4984,33 +4992,37 @@ var CombinedStopReload = {
   observe(subject, topic, data) {
     if (topic == "nsPref:changed") {
       this.animate = Services.prefs.getBoolPref("toolkit.cosmeticAnimations.enabled");
     }
   },
 
   startAnimationPrefMonitoring() {
     // CombinedStopReload may have been uninitialized before the idleCallback is executed.
-    if (!this._initialized)
+    if (this._destroyed)
       return;
+    if (!this.ensureInitialized()) {
+      this._shouldStartPrefMonitoring = true;
+      return;
+    }
     this.animate = Services.prefs.getBoolPref("toolkit.cosmeticAnimations.enabled") &&
                    Services.prefs.getBoolPref("browser.stopReloadAnimation.enabled");
     Services.prefs.addObserver("toolkit.cosmeticAnimations.enabled", this);
     this.stopReloadContainer.addEventListener("animationend", this);
   },
 
   onTabSwitch() {
     // Reset the time in the event of a tabswitch since the stored time
     // would have been associated with the previous tab, so the animation will
     // still run if the page has been loading until long after the tab switch.
     this.timeWhenSwitchedToStop = window.performance.now();
   },
 
   switchToStop(aRequest, aWebProgress) {
-    if (!this._initialized || !this._shouldSwitch(aRequest, aWebProgress)) {
+    if (!this.ensureInitialized() || !this._shouldSwitch(aRequest, aWebProgress)) {
       return;
     }
 
     // Store the time that we switched to the stop button only if a request
     // is active. Requests are null if the switch is related to a tabswitch.
     // This is used to determine if we should show the stop->reload animation.
     if (aRequest instanceof Ci.nsIRequest) {
       this.timeWhenSwitchedToStop = window.performance.now();
@@ -5029,17 +5041,17 @@ var CombinedStopReload = {
       this.stopReloadContainer.setAttribute("animate", "true");
     } else {
       this.stopReloadContainer.removeAttribute("animate");
     }
     this.reload.setAttribute("displaystop", "true");
   },
 
   switchToReload(aRequest, aWebProgress) {
-    if (!this._initialized || !this._shouldSwitch(aRequest, aWebProgress) ||
+    if (!this.ensureInitialized() || !this._shouldSwitch(aRequest, aWebProgress) ||
         !this.reload.hasAttribute("displaystop")) {
       return;
     }
 
     let shouldAnimate = aRequest instanceof Ci.nsIRequest &&
                         aWebProgress.isTopLevel &&
                         !aWebProgress.isLoadingDocument &&
                         !gBrowser.tabAnimationsInProgress &&
@@ -5437,17 +5449,18 @@ function onViewToolbarsPopupShowing(aEve
   // triggerNode can be a nested child element of a toolbaritem.
   let toolbarItem = popup.triggerNode;
 
   if (toolbarItem && toolbarItem.localName == "toolbarpaletteitem") {
     toolbarItem = toolbarItem.firstChild;
   } else if (toolbarItem && toolbarItem.localName != "toolbar") {
     while (toolbarItem && toolbarItem.parentNode) {
       let parent = toolbarItem.parentNode;
-      if ((parent.classList && parent.classList.contains("customization-target")) ||
+      if (parent.nodeType !== Node.ELEMENT_NODE ||
+          (parent.classList && parent.classList.contains("customization-target")) ||
           parent.getAttribute("overflowfortoolbar") || // Needs to work in the overflow list as well.
           parent.localName == "toolbarpaletteitem" ||
           parent.localName == "toolbar")
         break;
       toolbarItem = parent;
     }
   } else {
     toolbarItem = null;
@@ -8046,16 +8059,73 @@ function getTabModalPromptBox(aWindow) {
   return null;
 }
 
 /* DEPRECATED */
 function getBrowser() {
   return gBrowser;
 }
 
+const gAccessibilityServiceIndicator = {
+  init() {
+    // Pref to enable accessibility service indicator.
+    gPrefService.addObserver("accessibility.indicator.enabled", this);
+    // Accessibility service init/shutdown event.
+    Services.obs.addObserver(this, "a11y-init-or-shutdown");
+    this.update(Services.appinfo.accessibilityEnabled);
+  },
+
+  update(accessibilityEnabled = false) {
+    if (this.enabled && accessibilityEnabled) {
+      this._active = true;
+      document.documentElement.setAttribute("accessibilitymode", "true");
+      [...document.querySelectorAll(".accessibility-indicator")].forEach(
+        indicator => ["click", "keypress"].forEach(type =>
+          indicator.addEventListener(type, this)));
+      TabsInTitlebar.updateAppearance(true);
+    } else if (this._active) {
+      this._active = false;
+      document.documentElement.removeAttribute("accessibilitymode");
+      [...document.querySelectorAll(".accessibility-indicator")].forEach(
+        indicator => ["click", "keypress"].forEach(type =>
+          indicator.removeEventListener(type, this)));
+      TabsInTitlebar.updateAppearance(true);
+    }
+  },
+
+  observe(subject, topic, data) {
+    if (topic == "nsPref:changed" && data === "accessibility.indicator.enabled") {
+      this.update(Services.appinfo.accessibilityEnabled);
+    } else if (topic === "a11y-init-or-shutdown") {
+      // When "a11y-init-or-shutdown" event is fired, "1" indicates that
+      // accessibility service is started and "0" that it is shut down.
+      this.update(data === "1");
+    }
+  },
+
+  get enabled() {
+    return gPrefService.getBoolPref("accessibility.indicator.enabled");
+  },
+
+  handleEvent({ key, type }) {
+    if ((type === "keypress" && [" ", "Enter"].includes(key)) ||
+         type === "click") {
+      let a11yServicesSupportURL =
+        Services.urlFormatter.formatURLPref("accessibility.support.url");
+      gBrowser.selectedTab = gBrowser.addTab(a11yServicesSupportURL);
+    }
+  },
+
+  uninit() {
+    gPrefService.removeObserver("accessibility.indicator.enabled", this);
+    Services.obs.removeObserver(this, "a11y-init-or-shutdown");
+    this.update();
+  }
+};
+
 var gPrivateBrowsingUI = {
   init: function PBUI_init() {
     // Do nothing for normal windows
     if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
       return;
     }
 
     // Disable the Clear Recent History... menu item when in PB mode
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -388,35 +388,17 @@
                onpopuphiding="if (event.target != this)
                                 return;
                               gContextMenu.hiding();
                               gContextMenu = null;
                               updateEditUIVisibility();">
 #include browser-context.inc
     </menupopup>
 
-    <menupopup id="placesContext">
-      <menuseparator id="placesContext_recentlyBookmarkedSeparator"
-                     ignoreitem="true"
-                     hidden="true"/>
-      <menuitem id="placesContext_hideRecentlyBookmarked"
-                label="&hideRecentlyBookmarked.label;"
-                accesskey="&hideRecentlyBookmarked.accesskey;"
-                oncommand="RecentBookmarksMenuUI.visible = false;"
-                closemenu="single"
-                ignoreitem="true"
-                hidden="true"/>
-      <menuitem id="placesContext_showRecentlyBookmarked"
-                label="&showRecentlyBookmarked.label;"
-                accesskey="&showRecentlyBookmarked.accesskey;"
-                oncommand="RecentBookmarksMenuUI.visible = true;"
-                closemenu="single"
-                ignoreitem="true"
-                hidden="true"/>
-    </menupopup>
+    <menupopup id="placesContext"/>
 
     <panel id="ctrlTab-panel" hidden="true" norestorefocus="true" level="top">
       <hbox>
         <button class="ctrlTab-preview" flex="1"/>
         <button class="ctrlTab-preview" flex="1"/>
         <button class="ctrlTab-preview" flex="1"/>
         <button class="ctrlTab-preview" flex="1"/>
         <button class="ctrlTab-preview" flex="1"/>
@@ -586,30 +568,30 @@
   <box id="appMenu-viewCache" hidden="true"/>
 
 #ifdef CAN_DRAW_IN_TITLEBAR
 <vbox id="titlebar">
   <hbox id="titlebar-content">
     <spacer id="titlebar-spacer" flex="1"/>
     <hbox id="titlebar-buttonbox-container">
 #ifdef XP_WIN
-      <hbox id="private-browsing-indicator-titlebar">
-        <hbox class="private-browsing-indicator"/>
-      </hbox>
+      <button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;" aria-live="polite"/>
+      <hbox class="private-browsing-indicator"/>
 #endif
       <hbox id="titlebar-buttonbox">
         <toolbarbutton class="titlebar-button" id="titlebar-min" oncommand="window.minimize();"/>
         <toolbarbutton class="titlebar-button" id="titlebar-max" oncommand="onTitlebarMaxClick();"/>
         <toolbarbutton class="titlebar-button" id="titlebar-close" command="cmd_closeWindow"/>
       </hbox>
     </hbox>
 #ifdef XP_MACOSX
     <!-- OS X does not natively support RTL for its titlebar items, so we prevent this secondary
          buttonbox from reversing order in RTL by forcing an LTR direction. -->
     <hbox id="titlebar-secondary-buttonbox" dir="ltr">
+      <button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;" aria-live="polite"/>
       <hbox class="private-browsing-indicator"/>
       <hbox id="titlebar-fullscreen-button"/>
     </hbox>
 #endif
   </hbox>
 </vbox>
 #endif
 
@@ -646,18 +628,22 @@
              customizable="true"
              mode="icons"
              iconsize="small"
              aria-label="&tabsToolbar.label;"
              context="toolbar-context-menu"
              collapsed="true">
 
 #if defined(MOZ_WIDGET_GTK)
-      <hbox id="private-browsing-indicator"
+      <hbox class="private-browsing-indicator"
             skipintoolbarset="true"/>
+      <button class="accessibility-indicator"
+              tooltiptext="&accessibilityIndicator.tooltip;"
+              aria-live="polite"
+              skipintoolbarset="true"/>
 #endif
 
       <tabs id="tabbrowser-tabs"
             class="tabbrowser-tabs"
             tabbrowser="content"
             flex="1"
             setfocus="false"
             tooltip="tabbrowser-tab-tooltip"
@@ -695,16 +681,18 @@
                 label="&newUserContext.label;">
             <menupopup id="alltabs_containersMenuTab" />
           </menu>
           <menuseparator id="alltabs-popup-separator-2"/>
         </menupopup>
       </toolbarbutton>
 
 #if !defined(MOZ_WIDGET_GTK)
+      <button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;"
+              aria-live="polite" skipintoolbarset="true"/>
       <hbox class="private-browsing-indicator" skipintoolbarset="true"/>
 #endif
 #ifdef CAN_DRAW_IN_TITLEBAR
       <hbox class="titlebar-placeholder" type="caption-buttons"
             id="titlebar-placeholder-on-TabsToolbar-for-captions-buttons" persist="width"
 #ifndef XP_MACOSX
             ordinal="1000"
 #endif
@@ -1110,21 +1098,16 @@
           </menuitem>
           <!-- NB: temporary solution for bug 985024, this should go away soon. -->
           <menuitem id="BMB_bookmarksShowAllTop"
                     class="menuitem-iconic subviewbutton"
                     label="&showAllBookmarks2.label;"
                     command="Browser:ShowAllBookmarks"
                     key="manBookmarkKb"/>
           <menuseparator/>
-          <menuitem label="&recentBookmarks.label;"
-                    id="BMB_recentBookmarks"
-                    disabled="true"
-                    class="menuitem-iconic subviewbutton"/>
-          <menuseparator/>
           <menu id="BMB_bookmarksToolbar"
                 class="menu-iconic bookmark-item subviewbutton"
                 label="&personalbarCmd.label;"
                 container="true">
             <menupopup id="BMB_bookmarksToolbarPopup"
                        placespopup="true"
                        context="placesContext"
                        onpopupshowing="if (!this.parentNode._placesView)
--- a/browser/base/content/content.js
+++ b/browser/base/content/content.js
@@ -160,16 +160,54 @@ var AboutBlockedSiteListener = {
     if (docShell.failedChannel) {
       let classifiedChannel = docShell.failedChannel.
                               QueryInterface(Ci.nsIClassifiedChannel);
       if (classifiedChannel) {
         provider = classifiedChannel.matchedProvider;
       }
     }
 
+    let doc = content.document;
+
+    /**
+    * Set error description link in error details.
+    * For example, the "reported as a deceptive site" link for
+    * blocked phishing pages.
+    */
+    let desc = Services.prefs.getCharPref(
+      "browser.safebrowsing.provider." + provider + ".reportURL", "");
+    if (desc) {
+      doc.getElementById("error_desc_link").setAttribute("href", desc + aEvent.detail.url);
+    }
+
+    // Set other links in error details.
+    switch (aEvent.detail.err) {
+      case "malware":
+        doc.getElementById("report_detection").setAttribute("href",
+          "https://www.stopbadware.org/firefox");
+        doc.getElementById("learn_more_link").setAttribute("href",
+          "https://www.stopbadware.org/firefox");
+        break;
+      case "unwanted":
+        doc.getElementById("learn_more_link").setAttribute("href",
+          "https://www.google.com/about/unwanted-software-policy.html");
+        break;
+      case "phishing":
+        doc.getElementById("report_detection").setAttribute("href",
+          "https://safebrowsing.google.com/safebrowsing/report_error/?tpl=mozilla");
+        doc.getElementById("learn_more_link").setAttribute("href",
+          "https://www.antiphishing.org//");
+        break;
+    }
+
+    // Set the firefox support url.
+    doc.getElementById("firefox_support").setAttribute("href",
+      "https://support.mozilla.org/kb/how-does-phishing-and-malware-protection-work");
+
+    // Set safe browsing advisory link.
     let advisoryUrl = Services.prefs.getCharPref(
       "browser.safebrowsing.provider." + provider + ".advisoryURL", "");
     if (!advisoryUrl) {
       let el = content.document.getElementById("advisoryDesc");
       el.remove();
       return;
     }
 
--- a/browser/base/content/default-theme-icon.svg
+++ b/browser/base/content/default-theme-icon.svg
@@ -1,13 +1,11 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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/. -->
-<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">
-    <rect fill="#fff" x="1" y="1" width="30" height="30" rx="2" ry="2"/>
-    <path fill="#e3e3e3" d="M3 1h26a2 2 0 0 1 2 2v18H1V3a2 2 0 0 1 2-2z"/>
-    <rect stroke="gray" fill="#fff" x="10.5" y="5.5" width="18" height="11" rx="1" ry="1"/>
-    <circle fill="#fcfcfc" stroke="gray" stroke-width="1.2px" cx="11" cy="11" r="7.5"/>
-    <path fill="#595959" d="M14 10h-3.6l1.3-1.3a1 1 0 0 0-1.4-1.4l-3 3a1 1 0 0 0 0 1.4l3 3a1 1 0 0 0 1.4-1.4L10.4 12H14a1 1 0 0 0 0-2z"/>
-    <path fill="none" stroke="#999" d="M1.5 20.5h29"/>
-    <rect fill="none" stroke="#999" stroke-width="2" x="1" y="1" width="30" height="30" rx="2" ry="2"/>
-</svg>
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
+  <path fill="#202340" d="M2 2h14v13H2z"/>
+  <path fill="#f9f9fa" d="M16 2v13H2v15h28V2H16z"/>
+  <rect x="1" y="1" width="30" height="30" rx="2" ry="2" fill="none" stroke="#08091a" stroke-opacity=".35" stroke-width="2"/>
+  <circle cx="9.5" cy="22.5" r="6" fill="#fff" stroke="#adadb3"/>
+  <path d="M12.5 22H7.707l2.146-2.146a.5.5 0 0 0-.707-.707l-3 3a.5.5 0 0 0 0 .708l3 3a.5.5 0 1 0 .707-.707L7.707 23H12.5a.5.5 0 0 0 0-1z" fill="#0c0c0d" fill-opacity=".8"/>
+  <path d="M20.5 20h4a.5.5 0 0 0 0-1h-4a.5.5 0 0 0 0 1zm4 2h-4a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1zm0 3h-4a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1z" fill="#0c0c0d" fill-opacity=".8"/>
+  <path fill="#0a84ff" d="M16 2h14v1H16z"/>
+  <path d="M26.354 8.646l-3.5-3.5a.5.5 0 0 0-.707 0l-3.5 3.5a.5.5 0 0 0 .707.707L20 8.707V11.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5V8.707l.646.646a.5.5 0 1 0 .707-.707zM24 11h-1V9h-1v2h-1V7.707l1.5-1.5 1.5 1.5z" fill="#0c0c0d" fill-opacity=".8"/>
+  <path fill="#08091a" d="M15 2v12H2v1h14V2h-1z"/>
+</svg>
\ No newline at end of file
rename from browser/base/content/defaultthemes/compactdark.icon.svg
rename to browser/base/content/defaultthemes/dark.icon.svg
--- a/browser/base/content/defaultthemes/compactdark.icon.svg
+++ b/browser/base/content/defaultthemes/dark.icon.svg
@@ -1,16 +1,11 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 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/. -->
-<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">
-    <rect fill="#727780" x="1" y="1" width="30" height="30" rx="2" ry="2"/>
-    <path fill="#393f4c" d="M3 1h26a2 2 0 0 1 2 2v14H1V3a2 2 0 0 1 2-2z"/>
-    <rect fill="#171b1f" x="3.5" y="3.5" width="25" height="11" rx="1" ry="1"/>
-    <path fill="#252c33" d="M4.5 3.5h12v11h-12a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z"/>
-    <rect stroke="#1d2328" fill="none" stroke-width="2" x="1" y="1" width="30" height="30" rx="2" ry="2"/>
-    <path class="icon-line-2px" d="M10 6L7 9l3 3M7.5 9H13"/>
-    <path stroke="#1d2328" d="M1.5 16.5h29"/>
-    <path class="separator-toolbar-items" d="M16.5 3.5v11"/>
-    <rect fill="none" stroke="#171b1f" x="3.5" y="3.5" width="25" height="11" rx="1" ry="1"/>
-    <path fill="#f0f1f2" d="M13 8H9.4l1.3-1.3a1 1 0 0 0-1.4-1.4l-3 3a1 1 0 0 0 0 1.4l3 3a1 1 0 0 0 1.4-1.4L9.4 10H13a1 1 0 0 0 0-2z"/>
-</svg>
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
+  <path fill="#0c0c0d" d="M2 2h14v13H2z"/>
+  <path fill="#323234" d="M16 2v13H2v15h28V2H16z"/>
+  <rect x="1" y="1" width="30" height="30" rx="2" ry="2" fill="none" stroke="#08091a" stroke-opacity=".35" stroke-width="2"/>
+  <circle cx="9.5" cy="22.5" r="6" fill="#474749" stroke="#08091a"/>
+  <path d="M12.5 22H7.707l2.146-2.146a.5.5 0 0 0-.707-.707l-3 3a.5.5 0 0 0 0 .708l3 3a.5.5 0 1 0 .707-.707L7.707 23H12.5a.5.5 0 0 0 0-1z" fill="#f9f9fa" fill-opacity=".8"/>
+  <path d="M20.5 20h4a.5.5 0 0 0 0-1h-4a.5.5 0 0 0 0 1zm4 2h-4a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1zm0 3h-4a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1z" fill="#f9f9fa" fill-opacity=".8"/>
+  <path fill="#0a84ff" d="M16 2h14v1H16z"/>
+  <path d="M26.354 8.646l-3.5-3.5a.5.5 0 0 0-.707 0l-3.5 3.5a.5.5 0 0 0 .707.707L20 8.707V11.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5V8.707l.646.646a.5.5 0 1 0 .707-.707zM24 11h-1V9h-1v2h-1V7.707l1.5-1.5 1.5 1.5z" fill="#f9f9fa" fill-opacity=".8"/>
+  <path fill="#08091a" d="M15 2v12H2v1h14V2h-1z"/>
+</svg>
\ No newline at end of file
rename from browser/base/content/defaultthemes/compactlight.icon.svg
rename to browser/base/content/defaultthemes/light.icon.svg
--- a/browser/base/content/defaultthemes/compactlight.icon.svg
+++ b/browser/base/content/defaultthemes/light.icon.svg
@@ -1,15 +1,11 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 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/. -->
-<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">
-    <rect fill="#fff" x="1" y="1" width="30" height="30" rx="2" ry="2"/>
-    <path fill="#e3e3e3" d="M3 1h26a2 2 0 0 1 2 2v14H1V3a2 2 0 0 1 2-2z"/>
-    <rect fill="#fff" x="3.5" y="3.5" width="25" height="11" rx="1" ry="1"/>
-    <path fill="#fcfcfc" d="M4.5 3.5h12v11h-12a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z"/>
-    <rect fill="none" stroke="#999" stroke-width="2" x="1" y="1" width="30" height="30" rx="2" ry="2"/>
-    <path stroke="#999" d="M1.5 16.5h29"/>
-    <path stroke="#b3b3b3" d="M16.5 3.5v11"/>
-    <rect fill="none" stroke="#b3b3b3" x="3.5" y="3.5" width="25" height="11" rx="1" ry="1"/>
-    <path fill="#595959" d="M13 8H9.4l1.3-1.3a1 1 0 0 0-1.4-1.4l-3 3a1 1 0 0 0 0 1.4l3 3a1 1 0 0 0 1.4-1.4L9.4 10H13a1 1 0 0 0 0-2z"/>
-</svg>
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
+  <path fill="#e1e1e5" d="M2 2h14v13H2z"/>
+  <path fill="#f9f9fa" d="M16 2v13H2v15h28V2H16z"/>
+  <rect x="1" y="1" width="30" height="30" rx="2" ry="2" fill="none" stroke="#08091a" stroke-opacity=".35" stroke-width="2"/>
+  <circle cx="9.5" cy="22.5" r="6" fill="#fff" stroke="#adadb3"/>
+  <path d="M12.5 22H7.707l2.146-2.146a.5.5 0 0 0-.707-.707l-3 3a.5.5 0 0 0 0 .708l3 3a.5.5 0 1 0 .707-.707L7.707 23H12.5a.5.5 0 0 0 0-1z" fill="#0c0c0d" fill-opacity=".8"/>
+  <path d="M20.5 20h4a.5.5 0 0 0 0-1h-4a.5.5 0 0 0 0 1zm4 2h-4a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1zm0 3h-4a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1z" fill="#0c0c0d" fill-opacity=".8"/>
+  <path fill="#0a84ff" d="M16 2h14v1H16z"/>
+  <path d="M26.354 8.646l-3.5-3.5a.5.5 0 0 0-.707 0l-3.5 3.5a.5.5 0 0 0 .707.707L20 8.707V11.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5V8.707l.646.646a.5.5 0 1 0 .707-.707zM24 11h-1V9h-1v2h-1V7.707l1.5-1.5 1.5 1.5z" fill="#0c0c0d" fill-opacity=".8"/>
+  <path fill="#08091a" fill-opacity=".25" d="M15 2v12H2v1h14V2h-1z"/>
+</svg>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/browser/base/content/illustrations/error-connection-failure.svg
@@ -0,0 +1,49 @@
+<!-- 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/. -->
+<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300">
+  <defs>
+    <linearGradient id="a" x1="-300.021" y1="-272.736" x2="547.138" y2="574.423" gradientUnits="userSpaceOnUse">
+      <stop offset="0" stop-color="#ccfbff"/>
+      <stop offset="1" stop-color="#c9e4ff"/>
+    </linearGradient>
+    <linearGradient id="b" x1="-18.672" y1="23.78" x2="279.805" y2="322.256" gradientUnits="userSpaceOnUse">
+      <stop offset="0" stop-color="#00c8d7"/>
+      <stop offset="1" stop-color="#0a84ff"/>
+    </linearGradient>
+  </defs>
+  <path d="M224.245 144.067h-10.733c.136.343.274.674.41 1h10.323a.5.5 0 0 0 0-1zm2.454-11.821a.5.5 0 0 0-.5-.5h-20.26c.373.357.727.688 1.065 1h19.2a.5.5 0 0 0 .496-.5zm8.546 11.821h-3a.5.5 0 1 0 0 1h3a.5.5 0 0 0 0-1zm5 0h-1a.5.5 0 1 0 0 1h1a.5.5 0 0 0 0-1zm-3.3-6.66h-25.78a12.767 12.767 0 0 1 .862 2h24.918a1 1 0 0 0 0-2zm20.422 6.66h-8.122a.5.5 0 1 0 0 1h8.122a.5.5 0 0 0 0-1z" fill="#eaeaee"/>
+  <path d="M269.53 87.757h-24.236c-2.108-3.9-7.559-12.718-14.4-14.023-8.952-1.707-10.737 7.217-10.737 7.217s-5.949-15.468-21-13.419c-16.878 2.3-8.928 20.065-8.928 20.065h-25.408l8.181.159h-8.184a1 1 0 0 0 0 2H269.53a1 1 0 0 0 0-2z" fill="#fff"/>
+  <path d="M118.373 63.908h-13.69c-1.129-2.112-4.19-7.156-8.057-7.894-4.978-.949-5.971 4.013-5.971 4.013s-3.309-8.6-11.68-7.462c-9.386 1.278-4.965 11.158-4.965 11.158H59.88l9.471.185h-9.212a1 1 0 0 0 0 2h58.233a1 1 0 1 0 0-2z" fill="#fff"/>
+  <ellipse cx="143.566" cy="245.472" rx="55.042" ry="8.362" fill="#eaeaee"/>
+  <path d="M102.31 121.507H60.818a1 1 0 0 0 0 2h41.492a1 1 0 1 0 0-2zM70.336 117.6H82.1a.5.5 0 0 0 0-1H70.336a.5.5 0 0 0 0 1z" fill="#eaeaee"/>
+  <path d="M111.457 174.8h-78.3a1 1 0 0 0 0 2h78.3a1 1 0 1 0 0-2zm-26.742-3.793h1a.5.5 0 0 0 0-1h-1a.5.5 0 0 0 0 1zm10 0h3.1a.5.5 0 0 0 0-1h-3.1a.5.5 0 0 0 0 1zm-17 0h3a.5.5 0 0 0 0-1h-3a.5.5 0 0 0 0 1zm-20 0h12a.5.5 0 0 0 0-1h-12a.5.5 0 0 0 0 1z" fill="#eaeaee"/>
+  <path d="M206.885 62.973l.045-.1c-.058.027-.063.059-.045.1z" fill="#fff"/>
+  <path d="M77.937 214.941H39.95a1 1 0 1 1 0-2h37.987a1 1 0 1 1 0 2z" fill="#eaeaee"/>
+  <path d="M258.931 214.941h-61.813a1 1 0 0 1 0-2h61.813a1 1 0 0 1 0 2z" fill="#eaeaee"/>
+  <path d="M265.745 85.333h-3a.5.5 0 0 1 0-1h3a.5.5 0 0 1 0 1zm-11 0h-8.07a.5.5 0 0 1-.447-.277c-.007-.014-.724-1.425-1.979-3.342a.5.5 0 1 1 .837-.548c.393.6 1.444 2.293 1.888 3.167h7.772a.5.5 0 0 1 0 1zm-66.489-.712h-3a.5.5 0 0 1 0-1h3a.5.5 0 0 1 0 1zm-11 0h-12a.5.5 0 0 1 0-1h12a.5.5 0 0 1 0 1zM190.1 83.13a.5.5 0 0 1-.474-.339c-.1-.29-.2-.615-.31-.971a.5.5 0 1 1 .958-.287c.1.343.2.657.3.937a.5.5 0 0 1-.474.661zm30.5-5.156a.5.5 0 0 1-.467-.32 23.7 23.7 0 0 0-2.182-4.039.5.5 0 0 1 .834-.552 27.291 27.291 0 0 1 1.719 2.982 10.522 10.522 0 0 1 3.679-5.015.5.5 0 0 1 .571.82 10.181 10.181 0 0 0-3.665 5.721.5.5 0 0 1-.448.4zm18.345-2.964a.5.5 0 0 1-.339-.132q-.361-.333-.735-.651a.5.5 0 0 1 .647-.762q.39.331.765.678a.5.5 0 0 1-.339.868zm-49.923-1.725a.47.47 0 0 1-.09-.008.5.5 0 0 1-.4-.581c.792-4.351 3.544-7.229 8.18-8.556a.5.5 0 0 1 .275.962c-4.24 1.212-6.753 3.828-7.472 7.773a.5.5 0 0 1-.499.411zm45.893-1.218a.5.5 0 0 1-.237-.06 12.545 12.545 0 0 0-2.666-1.081.5.5 0 1 1 .261-.966 13.559 13.559 0 0 1 2.88 1.167.5.5 0 0 1-.238.94zM212.146 67.4a.5.5 0 0 1-.28-.086q-.4-.27-.82-.524a.5.5 0 1 1 .516-.856q.444.267.865.552a.5.5 0 0 1-.281.914zm-4.47-2.2a.5.5 0 0 1-.154-.024 16.724 16.724 0 0 0-2.832-.647.5.5 0 0 1 .137-.99 17.6 17.6 0 0 1 3 .686.5.5 0 0 1-.154.976z" fill="#eaeaee"/>
+  <path d="M72.315 62.052h-12a.5.5 0 0 1 0-1h12a.5.5 0 0 1 0 1zm45.582-.184h-1.8a.5.5 0 0 1 0-1h1.8a.5.5 0 0 1 0 1zm-10.8 0h-1a.5.5 0 0 1 0-1h1a.5.5 0 0 1 0 1zm-3.491-2.881a.5.5 0 0 1-.39-.186 18.484 18.484 0 0 0-2-2.129.5.5 0 0 1 .668-.744A19.433 19.433 0 0 1 104 58.174a.5.5 0 0 1-.389.814zm-12.521-.631a.5.5 0 0 1-.466-.319 13.8 13.8 0 0 0-3.857-5.165.5.5 0 0 1 .623-.782 14.47 14.47 0 0 1 3.624 4.438A5.414 5.414 0 0 1 94.12 53.5a.5.5 0 1 1 .326.945 4.994 4.994 0 0 0-2.867 3.51.5.5 0 0 1-.49.401zm-17.637-2.037h-.051a.5.5 0 0 1-.447-.548 6.454 6.454 0 0 1 1.057-3.036.5.5 0 1 1 .824.566 5.46 5.46 0 0 0-.886 2.571.5.5 0 0 1-.497.447zm4.193-5.039a.5.5 0 0 1-.151-.977 10.27 10.27 0 0 1 1.017-.264.5.5 0 0 1 .2.979 9.033 9.033 0 0 0-.917.237.5.5 0 0 1-.148.025z" fill="#eaeaee"/>
+  <path d="M216.326 144.72c-1.079-4.2-3.73-8.616-7.88-13.117a84.471 84.471 0 0 0-8.921-9.988 5.558 5.558 0 0 0-2.261-1.3c-7.177-6.885-21.972-19.819-32.5-20.546a27.625 27.625 0 0 0-1.889-.063 47.155 47.155 0 0 0-15.147 2.913l-5.114-1.4a5 5 0 0 0-6.142 3.5l-.969 3.545a68.668 68.668 0 0 0-7.844 5.3l-2.052-.048h-.116a5 5 0 0 0-5 4.884l-.042 1.829a45.575 45.575 0 0 0-5.648 7.656 5 5 0 0 0-2.515 5.326c-1.882 5.474-2.848 13.743-2.875 24.633a100.416 100.416 0 0 1-1.646 7.791l-4.279 2.594a6.312 6.312 0 0 0-2.125 8.657l1.516 2.5q-.375.778-.761 1.518l-4.037 1.24a6.312 6.312 0 0 0-4.176 7.877l.6 1.953q-.516.587-1.038 1.143l-1.616-.127a5.926 5.926 0 0 0-.5-.02 6.334 6.334 0 0 0-6.277 5.8l-.115 1.456c-2.741 2.043-5.415 4.547-5.415 9.117 0 6.528 10.272 10.568 13.648 11.9a68.955 68.955 0 0 0 24.224 4.781q.566 0 1.127-.012c.607 2.411 1.208 4.468 1.8 6.144a54.956 54.956 0 0 0 4.745 10.264c1.748 2.839 4.22 6.1 7.845 6.1a5.673 5.673 0 0 0 3.572-1.268c1.746-1.421 2.429-3.072 2.482-10.087a86.865 86.865 0 0 0 16.862 1.533 80.987 80.987 0 0 0 14.53-1.463c-.215 6.82.472 8.55 2.275 10.017a5.672 5.672 0 0 0 3.571 1.268c5.645 0 9.953-8.9 12.573-16.361a52.867 52.867 0 0 0 1.069-3.467c1.432-3.724 4.539-13.353 4.892-27.476.161-6.428 0-12.95-.488-19.419a7.56 7.56 0 0 0 1.131-4.949c6.461-1.2 10.808-3.919 15.1-9.34 3.4-4.308 8-14.308 5.826-22.788z" fill="#fff"/>
+  <path d="M211.476 145.947c-1.092-4.252-4.261-8.341-6.9-11.168a78.846 78.846 0 0 0-8.482-9.533.649.649 0 0 0-.907.018c-10.173-10.009-23.029-19.987-30.783-20.521-4.534-.313-10.392.808-16.48 3.1l-6.645-1.817-1.521 5.561a63.823 63.823 0 0 0-10.4 7l-3.884-.09-.087 3.744a40.534 40.534 0 0 0-7.123 9.675l-1.083.338.36 1.153c-2.227 5.146-3.144 14.255-3.147 24.842a104.047 104.047 0 0 1-2.33 10.6l-6 3.638a1.452 1.452 0 0 0-.685 1.835l3.021 4.978a54.736 54.736 0 0 1-2.883 5.777l-5.979 1.836a1.305 1.305 0 0 0-.864 1.63l1.394 4.541a51.394 51.394 0 0 1-4.691 5.189l-3.93-.31a1.3 1.3 0 0 0-1.4 1.2l-.3 3.752c-3.258 2.357-5.218 3.541-5.218 6.422 0 4.144 20.8 13.416 37.9 11.39a88.878 88.878 0 0 0 2.615 9.761c2.852 8.125 6.861 14.032 8.287 12.871.675-.549.711-6.554.562-12.73.446.174 8.025 3.054 21.939 3.054a88.332 88.332 0 0 0 19.876-2.718c-.4 5.844-.626 11.816.085 12.394 1.426 1.161 5.418-4.745 8.269-12.871.357-1.018.7-2.159 1.031-3.377 1.276-3.253 4.307-12.338 4.649-26.035a191.885 191.885 0 0 0-.651-21.1 2.592 2.592 0 0 0-.475-4.743 128.961 128.961 0 0 0-.36-2.871 28.465 28.465 0 0 0 4.578-.19c6.147-.82 9.835-2.869 13.728-7.786 2.797-3.536 6.551-12.06 4.914-18.439z" fill="url(#a)"/>
+  <path d="M193.99 124.155c.033.013.067.031.1.045-9.986-9.641-22.2-18.942-29.683-19.457-4.534-.313-10.392.808-16.48 3.1l-6.645-1.817-1.521 5.561a63.823 63.823 0 0 0-10.4 7l-3.884-.09-.087 3.744a40.534 40.534 0 0 0-7.123 9.675l-1.083.338.36 1.153c-2.227 5.146-3.144 14.255-3.147 24.842a109.944 109.944 0 0 1-.921 4.824c.168-.72.327-1.43.475-2.127.061 3.039.177 6.023.332 8.836-1.014 1.2-4.408 5.548-2.546 8.155a10.876 10.876 0 0 0 3.445 2.858c.069.589.138 1.155.209 1.681 1.015 7.544 4.11 29 6.408 38.3.207-.021.417-.036.623-.061a88.878 88.878 0 0 0 2.615 9.761c2.852 8.125 6.861 14.032 8.287 12.871.675-.549.711-6.554.562-12.73.038.015.145.054.283.1V222.3a46 46 0 0 0 27.634 3.451c15.651-3.043 21.467-14.705 22.172-22.607 1.194-13.372-1.415-19.893-1.415-19.893l6.558-2.852c-.011-.135-.022-.284-.034-.417a2.592 2.592 0 0 0-.475-4.743l-11.158 4.316s-.109-1.739-2.5-4.348c-3.174-3.462-10.521-6.355-11.428-6.7a84.091 84.091 0 0 0 24.884 5.065l-.109-.839c-10.706-.609-24.216-5.348-24.216-5.348s23.783 4.316 33.476-.761c6.847-3.587 11.086-13.369 9.456-21.846-1.731-9.023-13.024-20.623-13.024-20.623z" fill="#f9f9fa"/>
+  <path d="M149.523 146.54l-5.537-1.957a1 1 0 0 0-1.219 1.406l1.99 3.81a1 1 0 0 0 1.349.423l3.547-1.853a1 1 0 0 0-.13-1.829z" fill="#fff"/>
+  <g fill="url(#b)">
+    <path d="M268.754 200.7h-.768c-17.152 0-33.29 0-42.937.322-8.333.277-16.774 1.994-16.787 4.736-.008 1.811 4.646 3.3 13.565 5.982 7.387 2.225 17.5 5.271 17.736 7.75a2.9 2.9 0 0 1-1.2 2.046c-2.984 2.772-11.281 5.909-19.089 4.588a25.1 25.1 0 0 1-12.468-6.4c-4.383-3.888-6.191-7.86-7.786-11.364-.619-1.359-1.2-2.643-1.9-3.837a22.145 22.145 0 0 0-5.357-6.126 194.068 194.068 0 0 0-.6-17.308 4.6 4.6 0 0 0-.2-6.523c.75-.036 1.463-.1 2.13-.188 6.749-.9 10.823-3.211 15.032-8.527 3.282-4.146 7.092-13.147 5.287-20.18-1.2-4.662-4.606-9.055-7.29-11.947a80.769 80.769 0 0 0-8.657-9.724 2.62 2.62 0 0 0-1.653-.713 133.306 133.306 0 0 0-15.775-13.264c-6.315-4.414-11.527-6.79-15.492-7.064a24.782 24.782 0 0 0-1.683-.056 45.119 45.119 0 0 0-15.027 3.055l-6.025-1.648a2 2 0 0 0-2.457 1.4l-1.3 4.745a65.633 65.633 0 0 0-9.391 6.332l-3.141-.073h-.047a2 2 0 0 0-2 1.953l-.069 2.965a42.572 42.572 0 0 0-6.522 8.837l-.3.093a2 2 0 0 0-1.312 2.506l.145.465c-1.993 5.12-3.01 13.443-3.023 24.766a102.594 102.594 0 0 1-2.05 9.47L105.03 171a3.309 3.309 0 0 0-1.114 4.538l2.345 3.87a56.333 56.333 0 0 1-2.1 4.209l-5.216 1.6a3.309 3.309 0 0 0-2.189 4.129l1.082 3.524a49.795 49.795 0 0 1-3.217 3.554l-3.023-.238a3.177 3.177 0 0 0-.267-.011 3.318 3.318 0 0 0-3.287 3.043l-.223 2.83c-2.965 2.13-5.3 3.833-5.3 7.5 0 2.65 3.4 5.1 6.95 6.946a89.372 89.372 0 0 0-1.57 3.365c-1.866 4.156-3.1 6.9-7.448 8.232-8.459 2.584-20.437.244-26.315-3.564-1.825-1.182-2.9-2.432-3.041-3.519-.264-2.111 5.188-4.187 9.167-5.7 3.919-1.492 6.152-2.394 6.47-3.56a1.66 1.66 0 0 0-.295-1.493C64.48 207.69 53.977 207.22 34 207.22a.5.5 0 0 0 0 1c12.5 0 29.627 0 31.645 2.642a.661.661 0 0 1 .125.623c-.2.732-3.339 1.928-5.861 2.888-5 1.9-10.165 3.871-9.8 6.761.176 1.405 1.382 2.869 3.489 4.234 4.275 2.77 11.581 4.841 18.68 4.841a29.2 29.2 0 0 0 8.471-1.16c4.784-1.462 6.161-4.531 8.068-8.778a89.007 89.007 0 0 1 1.552-3.326 54.676 54.676 0 0 0 3.9 1.709 65.842 65.842 0 0 0 23.126 4.572c1.177 0 2.336-.042 3.462-.126a80.823 80.823 0 0 0 2.292 8.265c.516 1.469 5.171 14.354 9.759 14.354a2.629 2.629 0 0 0 1.678-.595c.831-.677 1.5-1.223 1.353-11.536a76.69 76.69 0 0 0 19.885 2.308 86.392 86.392 0 0 0 17.71-2.167c-.585 10.114.149 10.711.989 11.395a2.628 2.628 0 0 0 1.677.595c4.572 0 9.226-12.885 9.742-14.354.347-.989.7-2.137 1.046-3.412 1.345-3.458 4.4-12.766 4.747-26.612.014-.552.01-1.108.019-1.662a20.857 20.857 0 0 1 4.507 5.34c.668 1.152 1.242 2.415 1.851 3.751 1.636 3.595 3.491 7.669 8.032 11.7a26.054 26.054 0 0 0 12.965 6.641 24.08 24.08 0 0 0 4.006.325c6.5 0 12.949-2.4 15.93-5.166a3.735 3.735 0 0 0 1.514-2.872c-.274-2.93-7.481-5.313-18.444-8.614-5.427-1.634-12.859-3.872-12.854-5.02.006-1.314 5.643-3.4 15.82-3.742 9.631-.321 25.785-.326 42.9-.321h.768a.5.5 0 0 0 0-1zM204.579 135c2.636 2.827 5.805 6.916 6.9 11.168 1.637 6.379-2.117 14.9-4.918 18.441-3.893 4.918-7.581 6.967-13.728 7.786-.7.093-1.432.142-2.179.172a.988.988 0 0 0-.354-.077 73.652 73.652 0 0 1-26.1-5.54 1 1 0 0 0-.826 1.821 74.46 74.46 0 0 0 25.115 5.664c.039.323.08.659.121 1.021a2.579 2.579 0 0 1 1.39 3.874.484.484 0 0 0-.243.11c-1.838 1.634-8.407 3.132-8.474 3.146a.5.5 0 0 0-.113.041l-2.2 1.1a.5.5 0 0 0-.274.5c.006.061.561 6.134-2.275 8.973a5.1 5.1 0 0 1-3.97 1.438l.82-4.449a.5.5 0 0 0-.383-.579l-2.605-.579c-.139-1-.37-4.182 1.943-5.917.976-.731 8.157-3.579 10.842-4.614a.5.5 0 0 0-.359-.933c-1 .386-9.818 3.8-11.082 4.747-3.262 2.447-2.312 7.043-2.27 7.237a.492.492 0 0 0 .107.2q-1.276-.217-2.6-.406c-.048-1.62-.626-3.782-2.151-4.88a3.922 3.922 0 0 0-3.715-.379.507.507 0 0 0-.086.039 5.413 5.413 0 0 0-2.65 4.454c0 2.46 1.4 5.3 3.473 5.614a5.187 5.187 0 0 0 .772.059 4.147 4.147 0 0 0 2.763-1 4.691 4.691 0 0 0 1.526-2.9q2.748.39 5.267.9l-.694 3.765a.5.5 0 0 0 .444.588q.446.043.87.043a6.04 6.04 0 0 0 4.449-1.735 6.78 6.78 0 0 0 .928-1.172 40.237 40.237 0 0 1 11.732 5.419q-.012 1.546-.051 3.143c-.342 13.7-3.374 22.782-4.649 26.035a48.73 48.73 0 0 1-1.031 3.377c-2.611 7.438-6.177 13.017-7.855 13.017a.639.639 0 0 1-.415-.146c-.669-.545-.51-5.868-.153-11.366a19.327 19.327 0 0 0 5.9-3.617.5.5 0 0 0-.717-.7 18.885 18.885 0 0 1-5.594 3.4 87.371 87.371 0 0 1-19.4 2.607c-11.281 0-18.4-1.892-20.923-2.7l-.26-6.109a.5.5 0 1 0-1 .043l.243 5.714c.149 6.176.113 12.181-.562 12.73a.639.639 0 0 1-.415.146c-1.681 0-5.261-5.579-7.872-13.017a88.882 88.882 0 0 1-2.615-9.761h-.005c-2.551-10.248-4.636-21.971-4.657-22.089a.5.5 0 1 0-.984.175c.021.118 2.091 11.756 4.633 22-1.324.122-2.662.2-4.013.2a63.607 63.607 0 0 1-26.1-6.059 44.608 44.608 0 0 1 6.949-9.4c9.072-9.555 18.343-13.569 25.331-15.21a6.619 6.619 0 0 0 2.526 3.172 5.232 5.232 0 0 0 2.774.9 4.77 4.77 0 0 0 3.579-1.983.5.5 0 0 0 .052-.57l-1.467-2.574q2.151-.118 4.317-.032c1.077 3.689 5.807 4.056 5.858 4.06h.033a.5.5 0 0 0 .464-.314 8.392 8.392 0 0 0 .432-1.968h2.691a.5.5 0 1 0 0-1h-2.606a18.073 18.073 0 0 0-.152-3.239h2.437a.5.5 0 0 0 0-1h-2.593a24.74 24.74 0 0 0-.512-2.243.5.5 0 0 0-.564-.359 11.053 11.053 0 0 0-3 1.03c-1.867.989-2.77 2.376-2.658 4.025a46.151 46.151 0 0 0-4.689.068l-.048-.084 2.933-.3a.5.5 0 0 0 .449-.484c.005-.2.1-4.931-2.952-6.689-1.677-.968-11.4-4.872-11.818-5.037a.5.5 0 0 0-.372.928c.1.041 10.074 4.043 11.69 4.976 2.05 1.183 2.388 4.223 2.442 5.359l-3.237.333a.5.5 0 0 0-.383.745l2.271 3.988c-1.076 1.186-2.506 2.067-4.831.615-3.425-2.138-3.069-8.563-3.019-9.262 0-.022.005-.044 0-.066v-.007a.5.5 0 0 0-.052-.266.985.985 0 0 0-.548-.63c-.037-.016-3.859-1.7-7.521-3.205-3.062-1.261-3.5-3.464-3.524-3.584a1 1 0 0 0-1.975.313c.021.138.568 3.4 4.738 5.121 3.645 1.5 7.452 3.176 7.488 3.191.056.024.2.091.35.158a17.069 17.069 0 0 0 .664 4.966c-7.122 1.693-16.53 5.791-25.719 15.47a45.518 45.518 0 0 0-7.118 9.64c-3.625-1.887-5.88-3.8-5.88-5.166 0-2.882 1.96-4.065 5.218-6.422l.3-3.752a1.306 1.306 0 0 1 1.293-1.2h.11l2.534.2a15.544 15.544 0 0 1-1.922 1.463.5.5 0 0 0 .545.839 15.693 15.693 0 0 0 2.715-2.2h.058a51.394 51.394 0 0 0 4.691-5.189l-1.394-4.541a1.305 1.305 0 0 1 .864-1.63l4.352-1.336-1.57 2.34a.5.5 0 1 0 .83.558l2.256-3.363.111-.034a59.576 59.576 0 0 0 3-6.032l-2.884-4.76a1.305 1.305 0 0 1 .439-1.792l4.593-2.784-.9 2.5a.5.5 0 0 0 .941.338l1.316-3.665.051-.031c.038-.137.069-.27.106-.406l.078-.218a.5.5 0 0 0 .027-.185 105.18 105.18 0 0 0 2.119-9.789c0-9.717.779-18.179 2.627-23.484l.683 1.709a.5.5 0 0 0 .929-.371l-1.144-2.862-.308-.986 1.083-.338a39.766 39.766 0 0 1 6.223-8.725 12.852 12.852 0 0 0 .241 1.72.5.5 0 0 0 .629.315.5.5 0 0 0 .32-.631 24.71 24.71 0 0 1-.287-2.484l.084-3.613 3.884.09a63.833 63.833 0 0 1 10.4-7l1.521-5.561 5.138 1.405-2.527 1.118a.5.5 0 1 0 .409.912l3.7-1.659a44.04 44.04 0 0 1 14.851-3.124q.8 0 1.545.052c7.754.535 20.609 10.512 30.783 20.521a.655.655 0 0 1 .465-.193.639.639 0 0 1 .442.176m0 0a78.848 78.848 0 0 1 8.484 9.535m-14.79 61.935a42.035 42.035 0 0 0-11.248-5.1 15.357 15.357 0 0 0 1.207-6.3.955.955 0 0 0 .1.016.989.989 0 0 0 .292-.044l9.149-2.784c.288 4.005.511 8.839.5 14.208z"/>
+    <path d="M193.225 139.669a1.412 1.412 0 0 0 1.41-1.41V135.1a1.41 1.41 0 0 0-2.821 0v3.162a1.412 1.412 0 0 0 1.411 1.407z"/>
+    <path d="M193.225 144.475a5.736 5.736 0 0 0 4.644-2.413 1 1 0 1 0-1.679-1.088 3.76 3.76 0 0 1-2.965 1.5 3.71 3.71 0 0 1-2.969-1.506 1 1 0 0 0-1.675 1.094 5.736 5.736 0 0 0 4.644 2.413z"/>
+    <path d="M163.852 142.719a1 1 0 0 0 1.674-1.094 5.674 5.674 0 0 0-9.286 0 1 1 0 0 0 1.674 1.095 3.679 3.679 0 0 1 5.938 0z"/>
+    <path d="M159.473 135.1v3.162c0 .036.008.07.011.106a6.569 6.569 0 0 1 2.8 0c0-.036.011-.07.011-.106V135.1a1.41 1.41 0 1 0-2.821 0z"/>
+    <path d="M160.912 130.086a5.733 5.733 0 0 0 4.643-2.412 1 1 0 0 0-1.674-1.095 3.679 3.679 0 0 1-5.937 0 1 1 0 0 0-1.674 1.094 5.733 5.733 0 0 0 4.642 2.413z"/>
+    <path d="M155.934 155.646a18.515 18.515 0 0 0-4.51-8.323c-5.144-5.145-12.507-4.867-12.817-4.857a1 1 0 0 0 .089 2 16.68 16.68 0 0 1 3.159.279 18.431 18.431 0 0 0 1.1 3.47 6.118 6.118 0 0 0-1.562.513 7.174 7.174 0 0 0-2.41 2.27.5.5 0 1 0 .84.542 6.254 6.254 0 0 1 2.014-1.917 5.319 5.319 0 0 1 1.6-.478 4.113 4.113 0 0 0 .928 1.091 6.669 6.669 0 0 0-.955 2.347 7.171 7.171 0 0 0 .372 3.29.5.5 0 0 0 .469.326.494.494 0 0 0 .174-.031.5.5 0 0 0 .295-.643 6.214 6.214 0 0 1-.326-2.76 5.734 5.734 0 0 1 .894-2.1 2.673 2.673 0 0 0 .474.054 9.686 9.686 0 0 0 4.458-1.746 16.947 16.947 0 0 1 3.75 7.1 1 1 0 0 0 1.956-.42zm-10.821-6.082c-1.027-.642-1.8-3.029-2.178-4.592a15.045 15.045 0 0 1 6.547 3.285c-1.517.943-3.507 1.843-4.37 1.307z"/>
+    <path d="M193.839 116.06a1 1 0 0 0 .71-.3l2.533-2.554a1 1 0 1 0-1.42-1.408l-2.533 2.554a1 1 0 0 0 .71 1.7z"/>
+    <path d="M199.708 117.691a1 1 0 0 0 .409-.088l3.512-1.576a1 1 0 0 0-.818-1.825l-3.512 1.576a1 1 0 0 0 .41 1.913z"/>
+    <path d="M193.882 183.558a.5.5 0 0 0 .106.988.487.487 0 0 0 .105-.011 5.176 5.176 0 0 0 3-7.9.5.5 0 0 0-.807.591 4.178 4.178 0 0 1-2.41 6.327z"/>
+    <path d="M195.435 187.387a.487.487 0 0 0 .105-.011 7.781 7.781 0 0 0 4.512-11.856.5.5 0 1 0-.807.591 6.884 6.884 0 0 1 .676 6.146 6.8 6.8 0 0 1-4.593 4.142.5.5 0 0 0 .105.989z"/>
+    <path d="M127.087 198.745a5.134 5.134 0 0 0 1.54.239 5.254 5.254 0 0 0 3.143-1.063.5.5 0 0 0-.637-.771 4.178 4.178 0 0 1-6.463-2.021.5.5 0 0 0-.962.271 5.206 5.206 0 0 0 3.379 3.345z"/>
+    <path d="M132.43 200.03a6.783 6.783 0 0 1-10.508-3.284.5.5 0 0 0-.963.27 7.773 7.773 0 0 0 12.108 3.785.5.5 0 0 0-.638-.771z"/>
+  </g>
+  <g fill="#f9f9fa">
+    <path d="M160.366 188.859a.5.5 0 0 1-.43-.754l1.345-2.283a.5.5 0 1 1 .861.508l-1.345 2.283a.5.5 0 0 1-.431.246z"/>
+    <path d="M161.086 192.527a.5.5 0 0 1-.43-.754l1.344-2.282a.5.5 0 1 1 .861.508l-1.345 2.282a.5.5 0 0 1-.43.246z"/>
+  </g>
+</svg>
new file mode 100644
--- /dev/null
+++ b/browser/base/content/illustrations/error-malformed-url.svg
@@ -0,0 +1,61 @@
+<!-- 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/. -->
+<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300">
+  <defs>
+    <linearGradient id="a" x1="-300.021" y1="-272.736" x2="547.138" y2="574.423" gradientUnits="userSpaceOnUse">
+      <stop offset="0" stop-color="#ccfbff"/>
+      <stop offset="1" stop-color="#c9e4ff"/>
+    </linearGradient>
+    <linearGradient id="b" x1="-18.672" y1="23.78" x2="279.805" y2="322.256" gradientUnits="userSpaceOnUse">
+      <stop offset="0" stop-color="#00c8d7"/>
+      <stop offset="1" stop-color="#0a84ff"/>
+    </linearGradient>
+  </defs>
+  <path d="M73.275 165.84l63.117-26.74a1 1 0 0 0-.78-1.842L72.494 164a1 1 0 0 0 .78 1.842z" fill="#eaeaee"/>
+  <path d="M110.05 144.74l15.834-6.708a.5.5 0 1 0-.39-.921l-15.834 6.708a.5.5 0 0 0 .39.921z" fill="#eaeaee"/>
+  <path d="M59.35 176.038a.5.5 0 0 1 .265-.655l2.762-1.17a.5.5 0 1 1 .39.921l-2.762 1.17a.5.5 0 0 1-.655-.266zm10.128-4.291a.5.5 0 0 1 .265-.655l11.049-4.681a.5.5 0 1 1 .39.921l-11.049 4.681a.5.5 0 0 1-.654-.266zm19.336-8.192a.5.5 0 0 1 .265-.655l.921-.39a.5.5 0 1 1 .39.921l-.921.39a.5.5 0 0 1-.654-.266zm4.6-1.951a.5.5 0 0 1 .265-.655l2.762-1.17a.5.5 0 1 1 .39.921l-2.762 1.17a.5.5 0 0 1-.65-.27zm10.128-4.291a.5.5 0 0 1 .265-.655l11.049-4.681a.5.5 0 0 1 .39.921l-11.046 4.68a.5.5 0 0 1-.653-.265z" fill="#eaeaee"/>
+  <path d="M103.245 194.26L208.809 161a1 1 0 0 0-.6-1.908l-105.565 33.26a1 1 0 1 0 .6 1.908z" fill="#eaeaee"/>
+  <path d="M116 185l26.482-8.343a.5.5 0 1 0-.3-.954l-26.482 8.342a.5.5 0 0 0 .3.954z" fill="#eaeaee"/>
+  <path d="M84.918 204.09a.5.5 0 0 1 .327-.627l11.445-3.606a.5.5 0 0 1 .3.954l-11.445 3.606a.5.5 0 0 1-.627-.327zm19.076-6.01a.5.5 0 0 1 .327-.627l2.861-.9a.5.5 0 1 1 .3.954l-2.861.9a.5.5 0 0 1-.627-.326zm6.677-2.1a.5.5 0 0 1 .327-.627l.954-.3a.5.5 0 1 1 .3.954l-.954.3a.5.5 0 0 1-.627-.33zm9.538-3a.5.5 0 0 1 .327-.627l11.445-3.606a.5.5 0 1 1 .3.954l-11.445 3.599a.5.5 0 0 1-.628-.327zm19.076-6.01a.5.5 0 0 1 .327-.627l2.861-.9a.5.5 0 1 1 .3.954l-2.861.9a.5.5 0 0 1-.628-.334zm6.677-2.1a.5.5 0 0 1 .327-.627l.954-.3a.5.5 0 1 1 .3.954l-.954.3a.5.5 0 0 1-.628-.337zm9.538-3a.5.5 0 0 1 .327-.627l11.445-3.606a.5.5 0 1 1 .3.954l-11.445 3.606a.5.5 0 0 1-.627-.342zm19.076-6.01a.5.5 0 0 1 .327-.627l2.861-.9a.5.5 0 0 1 .3.954l-2.861.9a.5.5 0 0 1-.629-.342zm6.677-2.1a.5.5 0 0 1 .327-.627l.954-.3a.5.5 0 1 1 .3.954l-.954.3a.5.5 0 0 1-.629-.345zm9.538-3a.5.5 0 0 1 .327-.627l11.445-3.606a.5.5 0 0 1 .3.954l-11.445 3.606a.5.5 0 0 1-.629-.35zm19.076-6.01a.5.5 0 0 1 .327-.627l2.861-.9a.5.5 0 0 1 .3.954l-2.861.9a.5.5 0 0 1-.629-.349zm6.677-2.1a.5.5 0 0 1 .327-.627l.954-.3a.5.5 0 0 1 .3.954l-.954.3a.5.5 0 0 1-.63-.352zm9.538-3a.5.5 0 0 1 .327-.627l11.445-3.606a.5.5 0 1 1 .3.954l-11.445 3.606a.5.5 0 0 1-.63-.357z" fill="#eaeaee"/>
+  <path d="M50.883 109.437L73.366 97.57s-15.334-12.008-1.472-21.924C84.256 66.8 96.745 77.71 96.745 77.71s-2.589-8.73 6.13-11.4c8.6-2.633 20.994 6.885 20.994 6.885l19.577-10.334" fill="#fff"/>
+  <path d="M141.872 58.947L136.085 62a.588.588 0 0 1-.549-1.04l5.788-3.055a.588.588 0 1 1 .549 1.04zm-15.152 8l-1.04.549a.588.588 0 0 1-.549-1.04l1.04-.549a.588.588 0 0 1 .549 1.04zM72.4 94.811l-1.674.884a.588.588 0 0 1-.549-1.04l.9-.478a24.222 24.222 0 0 1-.591-.543.588.588 0 1 1 .81-.853c.7.664 1.177 1.039 1.188 1.048a.588.588 0 0 1-.088.983zm-10 5.277l-12.485 6.59a.588.588 0 1 1-.549-1.04l12.485-6.59a.588.588 0 1 1 .549 1.04zm59.158-31.3a.588.588 0 0 1-.6-.026 45.206 45.206 0 0 0-3-1.776.588.588 0 1 1 .559-1.036 46.056 46.056 0 0 1 3.086 1.824.588.588 0 0 1-.045 1.014zM68.064 90.2a.588.588 0 0 1-.751-.176q-.348-.483-.681-1a.588.588 0 0 1 .993-.631c.208.328.423.643.642.946a.588.588 0 0 1-.133.821.666.666 0 0 1-.07.04zm25.892-16.6a.587.587 0 0 1-.6-.031c-.293-.2-.617-.4-.972-.62a.588.588 0 0 1 .611-1.006c.37.225.71.444 1.016.649a.588.588 0 0 1-.052 1.008zm15.815-10.047a.586.586 0 0 1-.405.053 14.722 14.722 0 0 0-7.557-.008 8.578 8.578 0 0 0-4.693 3.166.588.588 0 0 1-.966-.673 9.747 9.747 0 0 1 5.314-3.618 15.855 15.855 0 0 1 8.163-.013.588.588 0 0 1 .144 1.093zm-21.029 7.324a.587.587 0 0 1-.486.029 21.942 21.942 0 0 0-3.291-.988.588.588 0 0 1 .246-1.151 23.255 23.255 0 0 1 3.468 1.04.588.588 0 0 1 .063 1.07zm-23.055 8.291a.589.589 0 0 1-.827-.722 14.421 14.421 0 0 1 5.452-6.558 19.345 19.345 0 0 1 5.307-2.711.588.588 0 1 1 .361 1.123A18.263 18.263 0 0 0 71 72.844a13.284 13.284 0 0 0-5.031 6.006.59.59 0 0 1-.282.318z" fill="#eaeaee"/>
+  <path d="M144.627 62.6l-92.656 48.906a1.176 1.176 0 0 1-1.1-2.081l92.656-48.907a1.176 1.176 0 1 1 1.1 2.081z" fill="#fff"/>
+  <path d="M185.779 90.824l13.771 3.409s-1.925-10.7 7.531-9.678c8.434.909 9.583 10.091 9.583 10.091s2.165-4.6 6.788-2.471c4.558 2.1 6.186 10.666 6.186 10.666l11.991 2.968" fill="#fff"/>
+  <path d="M200.337 92.789l-13.752-3.4a.59.59 0 0 1 .284-1.146l13.752 3.4a.59.59 0 0 1-.284 1.146zm42.412 10.311l-.529-.131a.59.59 0 1 1 .284-1.146l.529.131a.59.59 0 0 1-.284 1.146zm-5.113-1.266l-3.438-.851a.59.59 0 1 1 .284-1.146l3.438.851a.59.59 0 0 1-.284 1.146zm-20.166-8.627a.614.614 0 0 1-.445-.506l-.035-.222a.589.589 0 0 1 .4-.662 5.483 5.483 0 0 1 6-2.637 7.111 7.111 0 0 1 1.259.447 10.622 10.622 0 0 1 4.381 4.221.591.591 0 0 1-1 .626 9.484 9.484 0 0 0-3.872-3.774 5.935 5.935 0 0 0-1.05-.374c-3.3-.818-4.891 2.422-4.957 2.562a.592.592 0 0 1-.681.319zm-14.675-9.061a.591.591 0 0 1-.2-1.053 6.8 6.8 0 0 1 3.628-1.19.591.591 0 0 1 .07 1.179 5.632 5.632 0 0 0-3.009.97.589.589 0 0 1-.489.094zm9 .181a.6.6 0 0 1-.146-.057 9.055 9.055 0 0 0-1-.478.59.59 0 0 1-.324-.769.6.6 0 0 1 .769-.325 10.36 10.36 0 0 1 1.128.54.59.59 0 0 1-.428 1.089z" fill="#eaeaee"/>
+  <path d="M242.217 107.236l-56.755-14.049a1.181 1.181 0 1 1 .567-2.292l56.755 14.049a1.181 1.181 0 0 1-.567 2.292z" fill="#fff"/>
+  <ellipse cx="155.535" cy="245.952" rx="7.463" ry="43.55" transform="rotate(-86.464 155.535 245.951)" fill="#eaeaee"/>
+  <path d="M112.695 226.207l-64.217-18.684a1 1 0 1 0-.559 1.92l64.217 18.684a1 1 0 1 0 .559-1.92z" fill="#eaeaee"/>
+  <path d="M243.246 226.609L178.5 209.394a1 1 0 0 0-.514 1.933l64.751 17.215a1 1 0 1 0 .514-1.933z" fill="#eaeaee"/>
+  <path d="M146.467 240.275a.789.789 0 0 0 .166-.037.82.82 0 0 1-.205.045z" fill="#fff"/>
+  <g fill="#fff">
+    <path d="M179.037 101.776l-.121-.547a12.937 12.937 0 0 0-.4-1.386 12.75 12.75 0 0 0-22.367-3.36l-4.583-.2a5 5 0 0 0-4.02-2.981 5 5 0 0 0-1.409-1.736l-.987 5.022-.259 1.327 1.261-.689 2.337-1.286.866 3.905 8.492.371.509-.8a9.751 9.751 0 0 1 16.444 10.478l-1.117 1.753a166 166 0 0 1 5.9 23.121c.32-.012 11.494 70.842 11.421 75.734a61.9 61.9 0 0 1-.1 10.1c-.433 3.64-1.661 13.195-5.4 14.023a2.76 2.76 0 0 1-1.855-.234c-.957-.484-1.864-1.833-3.817-11.386a123 123 0 0 1-15.17 4.294 149.57 149.57 0 0 1-17.448 2.843c2.283 9.563 1.761 10.211 1.121 11.019a2.76 2.76 0 0 1-1.582 1c-3.739.829-8.634-6.281-10.574-9.446a46.87 46.87 0 0 1-2.769-5.378c-2.744-3.417-5.519-2.72-2.775.881a47.78 47.78 0 0 0 2.805 5.4 38.26 38.26 0 0 0 6.116 7.863c2.261 2.07 4.879 3.528 7.652 2.913a5.81 5.81 0 0 0 3.292-2.061c.926-1.229 1.334-2.436 1.126-4.9a43.46 43.46 0 0 0-.916-5.379c4.453-.567 9.452-1.439 14.4-2.536 3.437-.762 7.923-1.869 12.292-3.277A61.92 61.92 0 0 0 179 232.33c.863 2.369 1.735 4.03 3.085 4.714a5.017 5.017 0 0 0 3.538.655c2.812-.623 4.751-1.742 6.522-6.337a46.05 46.05 0 0 0 1.841-10.27 75.3 75.3 0 0 0-.13-11.375c.029-4.493-.48-7.184-.945-13.441-1.184-16.126-9.59-59.447-11.018-64.876a168.439 168.439 0 0 0-5.141-20.053l.342-.537a12.8 12.8 0 0 0 1.475-3.236c.1-.361.189-.718.262-1.082a12.68 12.68 0 0 0 .206-4.716z"/>
+    <path d="M134.237 228.656l-6.947-14.593c-1.686-6.992-20.874-79.082-21.813-86.213l-3.447-2.2a9.76 9.76 0 0 1 10.489-16.449l2.087 1.33c4.834-2.638 12.315-6.642 15.256-7.744 3.252-1.223 9.874-6.285 12.141-8.119L146 91.43c-.11-.078-.209-.158-.317-.227a5 5 0 0 0-5.729.4c-3.239 2.623-8.884 6.732-11.307 7.627-2.713 1.021-8.725 4.167-14.083 7.075l-.6-.38a12.76 12.76 0 1 0-13.679 21.468l2.254 1.436c.592 4.611 14.794 90.939 28.1 99.384z"/>
+    <path d="M186.722 176.206s10.389-4.558 15.3-2.655c3.46 1.339 7.075 4.468 9.434 12.129s2.346 13.664-1.921 16.234-9.314 1.9-10.178-.979c-.621-2.067-2.547-9.158-2.547-9.158s-1.255-.941-6.281 1.683z"/>
+    <path d="M116.553 182.33s-16.275-1.34-19.879 3.447c-2.232 2.964-4.4 7.12-3.154 15.039s3.888 13.307 8.85 13.744 9.2-2.381 8.716-5.346c-.349-2.129-1.73-9.347-1.73-9.347s.135 1.219 11.44 2.024z"/>
+  </g>
+  <path d="M205.432 180.5c-3.039-4.414-6.895-5.465-18.936.241-3.035-15.577-8.491-43.6-8.527-43.761a260.987 260.987 0 0 0-.7-3.767l-.039-.176-.958-4.325-.113-.508-.361-1.63-.307-1.386-.314-1.416q-.216-.976-.5-1.937l-.206-.927q-.369-1.342-.756-2.67a5 5 0 0 0-.285-.961q-.305-1.008-.618-2c-.065-.293-.179-.575-.275-.871-.3-.957-.6-1.833-.924-2.735l1.623-2.8a7.778 7.778 0 0 0-13.12-8.359l-.448.7a12.79 12.79 0 0 1 7.84 4.408.5.5 0 0 1-.755.659 11.81 11.81 0 0 0-7.682-4.115l-.084.131-11.187-.495-.052-.234-.059.013-.576-2.6-4.955 2.737.067-.343-.192.1 1.014-5.131c-1.3 1.047-8.6 6.812-12.5 8.282-3.064 1.15-11.506 5.715-16.035 8.2-4.027 2.582-4.287 5.938-4.3 6.074a.5.5 0 0 1-.391.455l-.137.03a.5.5 0 0 1-.474-.52c-.035-.156.269-3.778 4.383-6.615l-2.111-1.345a7.778 7.778 0 0 0-8.359 13.12l3.817 2.432.463.287c.312 3.3 1.05 7.88 2.09 13.129a244.916 244.916 0 0 0 2.3 10.359l.182.82s.136 11.739 6.835 36.611c-13.88-.9-19.023.179-20.366 4.046-1.625 4.678.566 13.9 1.116 15.346a4 4 0 0 0 4.6 2.486 4.046 4.046 0 0 0 .557-.167c2.064-.782 1.925-2.583 1.145-4.648-1.047-2.768-.811-7.074-.755-9.09 2.342-1.09 8.613-.388 16.016.208a437.29 437.29 0 0 0 5.028 15.915c3.14 9.547 6.214 11.174 9.089 14.624a46.19 46.19 0 0 0 2.75 5.383c2.74 4.412 5.31 7.181 7.025 8.174l.357.177.091.041.277.092.13.033.2.037.156-.035.137-.03a.821.821 0 0 0 .205-.045l.059-.013a.781.781 0 0 0 .214-.191c.465-.584-.541-5.4-1.791-10.532a17.821 17.821 0 0 1-5.563-1.625.5.5 0 1 1 .446-.9 17.649 17.649 0 0 0 4.866 1.482c2.018-.14 4.231-.364 6.637-.693l.185-.041 2.114-.3.989-.158 1.423-.234 1.45-.25.976-.216 1.836-.356.586-.13 2.119-.47.312-.069a115.067 115.067 0 0 0 17.231-4.884c2.187-1.13 5.312-3.021 5.347-3.049a.5.5 0 0 1 .518.858c-.136.081-2.713 1.625-4.879 2.8 1.044 5.218 2.365 11.073 3.045 11.414a.77.77 0 0 0 .476.069l.049-.011.215-.048.088-.019.205-.138.087-.07.2-.2.09-.1.216-.273.078-.109.228-.358.046-.072a15.559 15.559 0 0 0 1.319-3.293l-.019-.088.221-.807.033-.13.215-.877-.022-.1c.072-.323.143-.646.211-.989.213-1.071 1.234-3.087.359-4.558a61.5 61.5 0 0 0 .075-9.829l-.015-.068-.033-.658c.569-3.666-.534-19.041-.534-19.041l-.4-2.048c5.392-2.54 8.767-3.317 11.088-3.221.826 1.839 2.666 5.179 2.763 8.137.074 2.206.67 4.468 2.876 4.4a4 4 0 0 0 3.869-4.122c-.047-1.53-.432-9.45-3.24-13.53z" fill="url(#a)"/>
+  <g fill="#f9f9fa">
+    <path d="M120.69 115.886c-2.232 1.282-7.4 4.415-7.3 9.164s2.239 19.146 3.2 20.184 16.5-.365 17.218-1.631-1.208-31.981-1.974-32.714-8.428 3.437-11.144 4.997z"/>
+    <path d="M173.771 187.946c-.254-1.838 4.982-9.811 7.446-13.441-2.179-10.881-6.769-31.937-7.541-34.944-1.738-10.523-4.47-21.185-8.722-28.908-2.181-3.961-12.142-6.956-23.757-5.16l-4.669 36.8s-.428 3.26-2.172 3.549c-1.431.237-13.05 3.558-17.183 4.745q.248.932.505 1.867c.248 1.63 4.281 18.045 7.083 28.711 4.165 2.817 11.809 8.193 12.283 10.016.429 1.652-2.666 8.234-4.839 12.552 2.917 7.157 5.781 12.57 7.815 14.158 12.135 9.6 40.827 2.219 43.492-11.964a69.862 69.862 0 0 0 .03-7.868c-3.884-3.376-9.553-8.541-9.771-10.113z"/>
+  </g>
+  <g fill="url(#b)">
+    <path d="M124.228 131.126a1.4 1.4 0 0 0 1.064-1.67l-.679-3.066a1.4 1.4 0 1 0-2.734.606l.679 3.066a1.4 1.4 0 0 0 1.67 1.064z"/>
+    <path d="M165.962 143.534a1.4 1.4 0 0 0 1.064-1.67l-.679-3.066a1.4 1.4 0 1 0-2.734.606l.679 3.066a1.4 1.4 0 0 0 1.67 1.064z"/>
+    <path d="M125.543 137.062a5.7 5.7 0 0 0 3.981-3.341 1 1 0 1 0-1.876-.7 3.72 3.72 0 0 1-2.548 2.091 3.67 3.67 0 0 1-3.193-.819 1 1 0 0 0-1.4 1.428 5.7 5.7 0 0 0 5.036 1.341z"/>
+    <path d="M167.278 149.47a5.7 5.7 0 0 0 3.991-3.343 1 1 0 0 0-1.866-.7 3.64 3.64 0 0 1-5.741 1.272 1 1 0 0 0-1.395 1.426 5.7 5.7 0 0 0 5.011 1.345z"/>
+    <path d="M156.452 156.752a6.476 6.476 0 0 1-.522.387 6.69 6.69 0 0 1 .8 1.377 4.69 4.69 0 0 1-.525 4.333 1 1 0 0 0 1.592 1.21 6.72 6.72 0 0 0 .808-6.321 7.62 7.62 0 0 0-.365-.762 4.47 4.47 0 0 0 1.118.081 5 5 0 0 0 3.889-2.108 1 1 0 0 0-1.693-1.061 3.06 3.06 0 0 1-2.335 1.181 4.41 4.41 0 0 1-1.548-.31 6.4 6.4 0 0 1-.921 1.814 1.579 1.579 0 0 1-.298.179z"/>
+    <path d="M155.906 157.107a6.476 6.476 0 0 0 .522-.387 1.58 1.58 0 0 0 .249-.184 6.4 6.4 0 0 0 .921-1.814 14.34 14.34 0 0 0 .973-5.9 2.88 2.88 0 0 0-1.181-2.149 1.75 1.75 0 0 0-1.792-.017c-2.144 1-6.864 6.325-7.348 10.764a1.52 1.52 0 0 0 .906 1.594c1.376.615 5.074-.928 6.75-1.907z"/>
+    <path d="M205.286 200.2a5.653 5.653 0 0 0 4.378-4.134c.93-3.7-1.4-15.212-7.182-18.87-5.91-3.741-18 3.543-19.94 4.564-.488.258-.789.725-.531 1.213a1 1 0 0 0 1.35.418c14.7-7.753 16.768-5.262 18.106-4.473 4.967 2.926 7.036 13.563 6.257 16.658a3.561 3.561 0 0 1-3.3 2.686.794.794 0 0 1-.858-.791c-1.144-9.775-3.335-12.139-3.582-12.377a1 1 0 0 0-.744-.28c-.358.018-2.956-.343-13.509 4.457a.97.97 0 0 0-.37 1.365 1.049 1.049 0 0 0 1.365.369c7.878-3.365 10.1-3.936 12.094-4.148.54.877 1.925 3.726 2.759 10.845a2.777 2.777 0 0 0 2.714 2.555 4.132 4.132 0 0 0 .993-.057z"/>
+    <path d="M122.9 161.253l-16.287 3.61a1 1 0 0 1-.433-1.953l16.287-3.61a1 1 0 0 1 .433 1.953z"/>
+    <path d="M124.115 166.721l-16.287 3.61a1 1 0 1 1-.433-1.953l16.287-3.61a1 1 0 1 1 .433 1.953z"/>
+    <path d="M125.219 171.7l-16.287 3.61a.5.5 0 1 1-.216-.976l16.284-3.61a.5.5 0 0 1 .216.976z"/>
+    <path d="M177.123 139.793a1 1 0 0 1-1.06-1.514l8.964-14.069a1 1 0 0 1 1.687 1.075l-8.964 14.069a1 1 0 0 1-.627.439z"/>
+    <path d="M105.051 211.452a5.653 5.653 0 0 1-5.63-2.134c-2.28-3.056-4.647-14.652-.62-20.181 3.171-4.352 22.929-3.128 25.11-2.93a1 1 0 0 1 .9 1.087 1.024 1.024 0 0 1-1.086.9c-22.257-.643-23.329 2.139-23.329 2.139-3.462 4.61-1.284 15.225.625 17.784a3.561 3.561 0 0 0 4.076 1.213.794.794 0 0 0 .488-1.06c-2.7-9.464-1.586-12.489-1.449-12.8a1 1 0 0 1 .58-.544c.337-.121 7.4-.753 19.966.848a1 1 0 1 1-.253 1.983c-10.344-1.318-16.621-1.676-18.541-1.106-.162 1.018-.346 4.18 1.62 11.072a2.777 2.777 0 0 1-1.524 3.4 4.132 4.132 0 0 1-.933.329z"/>
+    <path d="M154.954 133.172s2.432 4.544 3.463 4.542 1.742-2.279 4.785-3.524c3.272-1.339 5.033.538 6.124-.251s1.2-5.459.718-6.368-3.7-2.42-8.672-.654-6.905 5.347-6.418 6.255z"/>
+    <path d="M131.166 148.6a6.476 6.476 0 0 0 .643.1 1.58 1.58 0 0 0 .307.046 6.4 6.4 0 0 0 1.934-.631 14.34 14.34 0 0 0 4.857-3.481 2.88 2.88 0 0 0 .685-2.355 1.75 1.75 0 0 0-1.255-1.279c-2.225-.807-9.326-.381-12.807 2.416a1.52 1.52 0 0 0-.486 1.768c.538 1.397 4.244 2.916 6.122 3.416z"/>
+    <path d="M131.973 147.394s-.186 6.672 2.354 8.45"/>
+    <path d="M134.349 156.844a1 1 0 0 1-.595-.181c-2.9-2.028-2.8-8.559-2.781-9.3a.982.982 0 0 1 1.028-.972 1 1 0 0 1 .972 1.027c-.064 2.374.4 6.536 1.929 7.6a1 1 0 0 1-.553 1.819z"/>
+    <path d="M191.146 210.564c-.657-8.673-1.389-15.793-2.2-22.113a70.69 70.69 0 0 0-1.943.918c.927 6.929 1.676 13.949 2.144 21.2l.015.068a61.494 61.494 0 0 1-.075 9.829c-.254 3.16-.151 3.467-.359 4.558-.067.343-.139.666-.211.989l.022.1-.215.877-.033.13-.221.807.019.088a15.562 15.562 0 0 1-1.319 3.293l-.046.072-.228.358-.078.109-.216.273-.09.1-.2.2-.087.07-.205.138-.088.019-.215.048-.049.011a.77.77 0 0 1-.476-.069c-.67-.343-2-6.187-3.045-11.414 2.134-1.139 4.734-2.719 4.879-2.8a.5.5 0 1 0-.518-.858s-3.162 1.909-5.347 3.049l-.156.035a113.632 113.632 0 0 1-16.147 4.695l-1.25.277-2.119.47-.586.13-1.837.356-.976.216-1.45.25-1.423.233-.989.158-2.114.3-.185.041c-2.4.326-4.649.559-6.637.693a17.65 17.65 0 0 1-4.866-1.482.5.5 0 1 0-.446.9 17.821 17.821 0 0 0 5.563 1.625c1.25 5.131 2.256 9.948 1.791 10.532a.769.769 0 0 1-.224.193l-.1.022a.784.784 0 0 1-.166.037l-.137.03-.156.035-.2-.037-.13-.033-.276-.092-.091-.041-.357-.177c-1.723-.98-4.285-3.762-7.025-8.174a46.184 46.184 0 0 1-2.75-5.383c-2.877-3.46-6.6-10.108-9.711-19.642q-1.77-5.725-3.244-10.808c-.206-.022-.41-.043-.606-.059-.655-.052-1.3-.1-1.936-.157 4.495 15.768 9.369 28.443 13.727 31.643a46.869 46.869 0 0 0 2.769 5.378c1.93 3.116 6.835 10.274 10.574 9.446a2.76 2.76 0 0 0 1.582-1c.64-.808 1.16-1.466-1.121-11.019a149.565 149.565 0 0 0 17.448-2.843 123 123 0 0 0 15.17-4.294c1.953 9.554 2.86 10.9 3.817 11.386a2.76 2.76 0 0 0 1.855.234c3.739-.829 5.571-8.783 5.4-14.023a61.9 61.9 0 0 0 .1-10.101zm-79.172-59.54l-.182-.82-2.3-10.359c-1.052-5.257-1.793-9.845-2.11-13.124l-.441-.281-3.817-2.432a7.778 7.778 0 1 1 8.359-13.12l2.111 1.345c-4.114 2.837-4.368 6.448-4.383 6.615a.5.5 0 0 0 .474.52l.137-.03a.5.5 0 0 0 .391-.455c-.032-.146.249-3.5 4.3-6.074 4.568-2.5 12.973-7.044 16.035-8.2 3.885-1.465 11.18-7.23 12.5-8.282l.2-.167-1.02 5.194-.067.343 4.955-2.737.059-.013.63 2.841 11.181.492.084-.131a11.81 11.81 0 0 1 7.682 4.115.5.5 0 1 0 .755-.659 12.79 12.79 0 0 0-7.84-4.408l.448-.7a7.778 7.778 0 1 1 13.12 8.359l-1.634 2.564c.311.894.616 1.81.924 2.735.065.293.188.573.275.871q.3.957.618 2a5 5 0 0 0 .285.961q.386 1.328.756 2.67l.206.927q.216.976.5 1.938l.314 1.416.307 1.386.361 1.63.112.508.959 4.325.039.176c2.917 16.877 6.122 32.387 8.549 48.11a99.288 99.288 0 0 1 1.969-.924c-2.147-13.977-4.762-25.188-7.888-44.349a179.865 179.865 0 0 0-6.07-24.087l1.117-1.753a9.751 9.751 0 0 0-16.447-10.479l-.509.8-8.492-.371-.859-3.91-2.337 1.286-1.261.689.259-1.327.987-5.022.076-.4-.3.24-3.993 3.241c-2.342 1.82-8.958 6.861-12.167 8.094-2.941 1.1-10.422 5.106-15.256 7.744l-2.087-1.33a9.76 9.76 0 1 0-11.04 16.1q.269.185.55.351l3.447 2.2A571.373 571.373 0 0 0 117.6 187.6q1.175.069 2.441.158c-6.999-25.479-8.067-36.735-8.067-36.735z"/>
+  </g>
+</svg>
new file mode 100644
--- /dev/null
+++ b/browser/base/content/illustrations/error-server-not-found.svg
@@ -0,0 +1,60 @@
+<!-- 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/. -->
+<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300">
+  <defs>
+    <linearGradient id="a" x1="-300.021" y1="-272.736" x2="547.138" y2="574.423" gradientUnits="userSpaceOnUse">
+      <stop offset="0" stop-color="#ccfbff"/>
+      <stop offset="1" stop-color="#c9e4ff"/>
+    </linearGradient>
+    <linearGradient id="b" x1="-18.672" y1="23.78" x2="279.805" y2="322.256" gradientUnits="userSpaceOnUse">
+      <stop offset="0" stop-color="#00c8d7"/>
+      <stop offset="1" stop-color="#0a84ff"/>
+    </linearGradient>
+  </defs>
+  <path d="M224.245 144.067h-10.733c.136.343.274.674.41 1h10.323a.5.5 0 0 0 0-1zm2.454-11.821a.5.5 0 0 0-.5-.5h-20.26c.373.357.727.688 1.065 1h19.2a.5.5 0 0 0 .496-.5zm8.546 11.821h-3a.5.5 0 1 0 0 1h3a.5.5 0 0 0 0-1zm5 0h-1a.5.5 0 1 0 0 1h1a.5.5 0 0 0 0-1zm-3.3-6.66h-25.78a12.767 12.767 0 0 1 .862 2h24.918a1 1 0 0 0 0-2zm20.422 6.66h-8.122a.5.5 0 1 0 0 1h8.122a.5.5 0 0 0 0-1z" fill="#eaeaee"/>
+  <path d="M269.53 87.757h-24.236c-2.108-3.9-7.559-12.718-14.4-14.023-8.952-1.707-10.737 7.217-10.737 7.217s-5.949-15.468-21-13.419c-16.878 2.3-8.928 20.065-8.928 20.065h-25.408l8.181.159h-8.184a1 1 0 0 0 0 2H269.53a1 1 0 0 0 0-2z" fill="#fff"/>
+  <path d="M118.373 63.908h-13.69c-1.129-2.112-4.19-7.156-8.057-7.894-4.978-.949-5.971 4.013-5.971 4.013s-3.309-8.6-11.68-7.462c-9.386 1.278-4.965 11.158-4.965 11.158H59.88l9.471.185h-9.212a1 1 0 0 0 0 2h58.233a1 1 0 1 0 0-2z" fill="#fff"/>
+  <path d="M102.31 121.507H60.818a1 1 0 0 0 0 2h41.492a1 1 0 1 0 0-2zM70.336 117.6H82.1a.5.5 0 0 0 0-1H70.336a.5.5 0 0 0 0 1z" fill="#eaeaee"/>
+  <path d="M111.457 174.8h-78.3a1 1 0 0 0 0 2h78.3a1 1 0 1 0 0-2zm-26.742-3.793h1a.5.5 0 0 0 0-1h-1a.5.5 0 0 0 0 1zm10 0h3.1a.5.5 0 0 0 0-1h-3.1a.5.5 0 0 0 0 1zm-17 0h3a.5.5 0 0 0 0-1h-3a.5.5 0 0 0 0 1zm-20 0h12a.5.5 0 0 0 0-1h-12a.5.5 0 0 0 0 1z" fill="#eaeaee"/>
+  <path d="M206.885 62.973l.045-.1c-.058.027-.063.059-.045.1z" fill="#fff"/>
+  <path d="M77.937 214.941H39.95a1 1 0 1 1 0-2h37.987a1 1 0 1 1 0 2z" fill="#eaeaee"/>
+  <path d="M258.931 214.941h-61.813a1 1 0 0 1 0-2h61.813a1 1 0 0 1 0 2z" fill="#eaeaee"/>
+  <path d="M265.745 85.333h-3a.5.5 0 0 1 0-1h3a.5.5 0 0 1 0 1zm-11 0h-8.07a.5.5 0 0 1-.447-.277c-.007-.014-.724-1.425-1.979-3.342a.5.5 0 1 1 .837-.548c.393.6 1.444 2.293 1.888 3.167h7.772a.5.5 0 0 1 0 1zm-66.489-.712h-3a.5.5 0 0 1 0-1h3a.5.5 0 0 1 0 1zm-11 0h-12a.5.5 0 0 1 0-1h12a.5.5 0 0 1 0 1zM190.1 83.13a.5.5 0 0 1-.474-.339c-.1-.29-.2-.615-.31-.971a.5.5 0 1 1 .958-.287c.1.343.2.657.3.937a.5.5 0 0 1-.474.661zm30.5-5.156a.5.5 0 0 1-.467-.32 23.7 23.7 0 0 0-2.182-4.039.5.5 0 0 1 .834-.552 27.291 27.291 0 0 1 1.719 2.982 10.522 10.522 0 0 1 3.679-5.015.5.5 0 0 1 .571.82 10.181 10.181 0 0 0-3.665 5.721.5.5 0 0 1-.448.4zm18.345-2.964a.5.5 0 0 1-.339-.132q-.361-.333-.735-.651a.5.5 0 0 1 .647-.762q.39.331.765.678a.5.5 0 0 1-.339.868zm-49.923-1.725a.47.47 0 0 1-.09-.008.5.5 0 0 1-.4-.581c.792-4.351 3.544-7.229 8.18-8.556a.5.5 0 0 1 .275.962c-4.24 1.212-6.753 3.828-7.472 7.773a.5.5 0 0 1-.499.411zm45.893-1.218a.5.5 0 0 1-.237-.06 12.545 12.545 0 0 0-2.666-1.081.5.5 0 1 1 .261-.966 13.559 13.559 0 0 1 2.88 1.167.5.5 0 0 1-.238.94zM212.146 67.4a.5.5 0 0 1-.28-.086q-.4-.27-.82-.524a.5.5 0 1 1 .516-.856q.444.267.865.552a.5.5 0 0 1-.281.914zm-4.47-2.2a.5.5 0 0 1-.154-.024 16.724 16.724 0 0 0-2.832-.647.5.5 0 0 1 .137-.99 17.6 17.6 0 0 1 3 .686.5.5 0 0 1-.154.976z" fill="#eaeaee"/>
+  <path d="M72.315 62.052h-12a.5.5 0 0 1 0-1h12a.5.5 0 0 1 0 1zm45.582-.184h-1.8a.5.5 0 0 1 0-1h1.8a.5.5 0 0 1 0 1zm-10.8 0h-1a.5.5 0 0 1 0-1h1a.5.5 0 0 1 0 1zm-3.491-2.881a.5.5 0 0 1-.39-.186 18.484 18.484 0 0 0-2-2.129.5.5 0 1 1 .668-.744A19.433 19.433 0 0 1 104 58.174a.5.5 0 0 1-.389.814zm-12.521-.631a.5.5 0 0 1-.466-.319 13.8 13.8 0 0 0-3.857-5.165.5.5 0 0 1 .623-.782 14.47 14.47 0 0 1 3.624 4.438A5.414 5.414 0 0 1 94.12 53.5a.5.5 0 0 1 .326.945 4.994 4.994 0 0 0-2.867 3.51.5.5 0 0 1-.49.401zm-17.637-2.037h-.051a.5.5 0 0 1-.447-.548 6.454 6.454 0 0 1 1.057-3.036.5.5 0 1 1 .824.566 5.46 5.46 0 0 0-.886 2.571.5.5 0 0 1-.497.447zm4.193-5.039a.5.5 0 0 1-.151-.977 10.27 10.27 0 0 1 1.017-.264.5.5 0 0 1 .2.979 9.033 9.033 0 0 0-.917.237.5.5 0 0 1-.148.025z" fill="#eaeaee"/>
+  <ellipse cx="143.502" cy="244.914" rx="54.673" ry="8.306" fill="#eaeaee"/>
+  <path d="M223.695 147.595a8.557 8.557 0 0 0-3.594-1.658v-.084a5 5 0 0 0-5.98-5.15 36.839 36.839 0 0 0-6.483-9.3 83.918 83.918 0 0 0-8.865-9.925 5.554 5.554 0 0 0-2.252-1.3c-7.134-6.844-21.832-19.69-32.3-20.412a27.308 27.308 0 0 0-1.879-.063A46.863 46.863 0 0 0 147.3 102.6l-5.07-1.386a5 5 0 0 0-6.142 3.5l-.959 3.508a68.223 68.223 0 0 0-7.774 5.252l-2.026-.047h-.116a5 5 0 0 0-5 4.884l-.042 1.8a45.3 45.3 0 0 0-5.6 7.593 5 5 0 0 0-2.508 5.313c-1.868 5.441-2.827 13.654-2.855 24.468-.454 2.653-1 5.24-1.63 7.721l-4.239 2.569a6.3 6.3 0 0 0-2.122 8.645l1.5 2.469q-.366.757-.741 1.478l-4 1.227a6.3 6.3 0 0 0-4.171 7.866l.59 1.923q-.5.569-1.007 1.109l-1.588-.122a5.857 5.857 0 0 0-.5-.02 6.325 6.325 0 0 0-6.268 5.8l-.113 1.431c-2.725 2.033-5.38 4.525-5.38 9.073 0 6.507 10.219 10.526 13.578 11.847a68.529 68.529 0 0 0 24.074 4.751q.549 0 1.093-.012c.6 2.385 1.2 4.42 1.778 6.08a54.622 54.622 0 0 0 4.716 10.2c1.741 2.827 4.2 6.072 7.821 6.072a5.668 5.668 0 0 0 3.569-1.267c1.74-1.416 2.422-3.057 2.477-10.005a86.376 86.376 0 0 0 16.716 1.516 80.415 80.415 0 0 0 14.4-1.446c-.21 6.755.477 8.474 2.273 9.935a5.668 5.668 0 0 0 3.568 1.267c5.627 0 9.914-8.85 12.52-16.273.379-1.079.76-2.326 1.133-3.705h-.008c1.555-5.314 12.415-46.933 15.771-59.81l9.2.076h.041q.235 0 .47-.022a13.639 13.639 0 0 0 8.795-4.994l.014.011c4.448-5.667 4.514-11.806.157-15.28z" fill="#fff"/>
+  <g fill="url(#a)">
+    <path d="M121.625 218.616c-4.1-12.832-7.76-39.924-7.746-61.081a103.51 103.51 0 0 1-2.321 10.573l-5.961 3.612a1.3 1.3 0 0 0-.437 1.779l2.865 4.729a59.209 59.209 0 0 1-2.977 5.993l-5.939 1.823a1.3 1.3 0 0 0-.858 1.619l1.385 4.511a51.054 51.054 0 0 1-4.661 5.155l-3.9-.308a1.3 1.3 0 0 0-1.394 1.19l-.294 3.726c-3.236 2.342-5.183 3.517-5.183 6.38 0 4.117 20.661 13.327 37.645 11.314-.078-.339-.149-.677-.224-1.015z"/>
+    <path d="M186.98 169.883l-12.066-1.734s10.339 13.394 7.748 33.691c-1 7.817-6.478 19.433-22.024 22.456a45.69 45.69 0 0 1-27.449-3.428v8.583s7.584 3.05 21.835 3.05a87.741 87.741 0 0 0 19.743-2.7c-.4 5.8-.622 11.737.084 12.311 1.416 1.153 5.381-4.714 8.214-12.785a48.073 48.073 0 0 0 1.019-3.337c1.268-3.235 4.283-12.279 4.623-25.878a176.857 176.857 0 0 0-1.727-30.229z"/>
+    <path d="M189.791 210.674l-4.457-18.074-8.517-31.348a1.288 1.288 0 0 0-1.554-.989l-20.588 10.535-2.94.327-15.735.134a1.287 1.287 0 0 0-1.177 1.782l6.114 14.682 4.476 18.806a1.278 1.278 0 0 0 .146.349l-1.614 14.85a1.287 1.287 0 0 0 1.3 1.426l18.745-.305q.061 0 .121-.008a1.288 1.288 0 0 0 .151-.026l24.607-10.476a1.287 1.287 0 0 0 .926-1.665z"/>
+    <path d="M139.025 177.647a1.384 1.384 0 0 0 .773-1.1 1.407 1.407 0 0 0-1.269-1.533s-1.257-.638-4.768-.72a7.635 7.635 0 0 0-5.773 2.53 75.369 75.369 0 0 1-13.532-5.021 2.5 2.5 0 0 0-2.225 4.478 76.1 76.1 0 0 0 15.616 5.619c1.4 1.485 3.989 2.07 5.679 2.241.1.031 5.754.357 7.31-3.608.474-1.206-.654-2.449-1.811-2.886z"/>
+    <path d="M212.017 152.78c2.378-2.584 6.425-3.047 8.227-1.609 2.856 2.278.577 6.3-.976 8.274-.044.09-3.736 4.39-7.671 2.758-1.2-.5-1.309-2.171-.821-3.307a1.384 1.384 0 0 1-1.327-.206 1.407 1.407 0 0 1-.223-1.978s.413-1.348 2.791-3.932z"/>
+    <path d="M210.657 147.674a12.766 12.766 0 0 0-.357-2.321c-1.084-4.224-4.233-8.285-6.851-11.094a78.307 78.307 0 0 0-8.425-9.468.648.648 0 0 0-.887.944 80.955 80.955 0 0 1 7.823 8.7c1.579 2.767 3.417 6.488 3.862 9.489a17.1 17.1 0 0 1-1.055 7.18zm-56.427 14.1a1.3 1.3 0 0 0 .514 1.758c.142.078 2.046 1.108 5.194 2.412l2.974-1.612a63.892 63.892 0 0 1-6.924-3.073 1.3 1.3 0 0 0-1.758.517z"/>
+  </g>
+  <g fill="#f9f9fa">
+    <path d="M164.107 222.841q-.06.007-.121.008l-18.745.305a1.287 1.287 0 0 1-1.3-1.426l1.614-14.85a1.28 1.28 0 0 1-.146-.349l-4.476-18.806-2.024-4.861a9.694 9.694 0 0 1-5.383 1.28c-1.69-.17-4.282-.756-5.679-2.241a70.415 70.415 0 0 1-13.1-4.449c1.326 16.092 3.99 32.149 6.873 41.164a93.749 93.749 0 0 0 2.817 10.711c2.833 8.071 6.815 13.938 8.231 12.785.67-.545.705-6.511.557-12.645l-.042-.016v-8.583a45.69 45.69 0 0 0 27.449 3.428 29.062 29.062 0 0 0 11.749-4.94l-8.127 3.46a1.29 1.29 0 0 1-.147.025z"/>
+    <path d="M218.386 185.448c-.284-.616-4.741-17.387-4.741-17.387l.274-5.519a4.792 4.792 0 0 1-2.322-.339c-1.2-.5-1.309-2.171-.821-3.307a1.384 1.384 0 0 1-1.328-.206 1.407 1.407 0 0 1-.223-1.978s.413-1.348 2.791-3.932a7.392 7.392 0 0 1 2.474-1.729l.287-5.78-10.011 5.837a17.1 17.1 0 0 0 1.055-7.18c-.445-3-2.283-6.722-3.862-9.489a80.955 80.955 0 0 0-7.823-8.7.648.648 0 0 1-.028-.915s.011-.006.015-.011c-10.105-9.943-22.875-19.853-30.577-20.384-4.5-.311-10.323.8-16.37 3.082l-6.6-1.805-1.511 5.524a63.4 63.4 0 0 0-10.33 6.958l-3.858-.09-.086 3.719a40.259 40.259 0 0 0-7.075 9.61l-1.076.336.36 1.137c-3.164 7.31-3.661 22.679-2.656 38.859.037.016.076.024.113.043a75.369 75.369 0 0 0 13.532 5.021 6.434 6.434 0 0 1 .467-.48c.065-.061.135-.118.2-.177.1-.088.2-.175.314-.259l.3-.218a7.807 7.807 0 0 1 .651-.406c.045-.025.091-.048.137-.072a7.522 7.522 0 0 1 3.707-.919c.615.014 1.137.049 1.619.092l-.56-1.346a1.287 1.287 0 0 1 1.176-1.779l15.739-.139 2.94-.327 20.588-10.535a1.287 1.287 0 0 1 1.554.989l8.517 31.348 4.457 18.078a1.287 1.287 0 0 1-.926 1.665l-24.607 10.476a1.29 1.29 0 0 1-.151.026q-.06.007-.121.008l-18.745.305a1.287 1.287 0 0 1-1.3-1.426l1.614-14.85a1.28 1.28 0 0 1-.146-.349l-4.476-18.806-2.024-4.861a7.222 7.222 0 0 1-1.957.882l1.244 2.643 4.883 18.667-1.442 20.018 22.316.754 28.2-12.809 22.4-5.773 12.27-10s-8.157-11.179-8.441-11.795zm-58.447-19.5c-3.153-1.305-5.053-2.334-5.2-2.412a1.3 1.3 0 0 1 1.244-2.273 64.081 64.081 0 0 0 6.926 3.071z"/>
+  </g>
+  <path d="M148.2 151.572a1 1 0 0 0-.969-.513l-5.848.544a1 1 0 0 0-.518 1.788l3.4 2.625a1 1 0 0 0 .611.208 1.023 1.023 0 0 0 .128-.008 1 1 0 0 0 .664-.381l2.444-3.169a1 1 0 0 0 .088-1.094z" fill="#fff"/>
+  <g fill="url(#a)">
+    <path d="M215.942 188.189a.5.5 0 0 0-.643-.294c-.657.244-6.829 2.359-9.226 3.179a.485.485 0 0 0-.129.02l-.223.082-.3-.533-4.132-16.317c3.722-1.631 9.422-4.082 10-4.2a.5.5 0 0 0 .43-.551.507.507 0 0 0-.552-.442c-.612.068-7.152 2.91-10.007 4.159l-.978-16.222a.506.506 0 0 0-.529-.469.5.5 0 0 0-.469.529l1.027 16.881a.482.482 0 0 0 .005.087v.063l4.244 16.8a.5.5 0 0 0 .048.121l.252.452-14.371 5.266a.5.5 0 1 0 .345.938l14.53-5.331 7.075 12.687a.5.5 0 1 0 .873-.487l-6.987-12.529c2.259-.773 8.727-2.988 9.423-3.247a.5.5 0 0 0 .294-.642zm-17.866-13.124a.5.5 0 0 0-.645-.29l-12.685 4.811a.5.5 0 0 0 .177.967.49.49 0 0 0 .177-.033l12.685-4.811a.5.5 0 0 0 .29-.644z"/>
+    <path d="M177.573 181.528a1.031 1.031 0 1 0 1.081.668 1.036 1.036 0 0 0-1.081-.668z"/>
+  </g>
+  <path d="M186.537 198.867a.5.5 0 0 0-.634-.312l-22.81 7.758-.215-2.424-3.513-18.32 22.327-4.386a.5.5 0 0 0-.192-.981l-22.373 4.4-4.2-13.34a.5.5 0 0 0-.954.3l4.153 13.167-15.205 1.277a.5.5 0 0 0 .042 1h.042l15.376-1.294 3.513 18.32.214 2.418c-3.146-.116-12.594-.432-13.583-.117a.5.5 0 0 0-.321.621.506.506 0 0 0 .623.333c.734-.214 8.379-.017 13.371.167l1.382 15.6a.5.5 0 0 0 .5.456h.044a.5.5 0 0 0 .454-.542l-1.386-15.624 23.041-7.837a.5.5 0 0 0 .304-.64z" fill="#f9f9fa"/>
+  <g fill="url(#b)">
+    <path d="M158.845 166.591l-3.592-1.575a1 1 0 0 1 .8-1.832l4.854 2.129z"/>
+    <path d="M151.812 151.976a11.582 11.582 0 0 0-15.092 1.077 1 1 0 0 0 1.387 1.441 10.932 10.932 0 0 1 1.693-1.238c1.011 1.259 2.852 3.273 4.438 3.474a1.779 1.779 0 0 0 .228.014c1.905 0 3.843-2.924 4.537-4.082a11.155 11.155 0 0 1 1.621.922 1 1 0 0 0 1.189-1.608zm-7.448 3.762c-1.113-.141-2.654-1.735-3.671-2.971a9.546 9.546 0 0 1 4.815-1.067 9.091 9.091 0 0 1 2.56.576c-.968 1.589-2.592 3.611-3.705 3.461z"/>
+    <path d="M195.7 141.2a5.614 5.614 0 0 0-9.187 0 1 1 0 1 0 1.679 1.088 3.7 3.7 0 0 1 2.915-1.475 3.648 3.648 0 0 1 2.918 1.48 1 1 0 0 0 1.675-1.093z"/>
+    <path d="M155.081 127.311a1 1 0 0 0 1.383-.28 3.618 3.618 0 0 1 5.838 0 1 1 0 0 0 1.675-1.093 5.614 5.614 0 0 0-9.187 0 1 1 0 0 0 .291 1.373z"/>
+    <path d="M189.934 134.871c0 .034-.01.066-.01.1v2.844a6.008 6.008 0 0 1 2.784.078v-2.922a1.378 1.378 0 0 0-.023-.227 5.846 5.846 0 0 0 2.993-2.135 1 1 0 0 0-1.678-1.094 3.617 3.617 0 0 1-5.838 0 1 1 0 0 0-1.674 1.094 5.755 5.755 0 0 0 3.446 2.262z"/>
+    <path d="M158.008 134.971v3.152a5.941 5.941 0 0 1 2.781-.038v-3.114a1.392 1.392 0 1 0-2.784 0z"/>
+    <path d="M159.4 139.021a5.674 5.674 0 0 0-4.593 2.387 1 1 0 0 0 1.674 1.094 3.618 3.618 0 0 1 5.838 0 1 1 0 0 0 1.675-1.093 5.674 5.674 0 0 0-4.594-2.388z"/>
+    <path d="M180.388 181.389a2.938 2.938 0 1 0-4.66 3.254 4.326 4.326 0 0 0 .765.557l2.4 1.8a.562.562 0 0 0 .531.077h.008a.564.564 0 0 0 .35-.418l.577-3a3.9 3.9 0 0 0 .029-2.27zm-2.344 2.132a1.031 1.031 0 1 1 .61-1.325 1.034 1.034 0 0 1-.61 1.325z"/>
+    <path d="M212.864 169.173a.64.64 0 0 0-.9-.158l-6.583 4.6-6.6 4.16-.891.437-6.69-16.391-6.419 2.481-1.271-5.447a.643.643 0 1 0-1.252.294l1.315 5.621-3.806 1.471v.01l-19.531 7.538 3.908 11.6-2.937 1.966-7.657 3.829-11.434.845a.8.8 0 0 0-.1.031l.3 1.246 11.461-.848.127-.01 7.955-3.983 2.715-1.815 8.963 26.609 13.988-4.649-.86-1.86 3.448-1.219 1.248-.441 5.962 3.956a.643.643 0 1 0 .71-1.073l-5.168-3.415.03-.01-1.152-2.5 13.594-5.606-6.957-17.044 1.032-.505 6.682-4.212 6.609-4.621a.642.642 0 0 0 .161-.887zm-9.2 26.575l-13.647 5.629.785 1.7-2.343-2.449-1.288-1.346-4.425-3.346L180.2 193l-.376-4.707a1.748 1.748 0 0 1-1.294-.042l.421 5.273 2.862 3.309 4.5 3.41 3.112 3.263.648.68-.228.081-.146.052-4.8 1.7.847 1.836-11.4 3.79-8.665-25.724 1.41-.943 5.921.554 2.9 2.118 1.361-.251-1.479-1.1a5.89 5.89 0 0 1-.9-.663 4.206 4.206 0 0 1-.783-.893l-.624-.456-6.729-.628-1.5 1-3.4-10.1 19.632-7.577v-.01l2.388-.923.438 1.874.528 4.731.565 3.225-1 2.954-2.623 1.281-.4.374a4.217 4.217 0 0 1 .218.466 3.835 3.835 0 0 1 .2.87l.634-.6 3.021-1.474 1.275-3.774-.616-3.508-.536-4.767-.5-2.123 5.41-2.091 6.246 15.3-10.983 5.386-4.378 1.031-.267 1.386 4.4-1.038.607-.143 11.1-5.432z"/>
+    <path d="M211.383 147.927l2.9-1.77.039 5.23a.5.5 0 0 0 .5.5.5.5 0 0 0 .5-.5l-.046-6.113a.5.5 0 0 0-.76-.423l-3.655 2.229a.5.5 0 0 0 .521.854zm15.845 49.026l-8.383-11.723-4.7-17.252-.32-5.243a.51.51 0 0 0-.529-.469.5.5 0 0 0-.469.529l.323 5.294a.5.5 0 0 0 .017.1l4.733 17.391a.5.5 0 0 0 .076.16l8.163 11.414-11.821 9.633-22.291 5.745c-.015 0-.026.014-.04.02s-.028 0-.041.01l-28.095 12.761-21.68-.732 1.4-19.5a.506.506 0 0 0-.015-.163l-4.876-18.668a.537.537 0 0 0-.041-.1l-1.539-2.96a.5.5 0 0 0-.887.463l1.515 2.9 4.848 18.532-1.435 19.936a.5.5 0 0 0 .481.536l22.316.754h.017a.5.5 0 0 0 .207-.045l28.159-12.79 22.358-5.762a.505.505 0 0 0 .191-.1l12.27-10a.5.5 0 0 0 .088-.671zm-96.2-26.9l23.165-.486a.5.5 0 0 0 .228-.061l22.133-12 14.9-1.49h.011l7.36-.909a.5.5 0 0 0 .187-.062l8.711-4.962a.5.5 0 1 0-.5-.869l-8.624 4.913-7.249.9-15 1.5a.5.5 0 0 0-.188.058l-22.115 11.992-23.782.5a.5.5 0 0 0-.449.7l1.47 3.46a.5.5 0 0 0 .46.3.493.493 0 0 0 .2-.04.5.5 0 0 0 .265-.655z"/>
+    <path d="M221.337 150.947c-.37-.407-2.546-2.481-6.929-.472a1 1 0 0 0 .832 1.818c3.251-1.489 4.553-.074 4.594-.03.024.03.064.072.091.1.076.074 1.82 1.86-.674 5.575-2.65 3.945-5.713 3.84-5.862 3.832a1 1 0 0 0-.142 1.995c.019 0 .085.006.193.006.877 0 4.494-.285 7.471-4.717 3.289-4.902.831-7.7.426-8.107zm-9.037 2.245a.5.5 0 1 0-.567-.823c-.354.244-3.456 2.447-3.149 4.537.13.889.826 1.577 2.071 2.049v2.479a.5.5 0 0 0 1 0V158.6a.5.5 0 0 0-.347-.476c-1.069-.345-1.652-.8-1.735-1.363-.183-1.25 1.962-3.041 2.727-3.569z"/>
+    <path d="M141.324 179.661a1 1 0 0 0-1.361.384 5.382 5.382 0 0 1-3.357 2.765c-3.375.921-7.389-1.383-7.43-1.407a1.043 1.043 0 0 0-.494-.137 23.844 23.844 0 0 1-5.361-1.266 94.816 94.816 0 0 1-10.046-4.156 1 1 0 1 0-.87 1.8 94.837 94.837 0 0 0 10.318 4.263 28.613 28.613 0 0 0 5.662 1.344 14.825 14.825 0 0 0 6.505 1.775 8.516 8.516 0 0 0 2.233-.285 7.38 7.38 0 0 0 4.585-3.72 1 1 0 0 0-.384-1.36zm-13.077-2.407c1.673-1.014 6.485-3.407 8.631-2.308a2.26 2.26 0 0 1 1.111 2.027.5.5 0 0 0 .125.292l1.333 1.5a.5.5 0 1 0 .747-.664l-1.225-1.378a3.151 3.151 0 0 0-1.637-2.667c-3.076-1.572-9.338 2.182-9.6 2.343a.5.5 0 0 0 .519.855z"/>
+    <path d="M187.079 215.322a62.9 62.9 0 0 1-2.99 10.65 48.268 48.268 0 0 1-1.024 3.355c-2.593 7.389-6.135 12.929-7.8 12.929a.634.634 0 0 1-.412-.145c-.706-.575-.484-6.506-.084-12.311a87.741 87.741 0 0 1-19.743 2.7c-11.364 0-18.463-1.931-20.878-2.715l-.237-5.569a.5.5 0 0 0-1 .043l.386 9.076c.038 4.572-.1 8.349-.622 8.777a.635.635 0 0 1-.412.145c-1.67 0-5.226-5.541-7.819-12.929a88.238 88.238 0 0 1-2.593-9.678v-.018c-2.557-10.229-4.4-21.578-4.427-21.725a.5.5 0 0 0-.984.174c.025.144 1.891 11.541 4.373 21.641a43.511 43.511 0 0 1-3.955.194c-15.782 0-32.651-7.878-32.651-11.6 0-2.862 1.947-4.038 5.183-6.379l.294-3.727a1.3 1.3 0 0 1 1.284-1.194h.109l2.658.209c-.932 1-1.8 1.954-1.856 2.019a.5.5 0 0 0 .741.672c.02-.022 1.7-1.876 2.915-3.143a51.528 51.528 0 0 0 4.106-4.6l-1.385-4.51a1.3 1.3 0 0 1 .858-1.619l4.541-1.395-1.472 2.6a.5.5 0 0 0 .871.492l2-3.526a59.168 59.168 0 0 0 2.977-5.992l-2.871-4.723a1.3 1.3 0 0 1 .436-1.78l4.685-2.84-.841 2.8a.5.5 0 0 0 .335.623.506.506 0 0 0 .144.021.5.5 0 0 0 .479-.356l1.159-3.861a103.318 103.318 0 0 0 2.315-10.528c0-9.635.771-18.028 2.6-23.3l.629 1.572a.5.5 0 0 0 .929-.371l-1.036-2.59-.354-1.132 1.076-.336a39.516 39.516 0 0 1 6.206-8.693 17.58 17.58 0 0 0 .293 2.241.5.5 0 0 0 .472.34.5.5 0 0 0 .477-.656c-.081-.25-.222-1.675-.361-3.33l.075-3.231 3.858.09a63.4 63.4 0 0 1 10.33-6.958l1.511-5.524 5.175 1.415-2.448 1.1a.5.5 0 1 0 .409.912l3.465-1.619a43.83 43.83 0 0 1 14.834-3.133q.79 0 1.535.051c7.7.531 20.471 10.442 30.576 20.384a.65.65 0 0 1 .461-.192.635.635 0 0 1 .439.175 78.316 78.316 0 0 1 8.426 9.469c2.618 2.808 5.766 6.87 6.851 11.093a12.766 12.766 0 0 1 .357 2.321l1.9-1.109a14.088 14.088 0 0 0-.321-1.71c-1.189-4.633-4.577-9-7.244-11.873a80.227 80.227 0 0 0-8.6-9.651 2.616 2.616 0 0 0-1.645-.711 132.405 132.405 0 0 0-15.667-13.173c-6.275-4.386-11.455-6.747-15.4-7.019-.538-.037-1.1-.056-1.673-.056a44.826 44.826 0 0 0-14.927 3.034l-5.98-1.635a2 2 0 0 0-2.457 1.4l-1.287 4.707a65.217 65.217 0 0 0-9.321 6.285l-3.115-.072h-.047a2 2 0 0 0-2 1.953l-.068 2.94a42.293 42.293 0 0 0-6.474 8.772l-.291.091a2 2 0 0 0-1.313 2.506l.143.457c-1.979 5.088-2.989 13.356-3 24.6a102.64 102.64 0 0 1-2.034 9.4l-5.279 3.2a3.3 3.3 0 0 0-1.111 4.526l2.326 3.838a57.63 57.63 0 0 1-2.077 4.169l-5.176 1.59a3.3 3.3 0 0 0-2.183 4.118l1.073 3.494a49.486 49.486 0 0 1-3.185 3.519l-3-.236a3.17 3.17 0 0 0-.266-.011 3.31 3.31 0 0 0-3.278 3.035l-.221 2.8c-2.946 2.116-5.262 3.81-5.262 7.461 0 3.883 7.315 7.34 11.675 9.055a65.414 65.414 0 0 0 22.976 4.543 46.33 46.33 0 0 0 3.429-.125 80.231 80.231 0 0 0 2.274 8.2c.513 1.46 5.14 14.267 9.706 14.267a2.624 2.624 0 0 0 1.675-.594c.828-.674 1.5-1.218 1.349-11.451a76.223 76.223 0 0 0 19.738 2.288 85.8 85.8 0 0 0 17.577-2.149c-.579 10.036.152 10.631.988 11.312a2.623 2.623 0 0 0 1.674.594c4.55 0 9.177-12.807 9.689-14.267.345-.983.694-2.123 1.039-3.39a67.385 67.385 0 0 0 3.306-12.285z"/>
+  </g>
+</svg>
--- a/browser/base/content/nsContextMenu.js
+++ b/browser/base/content/nsContextMenu.js
@@ -39,17 +39,16 @@ function openContextMenu(aMessage) {
   gContextMenuContentData = { context: data.context,
                               isRemote: data.isRemote,
                               popupNodeSelectors: data.popupNodeSelectors,
                               browser,
                               editFlags: data.editFlags,
                               spellInfo,
                               principal: data.principal,
                               customMenuItems: data.customMenuItems,
-                              addonInfo: data.addonInfo,
                               documentURIObject,
                               docLocation: data.docLocation,
                               charSet: data.charSet,
                               referrer: data.referrer,
                               referrerPolicy: data.referrerPolicy,
                               contentType: data.contentType,
                               contentDisposition: data.contentDisposition,
                               frameOuterWindowID: data.frameOuterWindowID,
--- a/browser/base/content/popup-notifications.inc
+++ b/browser/base/content/popup-notifications.inc
@@ -76,14 +76,20 @@
       <popupnotificationcontent class="addon-webext-perm-notification-content" orient="vertical">
         <description id="addon-webext-perm-header" class="addon-webext-perm-header"/>
         <description id="addon-webext-perm-text" class="addon-webext-perm-text"/>
         <label id="addon-webext-perm-intro" class="addon-webext-perm-text"/>
         <html:ul id="addon-webext-perm-list" class="addon-webext-perm-list"/>
       </popupnotificationcontent>
     </popupnotification>
 
+    <popupnotification id="addon-webext-defaultsearch-notification" hidden="true">
+      <popupnotificationcontent class="addon-webext-defaultsearch-notification-content" orient="vertical">
+        <description id="addon-webext-defaultsearch-text" class="addon-webext-perm-header"/>
+      </popupnotificationcontent>
+    </popupnotification>
+
     <popupnotification id="addon-installed-notification" hidden="true">
       <popupnotificationcontent class="addon-installed-notification-content" orient="vertical">
         <description id="addon-installed-notification-header"/>
         <description id="addon-installed-notification-message"/>
       </popupnotificationcontent>
     </popupnotification>
--- a/browser/base/content/sanitize.js
+++ b/browser/base/content/sanitize.js
@@ -14,16 +14,24 @@ XPCOMUtils.defineLazyModuleGetters(this,
   FormHistory: "resource://gre/modules/FormHistory.jsm",
   Downloads: "resource://gre/modules/Downloads.jsm",
   DownloadsCommon: "resource:///modules/DownloadsCommon.jsm",
   TelemetryStopwatch: "resource://gre/modules/TelemetryStopwatch.jsm",
   console: "resource://gre/modules/Console.jsm",
   setTimeout: "resource://gre/modules/Timer.jsm",
 });
 
+
+XPCOMUtils.defineLazyServiceGetter(this, "serviceWorkerManager",
+                                   "@mozilla.org/serviceworkers/manager;1",
+                                   "nsIServiceWorkerManager");
+XPCOMUtils.defineLazyServiceGetter(this, "quotaManagerService",
+                                   "@mozilla.org/dom/quota-manager-service;1",
+                                   "nsIQuotaManagerService");
+
 var {classes: Cc, interfaces: Ci} = Components;
 
 /**
  * A number of iterations after which to yield time back
  * to the system.
  */
 const YIELD_PERIOD = 10;
 
@@ -275,19 +283,51 @@ Sanitizer.prototype = {
         if (seenException) {
           throw seenException;
         }
       },
     },
 
     offlineApps: {
       async clear(range) {
+        // AppCache
         Components.utils.import("resource:///modules/offlineAppCache.jsm");
         // This doesn't wait for the cleanup to be complete.
         OfflineAppCacheHelper.clear();
+
+        // LocalStorage
+        Services.obs.notifyObservers(null, "extension:purge-localStorage");
+
+        // ServiceWorkers
+        let serviceWorkers = serviceWorkerManager.getAllRegistrations();
+        for (let i = 0; i < serviceWorkers.length; i++) {
+          let sw = serviceWorkers.queryElementAt(i, Ci.nsIServiceWorkerRegistrationInfo);
+          let host = sw.principal.URI.host;
+          serviceWorkerManager.removeAndPropagate(host);
+        }
+
+        // QuotaManager
+        let promises = [];
+        await new Promise(resolve => {
+          quotaManagerService.getUsage(request => {
+            for (let item of request.result) {
+              let principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(item.origin);
+              let uri = principal.URI;
+              if (uri.scheme == "http" || uri.scheme == "https" || uri.scheme == "file") {
+                promises.push(new Promise(r => {
+                  let req = quotaManagerService.clearStoragesForPrincipal(principal, null, false);
+                  req.callback = () => { r(); };
+                }));
+              }
+            }
+            resolve();
+          });
+        });
+
+        return Promise.all(promises);
       }
     },
 
     history: {
       async clear(range) {
         let seenException;
         let refObj = {};
         TelemetryStopwatch.start("FX_SANITIZE_HISTORY", refObj);
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -970,38 +970,41 @@
       <field name="mIconLoadingPrincipal">
         null
       </field>
 
       <method name="setIcon">
         <parameter name="aTab"/>
         <parameter name="aURI"/>
         <parameter name="aLoadingPrincipal"/>
+        <parameter name="aRequestContextID"/>
         <body>
           <![CDATA[
             let browser = this.getBrowserForTab(aTab);
             browser.mIconURL = aURI instanceof Ci.nsIURI ? aURI.spec : aURI;
             let loadingPrincipal = aLoadingPrincipal
               ? aLoadingPrincipal
               : Services.scriptSecurityManager.getSystemPrincipal();
+            let requestContextID = aRequestContextID || 0;
 
             if (aURI) {
               if (!(aURI instanceof Ci.nsIURI)) {
                 aURI = makeURI(aURI);
               }
-              PlacesUIUtils.loadFavicon(browser, loadingPrincipal, aURI);
+              PlacesUIUtils.loadFavicon(browser, loadingPrincipal, aURI, requestContextID);
             }
 
             let sizedIconUrl = browser.mIconURL || "";
             if (sizedIconUrl != aTab.getAttribute("image")) {
               if (sizedIconUrl) {
                 if (!browser.mIconLoadingPrincipal ||
                     !browser.mIconLoadingPrincipal.equals(loadingPrincipal)) {
                   aTab.setAttribute("iconLoadingPrincipal",
                     this.serializationHelper.serializeToString(loadingPrincipal));
+                  aTab.setAttribute("requestcontextid", requestContextID);
                   browser.mIconLoadingPrincipal = loadingPrincipal;
                 }
                 aTab.setAttribute("image", sizedIconUrl);
               } else {
                 aTab.removeAttribute("iconLoadingPrincipal");
                 delete browser.mIconLoadingPrincipal;
                 aTab.removeAttribute("image");
               }
@@ -1069,17 +1072,17 @@
 
             // Use documentURIObject in the check for shouldLoadFavIcon so that we
             // do the right thing with about:-style error pages.  Bug 453442
             if (!icon && this.shouldLoadFavIcon(documentURI)) {
               let url = documentURI.prePath + "/favicon.ico";
               if (!this.isFailedIcon(url))
                 icon = url;
             }
-            this.setIcon(aTab, icon, browser.contentPrincipal);
+            this.setIcon(aTab, icon, browser.contentPrincipal, browser.contentRequestContextID);
           ]]>
         </body>
       </method>
 
       <method name="isFailedIcon">
         <parameter name="aURI"/>
         <body>
           <![CDATA[
@@ -1847,22 +1850,18 @@
               postData: aPostDatas[i],
               userContextId: aUserContextId,
               triggeringPrincipal: aTriggeringPrincipal,
             });
             if (targetTabIndex !== -1)
               this.moveTabTo(tab, ++tabNum);
           }
 
-          if (!aLoadInBackground) {
-            if (firstTabAdded) {
-              // .selectedTab setter focuses the content area
-              this.selectedTab = firstTabAdded;
-            } else
-              this.selectedBrowser.focus();
+          if (firstTabAdded && !aLoadInBackground) {
+            this.selectedTab = firstTabAdded;
           }
         ]]></body>
       </method>
 
       <method name="updateBrowserRemoteness">
         <parameter name="aBrowser"/>
         <parameter name="aShouldBeRemote"/>
         <parameter name="aOptions"/>
@@ -3498,17 +3497,17 @@
               SessionStore.setTabState(aOurTab, SessionStore.getTabState(aOtherTab));
 
               // Make sure to unregister any open URIs.
               this._swapRegisteredOpenURIs(ourBrowser, otherBrowser);
             } else {
               // Workarounds for bug 458697
               // Icon might have been set on DOMLinkAdded, don't override that.
               if (!ourBrowser.mIconURL && otherBrowser.mIconURL)
-                this.setIcon(aOurTab, otherBrowser.mIconURL, otherBrowser.contentPrincipal);
+                this.setIcon(aOurTab, otherBrowser.mIconURL, otherBrowser.contentPrincipal, otherBrowser.contentRequestContextID);
               var isBusy = aOtherTab.hasAttribute("busy");
               if (isBusy) {
                 aOurTab.setAttribute("busy", "true");
                 modifiedAttrs.push("busy");
                 if (aOurTab.selected)
                   this.mIsBusy = true;
               }
 
@@ -4368,23 +4367,16 @@
             get minimizedOrFullyOccluded() {
               return window.windowState == window.STATE_MINIMIZED ||
                      window.isFullyOccluded;
             },
 
             init() {
               this.log("START");
 
-              XPCOMUtils.defineLazyPreferenceGetter(this, "WARMING_ENABLED",
-                                                    "browser.tabs.remote.warmup.enabled", false);
-              XPCOMUtils.defineLazyPreferenceGetter(this, "MAX_WARMING_TABS",
-                                                    "browser.tabs.remote.warmup.maxTabs", 3);
-              XPCOMUtils.defineLazyPreferenceGetter(this, "WARMING_UNLOAD_DELAY" /* ms */,
-                                                    "browser.tabs.remote.warmup.unloadDelayMs", 2000);
-
               // If we minimized the window before the switcher was activated,
               // we might have set  the preserveLayers flag for the current
               // browser. Let's clear it.
               this.tabbrowser.mCurrentBrowser.preserveLayers(false);
 
               window.addEventListener("MozAfterPaint", this);
               window.addEventListener("MozLayerTreeReady", this);
               window.addEventListener("MozLayerTreeCleared", this);
@@ -4712,18 +4704,18 @@
               // handlers, which might cause finish() to already have been called.
               // Check for that before calling finish() again.
               if (!this.tabbrowser._switcher) {
                 return;
               }
 
               this.maybeFinishTabSwitch();
 
-              if (numWarming > this.MAX_WARMING_TABS) {
-                this.logState("Hit MAX_WARMING_TABS");
+              if (numWarming > this.tabbrowser.tabWarmingMax) {
+                this.logState("Hit tabWarmingMax");
                 if (this.unloadTimer) {
                   this.clearTimer(this.unloadTimer);
                 }
                 this.unloadNonRequiredTabs();
               }
 
               if (numPending == 0) {
                 this.finish();
@@ -4932,17 +4924,17 @@
             },
 
             activateBrowserForPrintPreview(browser) {
               let tab = this.tabbrowser.getTabForBrowser(browser);
               this.setTabState(tab, this.STATE_LOADING);
             },
 
             canWarmTab(tab) {
-              if (!this.WARMING_ENABLED) {
+              if (!this.tabbrowser.tabWarmingEnabled) {
                 return false;
               }
 
               // If the tab is not yet inserted, closing, not remote,
               // crashed, already visible, or already requested, warming
               // up the tab makes no sense.
               if (this.minimizedOrFullyOccluded ||
                   !tab.linkedPanel ||
@@ -4972,26 +4964,27 @@
               if (!this.canWarmTab(tab)) {
                 return;
               }
 
               this.logState("warmupTab " + this.tinfo(tab));
 
               this.warmingTabs.add(tab);
               this.setTabState(tab, this.STATE_LOADING);
-              this.suppressDisplayPortAndQueueUnload(tab, this.WARMING_UNLOAD_DELAY);
+              this.suppressDisplayPortAndQueueUnload(tab,
+                this.tabbrowser.tabWarmingUnloadDelay);
             },
 
             // Called when the user asks to switch to a given tab.
             requestTab(tab) {
               if (tab === this.requestedTab) {
                 return;
               }
 
-              if (this.WARMING_ENABLED) {
+              if (this.tabbrowser.tabWarmingEnabled) {
                 let warmingState = "disqualified";
 
                 if (this.warmingTabs.has(tab)) {
                   let tabState = this.getTabState(tab);
                   if (tabState == this.STATE_LOADING) {
                     warmingState = "stillLoading";
                   } else if (tabState == this.STATE_LOADED) {
                     warmingState = "loaded";
@@ -5876,16 +5869,22 @@
 
           // Add listeners for prerender messages
           messageManager.addMessageListener("Prerender:Request", this);
           messageManager.addMessageListener("Prerender:Cancel", this);
           messageManager.addMessageListener("Prerender:Swap", this);
 
           XPCOMUtils.defineLazyPreferenceGetter(this, "animationsEnabled",
                                                 "toolkit.cosmeticAnimations.enabled", true);
+          XPCOMUtils.defineLazyPreferenceGetter(this, "tabWarmingEnabled",
+                                                "browser.tabs.remote.warmup.enabled", false);
+          XPCOMUtils.defineLazyPreferenceGetter(this, "tabWarmingMax",
+                                                "browser.tabs.remote.warmup.maxTabs", 3);
+          XPCOMUtils.defineLazyPreferenceGetter(this, "tabWarmingUnloadDelay" /* ms */,
+                                                "browser.tabs.remote.warmup.unloadDelayMs", 2000);
         ]]>
       </constructor>
 
       <method name="_generateUniquePanelID">
         <body><![CDATA[
           if (!this._uniquePanelIDCounter) {
             this._uniquePanelIDCounter = 0;
           }
@@ -6079,17 +6078,17 @@
           if (this.selectedBrowser == browser) {
             TabCrashHandler.onSelectedBrowserCrash(browser);
           } else {
             this.updateBrowserRemoteness(browser, false);
             SessionStore.reviveCrashedTab(tab);
           }
 
           tab.removeAttribute("soundplaying");
-          this.setIcon(tab, icon, browser.contentPrincipal);
+          this.setIcon(tab, icon, browser.contentPrincipal, browser.contentRequestContextID);
         ]]>
       </handler>
       <handler event="DOMAudioPlaybackStarted">
         <![CDATA[
           var tab = this.getTabFromAudioEvent(event)
           if (!tab) {
             return;
           }
@@ -7658,17 +7657,17 @@
                   anonid="tab-loading-burst"
                   class="tab-loading-burst"/>
         <xul:hbox xbl:inherits="pinned,selected=visuallyselected,titlechanged,attention"
                   class="tab-content" align="center">
           <xul:hbox xbl:inherits="fadein,pinned,busy,progress,selected=visuallyselected"
                     anonid="tab-throbber"
                     class="tab-throbber"
                     layer="true"/>
-          <xul:image xbl:inherits="src=image,loadingprincipal=iconLoadingPrincipal,fadein,pinned,selected=visuallyselected,busy,crashed,sharing"
+          <xul:image xbl:inherits="src=image,loadingprincipal=iconLoadingPrincipal,requestcontextid,fadein,pinned,selected=visuallyselected,busy,crashed,sharing"
                      anonid="tab-icon-image"
                      class="tab-icon-image"
                      validate="never"
                      role="presentation"/>
           <xul:image xbl:inherits="sharing,selected=visuallyselected,pinned"
                      anonid="sharing-icon"
                      class="tab-sharing-icon-overlay"
                      role="presentation"/>
--- a/browser/base/content/test/about/browser.ini
+++ b/browser/base/content/test/about/browser.ini
@@ -13,17 +13,17 @@ support-files =
 [browser_aboutCertError.js]
 [browser_aboutHealthReport.js]
 skip-if = os == "linux" # Bug 924307
 [browser_aboutHome_imitate.js]
 [browser_aboutHome_input.js]
 skip-if = os == "win" && debug && !e10s # Bug 1399648
 [browser_aboutHome_search_POST.js]
 [browser_aboutHome_search_composing.js]
-skip-if = os == "linux" && !debug && bits == 32 # Bug 1399648
+skip-if = !debug && (os == "mac" || (os == "linux" && bits == 32)) # Bug 1400491, bug 1399648
 [browser_aboutHome_search_searchbar.js]
 [browser_aboutHome_search_suggestion.js]
 skip-if = os == "mac" || (os == "linux" && !debug) # Bug 1399648
 [browser_aboutHome_search_telemetry.js]
 [browser_aboutHome_snippets.js]
 [browser_aboutHome_wrapsCorrectly.js]
 skip-if = os == "linux" && !debug # Bug 1395602
 [browser_aboutNetError.js]
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -287,17 +287,16 @@ skip-if = os == "win" && debug && e10s #
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_bug832435.js]
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_bug839103.js]
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_bug882977.js]
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_bug970746.js]
-skip-if = (os == "win" && os_version == "6.1") # Disabled on Windows 7 (No D2D but supports DWrite) due to unexplained consequence of bug 1376026
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_bug1015721.js]
 skip-if = os == 'win'
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_accesskeys.js]
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_clipboard.js]
 subsuite = clipboard
--- a/browser/base/content/test/general/browser_bug970746.xhtml
+++ b/browser/base/content/test/general/browser_bug970746.xhtml
@@ -1,20 +1,22 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <html xmlns="http://www.w3.org/1999/xhtml">
   <body>
     <a href="http://mozilla.org" id="link">I'm a link!</a>
+    <br/>
     <a href="http://mozilla.org" id="longLink">I'm a really long link and I should be truncated.</a>
-
+    <br/>
     <span id="plainText">
       Right clicking me when I'm selected should show the menu item.
     </span>
+    <br/>
     <span id="mixedContent">
       I'm some text, and <a href="http://mozilla.org">I'm a link!</a>
     </span>
-
+    <br/>
     <a href="http://mozilla.org">A partial <span id="partialLink">link selection</span></a>
-
+    <br/>
     <span id="surrogatePair">
       This characteršŸ”„  shouldn't be truncated. 
     </span>
   </body>
 </html>
--- a/browser/base/content/test/general/browser_compacttheme.js
+++ b/browser/base/content/test/general/browser_compacttheme.js
@@ -48,17 +48,17 @@ add_task(async function startTests() {
   ok(!CompactTheme.isStyleSheetEnabled, "There is no compact style sheet when no lw theme is applied.");
 });
 
 function dummyLightweightTheme(id) {
   return {
     id,
     name: id,
     headerURL: "resource:///chrome/browser/content/browser/defaultthemes/compact.header.png",
-    iconURL: "resource:///chrome/browser/content/browser/defaultthemes/compactlight.icon.svg",
+    iconURL: "resource:///chrome/browser/content/browser/defaultthemes/light.icon.svg",
     textcolor: "red",
     accentcolor: "blue"
   };
 }
 
 add_task(async function testLightweightThemePreview() {
   if (SKIP_TEST) {
     ok(true, "No need to run this test since themes aren't installed");
--- a/browser/base/content/test/general/browser_discovery.js
+++ b/browser/base/content/test/general/browser_discovery.js
@@ -29,27 +29,36 @@ var iconDiscoveryTests = [
   { rel: "shortcut-icon", pass: false, text: "rel shortcut-icon not discovered" },
   { href: "moz.png", text: "relative href works" },
   { href: "notthere.png", text: "404'd icon is removed properly" },
   { href: "data:image/x-icon,%00", type: "image/x-icon", text: "data: URIs work" },
   { type: "image/png; charset=utf-8", text: "type may have optional parameters (RFC2046)" }
 ];
 
 function runIconDiscoveryTest() {
-  var testCase = iconDiscoveryTests[0];
-  var head = doc().getElementById("linkparent");
-  var hasSrc = gBrowser.getIcon() != null;
-  if (testCase.pass)
-    ok(hasSrc, testCase.text);
-  else
-    ok(!hasSrc, testCase.text);
+  let testCase = iconDiscoveryTests[0];
+  let head = doc().getElementById("linkparent");
 
-  head.removeChild(head.getElementsByTagName("link")[0]);
-  iconDiscoveryTests.shift();
-  iconDiscovery(); // Run the next test.
+  // Because there is debounce logic in ContentLinkHandler.jsm to reduce the
+  // favicon loads, we have to wait some time before checking that icon was
+  // stored properly.
+  BrowserTestUtils.waitForCondition(() => {
+    return gBrowser.getIcon() != null;
+  }, "wait for icon load to finish", 100, 5)
+  .then(() => {
+    ok(testCase.pass, testCase.text);
+  })
+  .catch(() => {
+    ok(!testCase.pass, testCase.text);
+  })
+  .then(() => {
+    head.removeChild(head.getElementsByTagName("link")[0]);
+    iconDiscoveryTests.shift();
+    iconDiscovery(); // Run the next test.
+  });
 }
 
 function iconDiscovery() {
   if (iconDiscoveryTests.length) {
     setHandlerFunc(runIconDiscoveryTest);
     gBrowser.setIcon(gBrowser.selectedTab, null,
                      Services.scriptSecurityManager.getSystemPrincipal());
 
@@ -64,16 +73,73 @@ function iconDiscovery() {
     if (testCase.pass == undefined)
       testCase.pass = true;
 
     link.rel = rel;
     link.href = href;
     link.type = type;
     head.appendChild(link);
   } else {
+    richIconDiscovery();
+  }
+}
+
+let richIconDiscoveryTests = [
+  { rel: "apple-touch-icon", text: "apple-touch-icon discovered" },
+  { rel: "apple-touch-icon-precomposed", text: "apple-touch-icon-precomposed discovered" },
+  { rel: "fluid-icon", text: "fluid-icon discovered" },
+  { rel: "unknown-icon", pass: false, text: "unknown icon not discovered" }
+];
+
+function runRichIconDiscoveryTest() {
+  let testCase = richIconDiscoveryTests[0];
+  let head = doc().getElementById("linkparent");
+
+  // Because there is debounce logic in ContentLinkHandler.jsm to reduce the
+  // favicon loads, we have to wait some time before checking that icon was
+  // stored properly.
+  BrowserTestUtils.waitForCondition(() => {
+    return gBrowser.getIcon() != null;
+  }, "wait for icon load to finish", 100, 5)
+  .then(() => {
+    ok(testCase.pass, testCase.text);
+  })
+  .catch(() => {
+    ok(!testCase.pass, testCase.text);
+  })
+  .then(() => {
+    head.removeChild(head.getElementsByTagName("link")[0]);
+    richIconDiscoveryTests.shift();
+    richIconDiscovery(); // Run the next test.
+  });
+}
+
+function richIconDiscovery() {
+  if (richIconDiscoveryTests.length) {
+    setHandlerFunc(runRichIconDiscoveryTest);
+    gBrowser.setIcon(gBrowser.selectedTab, null,
+                     Services.scriptSecurityManager.getSystemPrincipal()
+    );
+
+    let testCase = richIconDiscoveryTests[0];
+    let head = doc().getElementById("linkparent");
+    let link = doc().createElement("link");
+
+    let rel = testCase.rel;
+    let rootDir = getRootDirectory(gTestPath);
+    let href = testCase.href || rootDir + "moz.png";
+    let type = testCase.type || "image/png";
+    if (testCase.pass === undefined)
+      testCase.pass = true;
+
+    link.rel = rel;
+    link.href = href;
+    link.type = type;
+    head.appendChild(link);
+  } else {
     searchDiscovery();
   }
 }
 
 var searchDiscoveryTests = [
   { text: "rel search discovered" },
   { rel: "SEARCH", text: "rel is case insensitive" },
   { rel: "-search-", pass: false, text: "rel -search- not discovered" },
--- a/browser/base/content/test/general/browser_favicon_change_not_in_document.js
+++ b/browser/base/content/test/general/browser_favicon_change_not_in_document.js
@@ -1,34 +1,45 @@
 "use strict";
 
 const TEST_URL = "http://mochi.test:8888/browser/browser/base/content/test/general/file_favicon_change_not_in_document.html"
 
+/*
+ * This test tests a link element won't fire DOMLinkChanged/DOMLinkAdded unless
+ * it is added to the DOM. See more details in bug 1083895.
+ *
+ * Note that there is debounce logic in ContentLinkHandler.jsm, adding a new
+ * icon link after the icon parsing timeout will trigger a new icon extraction
+ * cycle. Hence, there should be two favicons loads in this test as it appends
+ * a new link to the DOM in the timeout callback defined in the test HTML page.
+ * However, the not-yet-added link element with href as "http://example.org/other-icon"
+ * should not fire the DOMLinkAdded event, nor should it fire the DOMLinkChanged
+ * event after its href gets updated later.
+ */
 add_task(async function() {
   let extraTab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
-  let tabLoaded = promiseTabLoaded(extraTab);
+  let domLinkAddedFired = 0;
+  let domLinkChangedFired = 0;
+  const linkAddedHandler = event => domLinkAddedFired++;
+  const linkChangedhandler = event => domLinkChangedFired++;
+  gBrowser.addEventListener("DOMLinkAdded", linkAddedHandler);
+  gBrowser.addEventListener("DOMLinkChanged", linkChangedhandler);
   extraTab.linkedBrowser.loadURI(TEST_URL);
-  let expectedFavicon = "http://example.org/one-icon";
-  let haveChanged = PromiseUtils.defer();
-  let observer = new MutationObserver(function(mutations) {
-    for (let mut of mutations) {
-      if (mut.attributeName != "image") {
-        continue;
-      }
-      let imageVal = extraTab.getAttribute("image").replace(/#.*$/, "");
-      if (!imageVal) {
-        // The value gets removed because it doesn't load.
-        continue;
-      }
-      is(imageVal, expectedFavicon, "Favicon image should correspond to expected image.");
-      haveChanged.resolve();
-    }
-  });
-  observer.observe(extraTab, {attributes: true});
-  await tabLoaded;
-  expectedFavicon = "http://example.org/yet-another-icon";
-  haveChanged = PromiseUtils.defer();
-  await haveChanged.promise;
-  observer.disconnect();
+  let expectedFavicon = "http://example.org/yet-another-icon";
+  await promiseTabLoaded(extraTab);
+
+  // Make sure the new added favicon link gets loaded.
+  try {
+    await BrowserTestUtils.waitForCondition(() => {
+      return gBrowser.getIcon(extraTab) === expectedFavicon;
+    }, "wait for favicon load to finish", 1000, 5);
+    ok(true, "Should load the added favicon");
+  } catch (e) {
+    ok(false, "Should've loaded the new added favicon.");
+  }
+
+  is(domLinkAddedFired, 2, "Should fire the correct number of DOMLinkAdded event.");
+  is(domLinkChangedFired, 0, "Should not fire any DOMLinkChanged event.");
+
+  gBrowser.removeEventListener("DOMLinkAdded", linkAddedHandler);
+  gBrowser.removeEventListener("DOMLinkChanged", linkChangedhandler);
   gBrowser.removeTab(extraTab);
 });
-
-
--- a/browser/base/content/test/general/browser_subframe_favicons_not_used.js
+++ b/browser/base/content/test/general/browser_subframe_favicons_not_used.js
@@ -4,15 +4,29 @@ function test() {
   waitForExplicitFinish();
 
   let testPath = getRootDirectory(gTestPath);
 
   let tab = BrowserTestUtils.addTab(gBrowser, testPath + "file_bug970276_popup1.html");
 
   tab.linkedBrowser.addEventListener("load", function() {
     let expectedIcon = testPath + "file_bug970276_favicon1.ico";
-    is(gBrowser.getIcon(tab), expectedIcon, "Correct icon.");
+    let icon;
 
-    gBrowser.removeTab(tab);
-
-    finish();
+    // Because there is debounce logic in ContentLinkHandler.jsm to reduce the
+    // favicon loads, we have to wait some time before checking that icon was
+    // stored properly.
+    BrowserTestUtils.waitForCondition(() => {
+      icon = gBrowser.getIcon(tab);
+      return icon != null;
+    }, "wait for favicon load to finish", 100, 5)
+    .then(() => {
+      is(icon, expectedIcon, "Correct icon.");
+    })
+    .catch(() => {
+      ok(false, "Can't get the correct icon.");
+    })
+    .then(() => {
+      gBrowser.removeTab(tab);
+      finish();
+    });
   }, {capture: true, once: true});
 }
--- a/browser/base/content/test/metaTags/browser.ini
+++ b/browser/base/content/test/metaTags/browser.ini
@@ -1,4 +1,5 @@
 [DEFAULT]
 support-files =
+  head.js
   meta_tags.html
 [browser_meta_tags.js]
--- a/browser/base/content/test/metaTags/browser_meta_tags.js
+++ b/browser/base/content/test/metaTags/browser_meta_tags.js
@@ -1,30 +1,48 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-/* globals gBrowser */
-/* This tests that with the page meta_tags.html, ContentMetaHandler.jsm parses out
- * the meta tags avilable and only stores the best one for description and one for
- * preview image url. In the case of this test, the best defined meta tags are
- * "og:description" and "og:image:url". The list of meta tags and their order of
- * preference is found in ContentMetaHandler.jsm. Because there is debounce logic
- * in ContentLinkHandler.jsm to only make one single SQL update, we have to wait
- * for some time before checking that the page info was stored correctly.
+const URL = "https://example.com/browser/browser/base/content/test/metaTags/meta_tags.html";
+
+/**
+ * This tests that with the page meta_tags.html, ContentMetaHandler.jsm parses
+ * out the meta tags avilable and only stores the best one for description and
+ * one for preview image url. In the case of this test, the best defined meta
+ * tags are "og:description" and "og:image:secure_url". The list of meta tags
+ * and order of preference is found in ContentMetaHandler.jsm. Because there is
+ * debounce logic in ContentLinkHandler.jsm to only make one single SQL update,
+ * we have to wait for some time before checking that the page info was stored.
  */
-add_task(async function test() {
-    Components.utils.import("resource://gre/modules/PlacesUtils.jsm");
-    const URL = "https://example.com/browser/browser/base/content/test/metaTags/meta_tags.html";
-    let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, URL);
+add_task(async function test_metadata() {
+  const tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, URL);
 
-    // Wait until places has stored the page info
-    let pageInfo;
-    await BrowserTestUtils.waitForCondition(async () => {
-      pageInfo = await PlacesUtils.history.fetch(URL, {"includeMeta": true});
-      const {previewImageURL, description} = pageInfo;
-      return previewImageURL && description;
-    });
-    is(pageInfo.description, "og:description", "got the correct description");
-    is(pageInfo.previewImageURL.href, "og:image:url", "got the correct preview image");
-    await BrowserTestUtils.removeTab(tab);
+  // Wait until places has stored the page info
+  const pageInfo = await waitForPageInfo(URL);
+  is(pageInfo.description, "og:description", "got the correct description");
+  is(pageInfo.previewImageURL.href, "og:image:secure_url", "got the correct preview image");
+
+  await BrowserTestUtils.removeTab(tab);
+  await PlacesTestUtils.clearHistory();
 });
 
+/**
+ * This test is almost like the previous one except it opens a second tab to
+ * make sure the extra tab does not cause the debounce logic to be skipped. If
+ * incorrectly skipped, the updated metadata would not include the delayed meta.
+ */
+add_task(async function multiple_tabs() {
+  const tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, URL);
+
+  // Add a background tab to cause another page to load *without* putting the
+  // desired URL in a background tab, which results in its timers being throttled.
+  gBrowser.addTab();
+
+  // Wait until places has stored the page info
+  const pageInfo = await waitForPageInfo(URL);
+  is(pageInfo.description, "og:description", "got the correct description");
+  is(pageInfo.previewImageURL.href, "og:image:secure_url", "got the correct preview image");
+
+  await BrowserTestUtils.removeTab(tab);
+  await BrowserTestUtils.removeTab(gBrowser.selectedTab);
+  await PlacesTestUtils.clearHistory();
+});
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/metaTags/head.js
@@ -0,0 +1,18 @@
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
+
+XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
+  "resource://gre/modules/PlacesUtils.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "PlacesTestUtils",
+  "resource://testing-common/PlacesTestUtils.jsm");
+
+/**
+ * Wait for url's page info (non-null description and preview url) to be set.
+ */
+async function waitForPageInfo(url) {
+  let pageInfo;
+  await BrowserTestUtils.waitForCondition(async () => {
+    pageInfo = await PlacesUtils.history.fetch(url, {"includeMeta": true});
+    return pageInfo && pageInfo.description && pageInfo.previewImageURL;
+  });
+  return pageInfo;
+}
--- a/browser/base/content/test/metaTags/meta_tags.html
+++ b/browser/base/content/test/metaTags/meta_tags.html
@@ -8,11 +8,23 @@
     <meta name="description" content="description" />
     <meta name="unknown:tag" content="unknown:tag" />
     <meta property="og:image" content="og:image" />
     <meta property="twitter:image" content="twitter:image" />
     <meta property="og:image:url" content="og:image:url" />
     <meta name="thumbnail" content="thumbnail" />
   </head>
   <body>
+    <script>
+      function addMeta(tag) {
+        const meta = document.createElement("meta");
+        meta.content = tag;
+        meta.setAttribute("property", tag);
+        document.head.appendChild(meta);
+      }
+
+      // Delay adding this "best" image tag to test that later tags are used.
+      // Use a delay that is long enough for tests to check for wrong metadata.
+      setTimeout(() => addMeta("og:image:secure_url"), 100);
+    </script>
   </body>
 </html>
 
--- a/browser/base/content/test/performance/browser.ini
+++ b/browser/base/content/test/performance/browser.ini
@@ -1,15 +1,16 @@
 [DEFAULT]
 prefs =
   browser.startup.record=true
 support-files =
   head.js
 [browser_appmenu_reflows.js]
 skip-if = asan || debug # Bug 1382809, bug 1369959
+[browser_favicon_load.js]
 [browser_startup.js]
 [browser_startup_content.js]
 skip-if = !e10s
 [browser_tabclose_grow_reflows.js]
 [browser_tabclose_reflows.js]
 [browser_tabopen_reflows.js]
 [browser_tabopen_squeeze_reflows.js]
 [browser_tabstrip_overflow_underflow_reflows.js]
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/performance/browser_favicon_load.js
@@ -0,0 +1,176 @@
+/**
+ * Bug 1247843 - A test case for testing whether the channel used to load favicon
+ * has correct classFlags.
+ * Note that this test is modified based on browser_favicon_userContextId.js.
+ */
+
+const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
+
+const TEST_SITE = "http://example.net";
+const TEST_THIRD_PARTY_SITE = "http://mochi.test:8888";
+
+const TEST_PAGE = TEST_SITE + "/browser/browser/components/originattributes/" +
+                  "test/browser/file_favicon.html";
+const FAVICON_URI = TEST_SITE + "/browser/browser/components/originattributes/" +
+                    "test/browser/file_favicon.png";
+const TEST_THIRD_PARTY_PAGE = "http://example.com/browser/browser/components/" +
+                              "originattributes/test/browser/file_favicon_thirdParty.html";
+const THIRD_PARTY_FAVICON_URI = TEST_THIRD_PARTY_SITE + "/browser/browser/components/" +
+                                "originattributes/test/browser/file_favicon.png";
+
+XPCOMUtils.defineLazyModuleGetter(this, "PromiseUtils",
+                                  "resource://gre/modules/PromiseUtils.jsm");
+
+let systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
+
+function clearAllImageCaches() {
+  var tools = Cc["@mozilla.org/image/tools;1"]
+                .getService(SpecialPowers.Ci.imgITools);
+  var imageCache = tools.getImgCacheForDocument(window.document);
+  imageCache.clearCache(true);  // true=chrome
+  imageCache.clearCache(false); // false=content
+}
+
+function clearAllPlacesFavicons() {
+  return new Promise(resolve => {
+    Services.obs.addObserver(function observer() {
+      Services.obs.removeObserver(observer, "places-favicons-expired");
+      resolve();
+    }, "places-favicons-expired");
+
+    PlacesUtils.favicons.expireAllFavicons();
+  });
+}
+
+function FaviconObserver(aPageURI, aFaviconURL, aTailingEnabled) {
+  this.reset(aPageURI, aFaviconURL, aTailingEnabled);
+}
+
+FaviconObserver.prototype = {
+  observe(aSubject, aTopic, aData) {
+    // Make sure that the topic is 'http-on-modify-request'.
+    if (aTopic === "http-on-modify-request") {
+      let httpChannel = aSubject.QueryInterface(Ci.nsIHttpChannel);
+      let reqLoadInfo = httpChannel.loadInfo;
+      // Make sure this is a favicon request.
+      if (httpChannel.URI.spec !== this._faviconURL) {
+        return;
+      }
+
+      let cos = aSubject.QueryInterface(Ci.nsIClassOfService);
+      if (!cos) {
+        ok(false, "Http channel should implement nsIClassOfService.");
+        return;
+      }
+
+      if (!reqLoadInfo) {
+        ok(false, "Should have load info.");
+        return;
+      }
+
+      let loadingPrincipal = reqLoadInfo.loadingPrincipal;
+
+      if (loadingPrincipal.equals(systemPrincipal)) {
+        this._faviconReqXUL = true;
+      } else {
+        this._faviconReqPlaces = true;
+      }
+
+      let haveTailFlag = !!(cos.classFlags & Ci.nsIClassOfService.Tail);
+      info("classFlags=" + cos.classFlags);
+      is(haveTailFlag, this._tailingEnabled, "Should have correct cos flag.");
+    } else {
+      ok(false, "Received unexpected topic: ", aTopic);
+    }
+
+    if (this._faviconReqXUL && this._faviconReqPlaces) {
+      this._faviconLoaded.resolve();
+    }
+  },
+
+  reset(aPageURI, aFaviconURL, aTailingEnabled) {
+    this._faviconReqXUL = false;
+    this._faviconReqPlaces = false;
+    this._faviconURL = aFaviconURL;
+    this._faviconLoaded = PromiseUtils.defer();
+    this._tailingEnabled = aTailingEnabled;
+  },
+
+  get promise() {
+    return this._faviconLoaded.promise;
+  }
+};
+
+function waitOnFaviconLoaded(aFaviconURL) {
+  return PlacesTestUtils.waitForNotification(
+    "onPageChanged",
+    (uri, attr, value, id) => attr === Ci.nsINavHistoryObserver.ATTRIBUTE_FAVICON &&
+                              value === aFaviconURL,
+    "history");
+}
+
+async function doTest(aTestPage, aFaviconURL, aTailingEnabled) {
+  let pageURI = Services.io.newURI(aTestPage);
+
+  // Create the observer object for observing favion channels.
+  let observer = new FaviconObserver(pageURI, aFaviconURL, aTailingEnabled);
+
+  let promiseWaitOnFaviconLoaded = waitOnFaviconLoaded(aFaviconURL);
+
+  // Add the observer earlier in case we miss it.
+  Services.obs.addObserver(observer, "http-on-modify-request");
+
+  // Open the tab.
+  let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, aTestPage);
+  // Waiting for favicon requests are all made.
+  await observer.promise;
+  // Waiting for favicon loaded.
+  await promiseWaitOnFaviconLoaded;
+
+  // Close the tab.
+  await BrowserTestUtils.removeTab(tab);
+}
+
+async function setupTailingPreference(aTailingEnabled) {
+  await SpecialPowers.pushPrefEnv({"set": [
+      ["network.http.tailing.enabled", aTailingEnabled]
+  ]});
+}
+
+async function cleanup() {
+  // Clear all cookies.
+  Services.cookies.removeAll();
+  // Clear cache.
+  Services.cache2.clear();
+  // Clear Places favicon caches.
+  await clearAllPlacesFavicons();
+  // Clear all image caches and network caches.
+  clearAllImageCaches();
+  // Clear Places history.
+  await PlacesUtils.history.clear();
+}
+
+// A clean up function to prevent affecting other tests.
+registerCleanupFunction(async () => {
+  await cleanup();
+});
+
+add_task(async function test_favicon_with_tailing_enabled() {
+  await cleanup();
+
+  let tailingEnabled = true;
+
+  await setupTailingPreference(tailingEnabled);
+
+  await doTest(TEST_PAGE, FAVICON_URI, tailingEnabled);
+});
+
+add_task(async function test_favicon_with_tailing_disabled() {
+  await cleanup();
+
+  let tailingEnabled = false;
+
+  await setupTailingPreference(tailingEnabled);
+
+  await doTest(TEST_THIRD_PARTY_PAGE, THIRD_PARTY_FAVICON_URI, tailingEnabled);
+});
--- a/browser/base/content/test/performance/browser_startup_images.js
+++ b/browser/base/content/test/performance/browser_startup_images.js
@@ -29,16 +29,18 @@ const whitelist = [
     file: "chrome://browser/skin/tabbrowser/tab-overflow-indicator.png",
     platforms: ["linux", "win", "macosx"],
   },
 
   {
     file: "chrome://browser/skin/places/toolbarDropMarker.png",
     platforms: ["linux", "win", "macosx"],
   },
+
+  // Bug 1363040
   {
     file: "chrome://browser/skin/tracking-protection-16.svg#enabled",
     platforms: ["linux", "win", "macosx"],
   },
 
   {
     file: "chrome://browser/skin/tabbrowser/tabDragIndicator.png",
     hidpi: "chrome://browser/skin/tabbrowser/tabDragIndicator@2x.png",
@@ -66,16 +68,26 @@ const whitelist = [
     file: "chrome://browser/skin/chevron.svg",
     platforms: ["win", "linux", "macosx"],
   },
 
   {
     file: "chrome://global/skin/icons/resizer.png",
     platforms: ["win"],
   },
+
+  {
+    file: "chrome://browser/skin/window-controls/maximize.svg",
+    platforms: ["win"],
+    // This is to prevent perma-fails in case Windows machines
+    // go back to running tests in non-maximized windows.
+    intermittentShown: ["win"],
+    // This file is not loaded on Windows 7/8.
+    intermittentNotLoaded: ["win"],
+  },
 ];
 
 add_task(async function() {
   if (!AppConstants.DEBUG) {
     ok(false, "You need to run this test on a debug build.");
   }
 
   let startupRecorder = Cc["@mozilla.org/test/startuprecorder;1"].getService().wrappedJSObject;
--- a/browser/base/content/test/performance/browser_urlbar_keyed_search_reflows.js
+++ b/browser/base/content/test/performance/browser_urlbar_keyed_search_reflows.js
@@ -14,16 +14,27 @@ requestLongerTimeout(5);
  * for tips on how to do that.
  */
 
 /* These reflows happen only the first time the awesomebar panel opens. */
 const EXPECTED_REFLOWS_FIRST_OPEN = [
   // Bug 1357054
   {
     stack: [
+      "_handleOverflow@chrome://global/content/bindings/autocomplete.xml",
+      "handleOverUnderflow@chrome://global/content/bindings/autocomplete.xml",
+      "_onChanged@chrome://global/content/bindings/autocomplete.xml",
+      "_appendCurrentResult/<@chrome://global/content/bindings/autocomplete.xml",
+    ],
+    times: 18, // This number should only ever go down - never up.
+    minTimes: 12,
+  },
+
+  {
+    stack: [
       "_rebuild@chrome://browser/content/search/search.xml",
       "set_popup@chrome://browser/content/search/search.xml",
       "enableOneOffSearches@chrome://browser/content/urlbarBindings.xml",
       "_enableOrDisableOneOffSearches@chrome://browser/content/urlbarBindings.xml",
       "urlbar_XBL_Constructor/<@chrome://browser/content/urlbarBindings.xml",
       "openPopup@chrome://global/content/bindings/popup.xml",
       "_openAutocompletePopup@chrome://browser/content/urlbarBindings.xml",
       "openAutocompletePopup@chrome://browser/content/urlbarBindings.xml",
@@ -50,39 +61,29 @@ const EXPECTED_REFLOWS_FIRST_OPEN = [
     times: 6, // This number should only ever go down - never up.
   },
 
   {
     stack: [
       "adjustHeight@chrome://global/content/bindings/autocomplete.xml",
       "_invalidate/this._adjustHeightTimeout<@chrome://global/content/bindings/autocomplete.xml",
     ],
-    times: 36, // This number should only ever go down - never up.
+    times: 51, // This number should only ever go down - never up.
   },
 
   {
     stack: [
       "_handleOverflow@chrome://global/content/bindings/autocomplete.xml",
       "handleOverUnderflow@chrome://global/content/bindings/autocomplete.xml",
       "_reuseAcItem@chrome://global/content/bindings/autocomplete.xml",
       "_appendCurrentResult@chrome://global/content/bindings/autocomplete.xml",
       "_invalidate@chrome://global/content/bindings/autocomplete.xml",
       "invalidate@chrome://global/content/bindings/autocomplete.xml"
     ],
-    times: 1344, // This number should only ever go down - never up.
-  },
-
-  {
-    stack: [
-      "_handleOverflow@chrome://global/content/bindings/autocomplete.xml",
-      "handleOverUnderflow@chrome://global/content/bindings/autocomplete.xml",
-      "_onChanged@chrome://global/content/bindings/autocomplete.xml",
-      "_appendCurrentResult/<@chrome://global/content/bindings/autocomplete.xml",
-    ],
-    times: 6,
+    times: 60, // This number should only ever go down - never up.
   },
 
   {
     stack: [
       "_openAutocompletePopup@chrome://browser/content/urlbarBindings.xml",
       "openAutocompletePopup@chrome://browser/content/urlbarBindings.xml",
       "openPopup@chrome://global/content/bindings/autocomplete.xml",
       "set_popupOpen@chrome://global/content/bindings/autocomplete.xml",
--- a/browser/base/content/test/performance/browser_urlbar_search_reflows.js
+++ b/browser/base/content/test/performance/browser_urlbar_search_reflows.js
@@ -14,16 +14,27 @@ requestLongerTimeout(5);
  * for tips on how to do that.
  */
 
 /* These reflows happen only the first time the awesomebar panel opens. */
 const EXPECTED_REFLOWS_FIRST_OPEN = [
   // Bug 1357054
   {
     stack: [
+      "_handleOverflow@chrome://global/content/bindings/autocomplete.xml",
+      "handleOverUnderflow@chrome://global/content/bindings/autocomplete.xml",
+      "_onChanged@chrome://global/content/bindings/autocomplete.xml",
+      "_appendCurrentResult/<@chrome://global/content/bindings/autocomplete.xml",
+    ],
+    times: 6, // This number should only ever go down - never up.
+    minTimes: 0, // Sometimes this is not hit.
+  },
+
+  {
+    stack: [
       "_rebuild@chrome://browser/content/search/search.xml",
       "set_popup@chrome://browser/content/search/search.xml",
       "enableOneOffSearches@chrome://browser/content/urlbarBindings.xml",
       "_enableOrDisableOneOffSearches@chrome://browser/content/urlbarBindings.xml",
       "urlbar_XBL_Constructor/<@chrome://browser/content/urlbarBindings.xml",
       "openPopup@chrome://global/content/bindings/popup.xml",
       "_openAutocompletePopup@chrome://browser/content/urlbarBindings.xml",
       "openAutocompletePopup@chrome://browser/content/urlbarBindings.xml",
@@ -62,17 +73,17 @@ const EXPECTED_REFLOWS_FIRST_OPEN = [
     stack: [
       "_handleOverflow@chrome://global/content/bindings/autocomplete.xml",
       "handleOverUnderflow@chrome://global/content/bindings/autocomplete.xml",
       "_reuseAcItem@chrome://global/content/bindings/autocomplete.xml",
       "_appendCurrentResult@chrome://global/content/bindings/autocomplete.xml",
       "_invalidate@chrome://global/content/bindings/autocomplete.xml",
       "invalidate@chrome://global/content/bindings/autocomplete.xml"
     ],
-    times: 330, // This number should only ever go down - never up.
+    times: 60, // This number should only ever go down - never up.
   },
 
   {
     stack: [
       "_openAutocompletePopup@chrome://browser/content/urlbarBindings.xml",
       "openAutocompletePopup@chrome://browser/content/urlbarBindings.xml",
       "openPopup@chrome://global/content/bindings/autocomplete.xml",
       "set_popupOpen@chrome://global/content/bindings/autocomplete.xml",
@@ -105,28 +116,16 @@ const EXPECTED_REFLOWS_SECOND_OPEN = [
   {
     stack: [
       "adjustHeight@chrome://global/content/bindings/autocomplete.xml",
       "_invalidate/this._adjustHeightTimeout<@chrome://global/content/bindings/autocomplete.xml",
     ],
     times: 3, // This number should only ever go down - never up.
   },
 
-  {
-    stack: [
-      "_handleOverflow@chrome://global/content/bindings/autocomplete.xml",
-      "handleOverUnderflow@chrome://global/content/bindings/autocomplete.xml",
-      "_reuseAcItem@chrome://global/content/bindings/autocomplete.xml",
-      "_appendCurrentResult@chrome://global/content/bindings/autocomplete.xml",
-      "_invalidate@chrome://global/content/bindings/autocomplete.xml",
-      "invalidate@chrome://global/content/bindings/autocomplete.xml"
-    ],
-    times: 384, // This number should only ever go down - never up.
-  },
-
   // Bug 1384256
   {
     stack: [
       "_openAutocompletePopup@chrome://browser/content/urlbarBindings.xml",
       "openAutocompletePopup@chrome://browser/content/urlbarBindings.xml",
       "openPopup@chrome://global/content/bindings/autocomplete.xml",
       "set_popupOpen@chrome://global/content/bindings/autocomplete.xml",
     ],
@@ -203,14 +202,16 @@ add_task(async function() {
     // especially if it's GC'ing from previous tests.
     await new Promise(resolve => win.requestIdleCallback(resolve, { timeout: 1000 }));
 
     let hiddenPromise = BrowserTestUtils.waitForEvent(URLBar.popup, "popuphidden");
     EventUtils.synthesizeKey("VK_ESCAPE", {}, win);
     await hiddenPromise;
   };
 
+  info("First opening");
   await withReflowObserver(testFn, EXPECTED_REFLOWS_FIRST_OPEN, win);
 
+  info("Second opening");
   await withReflowObserver(testFn, EXPECTED_REFLOWS_SECOND_OPEN, win);
 
   await BrowserTestUtils.closeWindow(win);
 });
--- a/browser/base/content/test/performance/browser_windowopen_reflows.js
+++ b/browser/base/content/test/performance/browser_windowopen_reflows.js
@@ -63,22 +63,16 @@ if (Services.appinfo.OS == "WINNT") {
 
     {
       stack: [
         "handleEvent@chrome://browser/content/tabbrowser.xml",
         "inferFromText@chrome://browser/content/browser.js",
         "handleEvent@chrome://browser/content/browser.js",
       ],
     },
-
-    {
-      stack: [
-        "handleEvent@chrome://browser/content/tabbrowser.xml",
-      ],
-    }
   );
 }
 
 if (Services.appinfo.OS == "WINNT" || Services.appinfo.OS == "Darwin") {
   EXPECTED_REFLOWS.push(
     {
       stack: [
         "verticalMargins@chrome://browser/content/browser-tabsintitlebar.js",
@@ -96,27 +90,32 @@ if (Services.appinfo.OS == "WINNT" || Se
         "init@chrome://browser/content/browser-tabsintitlebar.js",
         "handleEvent@chrome://browser/content/tabbrowser.xml",
       ],
       times: 4, // This number should only ever go down - never up.
     },
   );
 }
 
+// Windows Vista, 7 or 8
+if (navigator.userAgent.indexOf("Windows NT 6") != -1) {
+  EXPECTED_REFLOWS.push(
+    {
+      stack: [
+        "handleEvent@chrome://browser/content/tabbrowser.xml",
+      ],
+    },
+  );
+}
+
 /*
  * This test ensures that there are no unexpected
  * uninterruptible reflows when opening new windows.
  */
 add_task(async function() {
-  const IS_WIN8 = (navigator.userAgent.indexOf("Windows NT 6.2") != -1);
-  if (IS_WIN8) {
-    ok(true, "Skipping this test because of perma-failures on Windows 8 x64 (bug 1381521)");
-    return;
-  }
-
   // Flushing all caches helps to ensure that we get consistent
   // behaviour when opening a new window, even if windows have been
   // opened in previous tests.
   Services.obs.notifyObservers(null, "startupcache-invalidate");
   Services.obs.notifyObservers(null, "chrome-flush-skin-caches");
   Services.obs.notifyObservers(null, "chrome-flush-caches");
 
   let win = OpenBrowserWindow();
--- a/browser/base/content/test/performance/head.js
+++ b/browser/base/content/test/performance/head.js
@@ -16,39 +16,43 @@ XPCOMUtils.defineLazyModuleGetter(this, 
  *        dirtying outside of the normal mechanism.
  * @param expectedReflows (Array, optional)
  *        An Array of Objects representing reflows.
  *
  *        Example:
  *
  *        [
  *          {
- *            // This reflow is caused by lorem ipsum
+ *            // This reflow is caused by lorem ipsum.
+ *            // Sometimes, due to unpredictable timings, the reflow may be hit
+ *            // less times, or not hit at all; in such a case a minTimes
+ *            // property can be provided to avoid intermittent failures.
  *            stack: [
  *              "select@chrome://global/content/bindings/textbox.xml",
  *              "focusAndSelectUrlBar@chrome://browser/content/browser.js",
  *              "openLinkIn@chrome://browser/content/utilityOverlay.js",
  *              "openUILinkIn@chrome://browser/content/utilityOverlay.js",
  *              "BrowserOpenTab@chrome://browser/content/browser.js",
  *            ],
  *            // We expect this particular reflow to happen 2 times
  *            times: 2,
+ *            // Sometimes this is not hit.
+ *            minTimes: 0
  *          },
  *
  *          {
  *            // This reflow is caused by lorem ipsum. We expect this reflow
  *            // to only happen once, so we can omit the "times" property.
  *            stack: [
  *              "get_scrollPosition@chrome://global/content/bindings/scrollbox.xml",
  *              "_fillTrailingGap@chrome://browser/content/tabbrowser.xml",
  *              "_handleNewTab@chrome://browser/content/tabbrowser.xml",
  *              "onxbltransitionend@chrome://browser/content/tabbrowser.xml",
  *            ],
  *          }
- *
  *        ]
  *
  *        Note that line numbers are not included in the stacks.
  *
  *        Order of the reflows doesn't matter. Expected reflows that aren't seen
  *        will cause an assertion failure. When this argument is not passed,
  *        it defaults to the empty Array, meaning no reflows are expected.
  * @param window (browser window, optional)
@@ -103,16 +107,19 @@ async function withReflowObserver(testFn
         return;
       }
 
       let index = expectedReflows.findIndex(reflow => path.startsWith(reflow.stack.join("|")));
 
       if (index != -1) {
         Assert.ok(true, "expected uninterruptible reflow: '" +
                   JSON.stringify(pathWithLineNumbers, null, "\t") + "'");
+        if (expectedReflows[index].minTimes) {
+          expectedReflows[index].minTimes--;
+        }
         if (--expectedReflows[index].times == 0) {
           expectedReflows.splice(index, 1);
         }
       } else {
         Assert.ok(false, "unexpected uninterruptible reflow \n" +
                          JSON.stringify(pathWithLineNumbers, null, "\t") + "\n");
       }
     },
@@ -134,21 +141,23 @@ async function withReflowObserver(testFn
 
   els.addListenerForAllEvents(win, dirtyFrameFn, true);
 
   try {
     dirtyFrameFn();
     await testFn(dirtyFrameFn);
   } finally {
     for (let remainder of expectedReflows) {
-      Assert.ok(false,
-                `Unused expected reflow: ${JSON.stringify(remainder.stack, null, "\t")}\n` +
-                `This reflow was supposed to be hit ${remainder.times} more time(s).\n` +
-                "This is probably a good thing - just remove it from the " +
-                "expected list.");
+      if (!Number.isInteger(remainder.minTimes) || remainder.minTimes > 0) {
+        Assert.ok(false,
+                  `Unused expected reflow: ${JSON.stringify(remainder.stack, null, "\t")}\n` +
+                  `This reflow was supposed to be hit ${remainder.minTimes || remainder.times} more time(s).\n` +
+                  "This is probably a good thing - just remove it from the " +
+                  "expected list.");
+      }
     }
 
     els.removeListenerForAllEvents(win, dirtyFrameFn, true);
     docShell.removeWeakReflowObserver(observer);
   }
 }
 
 async function ensureNoPreloadedBrowser() {
@@ -236,16 +245,17 @@ async function removeAllButFirstTab() {
   await SpecialPowers.popPrefEnv();
 }
 
 /**
  * Adds some entries to the Places database so that we can
  * do semi-realistic look-ups in the URL bar.
  */
 async function addDummyHistoryEntries() {
+  await PlacesTestUtils.clearHistory();
   const NUM_VISITS = 10;
   let visits = [];
 
   for (let i = 0; i < NUM_VISITS; ++i) {
     visits.push({
       uri: `http://example.com/urlbar-reflows-${i}`,
       title: `Reflow test for URL bar entry #${i}`,
     });
--- a/browser/base/content/test/performance/hidpi/browser.ini
+++ b/browser/base/content/test/performance/hidpi/browser.ini
@@ -1,6 +1,6 @@
 [DEFAULT]
 prefs =
   layout.css.devPixelsPerPx='2'
 
 [../browser_startup_images.js]
-skip-if = !debug || (os == 'win' && os_version == '6.1') # hidpi results in the toolbar overflowing on Win 7
+skip-if = !debug || (os == 'win' && (os_version == '6.1'))  # hidpi results in the toolbar overflowing on Win 7
--- a/browser/base/content/test/popupNotifications/browser.ini
+++ b/browser/base/content/test/popupNotifications/browser.ini
@@ -11,14 +11,16 @@ skip-if = (os == "linux" && (debug || as
 [browser_popupNotification_3.js]
 skip-if = (os == "linux" && (debug || asan))
 [browser_popupNotification_4.js]
 skip-if = (os == "linux" && (debug || asan))
 [browser_popupNotification_5.js]
 skip-if = true # bug 1332646
 [browser_popupNotification_checkbox.js]
 skip-if = (os == "linux" && (debug || asan))
+[browser_popupNotification_selection_required.js]
+skip-if = (os == "linux" && (debug || asan))
 [browser_popupNotification_keyboard.js]
 skip-if = (os == "linux" && (debug || asan))
 [browser_popupNotification_no_anchors.js]
 skip-if = (os == "linux" && (debug || asan))
 [browser_reshow_in_background.js]
 skip-if = (os == "linux" && (debug || asan))
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/popupNotifications/browser_popupNotification_selection_required.js
@@ -0,0 +1,48 @@
+/* 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/. */
+
+function test() {
+  waitForExplicitFinish();
+
+  ok(PopupNotifications, "PopupNotifications object exists");
+  ok(PopupNotifications.panel, "PopupNotifications panel exists");
+
+  setup();
+}
+
+function promiseElementVisible(element) {
+  // HTMLElement.offsetParent is null when the element is not visisble
+  // (or if the element has |position: fixed|). See:
+  // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent
+  return BrowserTestUtils.waitForCondition(() => element.offsetParent !== null,
+                                          "Waiting for element to be visible");
+}
+
+var gNotification;
+
+var tests = [
+  // Test that passing selection required prevents the button from clicking
+  { id: "require_selection_check",
+    run() {
+      this.notifyObj = new BasicNotification(this.id);
+      this.notifyObj.options.checkbox = {
+        label: "This is a checkbox",
+      };
+      gNotification = showNotification(this.notifyObj);
+    },
+    async onShown(popup) {
+      checkPopup(popup, this.notifyObj);
+      let notification = popup.childNodes[0];
+      notification.setAttribute("invalidselection", true);
+      await promiseElementVisible(notification.checkbox);
+      EventUtils.synthesizeMouseAtCenter(notification.checkbox, {});
+      ok(notification.button.disabled, "should be disabled when invalidselection");
+      notification.removeAttribute("invalidselection");
+      EventUtils.synthesizeMouseAtCenter(notification.checkbox, {});
+      ok(!notification.button.disabled, "should not be disabled when invalidselection is not present");
+      triggerMainCommand(popup);
+    },
+    onHidden() { }
+  },
+];
--- a/browser/base/content/test/static/browser_all_files_referenced.js
+++ b/browser/base/content/test/static/browser_all_files_referenced.js
@@ -121,17 +121,17 @@ var whitelist = [
   // browser/extensions/pdfjs/content/web/viewer.js#7450
   {file: "resource://pdf.js/web/debugger.js"},
 
   // These are used in content processes. They are actually referenced.
   {file: "resource://shield-recipe-client-content/shield-content-frame.js"},
   {file: "resource://shield-recipe-client-content/shield-content-process.js"},
 
   // New L10n API that is not yet used in production
-  {file: "resource://gre/modules/DOMLocalization.jsm"},
+  {file: "chrome://global/content/l10n.js"},
 
   // Starting from here, files in the whitelist are bugs that need fixing.
   // Bug 1339424 (wontfix?)
   {file: "chrome://browser/locale/taskbar.properties",
    platforms: ["linux", "macosx"]},
   // Bug 1316187
   {file: "chrome://global/content/customizeToolbar.xul"},
   // Bug 1343837
--- a/browser/base/content/test/static/browser_misused_characters_in_strings.js
+++ b/browser/base/content/test/static/browser_misused_characters_in_strings.js
@@ -25,29 +25,65 @@ let gWhitelist = [{
     key: "certerror.wrongSystemTime2",
     type: "single-quote"
   }, {
     file: "netError.dtd",
     key: "certerror.wrongSystemTimeWithoutReference",
     type: "single-quote"
   }, {
     file: "phishing-afterload-warning-message.dtd",
-    key: "safeb.palm.advisory.desc",
+    key: "safeb.palm.advisory.desc2",
+    type: "single-quote"
+  }, {
+    file: "phishing-afterload-warning-message.dtd",
+    key: "safeb.blocked.malwarePage.errorDesc.override",
+    type: "single-quote"
+  }, {
+    file: "phishing-afterload-warning-message.dtd",
+    key: "safeb.blocked.malwarePage.errorDesc.noOverride",
+    type: "single-quote"
+  }, {
+    file: "phishing-afterload-warning-message.dtd",
+    key: "safeb.blocked.malwarePage.learnMore",
+    type: "single-quote"
+  }, {
+    file: "phishing-afterload-warning-message.dtd",
+    key: "safeb.blocked.unwantedPage.errorDesc.override",
+    type: "single-quote"
+  }, {
+    file: "phishing-afterload-warning-message.dtd",
+    key: "safeb.blocked.unwantedPage.errorDesc.noOverride",
     type: "single-quote"
   }, {
     file: "phishing-afterload-warning-message.dtd",
-    key: "safeb.blocked.malwarePage.shortDesc",
+    key: "safeb.blocked.unwantedPage.learnMore",
+    type: "single-quote"
+  }, {
+    file: "phishing-afterload-warning-message.dtd",
+    key: "safeb.blocked.phishingPage.errorDesc.override",
+    type: "single-quote"
+  }, {
+    file: "phishing-afterload-warning-message.dtd",
+    key: "safeb.blocked.phishingPage.errorDesc.noOverride",
     type: "single-quote"
   }, {
     file: "phishing-afterload-warning-message.dtd",
-    key: "safeb.blocked.unwantedPage.shortDesc",
+    key: "safeb.blocked.phishingPage.learnMore",
     type: "single-quote"
   }, {
     file: "phishing-afterload-warning-message.dtd",
-    key: "safeb.blocked.phishingPage.shortDesc2",
+    key: "safeb.blocked.harmfulPage.errorDesc.override",
+    type: "single-quote"
+  }, {
+    file: "phishing-afterload-warning-message.dtd",
+    key: "safeb.blocked.harmfulPage.errorDesc.noOverride",
+    type: "single-quote"
+  }, {
+    file: "phishing-afterload-warning-message.dtd",
+    key: "safeb.blocked.harmfulPage.learnMore",
     type: "single-quote"
   }, {
     file: "mathfont.properties",
     key: "operator.\\u002E\\u002E\\u002E.postfix",
     type: "ellipsis"
   }, {
     file: "layout_errors.properties",
     key: "ImageMapRectBoundsError",
--- a/browser/base/content/test/tabs/browser.ini
+++ b/browser/base/content/test/tabs/browser.ini
@@ -1,14 +1,15 @@
 [DEFAULT]
 support-files =
   dummy_page.html
   test_bug1358314.html
 
 [browser_abandonment_telemetry.js]
+[browser_accessibility_indicator.js]
 [browser_allow_process_switches_despite_related_browser.js]
 [browser_contextmenu_openlink_after_tabnavigated.js]
 [browser_isLocalAboutURI.js]
 [browser_tabCloseProbes.js]
 [browser_tabSpinnerProbe.js]
 skip-if = !e10s # Tab spinner is e10s only.
 [browser_tabSwitchPrintPreview.js]
 skip-if = os == 'mac'
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/tabs/browser_accessibility_indicator.js
@@ -0,0 +1,124 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const A11Y_INDICATOR_ENABLED_PREF = "accessibility.indicator.enabled";
+
+/**
+ * Test various pref and UI properties based on whether the accessibility
+ * indicator is enabled and the accessibility service is initialized.
+ * @param  {Object}  win      browser window to check the indicator in.
+ * @param  {Boolean} enabled  pref flag for accessibility indicator.
+ * @param  {Boolean} active   whether accessibility service is started or not.
+ */
+function testIndicatorState(win, enabled, active) {
+  is(Services.prefs.getBoolPref(A11Y_INDICATOR_ENABLED_PREF), enabled,
+    `Indicator is ${enabled ? "enabled" : "disabled"}.`);
+  is(Services.appinfo.accessibilityEnabled, active,
+    `Accessibility service is ${active ? "enabled" : "disabled"}.`);
+
+  let visible = enabled && active;
+  is(win.document.documentElement.hasAttribute("accessibilitymode"), visible,
+    `accessibilitymode flag is ${visible ? "set" : "unset"}.`);
+
+  // Browser UI has 2 indicators in markup for OSX and Windows but only 1 is
+  // shown depending on whether the titlebar is enabled.
+  let expectedVisibleCount = visible ? 1 : 0;
+  let visibleCount = 0;
+  [...win.document.querySelectorAll(".accessibility-indicator")].forEach(indicator =>
+    win.getComputedStyle(indicator).getPropertyValue("display") !== "none" &&
+    visibleCount++);
+  is(expectedVisibleCount, visibleCount,
+    `Indicator is ${visible ? "visible" : "invisible"}.`);
+}
+
+/**
+ * Instantiate accessibility service and wait for event associated with its
+ * startup, if necessary.
+ */
+async function initAccessibilityService() {
+  let accService = Cc["@mozilla.org/accessibilityService;1"].getService(
+    Ci.nsIAccessibilityService);
+
+  if (!Services.appinfo.accessibilityEnabled) {
+    await new Promise(resolve => {
+      let observe = (subject, topic, data) => {
+        Services.obs.removeObserver(observe, "a11y-init-or-shutdown");
+        // "1" indicates that the accessibility service is initialized.
+        data === "1" && resolve();
+      };
+      Services.obs.addObserver(observe, "a11y-init-or-shutdown");
+    })
+  }
+
+  return accService;
+}
+
+/**
+ * If accessibility service is not yet disabled, wait for the event associated
+ * with its shutdown.
+ */
+async function shutdownAccessibilityService() {
+  if (Services.appinfo.accessibilityEnabled) {
+    await new Promise(resolve => {
+      let observe = (subject, topic, data) => {
+        Services.obs.removeObserver(observe, "a11y-init-or-shutdown");
+        // "1" indicates that the accessibility service is shutdown.
+        data === "0" && resolve();
+      };
+      Services.obs.addObserver(observe, "a11y-init-or-shutdown");
+    })
+  }
+}
+
+/**
+ * Force garbage collection.
+ */
+function forceGC() {
+  SpecialPowers.gc();
+  SpecialPowers.forceShrinkingGC();
+  SpecialPowers.forceCC();
+}
+
+add_task(async function test_accessibility_indicator() {
+  info("Test default accessibility indicator state.");
+  let newWin = await BrowserTestUtils.openNewBrowserWindow();
+  testIndicatorState(window, true, false);
+  testIndicatorState(newWin, true, false);
+
+  info("Enable accessibility and ensure the indicator is shown in all windows.");
+  let accService = await initAccessibilityService(); // eslint-disable-line no-unused-vars
+  testIndicatorState(window, true, true);
+  testIndicatorState(newWin, true, true);
+
+  info("Open a new window and ensure the indicator is shown there by default.");
+  let dynamicWin = await BrowserTestUtils.openNewBrowserWindow({ private: true });
+  testIndicatorState(dynamicWin, true, true);
+  await BrowserTestUtils.closeWindow(dynamicWin);
+
+  info("Preff off accessibility indicator.");
+  Services.prefs.setBoolPref(A11Y_INDICATOR_ENABLED_PREF, false);
+  testIndicatorState(window, false, true);
+  testIndicatorState(newWin, false, true);
+  dynamicWin = await BrowserTestUtils.openNewBrowserWindow({ private: true });
+  testIndicatorState(dynamicWin, false, true);
+
+  info("Preff on accessibility indicator.");
+  Services.prefs.setBoolPref(A11Y_INDICATOR_ENABLED_PREF, true);
+  testIndicatorState(window, true, true);
+  testIndicatorState(newWin, true, true);
+  testIndicatorState(dynamicWin, true, true);
+
+  info("Disable accessibility and ensure the indicator is hidden in all windows.");
+  accService = undefined;
+  forceGC();
+  await shutdownAccessibilityService();
+  testIndicatorState(window, true, false);
+  testIndicatorState(newWin, true, false);
+  testIndicatorState(dynamicWin, true, false);
+
+  Services.prefs.clearUserPref(A11Y_INDICATOR_ENABLED_PREF);
+  await BrowserTestUtils.closeWindow(newWin);
+  await BrowserTestUtils.closeWindow(dynamicWin);
+});
--- a/browser/base/content/test/urlbar/browser.ini
+++ b/browser/base/content/test/urlbar/browser.ini
@@ -115,16 +115,17 @@ support-files =
   file_urlbar_edit_dos.html
 [browser_urlbar_searchsettings.js]
 [browser_urlbar_search_speculative_connect.js]
 [browser_urlbar_search_speculative_connect_engine.js]
 support-files =
   searchSuggestionEngine2.xml
   searchSuggestionEngine.sjs
 [browser_urlbar_search_speculative_connect_mousedown.js]
+[browser_urlbar_search_no_speculative_connect_with_client_cert.js]
 [browser_urlbar_stop_pending.js]
 support-files =
   slow-page.sjs
 [browser_urlbar_remoteness_switch.js]
 run-if = e10s
 [browser_urlHighlight.js]
 [browser_wyciwyg_urlbarCopying.js]
 subsuite = clipboard
--- a/browser/base/content/test/urlbar/browser_page_action_menu.js
+++ b/browser/base/content/test/urlbar/browser_page_action_menu.js
@@ -35,17 +35,21 @@ add_task(async function bookmark() {
     // Make sure the edit-bookmark panel opens, then hide it.
     await new Promise(resolve => {
       if (StarUI.panel.state == "open") {
         resolve();
         return;
       }
       StarUI.panel.addEventListener("popupshown", resolve, { once: true });
     });
+    Assert.equal(BookmarkingUI.starBox.getAttribute("open"), "true",
+      "Star has open attribute");
     StarUI.panel.hidePopup();
+    Assert.ok(!BookmarkingUI.starBox.hasAttribute("open"),
+      "Star no longer has open attribute");
 
     // Open the panel again.
     await promisePageActionPanelOpen();
 
     // The bookmark button should now read "Edit This Bookmark" and be starred.
     Assert.equal(bookmarkButton.label, "Edit This Bookmark");
     Assert.ok(bookmarkButton.hasAttribute("starred"));
     Assert.equal(bookmarkButton.getAttribute("starred"), "true");
@@ -126,22 +130,26 @@ add_task(async function sendToDevice_non
       window.getComputedStyle(BrowserPageActions.mainButtonNode).display,
       "none",
       "Main button should be hidden on about:home"
     );
     BrowserPageActions.mainButtonNode.style.display = "-moz-box";
     await promiseSyncReady();
     // Open the panel.  Send to Device should be disabled.
     await promisePageActionPanelOpen();
+    Assert.equal(BrowserPageActions.mainButtonNode.getAttribute("open"),
+      "true", "Main button has 'open' attribute");
     let sendToDeviceButton =
       document.getElementById("pageAction-panel-sendToDevice");
     Assert.ok(sendToDeviceButton.disabled);
     let hiddenPromise = promisePageActionPanelHidden();
     BrowserPageActions.panelNode.hidePopup();
     await hiddenPromise;
+    Assert.ok(!BrowserPageActions.mainButtonNode.hasAttribute("open"),
+      "Main button no longer has 'open' attribute");
     // Remove the `display` style set above.
     BrowserPageActions.mainButtonNode.style.removeProperty("display");
   });
 });
 
 add_task(async function sendToDevice_syncNotReady_other_states() {
   // Open a tab that's sendable.
   await BrowserTestUtils.withNewTab("http://example.com/", async () => {
@@ -491,16 +499,18 @@ add_task(async function sendToDevice_inU
     let urlbarButton = document.getElementById(
       BrowserPageActions._urlbarButtonNodeIDForActionID(action.id)
     );
     Assert.ok(!urlbarButton.disabled);
     let panelPromise =
       promisePanelShown(BrowserPageActions._activatedActionPanelID);
     EventUtils.synthesizeMouseAtCenter(urlbarButton, {});
     await panelPromise;
+    Assert.equal(urlbarButton.getAttribute("open"), "true",
+      "Button has open attribute");
 
     // The devices should be shown in the subview.
     let expectedItems = [
       {
         id: "pageAction-urlbar-sendToDevice-notReady",
         display: "none",
         disabled: true,
       },
@@ -541,16 +551,18 @@ add_task(async function sendToDevice_inU
     }, "Waiting for first device menu item to appear");
 
     // Click it, which should cause the panel to close.
     let hiddenPromise =
       promisePanelHidden(BrowserPageActions._activatedActionPanelID);
     EventUtils.synthesizeMouseAtCenter(deviceMenuItem, {});
     info("Waiting for Send to Device panel to close after clicking a device");
     await hiddenPromise;
+    Assert.ok(!urlbarButton.hasAttribute("open"),
+      "URL bar button no longer has open attribute");
 
     // And then the "Sent!" notification panel should open and close by itself
     // after a moment.
     info("Waiting for the Sent! notification panel to open");
     await promisePanelShown(BrowserPageActionFeedback.panelNode.id);
     Assert.equal(
       BrowserPageActionFeedback.panelNode.anchorNode.id,
       urlbarButton.id
copy from browser/base/content/test/urlbar/browser_urlbar_search_speculative_connect_mousedown.js
copy to browser/base/content/test/urlbar/browser_urlbar_search_no_speculative_connect_with_client_cert.js
--- a/browser/base/content/test/urlbar/browser_urlbar_search_speculative_connect_mousedown.js
+++ b/browser/base/content/test/urlbar/browser_urlbar_search_no_speculative_connect_with_client_cert.js
@@ -1,73 +1,181 @@
+/* eslint-disable mozilla/no-arbitrary-setTimeout */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-// This test ensures that we setup a speculative network connection to
-// the site in mousedown event before the http request happens(in mouseup).
+// Tests that we don't speculatively connect when user certificates are installed
+
+const { MockRegistrar } =
+  Cu.import("resource://testing-common/MockRegistrar.jsm", {});
+
+const certService = Cc["@mozilla.org/security/local-cert-service;1"]
+                      .getService(Ci.nsILocalCertService);
+const certOverrideService = Cc["@mozilla.org/security/certoverride;1"]
+                              .getService(Ci.nsICertOverrideService);
+
+const host = "localhost";
+let uri;
+let handshakeDone = false;
+let expectingChooseCertificate = false;
+let chooseCertificateCalled = false;
+
+const clientAuthDialogs = {
+  chooseCertificate(ctx, hostname, port, organization, issuerOrg, certList,
+                    selectedIndex) {
+    ok(expectingChooseCertificate,
+       `${expectingChooseCertificate ? "" : "not "}expecting chooseCertificate to be called`);
+    is(certList.length, 1, "should have only one client certificate available");
+    selectedIndex.value = 0;
+    chooseCertificateCalled = true;
+    return true;
+  },
+
+  QueryInterface: XPCOMUtils.generateQI([Ci.nsIClientAuthDialogs]),
+};
+
+function startServer(cert) {
+  let tlsServer = Cc["@mozilla.org/network/tls-server-socket;1"]
+                    .createInstance(Ci.nsITLSServerSocket);
+  tlsServer.init(-1, true, -1);
+  tlsServer.serverCert = cert;
+
+  let input, output;
 
-let gHttpServer = null;
-let gScheme = "http";
-let gHost = "localhost"; // 'localhost' by default.
-let gPort = -1;
-let gIsSpeculativeConnected = false;
+  let listener = {
+    onSocketAccepted(socket, transport) {
+      info("Accepted TLS client connection");
+      let connectionInfo = transport.securityInfo
+                           .QueryInterface(Ci.nsITLSServerConnectionInfo);
+      connectionInfo.setSecurityObserver(listener);
+      input = transport.openInputStream(0, 0, 0);
+      output = transport.openOutputStream(0, 0, 0);
+    },
+
+    onHandshakeDone(socket, status) {
+      info("TLS handshake done");
+      handshakeDone = true;
+
+      input.asyncWait({
+        onInputStreamReady(readyInput) {
+          try {
+            let request = NetUtil.readInputStreamToString(readyInput,
+                                                          readyInput.available());
+            ok(request.startsWith("GET /") && request.includes("HTTP/1.1"),
+               "expecting an HTTP/1.1 GET request");
+            let response = "HTTP/1.1 200 OK\r\nContent-Type:text/plain\r\n" +
+                           "Connection:Close\r\nContent-Length:2\r\n\r\nOK";
+            output.write(response, response.length);
+          } catch (e) {
+            // This will fail when we close the speculative connection.
+          }
+        }
+      }, 0, 0, Services.tm.currentThread);
+    },
+
+    onStopListening() {
+      info("onStopListening");
+      input.close();
+      output.close();
+    }
+  };
+
+  tlsServer.setSessionCache(false);
+  tlsServer.setSessionTickets(false);
+  tlsServer.setRequestClientCertificate(Ci.nsITLSServerSocket.REQUEST_ALWAYS);
+
+  tlsServer.asyncListen(listener);
+
+  return tlsServer;
+}
+
+let server;
 
 add_task(async function setup() {
-  gHttpServer = runHttpServer(gScheme, gHost, gPort);
-  // The server will be run on a random port if the port number wasn't given.
-  gPort = gHttpServer.identity.primaryPort;
-
-  await PlacesTestUtils.addVisits([{
-    uri: `${gScheme}://${gHost}:${gPort}`,
-    title: "test visit for speculative connection",
-    transition: Ci.nsINavHistoryService.TRANSITION_TYPED,
-  }]);
-
   await SpecialPowers.pushPrefEnv({
     set: [["browser.urlbar.autoFill", true],
           // Turn off search suggestion so we won't speculative connect to the search engine.
           ["browser.search.suggest.enabled", false],
           ["browser.urlbar.speculativeConnect.enabled", true],
           // In mochitest this number is 0 by default but we have to turn it on.
           ["network.http.speculative-parallel-limit", 6],
           // The http server is using IPv4, so it's better to disable IPv6 to avoid weird
           // networking problem.
-          ["network.dns.disableIPv6", true]],
+          ["network.dns.disableIPv6", true],
+          ["security.default_personal_cert", "Ask Every Time"]],
   });
 
+  let clientAuthDialogsCID =
+    MockRegistrar.register("@mozilla.org/nsClientAuthDialogs;1",
+                           clientAuthDialogs);
+
+  let cert = await new Promise((resolve, reject) => {
+    certService.getOrCreateCert("speculative-connect", {
+      handleCert(c, rv) {
+        if (!Components.isSuccessCode(rv)) {
+          reject(rv);
+          return;
+        }
+        resolve(c);
+      }
+    });
+  });
+  server = startServer(cert);
+  uri = `https://${host}:${server.port}/`;
+  info(`running tls server at ${uri}`);
+  await PlacesTestUtils.addVisits([{
+    uri,
+    title: "test visit for speculative connection",
+    transition: Ci.nsINavHistoryService.TRANSITION_TYPED,
+  }]);
+
+  let overrideBits = Ci.nsICertOverrideService.ERROR_UNTRUSTED |
+                     Ci.nsICertOverrideService.ERROR_MISMATCH;
+  certOverrideService.rememberValidityOverride("localhost", server.port, cert,
+                                               overrideBits, true);
+
   registerCleanupFunction(async function() {
     await PlacesUtils.history.clear();
-    gHttpServer.identity.remove(gScheme, gHost, gPort);
-    gHttpServer.stop(() => {
-      gHttpServer = null;
-    });
+    MockRegistrar.unregister(clientAuthDialogsCID);
+    certOverrideService.clearValidityOverride("localhost", server.port);
   });
 });
 
-add_task(async function popup_mousedown_tests() {
+add_task(async function popup_mousedown_no_client_cert_dialog_until_navigate_test() {
   const test = {
     // To not trigger autofill, search keyword starts from the second character.
-    search: gHost.substr(1, 4),
-    completeValue: `${gScheme}://${gHost}:${gPort}/`
+    search: host.substr(1, 4),
+    completeValue: uri
   };
   info(`Searching for '${test.search}'`);
   await promiseAutocompleteResultPopup(test.search, window, true);
-  // Check if the first result is with type "searchengine"
   let controller = gURLBar.popup.input.controller;
-  // The first item should be 'Search with ...' thus we wan the second.
+  // The first item should be 'Search with ...' thus we want the second.
   let value = controller.getFinalCompleteValueAt(1);
   info(`The value of the second item is ${value}`);
   is(value, test.completeValue, "The second item has the url we visited.");
 
   await BrowserTestUtils.waitForCondition(() => {
     return !!gURLBar.popup.richlistbox.childNodes[1] &&
            is_visible(gURLBar.popup.richlistbox.childNodes[1]);
   }, "the node is there.");
 
+  expectingChooseCertificate = false;
   let listitem = gURLBar.popup.richlistbox.childNodes[1];
-  EventUtils.synthesizeMouse(listitem, 10, 10, {type: "mousedown"}, window);
+  EventUtils.synthesizeMouseAtCenter(listitem, {type: "mousedown"}, window);
   is(gURLBar.popup.richlistbox.selectedIndex, 1, "The second item is selected");
-  await promiseSpeculativeConnection(gHttpServer);
-  is(gHttpServer.connectionNumber, 1, `${gHttpServer.connectionNumber} speculative connection has been setup.`);
+
+  // We shouldn't have triggered a speculative connection, because a client
+  // certificate is installed.
+  SimpleTest.requestFlakyTimeout("Wait for UI");
+  await new Promise(resolve => setTimeout(resolve, 200));
+
+  // Now mouseup, expect that we choose a client certificate, and expect that
+  // we successfully load a page.
+  expectingChooseCertificate = true;
+  EventUtils.synthesizeMouseAtCenter(listitem, {type: "mouseup"}, window);
+  await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+  ok(chooseCertificateCalled, "chooseCertificate must have been called");
+  server.close();
 });
--- a/browser/base/content/test/urlbar/head.js
+++ b/browser/base/content/test/urlbar/head.js
@@ -270,23 +270,35 @@ function promisePanelEvent(panelIDOrNode
     }
     panel.addEventListener(eventType, () => {
       executeSoon(resolve);
     }, { once: true });
   });
 }
 
 function promisePageActionViewShown() {
-  return new Promise(resolve => {
-    BrowserPageActions.panelNode.addEventListener("ViewShown", (event) => {
-      let target = event.originalTarget;
-      window.setTimeout(() => {
-        resolve(target);
-      }, 5000);
-    }, { once: true });
+  let dwu = window.QueryInterface(Ci.nsIInterfaceRequestor)
+                  .getInterface(Ci.nsIDOMWindowUtils);
+  info("promisePageActionViewShown waiting for ViewShown");
+  return BrowserTestUtils.waitForEvent(BrowserPageActions.panelNode, "ViewShown").then(async event => {
+    let panelViewNode = event.originalTarget;
+    // Wait for the subview to be really truly shown by making sure there's at
+    // least one child with non-zero bounds.
+    info("promisePageActionViewShown waiting for a child node to be visible");
+    await BrowserTestUtils.waitForCondition(() => {
+      let bodyNode = panelViewNode.firstChild;
+      for (let childNode of bodyNode.childNodes) {
+        let bounds = dwu.getBoundsWithoutFlushing(childNode);
+        if (bounds.width > 0 && bounds.height > 0) {
+          return true;
+        }
+      }
+      return false;
+    });
+    return panelViewNode;
   });
 }
 
 function promiseSpeculativeConnection(httpserver) {
   return BrowserTestUtils.waitForCondition(() => {
     if (httpserver) {
       return httpserver.connectionNumber == 1;
     }
--- a/browser/base/content/test/webrtc/browser_devices_get_user_media_screen.js
+++ b/browser/base/content/test/webrtc/browser_devices_get_user_media_screen.js
@@ -25,30 +25,33 @@ var gTests = [
     let promise = promisePopupNotificationShown("webRTC-shareDevices");
     await promiseRequestDevice(false, true, null, "screen");
     await promise;
     await expectObserverCalled("getUserMedia:request");
 
     is(PopupNotifications.getNotification("webRTC-shareDevices").anchorID,
        "webRTC-shareScreen-notification-icon", "anchored to device icon");
     checkDeviceSelectors(false, false, true);
-    let iconclass =
-      PopupNotifications.panel.firstChild.getAttribute("iconclass");
+    let notification = PopupNotifications.panel.firstChild;
+    let iconclass = notification.getAttribute("iconclass");
     ok(iconclass.includes("screen-icon"), "panel using screen icon");
 
     let menulist =
       document.getElementById("webRTC-selectWindow-menulist");
     let count = menulist.itemCount;
     ok(count >= 3,
-       "There should be the 'No Screen' item, a separator and at least one screen");
+       "There should be the 'Select Screen' item, a separator and at least one screen");
 
     let noScreenItem = menulist.getItemAtIndex(0);
-    ok(noScreenItem.hasAttribute("selected"), "the 'No Screen' item is selected");
+    ok(noScreenItem.hasAttribute("selected"), "the 'Select Screen' item is selected");
+    is(menulist.selectedItem, noScreenItem, "'Select Screen' is the selected item");
     is(menulist.value, -1, "no screen is selected by default");
-    is(menulist.selectedItem, noScreenItem, "'No Screen' is the selected item");
+    ok(noScreenItem.disabled, "'Select Screen' item is disabled");
+    ok(notification.button.disabled, "Allow button is disabled");
+    ok(notification.hasAttribute("invalidselection"), "Notification is marked as invalid");
 
     let separator = menulist.getItemAtIndex(1);
     is(separator.localName, "menuseparator", "the second item is a separator");
 
     ok(document.getElementById("webRTC-all-windows-shared").hidden,
        "the 'all windows will be shared' warning should be hidden while there's no selection");
     ok(document.getElementById("webRTC-preview").hidden,
        "the preview area is hidden");
@@ -64,18 +67,19 @@ var gTests = [
     menulist.getItemAtIndex(2).doCommand();
     ok(!document.getElementById("webRTC-all-windows-shared").hidden,
        "the 'all windows will be shared' warning should now be visible");
     await promiseWaitForCondition(() => !document.getElementById("webRTC-preview").hidden, 100);
     ok(!document.getElementById("webRTC-preview").hidden,
        "the preview area is visible");
     ok(!document.getElementById("webRTC-previewWarning").hidden,
        "the scary warning is visible");
+    ok(!notification.button.disabled, "Allow button is enabled");
 
-    // Select the 'No Screen' item again, the preview should be hidden.
+    // Select the 'Select Screen' item again, the preview should be hidden.
     menulist.getItemAtIndex(0).doCommand();
     ok(document.getElementById("webRTC-all-windows-shared").hidden,
        "the 'all windows will be shared' warning should now be hidden");
     ok(document.getElementById("webRTC-preview").hidden,
        "the preview area is hidden");
 
     // Select the first screen again so that we can have a stream.
     menulist.getItemAtIndex(2).doCommand();
@@ -98,17 +102,17 @@ var gTests = [
     await promise;
     await expectObserverCalled("getUserMedia:request");
 
     is(PopupNotifications.getNotification("webRTC-shareDevices").anchorID,
        "webRTC-shareScreen-notification-icon", "anchored to device icon");
     checkDeviceSelectors(false, false, true);
 
     await promiseMessage(permissionError, () => {
-      PopupNotifications.panel.firstChild.button.click();
+      activateSecondaryAction(kActionDeny);
     });
 
     await expectObserverCalled("getUserMedia:response:deny");
     SitePermissions.remove(null, "screen", gBrowser.selectedBrowser);
     await closeStream();
   }
 },
 
@@ -118,30 +122,33 @@ var gTests = [
     let promise = promisePopupNotificationShown("webRTC-shareDevices");
     await promiseRequestDevice(false, true, null, "window");
     await promise;
     await expectObserverCalled("getUserMedia:request");
 
     is(PopupNotifications.getNotification("webRTC-shareDevices").anchorID,
        "webRTC-shareScreen-notification-icon", "anchored to device icon");
     checkDeviceSelectors(false, false, true);
-    let iconclass =
-      PopupNotifications.panel.firstChild.getAttribute("iconclass");
+    let notification = PopupNotifications.panel.firstChild;
+    let iconclass = notification.getAttribute("iconclass");
     ok(iconclass.includes("screen-icon"), "panel using screen icon");
 
     let menulist =
       document.getElementById("webRTC-selectWindow-menulist");
     let count = menulist.itemCount;
     ok(count >= 3,
-       "There should be the 'No Window' item, a separator and at least one window");
+       "There should be the 'Select Window' item, a separator and at least one window");
 
     let noWindowItem = menulist.getItemAtIndex(0);
-    ok(noWindowItem.hasAttribute("selected"), "the 'No Window' item is selected");
+    ok(noWindowItem.hasAttribute("selected"), "the 'Select Window' item is selected");
+    is(menulist.selectedItem, noWindowItem, "'Select Window' is the selected item");
     is(menulist.value, -1, "no window is selected by default");
-    is(menulist.selectedItem, noWindowItem, "'No Window' is the selected item");
+    ok(noWindowItem.disabled, "'Select Window' item is disabled");
+    ok(notification.button.disabled, "Allow button is disabled");
+    ok(notification.hasAttribute("invalidselection"), "Notification is marked as invalid");
 
     let separator = menulist.getItemAtIndex(1);
     is(separator.localName, "menuseparator", "the second item is a separator");
 
     ok(document.getElementById("webRTC-all-windows-shared").hidden,
        "the 'all windows will be shared' warning should be hidden");
     ok(document.getElementById("webRTC-preview").hidden,
        "the preview area is hidden");
@@ -163,17 +170,17 @@ var gTests = [
     ok(document.getElementById("webRTC-all-windows-shared").hidden,
        "the 'all windows will be shared' warning should still be hidden");
     await promiseWaitForCondition(() => !document.getElementById("webRTC-preview").hidden);
     ok(!document.getElementById("webRTC-preview").hidden,
        "the preview area is visible");
     ok(!document.getElementById("webRTC-previewWarning").hidden,
        "the scary warning is visible");
 
-    // Select the 'No Window' item again, the preview should be hidden.
+    // Select the 'Select Window' item again, the preview should be hidden.
     menulist.getItemAtIndex(0).doCommand();
     ok(document.getElementById("webRTC-preview").hidden,
        "the preview area is hidden");
 
     // If we have a non-scary window, select it and verify the warning isn't displayed.
     // A non-scary window may not always exist on test slaves.
     if (typeof nonScaryIndex == "number") {
       menulist.getItemAtIndex(nonScaryIndex).doCommand();
@@ -224,30 +231,33 @@ var gTests = [
       return;
     }
 
     await expectObserverCalled("getUserMedia:request");
 
     is(PopupNotifications.getNotification("webRTC-shareDevices").anchorID,
        "webRTC-shareScreen-notification-icon", "anchored to device icon");
     checkDeviceSelectors(false, false, true);
-    let iconclass =
-      PopupNotifications.panel.firstChild.getAttribute("iconclass");
+    let notification = PopupNotifications.panel.firstChild;
+    let iconclass = notification.getAttribute("iconclass");
     ok(iconclass.includes("screen-icon"), "panel using screen icon");
 
     let menulist =
       document.getElementById("webRTC-selectWindow-menulist");
     let count = menulist.itemCount;
     ok(count >= 3,
-       "There should be the 'No Application' item, a separator and at least one application");
+       "There should be the 'Select Application' item, a separator and at least one application");
 
     let noApplicationItem = menulist.getItemAtIndex(0);
-    ok(noApplicationItem.hasAttribute("selected"), "the 'No Application' item is selected");
+    ok(noApplicationItem.hasAttribute("selected"), "the 'Select Application' item is selected");
+    is(menulist.selectedItem, noApplicationItem, "'Select Application' is the selected item");
     is(menulist.value, -1, "no app is selected by default");
-    is(menulist.selectedItem, noApplicationItem, "'No Application' is the selected item");
+    ok(noApplicationItem.disabled, "'Select Application' item is disabled");
+    ok(notification.button.disabled, "Allow button is disabled");
+    ok(notification.hasAttribute("invalidselection"), "Notification is marked as invalid");
 
     let separator = menulist.getItemAtIndex(1);
     is(separator.localName, "menuseparator", "the second item is a separator");
 
     ok(document.getElementById("webRTC-all-windows-shared").hidden,
        "the 'all windows will be shared' warning should be hidden");
     ok(document.getElementById("webRTC-preview").hidden,
        "the preview area is hidden");
@@ -307,17 +317,17 @@ var gTests = [
     let iconclass =
       PopupNotifications.panel.firstChild.getAttribute("iconclass");
     ok(iconclass.includes("screen-icon"), "panel using screen icon");
 
     let menulist =
       document.getElementById("webRTC-selectWindow-menulist");
     let count = menulist.itemCount;
     ok(count >= 3,
-       "There should be the 'No Screen' item, a separator and at least one screen");
+       "There should be the 'Select Screen' item, a separator and at least one screen");
 
     // Select a screen, a preview with a scary warning should appear.
     menulist.getItemAtIndex(2).doCommand();
     ok(!document.getElementById("webRTC-all-windows-shared").hidden,
        "the 'all windows will be shared' warning should now be visible");
     await promiseWaitForCondition(() => !document.getElementById("webRTC-preview").hidden);
     ok(!document.getElementById("webRTC-preview").hidden,
        "the preview area is visible");
@@ -335,39 +345,16 @@ var gTests = [
                      "expected screen and microphone to be shared");
 
     await indicator;
     await checkSharingUI({audio: true, screen: "Screen"});
     await closeStream();
   }
 },
 
-
-{
-  desc: "getUserMedia screen: clicking through without selecting a screen denies",
-  run: async function checkClickThroughDenies() {
-    let promise = promisePopupNotificationShown("webRTC-shareDevices");
-    await promiseRequestDevice(false, true, null, "screen");
-    await promise;
-    await expectObserverCalled("getUserMedia:request");
-    checkDeviceSelectors(false, false, true);
-
-    await promiseMessage(permissionError, () => {
-      PopupNotifications.panel.firstChild.button.click();
-    });
-
-    await expectObserverCalled("getUserMedia:response:deny");
-    await expectObserverCalled("recording-window-ended");
-    await checkNotSharing();
-    SitePermissions.remove(null, "screen", gBrowser.selectedBrowser);
-    SitePermissions.remove(null, "camera", gBrowser.selectedBrowser);
-  }
-},
-
-
 {
   desc: "getUserMedia screen, user clicks \"Don't Allow\"",
   run: async function checkDontShare() {
     let promise = promisePopupNotificationShown("webRTC-shareDevices");
     await promiseRequestDevice(false, true, null, "screen");
     await promise;
     await expectObserverCalled("getUserMedia:request");
     checkDeviceSelectors(false, false, true);
--- a/browser/base/content/test/webrtc/browser_devices_get_user_media_unprompted_access.js
+++ b/browser/base/content/test/webrtc/browser_devices_get_user_media_unprompted_access.js
@@ -48,17 +48,17 @@ var gTests = [
     await promise;
     await expectObserverCalled("getUserMedia:request");
 
     is(PopupNotifications.getNotification("webRTC-shareDevices").anchorID,
        "webRTC-shareScreen-notification-icon", "anchored to device icon");
     checkDeviceSelectors(false, false, true);
 
     await promiseMessage(permissionError, () => {
-      PopupNotifications.panel.firstChild.button.click();
+      activateSecondaryAction(kActionDeny);
     });
 
     await expectObserverCalled("getUserMedia:response:deny");
     SitePermissions.remove(null, "screen", gBrowser.selectedBrowser);
     SitePermissions.remove(null, "camera", gBrowser.selectedBrowser);
     SitePermissions.remove(null, "microphone", gBrowser.selectedBrowser);
 
     // After closing all streams, gUM(audio+camera) causes a prompt.
@@ -141,17 +141,17 @@ var gTests = [
     await promise;
     await expectObserverCalled("getUserMedia:request");
 
     is(PopupNotifications.getNotification("webRTC-shareDevices").anchorID,
        "webRTC-shareScreen-notification-icon", "anchored to device icon");
     checkDeviceSelectors(false, false, true);
 
     await promiseMessage(permissionError, () => {
-      PopupNotifications.panel.firstChild.button.click();
+      activateSecondaryAction(kActionDeny);
     });
 
     await expectObserverCalled("getUserMedia:response:deny");
     SitePermissions.remove(null, "screen", gBrowser.selectedBrowser);
     SitePermissions.remove(null, "camera", gBrowser.selectedBrowser);
     SitePermissions.remove(null, "microphone", gBrowser.selectedBrowser);
 
     // gUM(camera) returns a stream without prompting.
--- a/browser/base/jar.mn
+++ b/browser/base/jar.mn
@@ -34,16 +34,19 @@ browser.jar:
         content/browser/abouthome/bookmarks@2x.png     (content/abouthome/bookmarks@2x.png)
         content/browser/abouthome/history@2x.png       (content/abouthome/history@2x.png)
         content/browser/abouthome/addons@2x.png        (content/abouthome/addons@2x.png)
         content/browser/abouthome/sync@2x.png          (content/abouthome/sync@2x.png)
         content/browser/abouthome/settings@2x.png      (content/abouthome/settings@2x.png)
         content/browser/abouthome/restore@2x.png       (content/abouthome/restore@2x.png)
         content/browser/abouthome/restore-large@2x.png (content/abouthome/restore-large@2x.png)
 
+        content/browser/illustrations/error-connection-failure.svg (content/illustrations/error-connection-failure.svg)
+        content/browser/illustrations/error-server-not-found.svg (content/illustrations/error-server-not-found.svg)
+        content/browser/illustrations/error-malformed-url.svg (content/illustrations/error-malformed-url.svg)
         content/browser/aboutNetError.xhtml            (content/aboutNetError.xhtml)
 
 #ifdef MOZ_SERVICES_HEALTHREPORT
         content/browser/abouthealthreport/abouthealth.xhtml   (content/abouthealthreport/abouthealth.xhtml)
         content/browser/abouthealthreport/abouthealth.js      (content/abouthealthreport/abouthealth.js)
         content/browser/abouthealthreport/abouthealth.css     (content/abouthealthreport/abouthealth.css)
 #endif
         content/browser/aboutaccounts/aboutaccounts.xhtml                     (content/aboutaccounts/aboutaccounts.xhtml)
@@ -103,18 +106,18 @@ browser.jar:
         content/browser/defaultthemes/3.preview.png   (content/defaultthemes/3.preview.png)
         content/browser/defaultthemes/4.header.png    (content/defaultthemes/4.header.png)
         content/browser/defaultthemes/4.icon.png      (content/defaultthemes/4.icon.png)
         content/browser/defaultthemes/4.preview.png   (content/defaultthemes/4.preview.png)
         content/browser/defaultthemes/5.header.png    (content/defaultthemes/5.header.png)
         content/browser/defaultthemes/5.icon.jpg      (content/defaultthemes/5.icon.jpg)
         content/browser/defaultthemes/5.preview.jpg   (content/defaultthemes/5.preview.jpg)
         content/browser/defaultthemes/compact.header.png    (content/defaultthemes/compact.header.png)
-        content/browser/defaultthemes/compactdark.icon.svg  (content/defaultthemes/compactdark.icon.svg)
-        content/browser/defaultthemes/compactlight.icon.svg (content/defaultthemes/compactlight.icon.svg)
+        content/browser/defaultthemes/dark.icon.svg  (content/defaultthemes/dark.icon.svg)
+        content/browser/defaultthemes/light.icon.svg (content/defaultthemes/light.icon.svg)
         content/browser/newtab/newTab.xhtml           (content/newtab/newTab.xhtml)
 *       content/browser/newtab/newTab.js              (content/newtab/newTab.js)
         content/browser/newtab/newTab.css             (content/newtab/newTab.css)
         content/browser/newtab/alternativeDefaultSites.json   (content/newtab/alternativeDefaultSites.json)
 *       content/browser/pageinfo/pageInfo.xul         (content/pageinfo/pageInfo.xul)
         content/browser/pageinfo/pageInfo.js          (content/pageinfo/pageInfo.js)
         content/browser/pageinfo/pageInfo.css         (content/pageinfo/pageInfo.css)
         content/browser/pageinfo/pageInfo.xml         (content/pageinfo/pageInfo.xml)
--- a/browser/branding/official/content/about-wordmark.svg
+++ b/browser/branding/official/content/about-wordmark.svg
@@ -1,8 +1,13 @@
-<?xml version="1.0" encoding="utf-8"?>
 <!-- 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/. -->
-<svg xmlns="http://www.w3.org/2000/svg" width="142" height="38" viewBox="0 0 142 38">
+<svg xmlns="http://www.w3.org/2000/svg" width="338" height="42" viewBox="0 0 338 42">
   <path d="M136.837 10.212H131.5l-5.7 9.9-5.645-9.9h-5.542l8.364 12.778-9.437 14.265h5.337l6.723-11.443 6.62 11.444h5.7l-9.391-14.471zM22.844 37.255h4.721V10.212h-4.721zm15.42-21.339l-.462-5.7h-4.054v27.039h4.721V23.306c0-4.205 3.079-8.878 6.466-8.878a8.485 8.485 0 0 1 2.36.308l.872-4.618A11.5 11.5 0 0 0 45.5 9.81c-3.284 0-5.8 2.053-7.236 6.106zM0 37.255h4.875V21.707h11.546v-3.849H4.875V5.8h13.342l.564-3.9H0zM25.153.163A3.14 3.14 0 0 0 21.869 3.4a3.128 3.128 0 0 0 3.284 3.182A3.143 3.143 0 0 0 28.489 3.4 3.154 3.154 0 0 0 25.153.163zm76.491 9.647c-7.7 0-12.111 5.585-12.111 13.949 0 8.57 4.362 14.112 12.059 14.112 7.646 0 12.059-5.8 12.059-14.163.001-8.57-4.309-13.898-12.007-13.898zm-.051 24.264c-4.516 0-6.979-3.284-6.979-10.315 0-7.082 2.515-10.152 7.03-10.152 4.464 0 6.928 3.07 6.928 10.1 0 7.083-2.463 10.367-6.979 10.367zM82.47 8.339c0-2.617 1.026-4.541 4-4.541a11.567 11.567 0 0 1 4.721 1.026l1.488-3.438A14.913 14.913 0 0 0 86.216 0c-5.491 0-8.467 3.447-8.467 7.963v2.249h-4.824v3.643h4.824v23.4h4.721v-23.4h6.055l.513-3.643H82.47zM59.952 9.81c-6.979 0-11.238 5.79-11.238 14.206 0 8.57 4.413 13.855 11.957 13.855a14.741 14.741 0 0 0 9.442-3.387l-2.053-2.822a11.384 11.384 0 0 1-7.03 2.361c-3.9 0-6.825-2.412-7.287-8.672h17.242c.051-.616.1-1.488.1-2.412.003-8.263-3.846-13.129-11.133-13.129zm6.466 12.051H53.743c.359-6 2.72-8.3 6.312-8.3 4.259 0 6.363 2.711 6.363 8z" fill="#fff"/>
-  <path d="M139.854 10.228a2.134 2.134 0 0 0-2.128 2.155 2.093 2.093 0 0 0 2.128 2.12 2.137 2.137 0 1 0 0-4.275zm0 3.954a1.755 1.755 0 0 1-1.772-1.8 1.783 1.783 0 0 1 1.772-1.826 1.761 1.761 0 0 1 1.79 1.808 1.779 1.779 0 0 1-1.79 1.819zm.891-2.333c0-.481-.33-.721-1.015-.721h-.614v2.422h.374v-.988h.321l.579.988h.445l-.659-1.051a.659.659 0 0 0 .568-.65zm-1.256.4v-.81h.294c.374 0 .579.1.579.41 0 .294-.2.4-.525.4z" fill="#fff"/>
+  <path d="M182.953 39.384L180.9 42c-3.8-3.386-7.284-4.309-13.542-4.309-8.464 0-14.312-6.258-14.312-17.954 0-11.593 5.9-18.21 14.312-18.21 8.566 0 14.363 6.309 14.363 18.159 0 9.644-3.693 14.414-8.874 16.312a16.2 16.2 0 0 1 10.106 3.386zm-15.594-4.206c6.874 0 11.131-4.924 11.131-15.491 0-10.67-4.36-15.543-11.131-15.543-6.617 0-11.08 4.924-11.08 15.594 0 10.515 4.566 15.44 11.08 15.44z" fill="#fff"/>
+  <path d="M206.037 37.229h-2.565l-.154-4.771c-1.9 3.18-4.617 5.335-8.772 5.335-4.822 0-7.592-2.924-7.592-8.207V10.4h2.975v18.879c0 4.258 1.8 6.053 5.283 6.053 3.539 0 6-2.308 7.848-5.489V10.4h2.975z" fill="#fff"/>
+  <path d="M232.505 35.691l-.667 2.1a4.731 4.731 0 0 1-4.155-4.463 9.45 9.45 0 0 1-8.361 4.463c-5.181 0-8.31-3.232-8.31-8 0-5.643 4.258-8.669 11.131-8.669h5.13v-2.615c0-4.258-1.744-6.155-6.207-6.155a21.849 21.849 0 0 0-7.284 1.539l-.769-2.257a22.421 22.421 0 0 1 8.464-1.8c6.1 0 8.772 3.026 8.772 8.515v12.93c-.001 2.975.82 3.847 2.256 4.412zm-5.232-5.13v-7.284h-4.668c-5.386 0-8.413 2.1-8.413 6.361 0 3.693 2.1 5.745 5.643 5.745 3.437 0 5.797-1.693 7.438-4.822z" fill="#fff"/>
+  <path d="M256.82 18.045v19.184h-2.975V18.455c0-4.411-1.8-6.207-5.078-6.207-3.642 0-6.1 2.257-8.31 5.54v19.441h-2.975V10.4h2.565l.256 4.565c2.154-3.026 5.13-5.13 9.028-5.13 4.869.003 7.489 3.029 7.489 8.21z" fill="#fff"/>
+  <path d="M276.312 36.1a10.026 10.026 0 0 1-5.643 1.693c-4.052 0-6.566-2.411-6.566-7.079v-17.9h-4.513V10.4h4.51V3.99l2.975-.359V10.4H274l-.359 2.411h-6.566v17.75c0 3.129 1.231 4.668 3.95 4.668a7.523 7.523 0 0 0 4.1-1.231z" fill="#fff"/>
+  <path d="M297.856 37.229h-2.565l-.154-4.771c-1.9 3.18-4.617 5.335-8.772 5.335-4.822 0-7.592-2.924-7.592-8.207V10.4h2.975v18.879c0 4.258 1.8 6.053 5.284 6.053 3.539 0 6-2.308 7.848-5.489V10.4h2.975z" fill="#fff"/>
+  <path d="M337.251 18.045v19.184h-2.975V18.455c0-4.36-1.8-6.207-4.565-6.207-3.232 0-5.489 2.257-7.54 5.54v19.441H319.2V18.455c0-4.36-1.8-6.207-4.565-6.207-3.232 0-5.54 2.257-7.541 5.54v19.441h-2.975V10.4h2.565l.256 4.514c2-3.026 4.771-5.078 8.259-5.078a6.432 6.432 0 0 1 6.617 5.335c2.1-3.18 4.873-5.335 8.464-5.335 4.304.002 6.971 3.131 6.971 8.209z" fill="#fff"/>
 </svg>
--- a/browser/components/customizableui/CustomizableUI.jsm
+++ b/browser/components/customizableui/CustomizableUI.jsm
@@ -54,17 +54,17 @@ const kSubviewEvents = [
   "ViewShowing",
   "ViewHiding"
 ];
 
 /**
  * The current version. We can use this to auto-add new default widgets as necessary.
  * (would be const but isn't because of testing purposes)
  */
-var kVersion = 11;
+var kVersion = 12;
 
 /**
  * Buttons removed from built-ins by version they were removed. kVersion must be
  * bumped any time a new id is added to this. Use the button id as key, and
  * version the button is removed in as the value.  e.g. "pocket-button": 5
  */
 var ObsoleteBuiltinButtons = {
 };
@@ -306,25 +306,16 @@ var CustomizableUIInternal = {
           }
           if (shouldSetPref) {
             Services.prefs.setBoolPref(prefId, true);
           }
         }
       }
     }
 
-    if (currentVersion < 2) {
-      // Nuke the old 'loop-call-button' out of orbit.
-      CustomizableUI.removeWidgetFromArea("loop-call-button");
-    }
-
-    if (currentVersion < 4) {
-      CustomizableUI.removeWidgetFromArea("loop-button-throttled");
-    }
-
     if (currentVersion < 7 && gSavedState.placements &&
         gSavedState.placements[CustomizableUI.AREA_NAVBAR]) {
       let placements = gSavedState.placements[CustomizableUI.AREA_NAVBAR];
       let newPlacements = ["back-button", "forward-button", "stop-reload-button", "home-button"];
       for (let button of placements) {
         if (!newPlacements.includes(button)) {
           newPlacements.push(button);
         }
@@ -444,16 +435,28 @@ var CustomizableUIInternal = {
             break;
           }
         }
         // We either found the right spot, or reached the end of the
         // placements, so insert here:
         navbarPlacements.splice(insertionPoint, 0, "downloads-button");
       }
     }
+
+    if (currentVersion < 12 && gSavedState.placements) {
+      const removedButtons = ["loop-call-button", "loop-button-throttled", "pocket-button"];
+      for (let placements of Object.values(gSavedState.placements)) {
+        for (let button of removedButtons) {
+          let buttonIndex = placements.indexOf(button);
+          if (buttonIndex != -1) {
+            placements.splice(buttonIndex, 1);
+          }
+        }
+      }
+    }
   },
 
   /**
    * _markObsoleteBuiltinButtonsSeen
    * when upgrading, ensure obsoleted buttons are in seen state.
    */
   _markObsoleteBuiltinButtonsSeen() {
     if (!gSavedState)
@@ -1231,19 +1234,25 @@ var CustomizableUIInternal = {
     }
 
     let container = aAreaNode.customizationTarget;
     let placements = gPlacements.get(areaId);
     let nodeIndex = placements.indexOf(aNode.id);
 
     while (++nodeIndex < placements.length) {
       let nextNodeId = placements[nodeIndex];
-      let nextNode = container.getElementsByAttribute("id", nextNodeId).item(0);
-
-      if (nextNode) {
+      let nextNode = aNode.ownerDocument.getElementById(nextNodeId);
+      // If the next placed widget exists, and is a direct child of the
+      // container, or wrapped in a customize mode wrapper (toolbarpaletteitem)
+      // inside the container, insert beside it.
+      // We have to check the parent to avoid errors when the placement ids
+      // are for nodes that are no longer customizable.
+      if (nextNode && (nextNode.parentNode == container ||
+                       (nextNode.parentNode.localName == "toolbarpaletteitem" &&
+                        nextNode.parentNode.parentNode == container))) {
         return [container, nextNode];
       }
     }
 
     return [container, null];
   },
 
   insertWidgetBefore(aNode, aNextNode, aContainer, aArea) {
@@ -4558,30 +4567,46 @@ OverflowableToolbar.prototype = {
   findOverflowedInsertionPoints(aNode) {
     let newNodeCanOverflow = aNode.getAttribute("overflows") != "false";
     let areaId = this._toolbar.id;
     let placements = gPlacements.get(areaId);
     let nodeIndex = placements.indexOf(aNode.id);
     let nodeBeforeNewNodeIsOverflown = false;
 
     let loopIndex = -1;
+    // Loop through placements to find where to insert this item.
+    // As soon as we find an overflown widget, we will only
+    // insert in the overflow panel (this is why we check placements
+    // before the desired location for the new node). Once we pass
+    // the desired location of the widget, we look for placement ids
+    // that actually have DOM equivalents to insert before. If all
+    // else fails, we insert at the end of either the overflow list
+    // or the toolbar target.
     while (++loopIndex < placements.length) {
       let nextNodeId = placements[loopIndex];
       if (loopIndex > nodeIndex) {
-        if (newNodeCanOverflow && this._collapsed.has(nextNodeId)) {
-          let nextNode = this._list.getElementsByAttribute("id", nextNodeId).item(0);
-          if (nextNode) {
-            return [this._list, nextNode];
-          }
+        let nextNode = aNode.ownerDocument.getElementById(nextNodeId);
+        // If the node we're inserting can overflow, and the next node
+        // in the toolbar is overflown, we should insert this node
+        // in the overflow panel before it.
+        if (newNodeCanOverflow && this._collapsed.has(nextNodeId) &&
+            nextNode && nextNode.parentNode == this._list) {
+          return [this._list, nextNode];
         }
-        if (!nodeBeforeNewNodeIsOverflown || !newNodeCanOverflow) {
-          let nextNode = this._target.getElementsByAttribute("id", nextNodeId).item(0);
-          if (nextNode) {
-            return [this._target, nextNode];
-          }
+        // Otherwise (if either we can't overflow, or the previous node
+        // wasn't overflown), and the next node is in the toolbar itself,
+        // insert the node in the toolbar.
+        if ((!nodeBeforeNewNodeIsOverflown || !newNodeCanOverflow) && nextNode &&
+            (nextNode.parentNode == this._target ||
+             // Also check if the next node is in a customization wrapper
+             // (toolbarpaletteitem). We don't need to do this for the
+             // overflow case because overflow is disabled in customize mode.
+             (nextNode.parentNode.localName == "toolbarpaletteitem" &&
+              nextNode.parentNode.parentNode == this._target))) {
+          return [this._target, nextNode];
         }
       } else if (loopIndex < nodeIndex && this._collapsed.has(nextNodeId)) {
         nodeBeforeNewNodeIsOverflown = true;
       }
     }
 
     let containerForAppending = (this._collapsed.size && newNodeCanOverflow) ?
                                 this._list : this._target;
--- a/browser/components/customizableui/CustomizableWidgets.jsm
+++ b/browser/components/customizableui/CustomizableWidgets.jsm
@@ -16,17 +16,16 @@ XPCOMUtils.defineLazyModuleGetters(this,
   BrowserUITelemetry: "resource:///modules/BrowserUITelemetry.jsm",
   PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
   PlacesUIUtils: "resource:///modules/PlacesUIUtils.jsm",
   RecentlyClosedTabsAndWindowsMenuUtils: "resource:///modules/sessionstore/RecentlyClosedTabsAndWindowsMenuUtils.jsm",
   ShortcutUtils: "resource://gre/modules/ShortcutUtils.jsm",
   CharsetMenu: "resource://gre/modules/CharsetMenu.jsm",
   PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
   SyncedTabs: "resource://services-sync/SyncedTabs.jsm",
-  ContextualIdentityService: "resource://gre/modules/ContextualIdentityService.jsm",
 });
 
 XPCOMUtils.defineLazyGetter(this, "CharsetBundle", function() {
   const kCharsetBundle = "chrome://global/locale/charsetMenu.properties";
   return Services.strings.createBundle(kCharsetBundle);
 });
 XPCOMUtils.defineLazyGetter(this, "BrandBundle", function() {
   const kBrandBundle = "chrome://branding/locale/brand.properties";
@@ -909,99 +908,16 @@ const CustomizableWidgets = [
     }
   }, {
     id: "email-link-button",
     tooltiptext: "email-link-button.tooltiptext3",
     onCommand(aEvent) {
       let win = aEvent.view;
       win.MailIntegration.sendLinkForBrowser(win.gBrowser.selectedBrowser)
     }
-  }, {
-    id: "containers-panelmenu",
-    type: "view",
-    viewId: "PanelUI-containers",
-    hasObserver: false,
-    onCreated(aNode) {
-      let doc = aNode.ownerDocument;
-      let win = doc.defaultView;
-      let items = doc.getElementById("PanelUI-containersItems");
-
-      let onItemCommand = function(aEvent) {
-        let item = aEvent.target;
-        if (item.hasAttribute("usercontextid")) {
-          let userContextId = parseInt(item.getAttribute("usercontextid"));
-          win.openUILinkIn(win.BROWSER_NEW_TAB_URL, "tab", {userContextId});
-        }
-      };
-      items.addEventListener("command", onItemCommand);
-
-      if (PrivateBrowsingUtils.isWindowPrivate(win)) {
-        aNode.setAttribute("disabled", "true");
-      }
-
-      this.updateVisibility(aNode);
-
-      if (!this.hasObserver) {
-        Services.prefs.addObserver("privacy.userContext.enabled", this, true);
-        this.hasObserver = true;
-      }
-    },
-    onViewShowing(aEvent) {
-      let doc = aEvent.target.ownerDocument;
-
-      let items = doc.getElementById("PanelUI-containersItems");
-
-      while (items.firstChild) {
-        items.firstChild.remove();
-      }
-
-      let fragment = doc.createDocumentFragment();
-      let bundle = doc.getElementById("bundle_browser");
-
-      ContextualIdentityService.getPublicIdentities().forEach(identity => {
-        let label = ContextualIdentityService.getUserContextLabel(identity.userContextId);
-
-        let item = doc.createElementNS(kNSXUL, "toolbarbutton");
-        item.setAttribute("label", label);
-        item.setAttribute("usercontextid", identity.userContextId);
-        item.setAttribute("class", "subviewbutton");
-        item.setAttribute("data-identity-color", identity.color);
-        item.setAttribute("data-identity-icon", identity.icon);
-
-        fragment.appendChild(item);
-      });
-
-      fragment.appendChild(doc.createElementNS(kNSXUL, "menuseparator"));
-
-      let item = doc.createElementNS(kNSXUL, "toolbarbutton");
-      item.setAttribute("label", bundle.getString("userContext.aboutPage.label"));
-      item.setAttribute("command", "Browser:OpenAboutContainers");
-      item.setAttribute("class", "subviewbutton");
-      fragment.appendChild(item);
-
-      items.appendChild(fragment);
-    },
-
-    updateVisibility(aNode) {
-      aNode.hidden = !Services.prefs.getBoolPref("privacy.userContext.enabled");
-    },
-
-    observe(aSubject, aTopic, aData) {
-      let {instances} = CustomizableUI.getWidget("containers-panelmenu");
-      for (let {node} of instances) {
-        if (node) {
-          this.updateVisibility(node);
-        }
-      }
-    },
-
-    QueryInterface: XPCOMUtils.generateQI([
-      Ci.nsISupportsWeakReference,
-      Ci.nsIObserver
-    ]),
   }];
 
 let preferencesButton = {
   id: "preferences-button",
   defaultArea: CustomizableUI.AREA_PANEL,
   onCommand(aEvent) {
     let win = aEvent.target.ownerGlobal;
     win.openPreferences(undefined, {origin: "preferencesButton"});
--- a/browser/components/customizableui/CustomizeMode.jsm
+++ b/browser/components/customizableui/CustomizeMode.jsm
@@ -4,17 +4,16 @@
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["CustomizeMode"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 const kPrefCustomizationDebug = "browser.uiCustomization.debug";
-const kPrefCustomizationAnimation = "browser.uiCustomization.disableAnimation";
 const kPaletteId = "customization-palette";
 const kDragDataTypePrefix = "text/toolbarwrapper-id/";
 const kSkipSourceNodePref = "browser.uiCustomization.skipSourceNodeCheck";
 const kToolbarVisibilityBtn = "customization-toolbar-visibility-button";
 const kDrawInTitlebarPref = "browser.tabs.drawInTitlebar";
 const kExtraDragSpacePref = "browser.tabs.extraDragSpace";
 const kMaxTransitionDurationMs = 2000;
 const kKeepBroadcastAttributes = "keepbroadcastattributeswhencustomizing";
@@ -54,18 +53,16 @@ XPCOMUtils.defineLazyGetter(this, "log",
   gDebug = Services.prefs.getBoolPref(kPrefCustomizationDebug, false);
   let consoleOptions = {
     maxLogLevel: gDebug ? "all" : "log",
     prefix: "CustomizeMode",
   };
   return new scope.ConsoleAPI(consoleOptions);
 });
 
-var gDisableAnimation = null;
-
 var gDraggingInToolbars;
 
 var gTab;
 
 function closeGlobalTab() {
   let win = gTab.ownerGlobal;
   if (win.gBrowser.browsers.length == 1) {
     win.BrowserOpenTab();
@@ -91,32 +88,27 @@ function unregisterGlobalTab() {
   win.gBrowser.removeTabsProgressListener(gTabsProgressListener);
 
   gTab.removeAttribute("customizemode");
 
   gTab = null;
 }
 
 function CustomizeMode(aWindow) {
-  if (gDisableAnimation === null) {
-    gDisableAnimation = Services.prefs.getPrefType(kPrefCustomizationAnimation) == Ci.nsIPrefBranch.PREF_BOOL &&
-                        Services.prefs.getBoolPref(kPrefCustomizationAnimation);
-  }
   this.window = aWindow;
   this.document = aWindow.document;
   this.browser = aWindow.gBrowser;
   this.areas = new Set();
 
   // There are two palettes - there's the palette that can be overlayed with
   // toolbar items in browser.xul. This is invisible, and never seen by the
   // user. Then there's the visible palette, which gets populated and displayed
   // to the user when in customizing mode.
   this.visiblePalette = this.document.getElementById(kPaletteId);
   this.paletteEmptyNotice = this.document.getElementById("customization-empty");
-  this.tipPanel = this.document.getElementById("customization-tipPanel");
   if (Services.prefs.getCharPref("general.skins.selectedSkin") != "classic/1.0") {
     let lwthemeButton = this.document.getElementById("customization-lwtheme-button");
     lwthemeButton.setAttribute("hidden", "true");
   }
   if (AppConstants.CAN_DRAW_IN_TITLEBAR) {
     this._updateTitlebarCheckbox();
     this._updateDragSpaceCheckbox();
     Services.prefs.addObserver(kDrawInTitlebarPref, this);
@@ -394,18 +386,16 @@ CustomizeMode.prototype = {
     }
 
     if (this.resetting) {
       log.debug("Attempted to exit while we're resetting. " +
                 "We'll exit after resetting has finished.");
       return;
     }
 
-    this.hideTip();
-
     this._handler.isExitingCustomizeMode = true;
 
     this._removeExtraToolbarsIfEmpty();
 
     this._teardownDownloadAutoHideToggle();
 
     CustomizableUI.removeListener(this);
 
@@ -551,54 +541,16 @@ CustomizeMode.prototype = {
 
     let deck = this.document.getElementById("tab-view-deck");
     let toolboxRect = this.window.gNavToolbox.getBoundingClientRect();
     let height = toolboxRect.bottom;
     deck.style.setProperty("--toolbox-rect-height", `${height}`);
     deck.style.setProperty("--toolbox-rect-height-with-unit", `${height}px`);
   },
 
-  maybeShowTip(aAnchor) {
-    const kShownPref = "browser.customizemode.tip0.shown";
-    let shown = Services.prefs.getBoolPref(kShownPref, false);
-    if (shown)
-      return;
-
-    let anchorNode = aAnchor || this.document.getElementById("customization-panelHolder");
-    let messageNode = this.tipPanel.querySelector(".customization-tipPanel-contentMessage");
-    if (!messageNode.childElementCount) {
-      // Put the tip contents in the popup.
-      let bundle = this.document.getElementById("bundle_browser");
-      const kLabelClass = "customization-tipPanel-link";
-      // eslint-disable-next-line no-unsanitized/property
-      messageNode.innerHTML = bundle.getFormattedString("customizeTips.tip0", [
-        "<label class=\"customization-tipPanel-em\" value=\"" +
-          bundle.getString("customizeTips.tip0.hint") + "\"/>",
-        this.document.getElementById("bundle_brand").getString("brandShortName"),
-        "<label class=\"" + kLabelClass + " text-link\" value=\"" +
-        bundle.getString("customizeTips.tip0.learnMore") + "\"/>"
-      ]);
-
-      messageNode.querySelector("." + kLabelClass).addEventListener("click", () => {
-        let url = Services.urlFormatter.formatURLPref("browser.customizemode.tip0.learnMoreUrl");
-        let browser = this.browser;
-        browser.selectedTab = browser.addTab(url);
-        this.hideTip();
-      });
-    }
-
-    this.tipPanel.hidden = false;
-    this.tipPanel.openPopup(anchorNode);
-    Services.prefs.setBoolPref(kShownPref, true);
-  },
-
-  hideTip() {
-    this.tipPanel.hidePopup();
-  },
-
   _getCustomizableChildForNode(aNode) {
     // NB: adjusted from _getCustomizableParent to keep that method fast
     // (it's used during drags), and avoid multiple DOM loops
     let areas = CustomizableUI.areas;
     // Caching this length is important because otherwise we'll also iterate
     // over items we add to the end from within the loop.
     let numberOfAreas = areas.length;
     for (let i = 0; i < numberOfAreas; i++) {
--- a/browser/components/customizableui/PanelMultiView.jsm
+++ b/browser/components/customizableui/PanelMultiView.jsm
@@ -427,17 +427,25 @@ this.PanelMultiView = class {
       } else {
         this._transitionHeight(() => {
           viewNode.removeAttribute("current");
           this._currentSubView = null;
           this.node.setAttribute("viewtype", "main");
         });
       }
     } else if (this.panelViews) {
-      this._mainView.setAttribute("current", "true");
+      // Make sure to hide all subviews, except for the mainView.
+      let mainView = this._mainView;
+      for (let panelview of this._panelViews) {
+        if (panelview == mainView)
+          panelview.setAttribute("current", true);
+        else
+          panelview.removeAttribute("current");
+      }
+      this.node.setAttribute("viewtype", "main");
     }
 
     if (!this.panelViews) {
       this._shiftMainView();
     }
   }
 
   showSubView(aViewId, aAnchor, aPreviousView) {
@@ -521,31 +529,27 @@ this.PanelMultiView = class {
 
       this._currentSubView = viewNode;
       if (this.panelViews) {
         if (viewNode.id == this._mainViewId) {
           this.node.setAttribute("viewtype", "main");
         } else {
           this.node.setAttribute("viewtype", "subview");
         }
+        // If we've got an older transition still running, make sure to clean it up.
+        await this._cleanupTransitionPhase();
         if (!playTransition) {
           viewNode.setAttribute("current", true);
           this.descriptionHeightWorkaround(viewNode);
         }
       }
 
       // Now we have to transition the panel.
       if (this.panelViews && playTransition) {
-        if (aAnchor)
-          aAnchor.setAttribute("open", true);
-
-        await this._transitionViews(previousViewNode, viewNode, reverse, previousRect);
-
-        if (aAnchor)
-          aAnchor.removeAttribute("open");
+        await this._transitionViews(previousViewNode, viewNode, reverse, previousRect, aAnchor);
 
         this._dispatchViewEvent(viewNode, "ViewShown");
         this._updateKeyboardFocus(viewNode);
       } else if (!this.panelViews) {
         this._transitionHeight(() => {
           viewNode.setAttribute("current", true);
           if (viewNode.id == this._mainViewId) {
             this.node.setAttribute("viewtype", "main");
@@ -572,37 +576,39 @@ this.PanelMultiView = class {
    * @param {panelview} previousViewNode Node that is currently shown as active,
    *                                     but is about to be transitioned away.
    * @param {panelview} viewNode         Node that will becode the active view,
    *                                     after the transition has finished.
    * @param {Boolean}   reverse          Whether we're navigation back to a
    *                                     previous view or forward to a next view.
    * @param {Object}    previousRect     Rect object, with the same structure as
    *                                     a DOMRect, of the `previousViewNode`.
-   * @param {Function}  callback         Function that will be invoked when the
-   *                                     transition is finished or when the
-   *                                     operation was canceled (early return).
+   * @param {Element}   anchor           the anchor for which we're opening
+   *                                     a new panelview, if any
    */
-  async _transitionViews(previousViewNode, viewNode, reverse, previousRect) {
+  async _transitionViews(previousViewNode, viewNode, reverse, previousRect, anchor) {
     // There's absolutely no need to show off our epic animation skillz when
     // the panel's not even open.
     if (this._panel.state != "open") {
       return;
     }
 
     const {window, document} = this;
 
     if (this._autoResizeWorkaroundTimer)
       window.clearTimeout(this._autoResizeWorkaroundTimer);
 
     this._transitionDetails = {
       phase: TRANSITION_PHASES.START,
-      previousViewNode, viewNode, reverse
+      previousViewNode, viewNode, reverse, anchor
     };
 
+    if (anchor)
+      anchor.setAttribute("open", "true");
+
     // Set the viewContainer dimensions to make sure only the current view is
     // visible.
     this._viewContainer.style.height = Math.max(previousRect.height, this._mainViewHeight) + "px";
     this._viewContainer.style.width = previousRect.width + "px";
     // Lock the dimensions of the window that hosts the popup panel.
     let rect = this._panel.popupBoxObject.getOuterScreenRect();
     this._panel.setAttribute("width", rect.width);
     this._panel.setAttribute("height", rect.height);
@@ -699,27 +705,30 @@ this.PanelMultiView = class {
    * Attempt to clean up the attributes and properties set by `_transitionViews`
    * above. Which attributes and properties depends on the phase the transition
    * was left from - normally that'd be `TRANSITION_PHASES.END`.
    */
   async _cleanupTransitionPhase() {
     if (!this._transitionDetails)
       return;
 
-    let {phase, previousViewNode, viewNode, reverse, resolve, listener} = this._transitionDetails;
+    let {phase, previousViewNode, viewNode, reverse, resolve, listener, anchor} = this._transitionDetails;
     this._transitionDetails = null;
 
     // Do the things we _always_ need to do whenever the transition ends or is
     // interrupted.
     this._dispatchViewEvent(previousViewNode, "ViewHiding");
     previousViewNode.removeAttribute("current");
     if (reverse)
       this._resetKeyNavigation(previousViewNode);
     this.descriptionHeightWorkaround(viewNode);
 
+    if (anchor)
+      anchor.removeAttribute("open");
+
     if (phase >= TRANSITION_PHASES.START) {
       this._panel.removeAttribute("width");
       this._panel.removeAttribute("height");
       // Myeah, panel layout auto-resizing is a funky thing. We'll wait
       // another few milliseconds to remove the width and height 'fixtures',
       // to be sure we don't flicker annoyingly.
       // NB: HACK! Bug 1363756 is there to fix this.
       this._autoResizeWorkaroundTimer = this.window.setTimeout(() => {
@@ -992,17 +1001,16 @@ this.PanelMultiView = class {
       case "popuphidden":
         // WebExtensions consumers can hide the popup from viewshowing, or
         // mid-transition, which disrupts our state:
         this._viewShowing = null;
         this._transitioning = false;
         this.node.removeAttribute("panelopen");
         this.showMainView();
         if (this.panelViews) {
-          this._cleanupTransitionPhase();
           for (let panelView of this._viewStack.children) {
             if (panelView.nodeName != "children") {
               panelView.__lastKnownBoundingRect = null;
               panelView.style.removeProperty("min-width");
               panelView.style.removeProperty("max-width");
             }
           }
           this.window.removeEventListener("keydown", this);
--- a/browser/components/customizableui/content/panelUI.inc.xul
+++ b/browser/components/customizableui/content/panelUI.inc.xul
@@ -374,35 +374,16 @@
     <menuseparator/>
     <menuitem command="cmd_CustomizeToolbars"
               class="viewCustomizeToolbar"
               accesskey="&viewCustomizeToolbar.accesskey;"
               label="&viewCustomizeToolbar.label;"/>
   </menupopup>
 </panel>
 
-<panel id="customization-tipPanel"
-       type="arrow"
-       flip="none"
-       side="left"
-       position="leftcenter topright"
-       noautohide="true"
-       hidden="true">
-  <hbox class="customization-tipPanel-wrapper">
-    <vbox class="customization-tipPanel-infoBox"/>
-    <vbox class="customization-tipPanel-content" flex="1">
-      <description class="customization-tipPanel-contentMessage"/>
-      <image class="customization-tipPanel-contentImage"/>
-    </vbox>
-    <vbox pack="start" align="end" class="customization-tipPanel-closeBox">
-      <toolbarbutton oncommand="gCustomizeMode.hideTip()" class="close-icon"/>
-    </vbox>
-  </hbox>
-</panel>
-
 <panel id="panic-button-success-notification"
        type="arrow"
        position="bottomcenter topright"
        hidden="true"
        role="alert"
        orient="vertical">
   <hbox id="panic-button-success-header">
     <image id="panic-button-success-icon" alt=""/>
@@ -435,38 +416,36 @@
                      closebuttonhidden="true"
                      secondarybuttonlabel="&updateAvailable.cancelButton.label;"
                      secondarybuttonaccesskey="&updateAvailable.cancelButton.accesskey;"
                      dropmarkerhidden="true"
                      checkboxhidden="true"
                      buttonhighlight="true"
                      hidden="true">
     <popupnotificationcontent id="update-available-notification-content" orient="vertical">
-      <description id="update-available-description">&updateAvailable.message;
-        <label id="update-available-whats-new" class="text-link" value="&updateAvailable.whatsnew.label;" />
-      </description>
+      <description id="update-available-description">&updateAvailable.message;</description>
+      <label id="update-available-whats-new" class="text-link" value="&updateAvailable.whatsnew.label;" />
     </popupnotificationcontent>
   </popupnotification>
 
   <popupnotification id="appMenu-update-manual-notification"
                      popupid="update-manual"
                      label="&updateManual.header.message;"
                      buttonlabel="&updateManual.acceptButton.label;"
                      buttonaccesskey="&updateManual.acceptButton.accesskey;"
                      closebuttonhidden="true"
                      secondarybuttonlabel="&updateManual.cancelButton.label;"
                      secondarybuttonaccesskey="&updateManual.cancelButton.accesskey;"
                      dropmarkerhidden="true"
                      checkboxhidden="true"
                      buttonhighlight="true"
                      hidden="true">
     <popupnotificationcontent id="update-manual-notification-content" orient="vertical">
-      <description id="update-manual-description">&updateManual.message;
-        <label id="update-manual-whats-new" class="text-link" value="&updateManual.whatsnew.label;" />
-      </description>
+      <description id="update-manual-description">&updateManual.message;</description>
+      <label id="update-manual-whats-new" class="text-link" value="&updateManual.whatsnew.label;" />
     </popupnotificationcontent>
   </popupnotification>
 
   <popupnotification id="appMenu-update-restart-notification"
                      popupid="update-restart"
                      label="&updateRestart.header.message2;"
                      buttonlabel="&updateRestart.acceptButton.label;"
                      buttonaccesskey="&updateRestart.acceptButton.accesskey;"
@@ -556,38 +535,37 @@
                        label="&newPrivateWindow.label;"
                        key="key_privatebrowsing"
                        command="Tools:PrivateBrowsing"/>
         <toolbarbutton id="appMenuRestoreLastSession"
                        label="&appMenuHistory.restoreSession.label;"
                        class="subviewbutton subviewbutton-iconic"
                        command="Browser:RestoreLastSession"/>
         <toolbarseparator/>
-        <toolbaritem id="appMenu-zoom-controls" class="toolbaritem-combined-buttons">
+        <toolbaritem id="appMenu-zoom-controls" class="toolbaritem-combined-buttons" closemenu="none">
           <label value="&fullZoom.label;"/>
           <toolbarbutton id="appMenu-zoomReduce-button"
                          class="subviewbutton subviewbutton-iconic"
                          command="cmd_fullZoomReduce"
-                         closemenu="none"
                          tooltip="dynamic-shortcut-tooltip"/>
           <toolbarbutton id="appMenu-zoomReset-button"
                          class="subviewbutton"
                          command="cmd_fullZoomReset"
-                         closemenu="none"
                          tooltip="dynamic-shortcut-tooltip"/>
           <toolbarbutton id="appMenu-zoomEnlarge-button"
                          class="subviewbutton subviewbutton-iconic"
                          command="cmd_fullZoomEnlarge"
-                         closemenu="none"
                          tooltip="dynamic-shortcut-tooltip"/>
           <toolbarseparator orient="vertical"/>
           <toolbarbutton id="appMenu-fullscreen-button"
                          class="subviewbutton subviewbutton-iconic"
                          observes="View:FullScreen"
                          type="checkbox"
+                         closemenu="auto"
+                         onclick="if (event.button == 0) this.closest('panel').hidePopup();"
                          tooltip="dynamic-shortcut-tooltip"/>
         </toolbaritem>
         <toolbarseparator/>
         <toolbaritem id="appMenu-edit-controls" class="toolbaritem-combined-buttons" closemenu="none">
           <label value="&editMenu.label;"/>
           <toolbarbutton id="appMenu-cut-button"
                          class="subviewbutton subviewbutton-iconic"
                          command="cmd_cut"
@@ -641,18 +619,22 @@
                        class="subviewbutton"
                        label="&savePageCmd.label;"
                        key="key_savePage"
                        command="Browser:SavePage"
                        />
         <toolbarbutton id="appMenu-print-button"
                        class="subviewbutton subviewbutton-iconic"
                        label="&printCmd.label;"
+#ifdef XP_MACOSX
                        key="printKb"
                        command="cmd_print"
+#else
+                       command="cmd_printPreview"
+#endif
                        />
         <toolbarseparator/>
         <toolbarbutton id="appMenu-find-button"
                        class="subviewbutton subviewbutton-iconic"
                        label="&findOnCmd.label;"
                        key="key_find"
                        command="cmd_find"/>
         <toolbarbutton id="appMenu-more-button"
@@ -717,16 +699,26 @@
                        label="&libraryDownloads.label;"
                        closemenu="none"
                        oncommand="DownloadsSubview.show(this);"/>
         <toolbarbutton id="appMenu-library-remotetabs-button"
                        class="subviewbutton subviewbutton-iconic subviewbutton-nav"
                        label="&appMenuRemoteTabs.label;"
                        closemenu="none"
                        oncommand="PanelUI.showSubView('PanelUI-remotetabs', this)"/>
+        <toolbarseparator/>
+        <label value="&appMenuRecentHighlights.label;"
+               class="subview-subheader"/>
+        <toolbaritem id="appMenu-library-recentHighlights"
+                     orient="vertical"
+                     smoothscroll="false"
+                     flatList="true"
+                     tooltip="bhTooltip">
+          <!-- Recent Highlights will go here -->
+        </toolbaritem>
       </vbox>
     </panelview>
 
     <panelview id="PanelUI-bookmarkingTools" class="PanelUI-subView">
       <vbox class="panel-subview-body">
         <toolbarbutton id="panelMenu_toggleBookmarksMenu"
                        label="&addBookmarksMenu.label;"
                        label-checked="&removeBookmarksMenu.label;"
--- a/browser/components/customizableui/content/panelUI.js
+++ b/browser/components/customizableui/content/panelUI.js
@@ -1,16 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+XPCOMUtils.defineLazyModuleGetter(this, "AppMenuNotifications",
+                                  "resource://gre/modules/AppMenuNotifications.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "NewTabUtils",
+                                  "resource://gre/modules/NewTabUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ScrollbarSampler",
                                   "resource:///modules/ScrollbarSampler.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AppMenuNotifications",
-                                  "resource://gre/modules/AppMenuNotifications.jsm");
 
 /**
  * Maintains the state and dispatches events for the main menu panel.
  */
 
 const PanelUI = {
   /** Panel events that we listen for. **/
   get kEvents() {
@@ -20,16 +22,17 @@ const PanelUI = {
    * Used for lazily getting and memoizing elements from the document. Lazy
    * getters are set in init, and memoizing happens after the first retrieval.
    */
   get kElements() {
     return {
       mainView: "appMenu-mainView",
       multiView: "appMenu-multiView",
       helpView: "PanelUI-helpView",
+      libraryView: "appMenu-libraryView",
       menuButton: "PanelUI-menu-button",
       panel: "appMenu-popup",
       notificationPanel: "appMenu-notification-popup",
       addonNotificationContainer: "appMenu-addon-banners",
       overflowFixedList: "widget-overflow-fixed-list",
       overflowPanel: "widget-overflow",
       navbar: "nav-bar",
     };
@@ -70,16 +73,22 @@ const PanelUI = {
 
     if (this.autoHideToolbarInFullScreen) {
       window.addEventListener("fullscreen", this);
     } else {
       window.addEventListener("MozDOMFullscreen:Entered", this);
       window.addEventListener("MozDOMFullscreen:Exited", this);
     }
 
+    XPCOMUtils.defineLazyPreferenceGetter(this, "libraryRecentHighlightsEnabled",
+      "browser.library.activity-stream.enabled", false, (pref, previousValue, newValue) => {
+        if (!newValue)
+          this.clearLibraryRecentHighlights();
+      });
+
     window.addEventListener("activate", this);
     window.matchMedia("(-moz-overlay-scrollbars)").addListener(this._overlayScrollListenerBoundFn);
     CustomizableUI.addListener(this);
 
     for (let event of this.kEvents) {
       this.notificationPanel.addEventListener(event, this);
     }
 
@@ -145,16 +154,17 @@ const PanelUI = {
     window.removeEventListener("MozDOMFullscreen:Exited", this);
     window.removeEventListener("fullscreen", this);
     window.removeEventListener("activate", this);
     this.menuButton.removeEventListener("mousedown", this);
     this.menuButton.removeEventListener("keypress", this);
     window.matchMedia("(-moz-overlay-scrollbars)").removeListener(this._overlayScrollListenerBoundFn);
     CustomizableUI.removeListener(this);
     this._overlayScrollListenerBoundFn = null;
+    this.libraryView.removeEventListener("ViewShowing", this);
   },
 
   /**
    * Customize mode extracts the mainView and puts it somewhere else while the
    * user customizes. Upon completion, this function can be called to put the
    * panel back to where it belongs in normal browsing mode.
    *
    * @param aMainView
@@ -288,16 +298,21 @@ const PanelUI = {
         this.toggle(aEvent);
         break;
       case "MozDOMFullscreen:Entered":
       case "MozDOMFullscreen:Exited":
       case "fullscreen":
       case "activate":
         this._updateNotifications();
         break;
+      case "ViewShowing":
+        if (aEvent.target == this.libraryView) {
+          this.onLibraryViewShowing(aEvent.target);
+        }
+        break;
     }
   },
 
   get isReady() {
     return !!this._isReady;
   },
 
   get isNotificationPanelOpen() {
@@ -379,16 +394,18 @@ const PanelUI = {
       return;
     }
 
     if (!aAnchor) {
       Cu.reportError("Expected an anchor when opening subview with id: " + aViewId);
       return;
     }
 
+    this.ensureLibraryInitialized(viewNode);
+
     let container = aAnchor.closest("panelmultiview,photonpanelmultiview");
     if (container) {
       container.showSubView(aViewId, aAnchor);
     } else if (!aAnchor.open) {
       aAnchor.open = true;
 
       let tempPanel = document.createElement("panel");
       tempPanel.setAttribute("type", "arrow");
@@ -477,16 +494,110 @@ const PanelUI = {
       tempPanel.openPopup(anchor, {
         position: "bottomcenter topright",
         triggerEvent: domEvent,
       });
     }
   },
 
   /**
+   * Sets up the event listener for when the Library view is shown.
+   *
+   * @param {panelview} viewNode The library view.
+   */
+  ensureLibraryInitialized(viewNode) {
+    if (viewNode != this.libraryView || viewNode._initialized)
+      return;
+
+    viewNode._initialized = true;
+    viewNode.addEventListener("ViewShowing", this);
+  },
+
+  /**
+   * When the Library view is showing, we can start fetching and populating the
+   * list of Recent Highlights.
+   * This is done asynchronously and may finish when the view is already visible.
+   *
+   * @param {panelview} viewNode The library view.
+   */
+  async onLibraryViewShowing(viewNode) {
+    if (this._loadingRecentHighlights) {
+      return;
+    }
+    this._loadingRecentHighlights = true;
+
+    // Since the library is the first view shown, we don't want to add a blocker
+    // to the event, which would make PanelMultiView wait to show it.
+    let container = this.clearLibraryRecentHighlights();
+    if (!this.libraryRecentHighlightsEnabled) {
+      this._loadingRecentHighlights = false;
+      return;
+    }
+
+    let highlights = await NewTabUtils.activityStreamLinks.getHighlights({
+      // As per bug 1402023, hard-coded limit, until Activity Stream develops a
+      // richer list.
+      numItems: 6,
+      withFavicons: true
+    });
+    // If there's nothing to display, or the panel is already hidden, get out.
+    if (!highlights.length || viewNode.panelMultiView.getAttribute("panelopen") != "true") {
+      this._loadingRecentHighlights = false;
+      return;
+    }
+
+    container.hidden = container.previousSibling.hidden =
+      container.previousSibling.previousSibling.hidden = false;
+    let fragment = document.createDocumentFragment();
+    for (let highlight of highlights) {
+      let button = document.createElement("toolbarbutton");
+      button.classList.add("subviewbutton", "highlight", "subviewbutton-iconic", "bookmark-item");
+      let title = highlight.title || highlight.url;
+      button.setAttribute("label", title);
+      button.setAttribute("tooltiptext", title);
+      button.setAttribute("type", "highlight-" + highlight.type);
+      button.setAttribute("onclick", "PanelUI.onLibraryHighlightClick(event)");
+      if (highlight.favicon) {
+        button.setAttribute("image", highlight.favicon);
+      }
+      button._highlight = highlight;
+      fragment.appendChild(button);
+    }
+    container.appendChild(fragment);
+
+    this._loadingRecentHighlights = false;
+  },
+
+  /**
+   * Remove all the nodes from the 'Recent Highlights' section and hide it as well.
+   */
+  clearLibraryRecentHighlights() {
+    let container = document.getElementById("appMenu-library-recentHighlights")
+    while (container.firstChild) {
+      container.firstChild.remove();
+    }
+    container.hidden = container.previousSibling.hidden =
+      container.previousSibling.previousSibling.hidden = true;
+    return container;
+  },
+
+  /**
+   * Event handler; invoked when an item of the Recent Highlights is clicked.
+   *
+   * @param {MouseEvent} event Click event, originating from the Highlight.
+   */
+  onLibraryHighlightClick(event) {
+    let button = event.target;
+    if (event.button > 1 || !button._highlight) {
+      return;
+    }
+    window.openUILink(button._highlight.url, event);
+  },
+
+  /**
    * NB: The enable- and disableSingleSubviewPanelAnimations methods only
    * affect the hiding/showing animations of single-subview panels (tempPanel
    * in the showSubView method).
    */
   disableSingleSubviewPanelAnimations() {
     this._disableAnimations = true;
   },
 
--- a/browser/components/customizableui/test/browser.ini
+++ b/browser/components/customizableui/test/browser.ini
@@ -36,18 +36,18 @@ skip-if = os == "linux"
 
 [browser_914138_widget_API_overflowable_toolbar.js]
 skip-if = os == "linux"
 
 [browser_918049_skipintoolbarset_dnd.js]
 [browser_923857_customize_mode_event_wrapping_during_reset.js]
 [browser_927717_customize_drag_empty_toolbar.js]
 
-# Bug 1163231 - Causes failures on Developer Edition on Windows 7.
-# [browser_932928_show_notice_when_palette_empty.js]
+[browser_932928_show_notice_when_palette_empty.js]
+disabled=Bug 1163231 - Fails on all platforms
 
 [browser_934113_menubar_removable.js]
 # Because this test is about the menubar, it can't be run on mac
 skip-if = os == "mac"
 
 [browser_934951_zoom_in_toolbar.js]
 [browser_938980_navbar_collapsed.js]
 [browser_938995_indefaultstate_nonremovable.js]
@@ -138,16 +138,17 @@ skip-if = os == "mac"
 [browser_allow_dragging_removable_false.js]
 [browser_bootstrapped_custom_toolbar.js]
 [browser_currentset_post_reset.js]
 [browser_customizemode_contextmenu_menubuttonstate.js]
 [browser_customizemode_dragspace.js]
 skip-if = os == "linux" # linux doesn't get drag space (no tabsintitlebar)
 [browser_customizemode_uidensity.js]
 [browser_exit_background_customize_mode.js]
+[browser_insert_before_moved_node.js]
 [browser_overflow_use_subviews.js]
 [browser_panel_keyboard_navigation.js]
 [browser_panel_toggle.js]
 [browser_panelUINotifications.js]
 [browser_panelUINotifications_fullscreen.js]
 tags = fullscreen
 skip-if = os == "mac"
 [browser_panelUINotifications_fullscreen_noAutoHideToolbar.js]
new file mode 100644
--- /dev/null
+++ b/browser/components/customizableui/test/browser_insert_before_moved_node.js
@@ -0,0 +1,37 @@
+"use strict";
+
+/**
+ * Check inserting before a node that has moved from the toolbar into a
+ * non-customizable bit of the browser works.
+ */
+add_task(async function() {
+  for (let toolbar of ["nav-bar", "TabsToolbar"]) {
+    CustomizableUI.createWidget({id: "real-button", label: "test real button"});
+    CustomizableUI.addWidgetToArea("real-button", toolbar);
+    CustomizableUI.addWidgetToArea("moved-button-not-here", toolbar);
+    let placements = CustomizableUI.getWidgetIdsInArea(toolbar);
+    Assert.deepEqual(placements.slice(-2), ["real-button", "moved-button-not-here"],
+      "Should have correct placements");
+    let otherButton = document.createElement("toolbarbutton");
+    otherButton.id = "moved-button-not-here";
+    if (toolbar == "nav-bar") {
+      gURLBar.parentNode.appendChild(otherButton);
+    } else {
+      gBrowser.tabContainer.appendChild(otherButton);
+    }
+    CustomizableUI.destroyWidget("real-button");
+    CustomizableUI.createWidget({id: "real-button", label: "test real button"});
+
+    let button = document.getElementById("real-button");
+    ok(button, "Button should exist");
+    if (button) {
+      let expectedContainer = document.getElementById(toolbar).customizationTarget;
+      is(button.parentNode, expectedContainer, "Button should be in the toolbar");
+    }
+
+    CustomizableUI.destroyWidget("real-button");
+    otherButton.remove();
+    CustomizableUI.reset();
+  }
+});
+
--- a/browser/components/customizableui/test/head.js
+++ b/browser/components/customizableui/test/head.js
@@ -185,38 +185,34 @@ function getAreaWidgetIds(areaId) {
 function simulateItemDrag(aToDrag, aTarget) {
   synthesizeDrop(aToDrag.parentNode, aTarget);
 }
 
 function endCustomizing(aWindow = window) {
   if (aWindow.document.documentElement.getAttribute("customizing") != "true") {
     return true;
   }
-  Services.prefs.setBoolPref("browser.uiCustomization.disableAnimation", true);
   return new Promise(resolve => {
     function onCustomizationEnds() {
-      Services.prefs.setBoolPref("browser.uiCustomization.disableAnimation", false);
       aWindow.gNavToolbox.removeEventListener("aftercustomization", onCustomizationEnds);
       resolve();
     }
     aWindow.gNavToolbox.addEventListener("aftercustomization", onCustomizationEnds);
     aWindow.gCustomizeMode.exit();
 
   });
 }
 
 function startCustomizing(aWindow = window) {
   if (aWindow.document.documentElement.getAttribute("customizing") == "true") {
     return null;
   }
-  Services.prefs.setBoolPref("browser.uiCustomization.disableAnimation", true);
   return new Promise(resolve => {
     function onCustomizing() {
       aWindow.gNavToolbox.removeEventListener("customizationready", onCustomizing);
-      Services.prefs.setBoolPref("browser.uiCustomization.disableAnimation", false);
       resolve();
     }
     aWindow.gNavToolbox.addEventListener("customizationready", onCustomizing);
     aWindow.gCustomizeMode.enter();
   });
 }
 
 function promiseObserverNotified(aTopic) {
--- a/browser/components/downloads/DownloadsSubview.jsm
+++ b/browser/components/downloads/DownloadsSubview.jsm
@@ -55,19 +55,21 @@ class DownloadsSubview extends Downloads
     if (!contextMenu) {
       contextMenu = this.document.getElementById("downloadsContextMenu").cloneNode(true);
       contextMenu.setAttribute("closemenu", "none");
       contextMenu.setAttribute("id", this.context);
       contextMenu.removeAttribute("onpopupshown");
       contextMenu.setAttribute("onpopupshowing",
         "DownloadsSubview.updateContextMenu(document.popupNode, this);");
       contextMenu.setAttribute("onpopuphidden", "DownloadsSubview.onContextMenuHidden(this);")
-      let clearButton = contextMenu.querySelector("menuitem[command='downloadsCmd_clearDownloads'");
+      let clearButton = contextMenu.querySelector("menuitem[command='downloadsCmd_clearDownloads']");
       clearButton.hidden = false;
       clearButton.previousSibling.hidden = true;
+      contextMenu.querySelector("menuitem[command='cmd_delete']")
+        .setAttribute("command", "downloadsCmd_delete");
     }
     this.panelview.appendChild(contextMenu);
     this.container.setAttribute("context", this.context);
 
     this._downloadsData = DownloadsCommon.getData(this.window, true, true, true);
     this._downloadsData.addView(this);
   }
 
@@ -225,18 +227,27 @@ class DownloadsSubview extends Downloads
       button = button.parentNode;
     }
     menu.setAttribute("state", button.getAttribute("state"));
     if (button.hasAttribute("exists"))
       menu.setAttribute("exists", button.getAttribute("exists"));
     else
       menu.removeAttribute("exists");
     menu.classList.toggle("temporary-block", button.classList.contains("temporary-block"));
-    menu.querySelector("menuitem[command='downloadsCmd_clearDownloads'").disabled =
-      !DownloadsSubview.canClearDownloads(button);
+    for (let menuitem of menu.getElementsByTagName("menuitem")) {
+      let command = menuitem.getAttribute("command");
+      if (!command)
+        continue;
+      if (command == "downloadsCmd_clearDownloads") {
+        menuitem.disabled = !DownloadsSubview.canClearDownloads(button);
+      } else {
+        menuitem.disabled = !button._shell.isCommandEnabled(command);
+      }
+    }
+
     // The menu anchorNode property is not available long enough to be used elsewhere,
     // so tack it another property name.
     menu._anchorNode = button;
   }
 
   /**
    * Right after the context menu was hidden, perform a bit of cleanup.
    *
--- a/browser/components/downloads/DownloadsViewUI.jsm
+++ b/browser/components/downloads/DownloadsViewUI.jsm
@@ -402,16 +402,17 @@ this.DownloadsViewUI.DownloadElementShel
           let partFile = new FileUtils.File(this.download.target.partFilePath);
           if (partFile.exists()) {
             return true;
           }
         }
 
         // This property is false if the download did not succeed.
         return this.download.target.exists;
+      case "downloadsCmd_delete":
       case "cmd_delete":
         // We don't want in-progress downloads to be removed accidentally.
         return this.download.stopped;
     }
     return DownloadsViewUI.isCommandName(aCommand) && !!this[aCommand];
   },
 
   doCommand(aCommand) {
@@ -463,16 +464,23 @@ this.DownloadsViewUI.DownloadElementShel
     let document = window.document;
 
     // Do not suggest a file name if we don't know the original target.
     let targetPath = this.download.target.path ?
                      OS.Path.basename(this.download.target.path) : null;
     window.DownloadURL(this.download.source.url, targetPath, document);
   },
 
+  downloadsCmd_delete() {
+    // Alias for the 'cmd_delete' command, because it may clash with another
+    // controller which causes unexpected behavior as different codepaths claim
+    // ownership.
+    this.cmd_delete();
+  },
+
   cmd_delete() {
     (async () => {
       // Remove the associated history element first, if any, so that the views
       // that combine history and session downloads won't resurrect the history
       // download into the view just before it is deleted permanently.
       try {
         await PlacesUtils.history.remove(this.download.source.url);
       } catch (ex) {
--- a/browser/components/downloads/content/downloads.js
+++ b/browser/components/downloads/content/downloads.js
@@ -542,17 +542,17 @@ var DownloadsPanel = {
       if (this._state != this.kStateWaitingAnchor) {
         return;
       }
 
       // At this point, if the window is minimized, opening the panel could fail
       // without any notification, and there would be no way to either open or
       // close the panel any more.  To prevent this, check if the window is
       // minimized and in that case force the panel to the closed state.
-      if (window.windowState == Ci.nsIDOMChromeWindow.STATE_MINIMIZED) {
+      if (window.windowState == window.STATE_MINIMIZED) {
         DownloadsButton.releaseAnchor();
         this._state = this.kStateHidden;
         return;
       }
 
       if (!anchor) {
         DownloadsCommon.error("Downloads button cannot be found.");
         return;
--- a/browser/components/extensions/ExtensionPopups.jsm
+++ b/browser/components/extensions/ExtensionPopups.jsm
@@ -464,16 +464,17 @@ class ViewPopup extends BasePopup {
    * @returns {Promise<boolean>}
    *        Resolves when the browser is ready. Resolves to `false` if the
    *        browser was destroyed before it was fully loaded, and the popup
    *        should be closed, or `true` otherwise.
    */
   async attach(viewNode) {
     this.viewNode = viewNode;
     this.viewNode.addEventListener(this.DESTROY_EVENT, this);
+    this.viewNode.setAttribute("closemenu", "none");
 
     if (this.extension.remote) {
       this.panel.setAttribute("remote", "true");
     }
 
     // Wait until the browser element is fully initialized, and give it at least
     // a short grace period to finish loading its initial content, if necessary.
     //
--- a/browser/components/extensions/ext-browser.js
+++ b/browser/components/extensions/ext-browser.js
@@ -660,17 +660,20 @@ class Tab extends TabBase {
       active: false,
       pinned: false,
       incognito: Boolean(tabData.state && tabData.state.isPrivate),
       lastAccessed: tabData.state ? tabData.state.lastAccessed : tabData.lastAccessed,
     };
 
     if (extension.tabManager.hasTabPermission(tabData)) {
       let entries = tabData.state ? tabData.state.entries : tabData.entries;
-      let entry = entries[entries.length - 1];
+      let lastTabIndex = tabData.state ? tabData.state.index : tabData.index;
+      // We need to take lastTabIndex - 1 because the index in the tab data is
+      // 1-based rather than 0-based.
+      let entry = entries[lastTabIndex - 1];
       result.url = entry.url;
       result.title = entry.title;
       if (tabData.image) {
         result.favIconUrl = tabData.image;
       }
     }
 
     return result;
--- a/browser/components/extensions/ext-browserAction.js
+++ b/browser/components/extensions/ext-browserAction.js
@@ -190,22 +190,16 @@ this.browserAction = class extends Exten
         let popupURL = this.getProperty(tab, "popup");
         this.tabManager.addActiveTabPermission(tab);
 
         // Popups are shown only if a popup URL is defined; otherwise
         // a "click" event is dispatched. This is done for compatibility with the
         // Google Chrome onClicked extension API.
         if (popupURL) {
           try {
-            if (event.target.closest("panelmultiview")) {
-              // FIXME: The line below needs to change eventually, but for now:
-              // ensure the view is _always_ visible _before_ `popup.attach()` is
-              // called. PanelMultiView.jsm dictates different behavior.
-              event.target.setAttribute("current", true);
-            }
             let popup = this.getPopup(document.defaultView, popupURL);
             let attachPromise = popup.attach(event.target);
             event.detail.addBlocker(attachPromise);
             await attachPromise;
             TelemetryStopwatch.finish(POPUP_OPEN_MS_HISTOGRAM, this);
             if (this.eventQueue.length) {
               let histogram = Services.telemetry.getHistogramById(POPUP_RESULT_HISTOGRAM);
               histogram.add("popupShown");
--- a/browser/components/extensions/ext-browsingData.js
+++ b/browser/components/extensions/ext-browsingData.js
@@ -12,16 +12,19 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
                                   "resource://gre/modules/Timer.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "serviceWorkerManager",
                                    "@mozilla.org/serviceworkers/manager;1",
                                    "nsIServiceWorkerManager");
+XPCOMUtils.defineLazyServiceGetter(this, "quotaManagerService",
+                                   "@mozilla.org/dom/quota-manager-service;1",
+                                   "nsIQuotaManagerService");
 
 /**
 * A number of iterations after which to yield time back
 * to the system.
 */
 const YIELD_PERIOD = 10;
 
 const PREF_DOMAIN = "privacy.cpd.";
@@ -75,16 +78,39 @@ const clearDownloads = options => {
 const clearFormData = options => {
   return sanitizer.items.formdata.clear(makeRange(options));
 };
 
 const clearHistory = options => {
   return sanitizer.items.history.clear(makeRange(options));
 };
 
+const clearIndexedDB = async function(options) {
+  let promises = [];
+
+  await new Promise(resolve => {
+    quotaManagerService.getUsage(request => {
+      for (let item of request.result) {
+        let principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(item.origin);
+        let uri = principal.URI;
+        if (uri.scheme == "http" || uri.scheme == "https" || uri.scheme == "file") {
+          promises.push(new Promise(r => {
+            let req = quotaManagerService.clearStoragesForPrincipal(principal, null, false);
+            req.callback = () => { r(); };
+          }));
+        }
+      }
+
+      resolve();
+    });
+  });
+
+  return Promise.all(promises);
+};
+
 const clearLocalStorage = async function(options) {
   Services.obs.notifyObservers(null, "extension:purge-localStorage");
 };
 
 const clearPasswords = async function(options) {
   let loginManager = Services.logins;
   let yieldCounter = 0;
 
@@ -148,16 +174,19 @@ const doRemoval = (options, dataToRemove
           removalPromises.push(clearDownloads(options));
           break;
         case "formData":
           removalPromises.push(clearFormData(options));
           break;
         case "history":
           removalPromises.push(clearHistory(options));
           break;
+        case "indexedDB":
+          removalPromises.push(clearIndexedDB(options));
+          break;
         case "localStorage":
           removalPromises.push(clearLocalStorage(options));
           break;
         case "passwords":
           removalPromises.push(clearPasswords(options));
           break;
         case "pluginData":
           removalPromises.push(clearPluginData(options));
@@ -224,16 +253,19 @@ this.browsingData = class extends Extens
           return doRemoval(options, {downloads: true});
         },
         removeFormData(options) {
           return doRemoval(options, {formData: true});
         },
         removeHistory(options) {
           return doRemoval(options, {history: true});
         },
+        removeIndexedDB(options) {
+          return doRemoval(options, {indexedDB: true});
+        },
         removeLocalStorage(options) {
           return doRemoval(options, {localStorage: true});
         },
         removePasswords(options) {
           return doRemoval(options, {passwords: true});
         },
         removePluginData(options) {
           return doRemoval(options, {pluginData: true});
--- a/browser/components/extensions/ext-chrome-settings-overrides.js
+++ b/browser/components/extensions/ext-chrome-settings-overrides.js
@@ -1,29 +1,31 @@
 /* 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/. */
 
+ /* globals windowTracker */
+
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 XPCOMUtils.defineLazyModuleGetter(this, "ExtensionPreferencesManager",
                                   "resource://gre/modules/ExtensionPreferencesManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ExtensionSettingsStore",
                                   "resource://gre/modules/ExtensionSettingsStore.jsm");
 
 const DEFAULT_SEARCH_STORE_TYPE = "default_search";
 const DEFAULT_SEARCH_SETTING_NAME = "defaultSearch";
 
 const searchInitialized = () => {
+  if (Services.search.isInitialized) {
+    return;
+  }
   return new Promise(resolve => {
-    if (Services.search.isInitialized) {
-      resolve();
-    }
     const SEARCH_SERVICE_TOPIC = "browser-search-service";
     Services.obs.addObserver(function observer(subject, topic, data) {
       if (data != "init-complete") {
         return;
       }
 
       Services.obs.removeObserver(observer, SEARCH_SERVICE_TOPIC);
       resolve();
@@ -65,113 +67,144 @@ this.chrome_settings_overrides = class e
 
     await ExtensionSettingsStore.initialize();
     if (manifest.chrome_settings_overrides.homepage) {
       ExtensionPreferencesManager.setSetting(extension, "homepage_override",
                                              manifest.chrome_settings_overrides.homepage);
     }
     if (manifest.chrome_settings_overrides.search_provider) {
       await searchInitialized();
+      extension.callOnClose({
+        close: () => {
+          if (extension.shutdownReason == "ADDON_DISABLE" ||
+              extension.shutdownReason == "ADDON_UNINSTALL") {
+            switch (extension.shutdownReason) {
+              case "ADDON_DISABLE":
+                this.processDefaultSearchSetting("disable");
+                break;
+
+              case "ADDON_UNINSTALL":
+                this.processDefaultSearchSetting("removeSetting");
+                break;
+            }
+            // We shouldn't need to wait for search initialized here
+            // because the search service should be ready to go.
+            let engines = Services.search.getEnginesByExtensionID(extension.id);
+            for (let engine of engines) {
+              try {
+                Services.search.removeEngine(engine);
+              } catch (e) {
+                Components.utils.reportError(e);
+              }
+            }
+          }
+        },
+      });
+
       let searchProvider = manifest.chrome_settings_overrides.search_provider;
+      let engineName = searchProvider.name.trim();
       if (searchProvider.is_default) {
-        let engineName = searchProvider.name.trim();
         let engine = Services.search.getEngineByName(engineName);
         if (engine && Services.search.getDefaultEngines().includes(engine)) {
-          // Only add onclose handlers if we would definitely
-          // be setting the default engine.
-          extension.callOnClose({
-            close: () => {
-              switch (extension.shutdownReason) {
-                case "ADDON_DISABLE":
-                  this.processDefaultSearchSetting("disable");
-                  break;
-
-                case "ADDON_UNINSTALL":
-                  this.processDefaultSearchSetting("removeSetting");
-                  break;
-              }
-            },
-          });
-          if (extension.startupReason === "ADDON_INSTALL") {
-            let item = await ExtensionSettingsStore.addSetting(
-              extension, DEFAULT_SEARCH_STORE_TYPE, DEFAULT_SEARCH_SETTING_NAME, engineName, () => {
-                return Services.search.currentEngine.name;
-              });
-            Services.search.currentEngine = Services.search.getEngineByName(item.value);
-          } else if (extension.startupReason === "ADDON_ENABLE") {
-            this.processDefaultSearchSetting("enable");
-          }
-          // If we would have set the default engine,
-          // we don't allow a search provider to be added.
+          // Needs to be called every time to handle reenabling, but
+          // only sets default for install or enable.
+          await this.setDefault(engineName);
+          // For built in search engines, we don't do anything further
           return;
         }
-        Components.utils.reportError("is_default can only be used for built-in engines.");
-      }
-      let isCurrent = false;
-      let index = -1;
-      if (extension.startupReason === "ADDON_UPGRADE") {
-        let engines = Services.search.getEnginesByExtensionID(extension.id);
-        if (engines.length > 0) {
-          // There can be only one engine right now
-          isCurrent = Services.search.currentEngine == engines[0];
-          // Get position of engine and store it
-          index = Services.search.getEngines().indexOf(engines[0]);
-          Services.search.removeEngine(engines[0]);
-        }
       }
-      try {
-        let params = {
-          template: searchProvider.search_url,
-          iconURL: searchProvider.favicon_url,
-          alias: searchProvider.keyword,
-          extensionID: extension.id,
-          suggestURL: searchProvider.suggest_url,
-        };
-        Services.search.addEngineWithDetails(searchProvider.name.trim(), params);
-        if (extension.startupReason === "ADDON_UPGRADE") {
-          let engine = Services.search.getEngineByName(searchProvider.name.trim());
-          if (isCurrent) {
-            Services.search.currentEngine = engine;
-          }
-          if (index != -1) {
-            Services.search.moveEngine(engine, index);
+      this.addSearchEngine(searchProvider);
+      if (searchProvider.is_default) {
+        if (extension.startupReason === "ADDON_INSTALL") {
+          // Don't ask if it already the current engine
+          let engine = Services.search.getEngineByName(engineName);
+          if (Services.search.currentEngine != engine) {
+            let allow = await new Promise(resolve => {
+              let subject = {
+                wrappedJSObject: {
+                  // This is a hack because we don't have the browser of
+                  // the actual install. This means the popup might show
+                  // in a different window. Will be addressed in a followup bug.
+                  browser: windowTracker.topWindow.gBrowser.selectedBrowser,
+                  name: this.extension.name,
+                  icon: this.extension.iconURL,
+                  currentEngine: Services.search.currentEngine.name,
+                  newEngine: engineName,
+                  resolve,
+                },
+              };
+              Services.obs.notifyObservers(subject, "webextension-defaultsearch-prompt");
+            });
+            if (!allow) {
+              return;
+            }
           }
         }
-      } catch (e) {
-        Components.utils.reportError(e);
+        // Needs to be called every time to handle reenabling, but
+        // only sets default for install or enable.
+        await this.setDefault(engineName);
+      } else if (ExtensionSettingsStore.hasSetting(
+                extension, DEFAULT_SEARCH_STORE_TYPE, DEFAULT_SEARCH_SETTING_NAME)) {
+        // is_default has been removed, but we still have a setting. Remove it.
+        // This won't cover the case where the entire search_provider is removed.
+        this.processDefaultSearchSetting("removeSetting");
       }
     }
-    // If the setting exists for the extension, but is missing from the manifest,
-    // remove it. This can happen if the extension removes is_default.
-    // There's really no good place to put this, because the entire search section
-    // could be removed.
-    // We'll never get here in the normal case because we always return early
-    // if we have an is_default value that we use.
-    if (ExtensionSettingsStore.hasSetting(
-               extension, DEFAULT_SEARCH_STORE_TYPE, DEFAULT_SEARCH_SETTING_NAME)) {
-      await searchInitialized();
-      this.processDefaultSearchSetting("removeSetting");
+  }
+
+  async setDefault(engineName) {
+    let {extension} = this;
+    if (extension.startupReason === "ADDON_INSTALL") {
+      let item = await ExtensionSettingsStore.addSetting(
+        extension, DEFAULT_SEARCH_STORE_TYPE, DEFAULT_SEARCH_SETTING_NAME, engineName, () => {
+          return Services.search.currentEngine.name;
+        });
+      Services.search.currentEngine = Services.search.getEngineByName(item.value);
+    } else if (extension.startupReason === "ADDON_ENABLE") {
+      this.processDefaultSearchSetting("enable");
     }
   }
-  async onShutdown(reason) {
+
+  addSearchEngine(searchProvider) {
     let {extension} = this;
-    if (reason == "ADDON_DISABLE" ||
-        reason == "ADDON_UNINSTALL") {
-      if (extension.manifest.chrome_settings_overrides.search_provider) {
-        await searchInitialized();
-        let engines = Services.search.getEnginesByExtensionID(extension.id);
-        for (let engine of engines) {
-          try {
-            Services.search.removeEngine(engine);
-          } catch (e) {
-            Components.utils.reportError(e);
-          }
+    let isCurrent = false;
+    let index = -1;
+    if (extension.startupReason === "ADDON_UPGRADE") {
+      let engines = Services.search.getEnginesByExtensionID(extension.id);
+      if (engines.length > 0) {
+        // There can be only one engine right now
+        isCurrent = Services.search.currentEngine == engines[0];
+        // Get position of engine and store it
+        index = Services.search.getEngines().indexOf(engines[0]);
+        Services.search.removeEngine(engines[0]);
+      }
+    }
+    try {
+      let params = {
+        template: searchProvider.search_url,
+        iconURL: searchProvider.favicon_url,
+        alias: searchProvider.keyword,
+        extensionID: extension.id,
+        suggestURL: searchProvider.suggest_url,
+      };
+      Services.search.addEngineWithDetails(searchProvider.name.trim(), params);
+      if (extension.startupReason === "ADDON_UPGRADE") {
+        let engine = Services.search.getEngineByName(searchProvider.name.trim());
+        if (isCurrent) {
+          Services.search.currentEngine = engine;
+        }
+        if (index != -1) {
+          Services.search.moveEngine(engine, index);
         }
       }
+    } catch (e) {
+      Components.utils.reportError(e);
+      return false;
     }
+    return true;
   }
 };
 
 ExtensionPreferencesManager.addSetting("homepage_override", {
   prefNames: [
     "browser.startup.homepage",
   ],
   setCallback(value) {
--- a/browser/components/extensions/ext-devtools-panels.js
+++ b/browser/components/extensions/ext-devtools-panels.js
@@ -208,31 +208,34 @@ class ParentDevToolsPanel {
     this.context = null;
     this.toolbox = null;
     this.browser = null;
     this.browserContainerWindow = null;
   }
 
   createBrowserElement(window) {
     const {toolbox} = this;
+    const {extension} = this.context;
     const {url} = this.panelOptions;
     const {document} = window;
 
     const browser = document.createElementNS(XUL_NS, "browser");
     browser.setAttribute("type", "content");
     browser.setAttribute("disableglobalhistory", "true");
     browser.setAttribute("style", "width: 100%; height: 100%;");
     browser.setAttribute("transparent", "true");
     browser.setAttribute("class", "webextension-devtoolsPanel-browser");
     browser.setAttribute("webextension-view-type", "devtools_panel");
     browser.setAttribute("flex", "1");
 
-    this.browser = browser;
+    // Ensure that the devtools panel browser is going to run in the same
+    // process of the other extension pages from the same addon.
+    browser.sameProcessAsFrameLoader = extension.groupFrameLoader;
 
-    const {extension} = this.context;
+    this.browser = browser;
 
     let awaitFrameLoader = Promise.resolve();
     if (extension.remote) {
       browser.setAttribute("remote", "true");
       browser.setAttribute("remoteType", E10SUtils.EXTENSION_REMOTE_TYPE);
       awaitFrameLoader = promiseEvent(browser, "XULFrameLoaderCreated");
     }
 
--- a/browser/components/extensions/ext-sidebarAction.js
+++ b/browser/components/extensions/ext-sidebarAction.js
@@ -177,17 +177,17 @@ this.sidebarAction = class extends Exten
     broadcaster.setAttribute("autoCheck", "false");
     broadcaster.setAttribute("type", "checkbox");
     broadcaster.setAttribute("group", "sidebar");
     broadcaster.setAttribute("label", details.title);
     broadcaster.setAttribute("sidebarurl", this.sidebarUrl(details.panel));
 
     // oncommand gets attached to menuitem, so we use the observes attribute to
     // get the command id we pass to SidebarUI.
-    broadcaster.setAttribute("oncommand", "SidebarUI.show(this.getAttribute('observes'))");
+    broadcaster.setAttribute("oncommand", "SidebarUI.toggle(this.getAttribute('observes'))");
 
     let header = document.getElementById("sidebar-switcher-target");
     header.addEventListener("SidebarShown", this.updateHeader);
 
     // Insert a menuitem for View->Show Sidebars.
     let menuitem = document.createElementNS(XUL_NS, "menuitem");
     menuitem.setAttribute("id", this.menuId);
     menuitem.setAttribute("observes", this.id);
--- a/browser/components/extensions/test/browser/browser-common.ini
+++ b/browser/components/extensions/test/browser/browser-common.ini
@@ -17,16 +17,17 @@ support-files =
   file_iframe_document.sjs
   file_bypass_cache.sjs
   file_language_fr_en.html
   file_language_ja.html
   file_language_tlh.html
   file_dummy.html
   file_title.html
   file_inspectedwindow_reload_target.sjs
+  file_indexedDB.html
   file_serviceWorker.html
   locale/chrome.manifest
   webNav_createdTarget.html
   webNav_createdTargetSource.html
   webNav_createdTargetSource_subframe.html
   serviceWorker.js
   searchSuggestionEngine.xml
   searchSuggestionEngine.sjs
@@ -40,22 +41,22 @@ skip-if = os == 'linux'
 [browser_ext_browserAction_disabled.js]
 [browser_ext_browserAction_pageAction_icon.js]
 [browser_ext_browserAction_pageAction_icon_permissions.js]
 [browser_ext_browserAction_popup.js]
 skip-if = debug && (os == 'linux' && bits == 32) # Bug 1313372
 [browser_ext_browserAction_popup_preload.js]
 skip-if = (os == 'win' && !debug) # bug 1352668
 [browser_ext_browserAction_popup_resize.js]
-skip-if = os == 'mac' # Bug 1374749 will re-enable this test again.
 [browser_ext_browserAction_simple.js]
 [browser_ext_browserAction_telemetry.js]
 [browser_ext_browserAction_theme_icons.js]
 [browser_ext_browsingData_formData.js]
 [browser_ext_browsingData_history.js]
+[browser_ext_browsingData_indexedDB.js]
 [browser_ext_browsingData_localStorage.js]
 [browser_ext_browsingData_pluginData.js]
 [browser_ext_browsingData_serviceWorkers.js]
 [browser_ext_chrome_settings_overrides_home.js]
 [browser_ext_commands_execute_browser_action.js]
 [browser_ext_commands_execute_page_action.js]
 [browser_ext_commands_execute_sidebar_action.js]
 [browser_ext_commands_getAll.js]
--- a/browser/components/extensions/test/browser/browser_ext_browserAction_popup_resize.js
+++ b/browser/components/extensions/test/browser/browser_ext_browserAction_popup_resize.js
@@ -151,19 +151,24 @@ async function testPopupSize(standardsMo
     await closeBrowserAction(extension, browserWin);
   }
 
 
   // Test the PanelUI panel for a menu panel button.
   let widget = getBrowserActionWidget(extension);
   CustomizableUI.addWidgetToArea(widget.id, getCustomizableUIPanelID());
 
+  let panel = browserWin.PanelUI.overflowPanel;
+  let panelMultiView = panel.firstChild;
+  let widgetId = makeWidgetId(extension.id);
+  // The 'ViewShown' event is the only way to correctly determine when the extensions'
+  // panelview has finished transitioning and is fully in view.
+  let shownPromise = BrowserTestUtils.waitForEvent(panelMultiView, "ViewShown",
+    e => (e.originalTarget.id || "").includes(widgetId));
   let browser = await openPanel(extension, browserWin);
-
-  let panel = browserWin.PanelUI.overflowPanel;
   let origPanelRect = panel.getBoundingClientRect();
 
   // Check that the panel is still positioned as expected.
   let checkPanelPosition = () => {
     is(panel.getAttribute("side"), arrowSide, "Panel arrow is positioned as expected");
 
     let panelRect = panel.getBoundingClientRect();
     if (arrowSide == "top") {
@@ -178,26 +183,20 @@ async function testPopupSize(standardsMo
       ok(panelRect.top <= origPanelRect.top, `Panel has not shrunk from original size (${panelRect.top} <= ${origPanelRect.top})`);
 
       let panelTop = browserWin.mozInnerScreenY + panelRect.top;
       ok(panelTop >= browserWin.screen.availTop, `Top of popup should be on-screen. (${panelTop} >= ${browserWin.screen.availTop})`);
     }
   };
 
   await awaitBrowserLoaded(browser);
-
-  let panelview = browser.closest("panelview");
-  // Need to wait first for the forced panel width and for the panelview's border to be gone,
-  // then for layout to happen again. Otherwise the removal of the border between views in the
-  // panelmultiview trips up our width checking causing it to be off-by-one.
-  await BrowserTestUtils.waitForCondition(() => (!panel.hasAttribute("width") && (!panelview || !panelview.style.borderInlineStart)));
-  await promiseAnimationFrame(browserWin);
+  await shownPromise;
   // Wait long enough to make sure the initial resize debouncing timer has
   // expired.
-  await delay(100);
+  await delay(500);
 
   let dims = await promiseContentDimensions(browser);
 
   is(dims.isStandards, standardsMode, "Document has the expected compat mode");
 
   // If the browser's preferred height is smaller than the initial height of the
   // panel, then it will still take up the full available vertical space. Even
   // so, we need to check that we've gotten the preferred height calculation
new file mode 100644
--- /dev/null
+++ b/browser/components/extensions/test/browser/browser_ext_browsingData_indexedDB.js
@@ -0,0 +1,81 @@
+/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set sts=2 sw=2 et tw=80: */
+/* eslint-disable mozilla/no-arbitrary-setTimeout */
+"use strict";
+
+add_task(async function testIndexedDB() {
+  function background() {
+    const PAGE = "/browser/browser/components/extensions/test/browser/file_indexedDB.html";
+
+    browser.test.onMessage.addListener(async (msg) => {
+      await browser.browsingData.remove({}, {indexedDB: true});
+      browser.test.sendMessage("indexedDBRemoved");
+    });
+
+    // Create two tabs.
+    browser.tabs.create({url: `http://mochi.test:8888${PAGE}`});
+    browser.tabs.create({url: `http://example.com${PAGE}`});
+  }
+
+  function contentScript() {
+    window.addEventListener("message", msg => { // eslint-disable-line mozilla/balanced-listeners
+      browser.test.sendMessage("indexedDBCreated");
+    }, true);
+  }
+
+  let extension = ExtensionTestUtils.loadExtension({
+    background,
+    manifest: {
+      permissions: ["browsingData", "tabs"],
+      "content_scripts": [{
+        "matches": [
+          "http://mochi.test/*/file_indexedDB.html",
+          "http://example.com/*/file_indexedDB.html",
+        ],
+        "js": ["script.js"],
+        "run_at": "document_start",
+      }],
+    },
+    files: {
+      "script.js": contentScript,
+    },
+  });
+
+  let win = await BrowserTestUtils.openNewBrowserWindow();
+  await focusWindow(win);
+
+  await extension.startup();
+  await extension.awaitMessage("indexedDBCreated");
+  await extension.awaitMessage("indexedDBCreated");
+
+  let qms = SpecialPowers.Cc["@mozilla.org/dom/quota-manager-service;1"]
+             .getService(Ci.nsIQuotaManagerService);
+
+  function getOrigins() {
+    return new Promise(resolve => {
+      let origins = [];
+      qms.getUsage(request => {
+        for (let i = 0; i < request.result.length; ++i) {
+          if (request.result[i].origin.startsWith("http://mochi.test") ||
+              request.result[i].origin.startsWith("http://example.com")) {
+            origins.push(request.result[i].origin);
+          }
+        }
+        resolve(origins);
+      });
+    });
+  }
+
+  let origins = await getOrigins();
+  is(origins.length, 2, "IndexedDB databases have been populated.");
+
+  extension.sendMessage();
+
+  await extension.awaitMessage("indexedDBRemoved");
+
+  origins = await getOrigins();
+  is(origins.length, 0, "IndexedDB data has been removed.");
+
+  await extension.unload();
+  await BrowserTestUtils.closeWindow(win);
+});
--- a/browser/components/extensions/test/browser/browser_ext_devtools_page.js
+++ b/browser/components/extensions/test/browser/browser_ext_devtools_page.js
@@ -6,77 +6,276 @@ const {DevToolsShim} = Cu.import("chrome
 const {gDevTools} = DevToolsShim;
 
 /**
  * This test file ensures that:
  *
  * - the devtools_page property creates a new WebExtensions context
  * - the devtools_page can exchange messages with the background page
  */
-
 add_task(async function test_devtools_page_runtime_api_messaging() {
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "http://mochi.test:8888/");
 
   function background() {
+    browser.runtime.onMessage.addListener((msg, sender) => {
+      if (sender.tab) {
+        browser.test.sendMessage("content_script_message_received");
+      }
+    });
+
     browser.runtime.onConnect.addListener((port) => {
+      if (port.sender.tab) {
+        browser.test.sendMessage("content_script_port_received");
+        return;
+      }
+
       let portMessageReceived = false;
 
       port.onDisconnect.addListener(() => {
         browser.test.assertTrue(portMessageReceived,
                                 "Got a port message before the port disconnect event");
-        browser.test.notifyPass("devtools_page_connect.done");
+        browser.test.sendMessage("devtools_page_connect.done");
       });
 
       port.onMessage.addListener((msg) => {
         portMessageReceived = true;
         browser.test.assertEq("devtools -> background port message", msg,
                               "Got the expected message from the devtools page");
         port.postMessage("background -> devtools port message");
       });
     });
   }
 
   function devtools_page() {
+    browser.runtime.onConnect.addListener(port => {
+      // Fail if a content script port has been received by the devtools page (Bug 1383310).
+      if (port.sender.tab) {
+        browser.test.fail(`A DevTools page should not receive ports from content scripts`);
+      }
+    });
+
+    browser.runtime.onMessage.addListener((msg, sender) => {
+      // Fail if a content script message has been received by the devtools page (Bug 1383310).
+      if (sender.tab) {
+        browser.test.fail(`A DevTools page should not receive messages from content scripts`);
+      }
+    });
+
     const port = browser.runtime.connect();
     port.onMessage.addListener((msg) => {
       browser.test.assertEq("background -> devtools port message", msg,
                             "Got the expected message from the background page");
       port.disconnect();
     });
     port.postMessage("devtools -> background port message");
+
+    browser.test.sendMessage("devtools_page_loaded");
+  }
+
+  function content_script() {
+    browser.test.onMessage.addListener(msg => {
+      switch (msg) {
+        case "content_script.send_message":
+          browser.runtime.sendMessage("content_script_message");
+          break;
+        case "content_script.connect_port":
+          const port = browser.runtime.connect();
+          port.disconnect();
+          break;
+        default:
+          browser.test.fail(`Unexpected message ${msg} received by content script`);
+      }
+    });
+
+    browser.test.sendMessage("content_script_loaded");
   }
 
   let extension = ExtensionTestUtils.loadExtension({
     background,
     manifest: {
       devtools_page: "devtools_page.html",
+      content_scripts: [
+        {
+          js: ["content_script.js"],
+          matches: ["http://mochi.test/*"],
+        },
+      ],
     },
     files: {
+      "content_script.js": content_script,
       "devtools_page.html": `<!DOCTYPE html>
-      <html>
-       <head>
-         <meta charset="utf-8">
-       </head>
-       <body>
-         <script src="devtools_page.js"></script>
-       </body>
-      </html>`,
+        <html>
+          <head>
+            <meta charset="utf-8">
+          </head>
+          <body>
+            <script src="devtools_page.js"></script>
+          </body>
+        </html>`,
       "devtools_page.js": devtools_page,
     },
   });
 
   await extension.startup();
 
+  info("Wait the content script load");
+  await extension.awaitMessage("content_script_loaded");
+
   let target = gDevTools.getTargetForTab(tab);
 
+  info("Open the developer toolbox");
   await gDevTools.showToolbox(target, "webconsole");
-  info("developer toolbox opened");
+
+  info("Wait the devtools page load");
+  await extension.awaitMessage("devtools_page_loaded");
+
+  info("Wait the connection 'devtools_page -> background' to complete");
+  await extension.awaitMessage("devtools_page_connect.done");
 
-  await extension.awaitFinish("devtools_page_connect.done");
+  // Send a message from the content script and expect it to be received from
+  // the background page (repeated twice to be sure that the devtools_page had
+  // the chance to receive the message and fail as